Auto merge of #152639 - jhpratt:rollup-sIUYGho, r=jhpratt
Rollup of 9 pull requests Successful merges: - rust-lang/rust#150424 (diagnostics: add note when param-env shadows global impl) - rust-lang/rust#152132 (implement `carryless_mul`) - rust-lang/rust#152508 (Improve write! and writeln! error when called without destination) - rust-lang/rust#152534 (Test(lib/win/net): Skip UDS tests when under Win7) - rust-lang/rust#152578 (ci: Lock cross toolchain version and update docs) - rust-lang/rust#152188 (Include `library/stdarch` for `CURRENT_RUSTC_VERSION` updates) - rust-lang/rust#152402 (Add regression test for rust-lang/rust#141738) - rust-lang/rust#152472 (unwind/wasm: fix compile error by wrapping wasm_throw in unsafe block) - rust-lang/rust#152610 (Exchange js_lint message between bless and non-bless)
This commit is contained in:
commit
ce0bf0b22b
59 changed files with 2278 additions and 1278 deletions
|
|
@ -387,6 +387,27 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
|
|||
let pair = self.insert_value(pair, high, 1);
|
||||
pair
|
||||
}
|
||||
|
||||
// FIXME move into the branch below when LLVM 22 is the lowest version we support.
|
||||
sym::carryless_mul if crate::llvm_util::get_version() >= (22, 0, 0) => {
|
||||
let ty = args[0].layout.ty;
|
||||
if !ty.is_integral() {
|
||||
tcx.dcx().emit_err(InvalidMonomorphization::BasicIntegerType {
|
||||
span,
|
||||
name,
|
||||
ty,
|
||||
});
|
||||
return Ok(());
|
||||
}
|
||||
let (size, _) = ty.int_size_and_signed(self.tcx);
|
||||
let width = size.bits();
|
||||
let llty = self.type_ix(width);
|
||||
|
||||
let lhs = args[0].immediate();
|
||||
let rhs = args[1].immediate();
|
||||
self.call_intrinsic("llvm.clmul", &[llty], &[lhs, rhs])
|
||||
}
|
||||
|
||||
sym::ctlz
|
||||
| sym::ctlz_nonzero
|
||||
| sym::cttz
|
||||
|
|
@ -2784,6 +2805,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
|
|||
| sym::simd_ctlz
|
||||
| sym::simd_ctpop
|
||||
| sym::simd_cttz
|
||||
| sym::simd_carryless_mul
|
||||
| sym::simd_funnel_shl
|
||||
| sym::simd_funnel_shr
|
||||
) {
|
||||
|
|
@ -2808,6 +2830,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
|
|||
sym::simd_cttz => "llvm.cttz",
|
||||
sym::simd_funnel_shl => "llvm.fshl",
|
||||
sym::simd_funnel_shr => "llvm.fshr",
|
||||
sym::simd_carryless_mul => "llvm.clmul",
|
||||
_ => unreachable!(),
|
||||
};
|
||||
let int_size = in_elem.int_size_and_signed(bx.tcx()).0.bits();
|
||||
|
|
@ -2833,6 +2856,17 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
|
|||
&[vec_ty],
|
||||
&[args[0].immediate(), args[1].immediate(), args[2].immediate()],
|
||||
)),
|
||||
sym::simd_carryless_mul => {
|
||||
if crate::llvm_util::get_version() >= (22, 0, 0) {
|
||||
Ok(bx.call_intrinsic(
|
||||
llvm_intrinsic,
|
||||
&[vec_ty],
|
||||
&[args[0].immediate(), args[1].immediate()],
|
||||
))
|
||||
} else {
|
||||
span_bug!(span, "`simd_carryless_mul` needs LLVM 22 or higher");
|
||||
}
|
||||
}
|
||||
_ => unreachable!(),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -354,7 +354,14 @@ impl CodegenBackend for LlvmCodegenBackend {
|
|||
}
|
||||
|
||||
fn replaced_intrinsics(&self) -> Vec<Symbol> {
|
||||
vec![sym::unchecked_funnel_shl, sym::unchecked_funnel_shr, sym::carrying_mul_add]
|
||||
let mut will_not_use_fallback =
|
||||
vec![sym::unchecked_funnel_shl, sym::unchecked_funnel_shr, sym::carrying_mul_add];
|
||||
|
||||
if llvm_util::get_version() >= (22, 0, 0) {
|
||||
will_not_use_fallback.push(sym::carryless_mul);
|
||||
}
|
||||
|
||||
will_not_use_fallback
|
||||
}
|
||||
|
||||
fn codegen_crate<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Box<dyn Any> {
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
|
|||
| sym::bswap
|
||||
| sym::caller_location
|
||||
| sym::carrying_mul_add
|
||||
| sym::carryless_mul
|
||||
| sym::ceilf16
|
||||
| sym::ceilf32
|
||||
| sym::ceilf64
|
||||
|
|
@ -564,6 +565,7 @@ pub(crate) fn check_intrinsic_type(
|
|||
(1, 0, vec![param(0), param(0)], param(0))
|
||||
}
|
||||
sym::saturating_add | sym::saturating_sub => (1, 0, vec![param(0), param(0)], param(0)),
|
||||
sym::carryless_mul => (1, 0, vec![param(0), param(0)], param(0)),
|
||||
sym::fadd_fast | sym::fsub_fast | sym::fmul_fast | sym::fdiv_fast | sym::frem_fast => {
|
||||
(1, 0, vec![param(0), param(0)], param(0))
|
||||
}
|
||||
|
|
@ -711,7 +713,8 @@ pub(crate) fn check_intrinsic_type(
|
|||
| sym::simd_fmin
|
||||
| sym::simd_fmax
|
||||
| sym::simd_saturating_add
|
||||
| sym::simd_saturating_sub => (1, 0, vec![param(0), param(0)], param(0)),
|
||||
| sym::simd_saturating_sub
|
||||
| sym::simd_carryless_mul => (1, 0, vec![param(0), param(0)], param(0)),
|
||||
sym::simd_arith_offset => (2, 0, vec![param(0), param(1)], param(0)),
|
||||
sym::simd_neg
|
||||
| sym::simd_bswap
|
||||
|
|
|
|||
|
|
@ -648,6 +648,7 @@ symbols! {
|
|||
caller_location,
|
||||
capture_disjoint_fields,
|
||||
carrying_mul_add,
|
||||
carryless_mul,
|
||||
catch_unwind,
|
||||
cause,
|
||||
cdylib,
|
||||
|
|
@ -2093,6 +2094,7 @@ symbols! {
|
|||
simd_bitmask,
|
||||
simd_bitreverse,
|
||||
simd_bswap,
|
||||
simd_carryless_mul,
|
||||
simd_cast,
|
||||
simd_cast_ptr,
|
||||
simd_ceil,
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ use rustc_hir::def_id::DefId;
|
|||
use rustc_hir::intravisit::Visitor;
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_hir::{self as hir};
|
||||
use rustc_infer::infer::DefineOpaqueTypes;
|
||||
use rustc_macros::extension;
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::dep_graph::DepContext;
|
||||
|
|
@ -72,12 +73,17 @@ use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, Pos, Span, sym};
|
|||
use tracing::{debug, instrument};
|
||||
|
||||
use crate::error_reporting::TypeErrCtxt;
|
||||
use crate::error_reporting::traits::ambiguity::{
|
||||
CandidateSource, compute_applicable_impls_for_diagnostics,
|
||||
};
|
||||
use crate::errors::{ObligationCauseFailureCode, TypeErrorAdditionalDiags};
|
||||
use crate::infer;
|
||||
use crate::infer::relate::{self, RelateResult, TypeRelation};
|
||||
use crate::infer::{InferCtxt, InferCtxtExt as _, TypeTrace, ValuePairs};
|
||||
use crate::solve::deeply_normalize_for_diagnostics;
|
||||
use crate::traits::{MatchExpressionArmCause, ObligationCause, ObligationCauseCode};
|
||||
use crate::traits::{
|
||||
MatchExpressionArmCause, Obligation, ObligationCause, ObligationCauseCode, specialization_graph,
|
||||
};
|
||||
|
||||
mod note_and_explain;
|
||||
mod suggest;
|
||||
|
|
@ -149,11 +155,15 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
|
|||
actual: Ty<'tcx>,
|
||||
err: TypeError<'tcx>,
|
||||
) -> Diag<'a> {
|
||||
self.report_and_explain_type_error(
|
||||
let mut diag = self.report_and_explain_type_error(
|
||||
TypeTrace::types(cause, expected, actual),
|
||||
param_env,
|
||||
err,
|
||||
)
|
||||
);
|
||||
|
||||
self.suggest_param_env_shadowing(&mut diag, expected, actual, param_env);
|
||||
|
||||
diag
|
||||
}
|
||||
|
||||
pub fn report_mismatched_consts(
|
||||
|
|
@ -240,6 +250,76 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
|
|||
false
|
||||
}
|
||||
|
||||
fn suggest_param_env_shadowing(
|
||||
&self,
|
||||
diag: &mut Diag<'_>,
|
||||
expected: Ty<'tcx>,
|
||||
found: Ty<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
) {
|
||||
let (alias, concrete) = match (expected.kind(), found.kind()) {
|
||||
(ty::Alias(ty::Projection, proj), _) => (proj, found),
|
||||
(_, ty::Alias(ty::Projection, proj)) => (proj, expected),
|
||||
_ => return,
|
||||
};
|
||||
|
||||
let tcx = self.tcx;
|
||||
|
||||
let trait_ref = alias.trait_ref(tcx);
|
||||
let obligation =
|
||||
Obligation::new(tcx, ObligationCause::dummy(), param_env, ty::Binder::dummy(trait_ref));
|
||||
|
||||
let applicable_impls = compute_applicable_impls_for_diagnostics(self.infcx, &obligation);
|
||||
|
||||
for candidate in applicable_impls {
|
||||
let impl_def_id = match candidate {
|
||||
CandidateSource::DefId(did) => did,
|
||||
CandidateSource::ParamEnv(_) => continue,
|
||||
};
|
||||
|
||||
let is_shadowed = self.infcx.probe(|_| {
|
||||
let impl_substs = self.infcx.fresh_args_for_item(DUMMY_SP, impl_def_id);
|
||||
let impl_trait_ref = tcx.impl_trait_ref(impl_def_id).instantiate(tcx, impl_substs);
|
||||
|
||||
let expected_trait_ref = alias.trait_ref(tcx);
|
||||
|
||||
if let Err(_) = self.infcx.at(&ObligationCause::dummy(), param_env).eq(
|
||||
DefineOpaqueTypes::No,
|
||||
expected_trait_ref,
|
||||
impl_trait_ref,
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let leaf_def = match specialization_graph::assoc_def(tcx, impl_def_id, alias.def_id)
|
||||
{
|
||||
Ok(leaf) => leaf,
|
||||
Err(_) => return false,
|
||||
};
|
||||
|
||||
let trait_def_id = alias.trait_def_id(tcx);
|
||||
let rebased_args = alias.args.rebase_onto(tcx, trait_def_id, impl_substs);
|
||||
|
||||
let impl_item_def_id = leaf_def.item.def_id;
|
||||
let impl_assoc_ty = tcx.type_of(impl_item_def_id).instantiate(tcx, rebased_args);
|
||||
|
||||
self.infcx.can_eq(param_env, impl_assoc_ty, concrete)
|
||||
});
|
||||
|
||||
if is_shadowed {
|
||||
diag.note(format!(
|
||||
"the associated type `{}` is defined as `{}` in the implementation, \
|
||||
but the where-bound `{}` shadows this definition\n\
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information",
|
||||
self.ty_to_string(tcx.mk_ty_from_kind(ty::Alias(ty::Projection, *alias))),
|
||||
self.ty_to_string(concrete),
|
||||
self.ty_to_string(alias.self_ty())
|
||||
));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn note_error_origin(
|
||||
&self,
|
||||
err: &mut Diag<'_>,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ pub mod project;
|
|||
pub mod query;
|
||||
#[allow(hidden_glob_reexports)]
|
||||
mod select;
|
||||
mod specialize;
|
||||
pub mod specialize;
|
||||
mod structural_normalize;
|
||||
#[allow(hidden_glob_reexports)]
|
||||
mod util;
|
||||
|
|
|
|||
|
|
@ -218,3 +218,38 @@ macro_rules! impl_funnel_shifts {
|
|||
impl_funnel_shifts! {
|
||||
u8, u16, u32, u64, u128, usize
|
||||
}
|
||||
|
||||
#[rustc_const_unstable(feature = "core_intrinsics_fallbacks", issue = "none")]
|
||||
pub const trait CarrylessMul: Copy + 'static {
|
||||
/// See [`super::carryless_mul`]; we just need the trait indirection to handle
|
||||
/// different types since calling intrinsics with generics doesn't work.
|
||||
fn carryless_mul(self, rhs: Self) -> Self;
|
||||
}
|
||||
|
||||
macro_rules! impl_carryless_mul{
|
||||
($($type:ident),*) => {$(
|
||||
#[rustc_const_unstable(feature = "core_intrinsics_fallbacks", issue = "none")]
|
||||
impl const CarrylessMul for $type {
|
||||
#[inline]
|
||||
fn carryless_mul(self, rhs: Self) -> Self {
|
||||
let mut result = 0;
|
||||
let mut i = 0;
|
||||
|
||||
while i < $type::BITS {
|
||||
// If the i-th bit in rhs is set.
|
||||
if (rhs >> i) & 1 != 0 {
|
||||
// Then xor the result with `self` shifted to the left by i positions.
|
||||
result ^= self << i;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
}
|
||||
)*};
|
||||
}
|
||||
|
||||
impl_carryless_mul! {
|
||||
u8, u16, u32, u64, u128, usize
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2178,6 +2178,19 @@ pub const unsafe fn unchecked_funnel_shr<T: [const] fallback::FunnelShift>(
|
|||
unsafe { a.unchecked_funnel_shr(b, shift) }
|
||||
}
|
||||
|
||||
/// Carryless multiply.
|
||||
///
|
||||
/// Safe versions of this intrinsic are available on the integer primitives
|
||||
/// via the `carryless_mul` method. For example, [`u32::carryless_mul`].
|
||||
#[rustc_intrinsic]
|
||||
#[rustc_nounwind]
|
||||
#[rustc_const_unstable(feature = "uint_carryless_mul", issue = "152080")]
|
||||
#[unstable(feature = "uint_carryless_mul", issue = "152080")]
|
||||
#[miri::intrinsic_fallback_is_spec]
|
||||
pub const fn carryless_mul<T: [const] fallback::CarrylessMul>(a: T, b: T) -> T {
|
||||
a.carryless_mul(b)
|
||||
}
|
||||
|
||||
/// This is an implementation detail of [`crate::ptr::read`] and should
|
||||
/// not be used anywhere else. See its comments for why this exists.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -162,6 +162,18 @@ pub const unsafe fn simd_funnel_shl<T>(a: T, b: T, shift: T) -> T;
|
|||
#[rustc_nounwind]
|
||||
pub const unsafe fn simd_funnel_shr<T>(a: T, b: T, shift: T) -> T;
|
||||
|
||||
/// Compute the carry-less product.
|
||||
///
|
||||
/// This is similar to long multiplication except that the carry is discarded.
|
||||
///
|
||||
/// This operation can be used to model multiplication in `GF(2)[X]`, the polynomial
|
||||
/// ring over `GF(2)`.
|
||||
///
|
||||
/// `T` must be a vector of integers.
|
||||
#[rustc_intrinsic]
|
||||
#[rustc_nounwind]
|
||||
pub unsafe fn simd_carryless_mul<T>(a: T, b: T) -> T;
|
||||
|
||||
/// "And"s vectors elementwise.
|
||||
///
|
||||
/// `T` must be a vector of integers.
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@
|
|||
#![feature(trait_alias)]
|
||||
#![feature(transparent_unions)]
|
||||
#![feature(try_blocks)]
|
||||
#![feature(uint_carryless_mul)]
|
||||
#![feature(unboxed_closures)]
|
||||
#![feature(unsized_fn_params)]
|
||||
#![feature(with_negative_coherence)]
|
||||
|
|
|
|||
|
|
@ -607,6 +607,9 @@ macro_rules! write {
|
|||
($dst:expr, $($arg:tt)*) => {
|
||||
$dst.write_fmt($crate::format_args!($($arg)*))
|
||||
};
|
||||
($($arg:tt)*) => {
|
||||
compile_error!("requires a destination and format arguments, like `write!(dest, \"format string\", args...)`")
|
||||
};
|
||||
}
|
||||
|
||||
/// Writes formatted data into a buffer, with a newline appended.
|
||||
|
|
@ -645,6 +648,9 @@ macro_rules! writeln {
|
|||
($dst:expr, $($arg:tt)*) => {
|
||||
$dst.write_fmt($crate::format_args_nl!($($arg)*))
|
||||
};
|
||||
($($arg:tt)*) => {
|
||||
compile_error!("requires a destination and format arguments, like `writeln!(dest, \"format string\", args...)`")
|
||||
};
|
||||
}
|
||||
|
||||
/// Indicates unreachable code.
|
||||
|
|
|
|||
|
|
@ -244,6 +244,104 @@ macro_rules! midpoint_impl {
|
|||
};
|
||||
}
|
||||
|
||||
macro_rules! widening_carryless_mul_impl {
|
||||
($SelfT:ty, $WideT:ty) => {
|
||||
/// Performs a widening carry-less multiplication.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(uint_carryless_mul)]
|
||||
///
|
||||
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.widening_carryless_mul(",
|
||||
stringify!($SelfT), "::MAX), ", stringify!($WideT), "::MAX / 3);")]
|
||||
/// ```
|
||||
#[rustc_const_unstable(feature = "uint_carryless_mul", issue = "152080")]
|
||||
#[doc(alias = "clmul")]
|
||||
#[unstable(feature = "uint_carryless_mul", issue = "152080")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
pub const fn widening_carryless_mul(self, rhs: $SelfT) -> $WideT {
|
||||
(self as $WideT).carryless_mul(rhs as $WideT)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! carrying_carryless_mul_impl {
|
||||
(u128, u256) => {
|
||||
carrying_carryless_mul_impl! { @internal u128 =>
|
||||
pub const fn carrying_carryless_mul(self, rhs: Self, carry: Self) -> (Self, Self) {
|
||||
let x0 = self as u64;
|
||||
let x1 = (self >> 64) as u64;
|
||||
let y0 = rhs as u64;
|
||||
let y1 = (rhs >> 64) as u64;
|
||||
|
||||
let z0 = u64::widening_carryless_mul(x0, y0);
|
||||
let z2 = u64::widening_carryless_mul(x1, y1);
|
||||
|
||||
// The grade school algorithm would compute:
|
||||
// z1 = x0y1 ^ x1y0
|
||||
|
||||
// Instead, Karatsuba first computes:
|
||||
let z3 = u64::widening_carryless_mul(x0 ^ x1, y0 ^ y1);
|
||||
// Since it distributes over XOR,
|
||||
// z3 == x0y0 ^ x0y1 ^ x1y0 ^ x1y1
|
||||
// |--| |---------| |--|
|
||||
// == z0 ^ z1 ^ z2
|
||||
// so we can compute z1 as
|
||||
let z1 = z3 ^ z0 ^ z2;
|
||||
|
||||
let lo = z0 ^ (z1 << 64);
|
||||
let hi = z2 ^ (z1 >> 64);
|
||||
|
||||
(lo ^ carry, hi)
|
||||
}
|
||||
}
|
||||
};
|
||||
($SelfT:ty, $WideT:ty) => {
|
||||
carrying_carryless_mul_impl! { @internal $SelfT =>
|
||||
pub const fn carrying_carryless_mul(self, rhs: Self, carry: Self) -> (Self, Self) {
|
||||
// Can't use widening_carryless_mul because it's not implemented for usize.
|
||||
let p = (self as $WideT).carryless_mul(rhs as $WideT);
|
||||
|
||||
let lo = (p as $SelfT);
|
||||
let hi = (p >> Self::BITS) as $SelfT;
|
||||
|
||||
(lo ^ carry, hi)
|
||||
}
|
||||
}
|
||||
};
|
||||
(@internal $SelfT:ty => $($fn:tt)*) => {
|
||||
/// Calculates the "full carryless multiplication" without the possibility to overflow.
|
||||
///
|
||||
/// This returns the low-order (wrapping) bits and the high-order (overflow) bits
|
||||
/// of the result as two separate values, in that order.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Please note that this example is shared among integer types, which is why `u8` is used.
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(uint_carryless_mul)]
|
||||
///
|
||||
/// assert_eq!(0b1000_0000u8.carrying_carryless_mul(0b1000_0000, 0b0000), (0, 0b0100_0000));
|
||||
/// assert_eq!(0b1000_0000u8.carrying_carryless_mul(0b1000_0000, 0b1111), (0b1111, 0b0100_0000));
|
||||
#[doc = concat!("assert_eq!(",
|
||||
stringify!($SelfT), "::MAX.carrying_carryless_mul(", stringify!($SelfT), "::MAX, ", stringify!($SelfT), "::MAX), ",
|
||||
"(!(", stringify!($SelfT), "::MAX / 3), ", stringify!($SelfT), "::MAX / 3));"
|
||||
)]
|
||||
/// ```
|
||||
#[rustc_const_unstable(feature = "uint_carryless_mul", issue = "152080")]
|
||||
#[doc(alias = "clmul")]
|
||||
#[unstable(feature = "uint_carryless_mul", issue = "152080")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline]
|
||||
$($fn)*
|
||||
}
|
||||
}
|
||||
|
||||
impl i8 {
|
||||
int_impl! {
|
||||
Self = i8,
|
||||
|
|
@ -458,6 +556,9 @@ impl u8 {
|
|||
fsh_op = "0x36",
|
||||
fshl_result = "0x8",
|
||||
fshr_result = "0x8d",
|
||||
clmul_lhs = "0x12",
|
||||
clmul_rhs = "0x34",
|
||||
clmul_result = "0x28",
|
||||
swap_op = "0x12",
|
||||
swapped = "0x12",
|
||||
reversed = "0x48",
|
||||
|
|
@ -468,6 +569,8 @@ impl u8 {
|
|||
bound_condition = "",
|
||||
}
|
||||
midpoint_impl! { u8, u16, unsigned }
|
||||
widening_carryless_mul_impl! { u8, u16 }
|
||||
carrying_carryless_mul_impl! { u8, u16 }
|
||||
|
||||
/// Checks if the value is within the ASCII range.
|
||||
///
|
||||
|
|
@ -1095,6 +1198,9 @@ impl u16 {
|
|||
fsh_op = "0x2de",
|
||||
fshl_result = "0x30",
|
||||
fshr_result = "0x302d",
|
||||
clmul_lhs = "0x9012",
|
||||
clmul_rhs = "0xcd34",
|
||||
clmul_result = "0x928",
|
||||
swap_op = "0x1234",
|
||||
swapped = "0x3412",
|
||||
reversed = "0x2c48",
|
||||
|
|
@ -1105,6 +1211,8 @@ impl u16 {
|
|||
bound_condition = "",
|
||||
}
|
||||
midpoint_impl! { u16, u32, unsigned }
|
||||
widening_carryless_mul_impl! { u16, u32 }
|
||||
carrying_carryless_mul_impl! { u16, u32 }
|
||||
|
||||
/// Checks if the value is a Unicode surrogate code point, which are disallowed values for [`char`].
|
||||
///
|
||||
|
|
@ -1145,6 +1253,9 @@ impl u32 {
|
|||
fsh_op = "0x2fe78e45",
|
||||
fshl_result = "0xb32f",
|
||||
fshr_result = "0xb32fe78e",
|
||||
clmul_lhs = "0x56789012",
|
||||
clmul_rhs = "0xf52ecd34",
|
||||
clmul_result = "0x9b980928",
|
||||
swap_op = "0x12345678",
|
||||
swapped = "0x78563412",
|
||||
reversed = "0x1e6a2c48",
|
||||
|
|
@ -1155,6 +1266,8 @@ impl u32 {
|
|||
bound_condition = "",
|
||||
}
|
||||
midpoint_impl! { u32, u64, unsigned }
|
||||
widening_carryless_mul_impl! { u32, u64 }
|
||||
carrying_carryless_mul_impl! { u32, u64 }
|
||||
}
|
||||
|
||||
impl u64 {
|
||||
|
|
@ -1171,6 +1284,9 @@ impl u64 {
|
|||
fsh_op = "0x2fe78e45983acd98",
|
||||
fshl_result = "0x6e12fe",
|
||||
fshr_result = "0x6e12fe78e45983ac",
|
||||
clmul_lhs = "0x7890123456789012",
|
||||
clmul_rhs = "0xdd358416f52ecd34",
|
||||
clmul_result = "0xa6299579b980928",
|
||||
swap_op = "0x1234567890123456",
|
||||
swapped = "0x5634129078563412",
|
||||
reversed = "0x6a2c48091e6a2c48",
|
||||
|
|
@ -1181,6 +1297,8 @@ impl u64 {
|
|||
bound_condition = "",
|
||||
}
|
||||
midpoint_impl! { u64, u128, unsigned }
|
||||
widening_carryless_mul_impl! { u64, u128 }
|
||||
carrying_carryless_mul_impl! { u64, u128 }
|
||||
}
|
||||
|
||||
impl u128 {
|
||||
|
|
@ -1197,6 +1315,9 @@ impl u128 {
|
|||
fsh_op = "0x2fe78e45983acd98039000008736273",
|
||||
fshl_result = "0x4f7602fe",
|
||||
fshr_result = "0x4f7602fe78e45983acd9803900000873",
|
||||
clmul_lhs = "0x12345678901234567890123456789012",
|
||||
clmul_rhs = "0x4317e40ab4ddcf05dd358416f52ecd34",
|
||||
clmul_result = "0xb9cf660de35d0c170a6299579b980928",
|
||||
swap_op = "0x12345678901234567890123456789012",
|
||||
swapped = "0x12907856341290785634129078563412",
|
||||
reversed = "0x48091e6a2c48091e6a2c48091e6a2c48",
|
||||
|
|
@ -1209,6 +1330,7 @@ impl u128 {
|
|||
bound_condition = "",
|
||||
}
|
||||
midpoint_impl! { u128, unsigned }
|
||||
carrying_carryless_mul_impl! { u128, u256 }
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "16")]
|
||||
|
|
@ -1223,9 +1345,12 @@ impl usize {
|
|||
rot = 4,
|
||||
rot_op = "0xa003",
|
||||
rot_result = "0x3a",
|
||||
fsh_op = "0x2fe78e45983acd98039000008736273",
|
||||
fshl_result = "0x4f7602fe",
|
||||
fshr_result = "0x4f7602fe78e45983acd9803900000873",
|
||||
fsh_op = "0x2de",
|
||||
fshl_result = "0x30",
|
||||
fshr_result = "0x302d",
|
||||
clmul_lhs = "0x9012",
|
||||
clmul_rhs = "0xcd34",
|
||||
clmul_result = "0x928",
|
||||
swap_op = "0x1234",
|
||||
swapped = "0x3412",
|
||||
reversed = "0x2c48",
|
||||
|
|
@ -1236,6 +1361,7 @@ impl usize {
|
|||
bound_condition = " on 16-bit targets",
|
||||
}
|
||||
midpoint_impl! { usize, u32, unsigned }
|
||||
carrying_carryless_mul_impl! { usize, u32 }
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
|
|
@ -1253,6 +1379,9 @@ impl usize {
|
|||
fsh_op = "0x2fe78e45",
|
||||
fshl_result = "0xb32f",
|
||||
fshr_result = "0xb32fe78e",
|
||||
clmul_lhs = "0x56789012",
|
||||
clmul_rhs = "0xf52ecd34",
|
||||
clmul_result = "0x9b980928",
|
||||
swap_op = "0x12345678",
|
||||
swapped = "0x78563412",
|
||||
reversed = "0x1e6a2c48",
|
||||
|
|
@ -1263,6 +1392,7 @@ impl usize {
|
|||
bound_condition = " on 32-bit targets",
|
||||
}
|
||||
midpoint_impl! { usize, u64, unsigned }
|
||||
carrying_carryless_mul_impl! { usize, u64 }
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
|
|
@ -1280,6 +1410,9 @@ impl usize {
|
|||
fsh_op = "0x2fe78e45983acd98",
|
||||
fshl_result = "0x6e12fe",
|
||||
fshr_result = "0x6e12fe78e45983ac",
|
||||
clmul_lhs = "0x7890123456789012",
|
||||
clmul_rhs = "0xdd358416f52ecd34",
|
||||
clmul_result = "0xa6299579b980928",
|
||||
swap_op = "0x1234567890123456",
|
||||
swapped = "0x5634129078563412",
|
||||
reversed = "0x6a2c48091e6a2c48",
|
||||
|
|
@ -1290,6 +1423,7 @@ impl usize {
|
|||
bound_condition = " on 64-bit targets",
|
||||
}
|
||||
midpoint_impl! { usize, u128, unsigned }
|
||||
carrying_carryless_mul_impl! { usize, u128 }
|
||||
}
|
||||
|
||||
impl usize {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ macro_rules! uint_impl {
|
|||
fsh_op = $fsh_op:literal,
|
||||
fshl_result = $fshl_result:literal,
|
||||
fshr_result = $fshr_result:literal,
|
||||
clmul_lhs = $clmul_rhs:literal,
|
||||
clmul_rhs = $clmul_lhs:literal,
|
||||
clmul_result = $clmul_result:literal,
|
||||
swap_op = $swap_op:literal,
|
||||
swapped = $swapped:literal,
|
||||
reversed = $reversed:literal,
|
||||
|
|
@ -482,6 +485,62 @@ macro_rules! uint_impl {
|
|||
unsafe { intrinsics::unchecked_funnel_shr(self, rhs, n) }
|
||||
}
|
||||
|
||||
/// Performs a carry-less multiplication, returning the lower bits.
|
||||
///
|
||||
/// This operation is similar to long multiplication, except that exclusive or is used
|
||||
/// instead of addition. The implementation is equivalent to:
|
||||
///
|
||||
/// ```no_run
|
||||
#[doc = concat!("pub fn carryless_mul(lhs: ", stringify!($SelfT), ", rhs: ", stringify!($SelfT), ") -> ", stringify!($SelfT), "{")]
|
||||
/// let mut retval = 0;
|
||||
#[doc = concat!(" for i in 0..", stringify!($SelfT), "::BITS {")]
|
||||
/// if (rhs >> i) & 1 != 0 {
|
||||
/// // long multiplication would use +=
|
||||
/// retval ^= lhs << i;
|
||||
/// }
|
||||
/// }
|
||||
/// retval
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// The actual implementation is more efficient, and on some platforms lowers directly to a
|
||||
/// dedicated instruction.
|
||||
///
|
||||
/// # Uses
|
||||
///
|
||||
/// Carryless multiplication can be used to turn a bitmask of quote characters into a
|
||||
/// bit mask of characters surrounded by quotes:
|
||||
///
|
||||
/// ```no_run
|
||||
/// r#"abc xxx "foobar" zzz "a"!"#; // input string
|
||||
/// 0b0000000010000001000001010; // quote_mask
|
||||
/// 0b0000000001111110000000100; // quote_mask.carryless_mul(!0) & !quote_mask
|
||||
/// ```
|
||||
///
|
||||
/// Another use is in cryptography, where carryless multiplication allows for efficient
|
||||
/// implementations of polynomial multiplication in `GF(2)[X]`, the polynomial ring
|
||||
/// over `GF(2)`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(uint_carryless_mul)]
|
||||
///
|
||||
#[doc = concat!("let a = ", $clmul_lhs, stringify!($SelfT), ";")]
|
||||
#[doc = concat!("let b = ", $clmul_rhs, stringify!($SelfT), ";")]
|
||||
///
|
||||
#[doc = concat!("assert_eq!(a.carryless_mul(b), ", $clmul_result, ");")]
|
||||
/// ```
|
||||
#[rustc_const_unstable(feature = "uint_carryless_mul", issue = "152080")]
|
||||
#[doc(alias = "clmul")]
|
||||
#[unstable(feature = "uint_carryless_mul", issue = "152080")]
|
||||
#[must_use = "this returns the result of the operation, \
|
||||
without modifying the original"]
|
||||
#[inline(always)]
|
||||
pub const fn carryless_mul(self, rhs: Self) -> Self {
|
||||
intrinsics::carryless_mul(self, rhs)
|
||||
}
|
||||
|
||||
/// Reverses the byte order of the integer.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@
|
|||
#![feature(try_trait_v2)]
|
||||
#![feature(type_info)]
|
||||
#![feature(uint_bit_width)]
|
||||
#![feature(uint_carryless_mul)]
|
||||
#![feature(uint_gather_scatter_bits)]
|
||||
#![feature(unsize)]
|
||||
#![feature(unwrap_infallible)]
|
||||
|
|
|
|||
254
library/coretests/tests/num/carryless_mul.rs
Normal file
254
library/coretests/tests/num/carryless_mul.rs
Normal file
|
|
@ -0,0 +1,254 @@
|
|||
//! Tests the `Unsigned::{carryless_mul, widening_carryless_mul, carrying_carryless_mul}` methods.
|
||||
|
||||
#[test]
|
||||
fn carryless_mul_u128() {
|
||||
assert_eq_const_safe!(u128: <u128>::carryless_mul(0, 0), 0);
|
||||
assert_eq_const_safe!(u128: <u128>::carryless_mul(1, 1), 1);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u128: <u128>::carryless_mul(
|
||||
0x0123456789ABCDEF_FEDCBA9876543210,
|
||||
1u128 << 64,
|
||||
),
|
||||
0xFEDCBA9876543210_0000000000000000
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u128: <u128>::carryless_mul(
|
||||
0x0123456789ABCDEF_FEDCBA9876543210,
|
||||
(1u128 << 64) | 1,
|
||||
),
|
||||
0xFFFFFFFFFFFFFFFF_FEDCBA9876543210
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u128: <u128>::carryless_mul(
|
||||
0x0123456789ABCDEF_FEDCBA9876543211,
|
||||
1u128 << 127,
|
||||
),
|
||||
0x8000000000000000_0000000000000000
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u128: <u128>::carryless_mul(
|
||||
0xAAAAAAAAAAAAAAAA_AAAAAAAAAAAAAAAA,
|
||||
0x5555555555555555_5555555555555555,
|
||||
),
|
||||
0x2222222222222222_2222222222222222
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u128: <u128>::carryless_mul(
|
||||
(1 << 127) | (1 << 64) | 1,
|
||||
(1 << 63) | 1
|
||||
),
|
||||
(1 << 64) | (1 << 63) | 1
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u128: <u128>::carryless_mul(
|
||||
0x8000000000000000_0000000000000001,
|
||||
0x7FFFFFFFFFFFFFFF_FFFFFFFFFFFFFFFF,
|
||||
),
|
||||
0xFFFFFFFFFFFFFFFF_FFFFFFFFFFFFFFFF
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn carryless_mul_u64() {
|
||||
assert_eq_const_safe!(u64: <u64>::carryless_mul(0, 0), 0);
|
||||
assert_eq_const_safe!(u64: <u64>::carryless_mul(1, 1), 1);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u64: <u64>::carryless_mul(
|
||||
0x0123_4567_89AB_CDEF,
|
||||
1u64 << 32,
|
||||
),
|
||||
0x89AB_CDEF_0000_0000
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u64: <u64>::carryless_mul(
|
||||
0x0123_4567_89AB_CDEF,
|
||||
(1u64 << 32) | 1,
|
||||
),
|
||||
0x8888_8888_89AB_CDEF
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u64: <u64>::carryless_mul(
|
||||
0x0123_4567_89AB_CDEF,
|
||||
1u64 << 63,
|
||||
),
|
||||
0x8000_0000_0000_0000
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u64: <u64>::carryless_mul(
|
||||
0xAAAA_AAAA_AAAA_AAAA,
|
||||
0x5555_5555_5555_5555,
|
||||
),
|
||||
0x2222_2222_2222_2222
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u64: <u64>::carryless_mul(
|
||||
(1u64 << 63) | (1u64 << 32) | 1,
|
||||
(1u64 << 31) | 1,
|
||||
),
|
||||
(1u64 << 32) | (1u64 << 31) | 1
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u64: <u64>::carryless_mul(
|
||||
0x8000_0000_0000_0001,
|
||||
0x7FFF_FFFF_FFFF_FFFF,
|
||||
),
|
||||
0xFFFF_FFFF_FFFF_FFFF
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn carryless_mul_u32() {
|
||||
assert_eq_const_safe!(
|
||||
u32: <u32>::carryless_mul(0x0123_4567, 1u32 << 16),
|
||||
0x4567_0000
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u32: <u32>::carryless_mul(0xAAAA_AAAA, 0x5555_5555),
|
||||
0x2222_2222
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn carryless_mul_u16() {
|
||||
assert_eq_const_safe!(
|
||||
u16: <u16>::carryless_mul(0x0123, 1u16 << 8),
|
||||
0x2300
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u16: <u16>::carryless_mul(0xAAAA, 0x5555),
|
||||
0x2222
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn carryless_mul_u8() {
|
||||
assert_eq_const_safe!(
|
||||
u8: <u8>::carryless_mul(0x01, 1u8 << 4),
|
||||
0x10
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u8: <u8>::carryless_mul(0xAA, 0x55),
|
||||
0x22
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn widening_carryless_mul() {
|
||||
assert_eq_const_safe!(
|
||||
u16: <u8>::widening_carryless_mul(0xEFu8, 1u8 << 7),
|
||||
0x7780u16
|
||||
);
|
||||
assert_eq_const_safe!(
|
||||
u16: <u8>::widening_carryless_mul(0xEFu8, (1u8 << 7) | 1),
|
||||
0x776Fu16
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u32: <u16>::widening_carryless_mul(0xBEEFu16, 1u16 << 15),
|
||||
0x5F77_8000u32
|
||||
);
|
||||
assert_eq_const_safe!(
|
||||
u32: <u16>::widening_carryless_mul(0xBEEFu16, (1u16 << 15) | 1),
|
||||
0x5F77_3EEFu32
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u64: <u32>::widening_carryless_mul(0xDEAD_BEEFu32, 1u32 << 31),
|
||||
0x6F56_DF77_8000_0000u64
|
||||
);
|
||||
assert_eq_const_safe!(
|
||||
u64: <u32>::widening_carryless_mul(0xDEAD_BEEFu32, (1u32 << 31) | 1),
|
||||
0x6F56_DF77_5EAD_BEEFu64
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
u128: <u64>::widening_carryless_mul(0xDEAD_BEEF_FACE_FEEDu64, 1u64 << 63),
|
||||
147995377545877439359040026616086396928
|
||||
|
||||
);
|
||||
assert_eq_const_safe!(
|
||||
u128: <u64>::widening_carryless_mul(0xDEAD_BEEF_FACE_FEEDu64, (1u64 << 63) | 1),
|
||||
147995377545877439356638973527682121453
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn carrying_carryless_mul() {
|
||||
assert_eq_const_safe!(
|
||||
(u8, u8): <u8>::carrying_carryless_mul(0xEFu8, 1u8 << 7, 0),
|
||||
(0x80u8, 0x77u8)
|
||||
);
|
||||
assert_eq_const_safe!(
|
||||
(u8, u8): <u8>::carrying_carryless_mul(0xEFu8, (1u8 << 7) | 1, 0xEF),
|
||||
(0x80u8, 0x77u8)
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
(u16, u16): <u16>::carrying_carryless_mul(0xBEEFu16, 1u16 << 15, 0),
|
||||
(0x8000u16, 0x5F77u16)
|
||||
);
|
||||
assert_eq_const_safe!(
|
||||
(u16, u16): <u16>::carrying_carryless_mul(0xBEEFu16, (1u16 << 15) | 1, 0xBEEF),
|
||||
(0x8000u16, 0x5F77u16)
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
(u32, u32): <u32>::carrying_carryless_mul(0xDEAD_BEEFu32, 1u32 << 31, 0),
|
||||
(0x8000_0000u32, 0x6F56_DF77u32)
|
||||
);
|
||||
assert_eq_const_safe!(
|
||||
(u32, u32): <u32>::carrying_carryless_mul(0xDEAD_BEEFu32, (1u32 << 31) | 1, 0xDEAD_BEEF),
|
||||
(0x8000_0000u32, 0x6F56_DF77u32)
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
(u64, u64): <u64>::carrying_carryless_mul(0xDEAD_BEEF_FACE_FEEDu64, 1u64 << 63, 0),
|
||||
(9223372036854775808, 8022845492652638070)
|
||||
);
|
||||
assert_eq_const_safe!(
|
||||
(u64, u64): <u64>::carrying_carryless_mul(
|
||||
0xDEAD_BEEF_FACE_FEEDu64,
|
||||
(1u64 << 63) | 1,
|
||||
0xDEAD_BEEF_FACE_FEED,
|
||||
),
|
||||
(9223372036854775808, 8022845492652638070)
|
||||
);
|
||||
|
||||
assert_eq_const_safe!(
|
||||
(u128, u128): <u128>::carrying_carryless_mul(
|
||||
0xDEAD_BEEF_FACE_FEED_0123_4567_89AB_CDEFu128,
|
||||
1u128 << 127,
|
||||
0,
|
||||
),
|
||||
(
|
||||
0x8000_0000_0000_0000_0000_0000_0000_0000u128,
|
||||
147995377545877439359081019380694640375,
|
||||
)
|
||||
);
|
||||
assert_eq_const_safe!(
|
||||
(u128, u128): <u128>::carrying_carryless_mul(
|
||||
0xDEAD_BEEF_FACE_FEED_0123_4567_89AB_CDEFu128,
|
||||
(1u128 << 127) | 1,
|
||||
0xDEAD_BEEF_FACE_FEED_0123_4567_89AB_CDEF,
|
||||
),
|
||||
(
|
||||
0x8000_0000_0000_0000_0000_0000_0000_0000u128,
|
||||
147995377545877439359081019380694640375,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
@ -22,6 +22,7 @@ mod u64;
|
|||
mod u8;
|
||||
|
||||
mod bignum;
|
||||
mod carryless_mul;
|
||||
mod const_from;
|
||||
mod dec2flt;
|
||||
mod float_iter_sum_identity;
|
||||
|
|
|
|||
|
|
@ -117,6 +117,13 @@ macro_rules! uint_module {
|
|||
assert_eq_const_safe!($T: <$T>::funnel_shr(_1, _1, 4), <$T>::rotate_right(_1, 4));
|
||||
}
|
||||
|
||||
fn test_carryless_mul() {
|
||||
assert_eq_const_safe!($T: <$T>::carryless_mul(0, 0), 0);
|
||||
assert_eq_const_safe!($T: <$T>::carryless_mul(1, 1), 1);
|
||||
|
||||
assert_eq_const_safe!($T: <$T>::carryless_mul(0b0100, 2), 0b1000);
|
||||
}
|
||||
|
||||
fn test_swap_bytes() {
|
||||
assert_eq_const_safe!($T: A.swap_bytes().swap_bytes(), A);
|
||||
assert_eq_const_safe!($T: B.swap_bytes().swap_bytes(), B);
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@
|
|||
#![feature(try_blocks)]
|
||||
#![feature(try_trait_v2)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(uint_carryless_mul)]
|
||||
// tidy-alphabetical-end
|
||||
//
|
||||
// Library features (core):
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ use crate::{fmt, io};
|
|||
|
||||
/// A structure representing a Unix domain socket server.
|
||||
///
|
||||
/// Under Windows, it will only work starting from Windows 10 17063.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ use crate::time::Duration;
|
|||
use crate::{fmt, io};
|
||||
/// A Unix stream socket.
|
||||
///
|
||||
/// Under Windows, it will only work starting from Windows 10 17063.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
|
|
|
|||
|
|
@ -5,10 +5,24 @@
|
|||
// in the future, will test both unix and windows uds
|
||||
use std::io::{Read, Write};
|
||||
use std::os::windows::net::{UnixListener, UnixStream};
|
||||
use std::thread;
|
||||
use std::{mem, thread};
|
||||
|
||||
macro_rules! skip_nonapplicable_oses {
|
||||
() => {
|
||||
// UDS have been available under Windows since Insider Preview Build
|
||||
// 17063. "Redstone 4" (RS4, version 1803, build number 17134) is
|
||||
// therefore the first official release to include it.
|
||||
if !is_windows_10_v1803_or_greater() {
|
||||
println!("Not running this test on too-old Windows.");
|
||||
return;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn win_uds_smoke_bind_connect() {
|
||||
skip_nonapplicable_oses!();
|
||||
|
||||
let tmp = std::env::temp_dir();
|
||||
let sock_path = tmp.join("rust-test-uds-smoke.sock");
|
||||
let _ = std::fs::remove_file(&sock_path);
|
||||
|
|
@ -32,6 +46,8 @@ fn win_uds_smoke_bind_connect() {
|
|||
|
||||
#[test]
|
||||
fn win_uds_echo() {
|
||||
skip_nonapplicable_oses!();
|
||||
|
||||
let tmp = std::env::temp_dir();
|
||||
let sock_path = tmp.join("rust-test-uds-echo.sock");
|
||||
let _ = std::fs::remove_file(&sock_path);
|
||||
|
|
@ -68,14 +84,19 @@ fn win_uds_echo() {
|
|||
|
||||
#[test]
|
||||
fn win_uds_path_too_long() {
|
||||
skip_nonapplicable_oses!();
|
||||
|
||||
let tmp = std::env::temp_dir();
|
||||
let long_path = tmp.join("a".repeat(200));
|
||||
let result = UnixListener::bind(&long_path);
|
||||
assert!(result.is_err());
|
||||
let _ = std::fs::remove_file(&long_path);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn win_uds_existing_bind() {
|
||||
skip_nonapplicable_oses!();
|
||||
|
||||
let tmp = std::env::temp_dir();
|
||||
let sock_path = tmp.join("rust-test-uds-existing.sock");
|
||||
let _ = std::fs::remove_file(&sock_path);
|
||||
|
|
@ -85,3 +106,115 @@ fn win_uds_existing_bind() {
|
|||
drop(listener);
|
||||
let _ = std::fs::remove_file(&sock_path);
|
||||
}
|
||||
|
||||
/// Returns true if we are currently running on Windows 10 v1803 (RS4) or greater.
|
||||
fn is_windows_10_v1803_or_greater() -> bool {
|
||||
is_windows_version_greater_or_equal(NTDDI_WIN10_RS4)
|
||||
}
|
||||
|
||||
/// Returns true if we are currently running on the given version of Windows
|
||||
/// 10 (or newer).
|
||||
fn is_windows_version_greater_or_equal(min_version: u32) -> bool {
|
||||
is_windows_version_or_greater(HIBYTE(OSVER(min_version)), LOBYTE(OSVER(min_version)), 0, 0)
|
||||
}
|
||||
|
||||
/// Checks if we are running a version of Windows newer than the specified one.
|
||||
fn is_windows_version_or_greater(
|
||||
major: u8,
|
||||
minor: u8,
|
||||
service_pack: u8,
|
||||
build_number: u32,
|
||||
) -> bool {
|
||||
let mut osvi = OSVERSIONINFOEXW {
|
||||
dwOSVersionInfoSize: mem::size_of::<OSVERSIONINFOEXW>() as _,
|
||||
dwMajorVersion: u32::from(major),
|
||||
dwMinorVersion: u32::from(minor),
|
||||
wServicePackMajor: u16::from(service_pack),
|
||||
dwBuildNumber: build_number,
|
||||
..OSVERSIONINFOEXW::default()
|
||||
};
|
||||
|
||||
// SAFETY: this function is always safe to call.
|
||||
let condmask = unsafe {
|
||||
VerSetConditionMask(
|
||||
VerSetConditionMask(
|
||||
VerSetConditionMask(
|
||||
VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL as _),
|
||||
VER_MINORVERSION,
|
||||
VER_GREATER_EQUAL as _,
|
||||
),
|
||||
VER_SERVICEPACKMAJOR,
|
||||
VER_GREATER_EQUAL as _,
|
||||
),
|
||||
VER_BUILDNUMBER,
|
||||
VER_GREATER_EQUAL as _,
|
||||
)
|
||||
};
|
||||
|
||||
// SAFETY: osvi needs to point to a memory region valid for at least
|
||||
// dwOSVersionInfoSize bytes, which is the case here.
|
||||
(unsafe {
|
||||
RtlVerifyVersionInfo(
|
||||
&raw mut osvi,
|
||||
VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR,
|
||||
condmask,
|
||||
)
|
||||
}) == STATUS_SUCCESS
|
||||
}
|
||||
|
||||
#[expect(non_snake_case)]
|
||||
const fn HIBYTE(x: u16) -> u8 {
|
||||
((x >> 8) & 0xFF) as u8
|
||||
}
|
||||
|
||||
#[expect(non_snake_case)]
|
||||
const fn LOBYTE(x: u16) -> u8 {
|
||||
(x & 0xFF) as u8
|
||||
}
|
||||
|
||||
#[expect(non_snake_case)]
|
||||
const fn OSVER(x: u32) -> u16 {
|
||||
((x & OSVERSION_MASK) >> 16) as u16
|
||||
}
|
||||
|
||||
// Inlined bindings because outside of `std` here.
|
||||
|
||||
type NTSTATUS = i32;
|
||||
const STATUS_SUCCESS: NTSTATUS = 0;
|
||||
|
||||
#[expect(non_camel_case_types)]
|
||||
type VER_FLAGS = u32;
|
||||
const VER_BUILDNUMBER: VER_FLAGS = 4u32;
|
||||
const VER_GREATER_EQUAL: VER_FLAGS = 3u32;
|
||||
const VER_MAJORVERSION: VER_FLAGS = 2u32;
|
||||
const VER_MINORVERSION: VER_FLAGS = 1u32;
|
||||
const VER_SERVICEPACKMAJOR: VER_FLAGS = 32u32;
|
||||
|
||||
const OSVERSION_MASK: u32 = 4294901760u32;
|
||||
const NTDDI_WIN10_RS4: u32 = 167772165u32;
|
||||
|
||||
#[expect(non_snake_case)]
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
struct OSVERSIONINFOEXW {
|
||||
pub dwOSVersionInfoSize: u32,
|
||||
pub dwMajorVersion: u32,
|
||||
pub dwMinorVersion: u32,
|
||||
pub dwBuildNumber: u32,
|
||||
pub dwPlatformId: u32,
|
||||
pub szCSDVersion: [u16; 128],
|
||||
pub wServicePackMajor: u16,
|
||||
pub wServicePackMinor: u16,
|
||||
pub wSuiteMask: u16,
|
||||
pub wProductType: u8,
|
||||
pub wReserved: u8,
|
||||
}
|
||||
|
||||
impl Default for OSVERSIONINFOEXW {
|
||||
fn default() -> Self {
|
||||
unsafe { core::mem::zeroed() }
|
||||
}
|
||||
}
|
||||
|
||||
windows_link::link!("ntdll.dll" "system" fn RtlVerifyVersionInfo(versioninfo : *const OSVERSIONINFOEXW, typemask : u32, conditionmask : u64) -> NTSTATUS);
|
||||
windows_link::link!("kernel32.dll" "system" fn VerSetConditionMask(conditionmask : u64, typemask : VER_FLAGS, condition : u8) -> u64);
|
||||
|
|
|
|||
|
|
@ -1565,7 +1565,7 @@ pub fn vceqh_f16(a: f16, b: f16) -> u16 {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcmeq))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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);
|
||||
|
|
@ -1576,7 +1576,7 @@ pub fn vceqz_f16(a: float16x4_t) -> uint16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcmeq))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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);
|
||||
|
|
@ -7283,7 +7283,7 @@ pub fn vcvtq_f64_u64(a: uint64x2_t) -> float64x2_t {
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[cfg_attr(test, assert_instr(fcvtn2))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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))
|
||||
|
|
@ -7293,7 +7293,7 @@ pub fn vcvt_high_f16_f32(a: float16x4_t, b: float32x4_t) -> float16x8_t {
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[cfg_attr(test, assert_instr(fcvtl2))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvt_high_f32_f16(a: float16x8_t) -> float32x4_t {
|
||||
vcvt_f32_f16(vget_high_f16(a))
|
||||
|
|
@ -7532,7 +7532,7 @@ pub fn vcvtq_u64_f64(a: float64x2_t) -> uint64x2_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtas))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvta_s16_f16(a: float16x4_t) -> int16x4_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -7549,7 +7549,7 @@ pub fn vcvta_s16_f16(a: float16x4_t) -> int16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtas))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtaq_s16_f16(a: float16x8_t) -> int16x8_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -7630,7 +7630,7 @@ pub fn vcvtaq_s64_f64(a: float64x2_t) -> int64x2_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtau))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvta_u16_f16(a: float16x4_t) -> uint16x4_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -7647,7 +7647,7 @@ pub fn vcvta_u16_f16(a: float16x4_t) -> uint16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtau))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtaq_u16_f16(a: float16x8_t) -> uint16x8_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8218,7 +8218,7 @@ pub fn vcvth_u64_f16(a: f16) -> u64 {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtms))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtm_s16_f16(a: float16x4_t) -> int16x4_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8235,7 +8235,7 @@ pub fn vcvtm_s16_f16(a: float16x4_t) -> int16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtms))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtmq_s16_f16(a: float16x8_t) -> int16x8_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8316,7 +8316,7 @@ pub fn vcvtmq_s64_f64(a: float64x2_t) -> int64x2_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtmu))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtm_u16_f16(a: float16x4_t) -> uint16x4_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8333,7 +8333,7 @@ pub fn vcvtm_u16_f16(a: float16x4_t) -> uint16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtmu))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtmq_u16_f16(a: float16x8_t) -> uint16x8_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8566,7 +8566,7 @@ pub fn vcvtmd_u64_f64(a: f64) -> u64 {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtns))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtn_s16_f16(a: float16x4_t) -> int16x4_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8583,7 +8583,7 @@ pub fn vcvtn_s16_f16(a: float16x4_t) -> int16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtns))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtnq_s16_f16(a: float16x8_t) -> int16x8_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8664,7 +8664,7 @@ pub fn vcvtnq_s64_f64(a: float64x2_t) -> int64x2_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtnu))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtn_u16_f16(a: float16x4_t) -> uint16x4_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8681,7 +8681,7 @@ pub fn vcvtn_u16_f16(a: float16x4_t) -> uint16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtnu))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtnq_u16_f16(a: float16x8_t) -> uint16x8_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8914,7 +8914,7 @@ pub fn vcvtnd_u64_f64(a: f64) -> u64 {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtps))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtp_s16_f16(a: float16x4_t) -> int16x4_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -8931,7 +8931,7 @@ pub fn vcvtp_s16_f16(a: float16x4_t) -> int16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtps))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtpq_s16_f16(a: float16x8_t) -> int16x8_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -9012,7 +9012,7 @@ pub fn vcvtpq_s64_f64(a: float64x2_t) -> int64x2_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtpu))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtp_u16_f16(a: float16x4_t) -> uint16x4_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -9029,7 +9029,7 @@ pub fn vcvtp_u16_f16(a: float16x4_t) -> uint16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fcvtpu))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vcvtpq_u16_f16(a: float16x8_t) -> uint16x8_t {
|
||||
unsafe extern "unadjusted" {
|
||||
|
|
@ -9493,7 +9493,7 @@ pub fn vcvtxd_f32_f64(a: f64) -> f32 {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vdiv_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fdiv))]
|
||||
pub fn vdiv_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -9503,7 +9503,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fdiv))]
|
||||
pub fn vdivq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -10108,7 +10108,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")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfma_lane_f16<const LANE: i32>(
|
||||
a: float16x4_t,
|
||||
|
|
@ -10124,7 +10124,7 @@ pub fn vfma_lane_f16<const LANE: i32>(
|
|||
#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfma_laneq_f16<const LANE: i32>(
|
||||
a: float16x4_t,
|
||||
|
|
@ -10140,7 +10140,7 @@ pub fn vfma_laneq_f16<const LANE: i32>(
|
|||
#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmaq_lane_f16<const LANE: i32>(
|
||||
a: float16x8_t,
|
||||
|
|
@ -10156,7 +10156,7 @@ pub fn vfmaq_lane_f16<const LANE: i32>(
|
|||
#[cfg_attr(test, assert_instr(fmla, LANE = 0))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmaq_laneq_f16<const LANE: i32>(
|
||||
a: float16x8_t,
|
||||
|
|
@ -10434,7 +10434,7 @@ pub fn vfmad_laneq_f64<const LANE: i32>(a: f64, b: f64, c: float64x2_t) -> f64 {
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -10452,7 +10452,7 @@ pub fn vfmlal_high_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float3
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -10472,7 +10472,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)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlal_lane_high_f16<const LANE: i32>(
|
||||
r: float32x2_t,
|
||||
|
|
@ -10489,7 +10489,7 @@ pub fn vfmlal_lane_high_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlal_laneq_high_f16<const LANE: i32>(
|
||||
r: float32x2_t,
|
||||
|
|
@ -10506,7 +10506,7 @@ pub fn vfmlal_laneq_high_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlalq_lane_high_f16<const LANE: i32>(
|
||||
r: float32x4_t,
|
||||
|
|
@ -10523,7 +10523,7 @@ pub fn vfmlalq_lane_high_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlalq_laneq_high_f16<const LANE: i32>(
|
||||
r: float32x4_t,
|
||||
|
|
@ -10540,7 +10540,7 @@ pub fn vfmlalq_laneq_high_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlal_lane_low_f16<const LANE: i32>(
|
||||
r: float32x2_t,
|
||||
|
|
@ -10557,7 +10557,7 @@ pub fn vfmlal_lane_low_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlal_laneq_low_f16<const LANE: i32>(
|
||||
r: float32x2_t,
|
||||
|
|
@ -10574,7 +10574,7 @@ pub fn vfmlal_laneq_low_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlalq_lane_low_f16<const LANE: i32>(
|
||||
r: float32x4_t,
|
||||
|
|
@ -10591,7 +10591,7 @@ pub fn vfmlalq_lane_low_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlalq_laneq_low_f16<const LANE: i32>(
|
||||
r: float32x4_t,
|
||||
|
|
@ -10606,7 +10606,7 @@ pub fn vfmlalq_laneq_low_f16<const LANE: i32>(
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -10624,7 +10624,7 @@ pub fn vfmlal_low_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float32
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -10642,7 +10642,7 @@ pub fn vfmlalq_low_f16(r: float32x4_t, a: float16x8_t, b: float16x8_t) -> float3
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -10660,7 +10660,7 @@ pub fn vfmlsl_high_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float3
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -10680,7 +10680,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)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlsl_lane_high_f16<const LANE: i32>(
|
||||
r: float32x2_t,
|
||||
|
|
@ -10697,7 +10697,7 @@ pub fn vfmlsl_lane_high_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlsl_laneq_high_f16<const LANE: i32>(
|
||||
r: float32x2_t,
|
||||
|
|
@ -10714,7 +10714,7 @@ pub fn vfmlsl_laneq_high_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlslq_lane_high_f16<const LANE: i32>(
|
||||
r: float32x4_t,
|
||||
|
|
@ -10731,7 +10731,7 @@ pub fn vfmlslq_lane_high_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlslq_laneq_high_f16<const LANE: i32>(
|
||||
r: float32x4_t,
|
||||
|
|
@ -10748,7 +10748,7 @@ pub fn vfmlslq_laneq_high_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlsl_lane_low_f16<const LANE: i32>(
|
||||
r: float32x2_t,
|
||||
|
|
@ -10765,7 +10765,7 @@ pub fn vfmlsl_lane_low_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlsl_laneq_low_f16<const LANE: i32>(
|
||||
r: float32x2_t,
|
||||
|
|
@ -10782,7 +10782,7 @@ pub fn vfmlsl_laneq_low_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlslq_lane_low_f16<const LANE: i32>(
|
||||
r: float32x4_t,
|
||||
|
|
@ -10799,7 +10799,7 @@ pub fn vfmlslq_lane_low_f16<const LANE: i32>(
|
|||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmlslq_laneq_low_f16<const LANE: i32>(
|
||||
r: float32x4_t,
|
||||
|
|
@ -10814,7 +10814,7 @@ pub fn vfmlslq_laneq_low_f16<const LANE: i32>(
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -10832,7 +10832,7 @@ pub fn vfmlsl_low_f16(r: float32x2_t, a: float16x4_t, b: float16x4_t) -> float32
|
|||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "fhm"))]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -10863,7 +10863,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")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfms_lane_f16<const LANE: i32>(
|
||||
a: float16x4_t,
|
||||
|
|
@ -10879,7 +10879,7 @@ pub fn vfms_lane_f16<const LANE: i32>(
|
|||
#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfms_laneq_f16<const LANE: i32>(
|
||||
a: float16x4_t,
|
||||
|
|
@ -10895,7 +10895,7 @@ pub fn vfms_laneq_f16<const LANE: i32>(
|
|||
#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmsq_lane_f16<const LANE: i32>(
|
||||
a: float16x8_t,
|
||||
|
|
@ -10911,7 +10911,7 @@ pub fn vfmsq_lane_f16<const LANE: i32>(
|
|||
#[cfg_attr(test, assert_instr(fmls, LANE = 0))]
|
||||
#[rustc_legacy_const_generics(3)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vfmsq_laneq_f16<const LANE: i32>(
|
||||
a: float16x8_t,
|
||||
|
|
@ -15085,7 +15085,7 @@ pub fn vmul_lane_f64<const LANE: i32>(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")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vmul_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float16x4_t {
|
||||
static_assert_uimm_bits!(LANE, 3);
|
||||
|
|
@ -15102,7 +15102,7 @@ pub fn vmul_laneq_f16<const LANE: i32>(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")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vmulq_laneq_f16<const LANE: i32>(a: float16x8_t, b: float16x8_t) -> float16x8_t {
|
||||
static_assert_uimm_bits!(LANE, 3);
|
||||
|
|
@ -15609,7 +15609,7 @@ pub fn vmuld_laneq_f64<const LANE: i32>(a: f64, b: float64x2_t) -> f64 {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vmulx_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fmulx))]
|
||||
pub fn vmulx_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -15626,7 +15626,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fmulx))]
|
||||
pub fn vmulxq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -15709,7 +15709,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")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vmulx_lane_f16<const LANE: i32>(a: float16x4_t, b: float16x4_t) -> float16x4_t {
|
||||
static_assert_uimm_bits!(LANE, 2);
|
||||
|
|
@ -15726,7 +15726,7 @@ pub fn vmulx_lane_f16<const LANE: i32>(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")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vmulx_laneq_f16<const LANE: i32>(a: float16x4_t, b: float16x8_t) -> float16x4_t {
|
||||
static_assert_uimm_bits!(LANE, 3);
|
||||
|
|
@ -15743,7 +15743,7 @@ pub fn vmulx_laneq_f16<const LANE: i32>(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")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vmulxq_lane_f16<const LANE: i32>(a: float16x8_t, b: float16x4_t) -> float16x8_t {
|
||||
static_assert_uimm_bits!(LANE, 2);
|
||||
|
|
@ -15773,7 +15773,7 @@ pub fn vmulxq_lane_f16<const LANE: i32>(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")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vmulxq_laneq_f16<const LANE: i32>(a: float16x8_t, b: float16x8_t) -> float16x8_t {
|
||||
static_assert_uimm_bits!(LANE, 3);
|
||||
|
|
@ -16135,7 +16135,7 @@ pub fn vpaddd_u64(a: uint64x2_t) -> u64 {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpaddq_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(faddp))]
|
||||
pub fn vpaddq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -16354,7 +16354,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fmaxp))]
|
||||
pub fn vpmax_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -16371,7 +16371,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fmaxp))]
|
||||
pub fn vpmaxq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -16388,7 +16388,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fmaxnmp))]
|
||||
pub fn vpmaxnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -16405,7 +16405,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fmaxnmp))]
|
||||
pub fn vpmaxnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -16662,7 +16662,7 @@ pub fn vpmaxs_f32(a: float32x2_t) -> f32 {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vpmin_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fminp))]
|
||||
pub fn vpmin_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -16679,7 +16679,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fminp))]
|
||||
pub fn vpminq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -16696,7 +16696,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fminnmp))]
|
||||
pub fn vpminnm_f16(a: float16x4_t, b: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -16713,7 +16713,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(fminnmp))]
|
||||
pub fn vpminnmq_f16(a: float16x8_t, b: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -21839,7 +21839,7 @@ pub fn vrecpxh_f16(a: f16) -> f16 {
|
|||
#[inline(always)]
|
||||
#[cfg(target_endian = "little")]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(nop))]
|
||||
pub fn vreinterpret_f64_f16(a: float16x4_t) -> float64x1_t {
|
||||
|
|
@ -21850,7 +21850,7 @@ pub fn vreinterpret_f64_f16(a: float16x4_t) -> float64x1_t {
|
|||
#[inline(always)]
|
||||
#[cfg(target_endian = "big")]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(nop))]
|
||||
pub fn vreinterpret_f64_f16(a: float16x4_t) -> float64x1_t {
|
||||
|
|
@ -21862,7 +21862,7 @@ pub fn vreinterpret_f64_f16(a: float16x4_t) -> float64x1_t {
|
|||
#[inline(always)]
|
||||
#[cfg(target_endian = "little")]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(nop))]
|
||||
pub fn vreinterpretq_f64_f16(a: float16x8_t) -> float64x2_t {
|
||||
|
|
@ -21873,7 +21873,7 @@ pub fn vreinterpretq_f64_f16(a: float16x8_t) -> float64x2_t {
|
|||
#[inline(always)]
|
||||
#[cfg(target_endian = "big")]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(nop))]
|
||||
pub fn vreinterpretq_f64_f16(a: float16x8_t) -> float64x2_t {
|
||||
|
|
@ -21888,7 +21888,7 @@ pub fn vreinterpretq_f64_f16(a: float16x8_t) -> float64x2_t {
|
|||
#[inline(always)]
|
||||
#[cfg(target_endian = "little")]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(nop))]
|
||||
pub fn vreinterpret_f16_f64(a: float64x1_t) -> float16x4_t {
|
||||
|
|
@ -21899,7 +21899,7 @@ pub fn vreinterpret_f16_f64(a: float64x1_t) -> float16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg(target_endian = "big")]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(nop))]
|
||||
pub fn vreinterpret_f16_f64(a: float64x1_t) -> float16x4_t {
|
||||
|
|
@ -21913,7 +21913,7 @@ pub fn vreinterpret_f16_f64(a: float64x1_t) -> float16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg(target_endian = "little")]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(nop))]
|
||||
pub fn vreinterpretq_f16_f64(a: float64x2_t) -> float16x8_t {
|
||||
|
|
@ -21924,7 +21924,7 @@ pub fn vreinterpretq_f16_f64(a: float64x2_t) -> float16x8_t {
|
|||
#[inline(always)]
|
||||
#[cfg(target_endian = "big")]
|
||||
#[target_feature(enable = "neon")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(nop))]
|
||||
pub fn vreinterpretq_f16_f64(a: float64x2_t) -> float16x8_t {
|
||||
|
|
@ -23503,7 +23503,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frintz))]
|
||||
pub fn vrnd_f16(a: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -23513,7 +23513,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frintz))]
|
||||
pub fn vrndq_f16(a: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -23559,7 +23559,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frinta))]
|
||||
pub fn vrnda_f16(a: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -23569,7 +23569,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frinta))]
|
||||
pub fn vrndaq_f16(a: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -23635,7 +23635,7 @@ pub fn vrndh_f16(a: f16) -> f16 {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndi_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frinti))]
|
||||
pub fn vrndi_f16(a: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -23652,7 +23652,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frinti))]
|
||||
pub fn vrndiq_f16(a: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -23750,7 +23750,7 @@ pub fn vrndih_f16(a: f16) -> f16 {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndm_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frintm))]
|
||||
pub fn vrndm_f16(a: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -23760,7 +23760,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frintm))]
|
||||
pub fn vrndmq_f16(a: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -23881,7 +23881,7 @@ pub fn vrndns_f32(a: f32) -> f32 {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndp_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frintp))]
|
||||
pub fn vrndp_f16(a: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -23891,7 +23891,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frintp))]
|
||||
pub fn vrndpq_f16(a: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -23947,7 +23947,7 @@ pub fn vrndph_f16(a: f16) -> f16 {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vrndx_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frintx))]
|
||||
pub fn vrndx_f16(a: float16x4_t) -> float16x4_t {
|
||||
|
|
@ -23957,7 +23957,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
#[cfg_attr(test, assert_instr(frintx))]
|
||||
pub fn vrndxq_f16(a: float16x8_t) -> float16x8_t {
|
||||
|
|
@ -25460,7 +25460,7 @@ pub fn vsqadds_u32(a: u32, b: i32) -> u32 {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fsqrt))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vsqrt_f16(a: float16x4_t) -> float16x4_t {
|
||||
unsafe { simd_fsqrt(a) }
|
||||
|
|
@ -25470,7 +25470,7 @@ pub fn vsqrt_f16(a: float16x4_t) -> float16x4_t {
|
|||
#[inline(always)]
|
||||
#[cfg_attr(test, assert_instr(fsqrt))]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[cfg(not(target_arch = "arm64ec"))]
|
||||
pub fn vsqrtq_f16(a: float16x8_t) -> float16x8_t {
|
||||
unsafe { simd_fsqrt(a) }
|
||||
|
|
@ -28031,7 +28031,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -28041,7 +28041,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -28267,7 +28267,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -28277,7 +28277,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -28777,7 +28777,7 @@ pub fn vuqadds_s32(a: i32, b: u32) -> i32 {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vuzp1_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -28787,7 +28787,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -29013,7 +29013,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -29023,7 +29023,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -29267,7 +29267,7 @@ pub fn vxarq_u64<const IMM6: i32>(a: uint64x2_t, b: uint64x2_t) -> uint64x2_t {
|
|||
#[doc = "[Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vzip1_f16)"]
|
||||
#[inline(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -29277,7 +29277,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -29503,7 +29503,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
@ -29513,7 +29513,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(always)]
|
||||
#[target_feature(enable = "neon,fp16")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
#[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 {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -104,7 +104,7 @@ types! {
|
|||
}
|
||||
|
||||
types! {
|
||||
#![cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION"))]
|
||||
#![cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_neon_fp16", since = "1.94.0"))]
|
||||
#![cfg_attr(target_arch = "arm", unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800"))]
|
||||
|
||||
/// Arm-specific 64-bit wide vector of four packed `f16`.
|
||||
|
|
@ -750,7 +750,7 @@ pub struct uint32x4x4_t(
|
|||
#[derive(Copy, Clone, Debug)]
|
||||
#[cfg_attr(
|
||||
not(target_arch = "arm"),
|
||||
stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")
|
||||
stable(feature = "stdarch_neon_fp16", since = "1.94.0")
|
||||
)]
|
||||
#[cfg_attr(
|
||||
target_arch = "arm",
|
||||
|
|
@ -763,7 +763,7 @@ pub struct float16x4x2_t(pub float16x4_t, pub float16x4_t);
|
|||
#[derive(Copy, Clone, Debug)]
|
||||
#[cfg_attr(
|
||||
not(target_arch = "arm"),
|
||||
stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")
|
||||
stable(feature = "stdarch_neon_fp16", since = "1.94.0")
|
||||
)]
|
||||
#[cfg_attr(
|
||||
target_arch = "arm",
|
||||
|
|
@ -776,7 +776,7 @@ pub struct float16x4x3_t(pub float16x4_t, pub float16x4_t, pub float16x4_t);
|
|||
#[derive(Copy, Clone, Debug)]
|
||||
#[cfg_attr(
|
||||
not(target_arch = "arm"),
|
||||
stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")
|
||||
stable(feature = "stdarch_neon_fp16", since = "1.94.0")
|
||||
)]
|
||||
#[cfg_attr(
|
||||
target_arch = "arm",
|
||||
|
|
@ -794,7 +794,7 @@ pub struct float16x4x4_t(
|
|||
#[derive(Copy, Clone, Debug)]
|
||||
#[cfg_attr(
|
||||
not(target_arch = "arm"),
|
||||
stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")
|
||||
stable(feature = "stdarch_neon_fp16", since = "1.94.0")
|
||||
)]
|
||||
#[cfg_attr(
|
||||
target_arch = "arm",
|
||||
|
|
@ -807,7 +807,7 @@ pub struct float16x8x2_t(pub float16x8_t, pub float16x8_t);
|
|||
#[derive(Copy, Clone, Debug)]
|
||||
#[cfg_attr(
|
||||
not(target_arch = "arm"),
|
||||
stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")
|
||||
stable(feature = "stdarch_neon_fp16", since = "1.94.0")
|
||||
)]
|
||||
#[cfg_attr(
|
||||
target_arch = "arm",
|
||||
|
|
@ -820,7 +820,7 @@ pub struct float16x8x3_t(pub float16x8_t, pub float16x8_t, pub float16x8_t);
|
|||
#[derive(Copy, Clone, Debug)]
|
||||
#[cfg_attr(
|
||||
not(target_arch = "arm"),
|
||||
stable(feature = "stdarch_neon_fp16", since = "CURRENT_RUSTC_VERSION")
|
||||
stable(feature = "stdarch_neon_fp16", since = "1.94.0")
|
||||
)]
|
||||
#[cfg_attr(
|
||||
target_arch = "arm",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -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))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
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))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
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))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
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))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
pub unsafe fn _mm256_cvtneoph_ps(a: *const __m256h) -> __m256 {
|
||||
transmute(cvtneoph2ps_256(a))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ types! {
|
|||
}
|
||||
|
||||
types! {
|
||||
#![stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#![stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
|
||||
/// 128-bit wide set of 8 `f16` types, x86-specific
|
||||
///
|
||||
|
|
@ -768,7 +768,7 @@ mod avxneconvert;
|
|||
pub use self::avxneconvert::*;
|
||||
|
||||
mod avx512fp16;
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
pub use self::avx512fp16::*;
|
||||
|
||||
mod kl;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use stdarch_test::assert_instr;
|
|||
#[inline]
|
||||
#[target_feature(enable = "avx512fp16")]
|
||||
#[cfg_attr(test, assert_instr(vcvtsi2sh))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
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)]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
pub fn _mm_cvt_roundi64_sh<const ROUNDING: i32>(a: __m128h, b: i64) -> __m128h {
|
||||
unsafe {
|
||||
static_assert_rounding!(ROUNDING);
|
||||
|
|
@ -48,7 +48,7 @@ pub fn _mm_cvt_roundi64_sh<const ROUNDING: i32>(a: __m128h, b: i64) -> __m128h {
|
|||
#[inline]
|
||||
#[target_feature(enable = "avx512fp16")]
|
||||
#[cfg_attr(test, assert_instr(vcvtusi2sh))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
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)]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
pub fn _mm_cvt_roundu64_sh<const ROUNDING: i32>(a: __m128h, b: u64) -> __m128h {
|
||||
unsafe {
|
||||
static_assert_rounding!(ROUNDING);
|
||||
|
|
@ -85,7 +85,7 @@ pub fn _mm_cvt_roundu64_sh<const ROUNDING: i32>(a: __m128h, b: u64) -> __m128h {
|
|||
#[inline]
|
||||
#[target_feature(enable = "avx512fp16")]
|
||||
#[cfg_attr(test, assert_instr(vcvtsh2si))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
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)]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
pub fn _mm_cvt_roundsh_i64<const ROUNDING: i32>(a: __m128h) -> i64 {
|
||||
unsafe {
|
||||
static_assert_rounding!(ROUNDING);
|
||||
|
|
@ -121,7 +121,7 @@ pub fn _mm_cvt_roundsh_i64<const ROUNDING: i32>(a: __m128h) -> i64 {
|
|||
#[inline]
|
||||
#[target_feature(enable = "avx512fp16")]
|
||||
#[cfg_attr(test, assert_instr(vcvtsh2usi))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
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)]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
pub fn _mm_cvt_roundsh_u64<const ROUNDING: i32>(a: __m128h) -> u64 {
|
||||
unsafe {
|
||||
static_assert_rounding!(ROUNDING);
|
||||
|
|
@ -157,7 +157,7 @@ pub fn _mm_cvt_roundsh_u64<const ROUNDING: i32>(a: __m128h) -> u64 {
|
|||
#[inline]
|
||||
#[target_feature(enable = "avx512fp16")]
|
||||
#[cfg_attr(test, assert_instr(vcvttsh2si))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
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)]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
pub fn _mm_cvtt_roundsh_i64<const SAE: i32>(a: __m128h) -> i64 {
|
||||
unsafe {
|
||||
static_assert_sae!(SAE);
|
||||
|
|
@ -187,7 +187,7 @@ pub fn _mm_cvtt_roundsh_i64<const SAE: i32>(a: __m128h) -> i64 {
|
|||
#[inline]
|
||||
#[target_feature(enable = "avx512fp16")]
|
||||
#[cfg_attr(test, assert_instr(vcvttsh2usi))]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
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)]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
pub fn _mm_cvtt_roundsh_u64<const SAE: i32>(a: __m128h) -> u64 {
|
||||
unsafe {
|
||||
static_assert_sae!(SAE);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ mod bt;
|
|||
pub use self::bt::*;
|
||||
|
||||
mod avx512fp16;
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[stable(feature = "stdarch_x86_avx512fp16", since = "1.94.0")]
|
||||
pub use self::avx512fp16::*;
|
||||
|
||||
mod amx;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ 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")]
|
||||
# #[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
neon-stable-fp16: &neon-stable-fp16
|
||||
FnCall: [stable, ['feature = "stdarch_neon_fp16"', 'since = "CURRENT_RUSTC_VERSION"']]
|
||||
FnCall: [stable, ['feature = "stdarch_neon_fp16"', 'since = "1.94.0"']]
|
||||
|
||||
# #[cfg(not(target_arch = "arm64ec"))]
|
||||
target-not-arm64ec: &target-not-arm64ec
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ 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")]
|
||||
# #[stable(feature = "stdarch_neon_fp16", since = "1.94.0")]
|
||||
neon-stable-fp16: &neon-stable-fp16
|
||||
FnCall: [stable, ['feature = "stdarch_neon_fp16"', 'since = "CURRENT_RUSTC_VERSION"']]
|
||||
FnCall: [stable, ['feature = "stdarch_neon_fp16"', 'since = "1.94.0"']]
|
||||
|
||||
# #[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800"))]
|
||||
neon-cfg-arm-unstable: &neon-cfg-arm-unstable
|
||||
|
|
@ -55,9 +55,9 @@ 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"))]
|
||||
# #[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_neon_fp16", since = "1.94.0"))]
|
||||
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"']]}]]
|
||||
FnCall: [cfg_attr, [{ FnCall: [not, ['target_arch = "arm"']]}, {FnCall: [stable, ['feature = "stdarch_neon_fp16"', 'since = "1.94.0"']]}]]
|
||||
|
||||
# #[cfg_attr(all(test, not(target_env = "msvc"))]
|
||||
msvc-disabled: &msvc-disabled
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ pub unsafe fn _Unwind_RaiseException(exception: *mut _Unwind_Exception) -> _Unwi
|
|||
// corresponds with llvm::WebAssembly::Tag::CPP_EXCEPTION
|
||||
// in llvm-project/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
|
||||
const CPP_EXCEPTION_TAG: i32 = 0;
|
||||
wasm_throw(CPP_EXCEPTION_TAG, exception.cast())
|
||||
unsafe { wasm_throw(CPP_EXCEPTION_TAG, exception.cast()) }
|
||||
}
|
||||
_ => {
|
||||
let _ = exception;
|
||||
|
|
|
|||
|
|
@ -231,25 +231,9 @@ For targets: `armv7-unknown-linux-gnueabihf`
|
|||
libraries like jemalloc. See the mk/cfg/arm(v7)-unknown-linux-gnueabi{,hf}.mk
|
||||
file in Rust's source code.
|
||||
|
||||
### `aarch64-linux-gnu.defconfig`
|
||||
|
||||
For targets: `aarch64-unknown-linux-gnu`
|
||||
|
||||
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
|
||||
- Path and misc options > Use a mirror = ENABLE
|
||||
- Path and misc options > Base URL = https://ci-mirrors.rust-lang.org/rustc
|
||||
- Target options > Target Architecture = arm
|
||||
- Target options > Bitness = 64-bit
|
||||
- Operating System > Target OS = linux
|
||||
- Operating System > Linux kernel version = 4.1.49
|
||||
- Binary utilities > Version of binutils = 2.29.1
|
||||
- C-library > glibc version = 2.17 -- aarch64 support was introduced in this version
|
||||
- C compiler > gcc version = 13.2.0
|
||||
- C compiler > C++ = ENABLE -- to cross compile LLVM
|
||||
|
||||
### `i586-linux-gnu.defconfig`
|
||||
|
||||
For targets: `i586-unknown-linux-gnu`
|
||||
For targets: `i586-unknown-linux-gnu`, `i586-unknown-linux-musl` and `i686-unknown-linux-musl`
|
||||
|
||||
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
|
||||
- Target options > Target Architecture = x86
|
||||
|
|
@ -266,7 +250,7 @@ For targets: `i586-unknown-linux-gnu`
|
|||
(\*) Compressed debug is enabled by default for gas (assembly) on Linux/x86 targets,
|
||||
but that makes our `compiler_builtins` incompatible with binutils < 2.32.
|
||||
|
||||
### `loongarch64-linux-gnu.defconfig`
|
||||
### `loongarch64-unknown-linux-gnu.defconfig`
|
||||
|
||||
For targets: `loongarch64-unknown-linux-gnu`
|
||||
|
||||
|
|
@ -282,7 +266,7 @@ For targets: `loongarch64-unknown-linux-gnu`
|
|||
- C compiler > gcc version = 14.2.0
|
||||
- C compiler > C++ = ENABLE -- to cross compile LLVM
|
||||
|
||||
### `loongarch64-linux-musl.defconfig`
|
||||
### `loongarch64-unknown-linux-musl.defconfig`
|
||||
|
||||
For targets: `loongarch64-unknown-linux-musl`
|
||||
|
||||
|
|
@ -412,6 +396,56 @@ For targets: `powerpc64-unknown-linux-gnu`
|
|||
|
||||
(+) These CPU options match the configuration of the toolchains in RHEL6.
|
||||
|
||||
### `powerpc64-unknown-linux-musl.defconfig`
|
||||
|
||||
For targets: `powerpc64-unknown-linux-musl`
|
||||
|
||||
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
|
||||
- Path and misc options > Use a mirror = ENABLE
|
||||
- Path and misc options > Base URL = https://ci-mirrors.rust-lang.org/rustc
|
||||
- Target options > Target Architecture = powerpc
|
||||
- Target options > Bitness = 64-bit
|
||||
- Operating System > Target OS = linux
|
||||
- Operating System > Linux kernel version = 4.19
|
||||
- Binary utilities > Version of binutils = 2.42
|
||||
- C-library > musl version = 1.2.5
|
||||
- C compiler > gcc version = 14.2.0
|
||||
- C compiler > C++ = ENABLE -- to cross compile LLVM
|
||||
|
||||
### `powerpc64le-unknown-linux-gnu.defconfig`
|
||||
|
||||
For targets: `powerpc64le-unknown-linux-gnu`
|
||||
|
||||
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
|
||||
- Path and misc options > Use a mirror = ENABLE
|
||||
- Path and misc options > Base URL = https://ci-mirrors.rust-lang.org/rustc
|
||||
- Target options > Target Architecture = powerpc
|
||||
- Target options > Bitness = 64-bit
|
||||
- Target options > Endianness = Little endian
|
||||
- Operating System > Target OS = linux
|
||||
- Operating System > Linux kernel version = 3.10
|
||||
- Binary utilities > Version of binutils = 2.42
|
||||
- C-library > glibc version = 2.17
|
||||
- C compiler > gcc version = 14.2.0
|
||||
- C compiler > C++ = ENABLE -- to cross compile LLVM
|
||||
|
||||
### `powerpc64le-unknown-linux-musl.defconfig`
|
||||
|
||||
For targets: `powerpc64le-unknown-linux-musl`
|
||||
|
||||
- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
|
||||
- Path and misc options > Use a mirror = ENABLE
|
||||
- Path and misc options > Base URL = https://ci-mirrors.rust-lang.org/rustc
|
||||
- Target options > Target Architecture = powerpc
|
||||
- Target options > Bitness = 64-bit
|
||||
- Target options > Endianness = Little endian
|
||||
- Operating System > Target OS = linux
|
||||
- Operating System > Linux kernel version = 4.19
|
||||
- Binary utilities > Version of binutils = 2.42
|
||||
- C-library > musl version = 1.2.5
|
||||
- C compiler > gcc version = 14.2.0
|
||||
- C compiler > C++ = ENABLE -- to cross compile LLVM
|
||||
|
||||
### `riscv64-unknown-linux-gnu.defconfig`
|
||||
|
||||
For targets: `riscv64-unknown-linux-gnu`
|
||||
|
|
@ -423,7 +457,7 @@ For targets: `riscv64-unknown-linux-gnu`
|
|||
- Target options > Bitness = 64-bit
|
||||
- Operating System > Target OS = linux
|
||||
- Operating System > Linux kernel version = 4.20.17
|
||||
- Binary utilities > Version of binutils = 2.36.1
|
||||
- Binary utilities > Version of binutils = 2.40
|
||||
- C-library > glibc version = 2.29
|
||||
- C compiler > gcc version = 8.5.0
|
||||
- C compiler > C++ = ENABLE -- to cross compile LLVM
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@ FROM ghcr.io/rust-lang/ubuntu:22.04
|
|||
COPY scripts/cross-apt-packages.sh /scripts/
|
||||
RUN sh /scripts/cross-apt-packages.sh
|
||||
|
||||
COPY scripts/crosstool-ng.sh /scripts/
|
||||
RUN sh /scripts/crosstool-ng.sh
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY scripts/musl-toolchain.sh /build/
|
||||
|
|
@ -14,14 +11,8 @@ RUN CFLAGS="-Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=non
|
|||
CXXFLAGS="-Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
|
||||
bash musl-toolchain.sh aarch64 && rm -rf build
|
||||
|
||||
COPY scripts/rustbuild-setup.sh /scripts/
|
||||
RUN sh /scripts/rustbuild-setup.sh
|
||||
WORKDIR /tmp
|
||||
|
||||
COPY scripts/crosstool-ng-build.sh /scripts/
|
||||
COPY host-x86_64/dist-arm-linux-musl/arm-linux-musl.defconfig /tmp/crosstool.defconfig
|
||||
RUN /scripts/crosstool-ng-build.sh
|
||||
|
||||
COPY scripts/sccache.sh /scripts/
|
||||
RUN sh /scripts/sccache.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
CT_CONFIG_VERSION="4"
|
||||
CT_PREFIX_DIR="/x-tools/${CT_TARGET}"
|
||||
CT_USE_MIRROR=y
|
||||
CT_MIRROR_BASE_URL="https://ci-mirrors.rust-lang.org/rustc"
|
||||
CT_ARCH_ARM=y
|
||||
CT_ARCH_ARCH="armv6"
|
||||
CT_ARCH_FLOAT_SW=y
|
||||
CT_KERNEL_LINUX=y
|
||||
CT_LINUX_V_3_2=y
|
||||
CT_BINUTILS_V_2_32=y
|
||||
CT_GLIBC_V_2_17=y
|
||||
CT_GCC_V_8=y
|
||||
CT_CC_LANG_CXX=y
|
||||
CT_MUSL_V_1_2_5=y
|
||||
|
|
@ -12,5 +12,7 @@ CT_TARGET_LDFLAGS="-mcmodel=medium"
|
|||
CT_KERNEL_LINUX=y
|
||||
CT_LINUX_V_5_19=y
|
||||
CT_GLIBC_V_2_36=y
|
||||
CT_BINUTILS_V_2_42=y
|
||||
CT_GCC_V_14=y
|
||||
CT_CC_GCC_ENABLE_DEFAULT_PIE=y
|
||||
CT_CC_LANG_CXX=y
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ CT_TARGET_LDFLAGS="-mcmodel=medium"
|
|||
CT_KERNEL_LINUX=y
|
||||
CT_LINUX_V_5_19=y
|
||||
CT_LIBC_MUSL=y
|
||||
CT_MUSL_V_1_2_5=y
|
||||
CT_BINUTILS_V_2_42=y
|
||||
CT_GCC_V_14=y
|
||||
CT_CC_GCC_ENABLE_DEFAULT_PIE=y
|
||||
CT_CC_LANG_CXX=y
|
||||
CT_GETTEXT_NEEDED=y
|
||||
|
|
|
|||
|
|
@ -11,5 +11,7 @@ CT_KERNEL_LINUX=y
|
|||
CT_LINUX_V_4_19=y
|
||||
CT_LIBC_MUSL=y
|
||||
CT_MUSL_V_1_2_5=y
|
||||
CT_BINUTILS_V_2_42=y
|
||||
CT_GCC_V_14=y
|
||||
CT_CC_LANG_CXX=y
|
||||
CT_GETTEXT_NEEDED=y
|
||||
|
|
|
|||
|
|
@ -11,5 +11,7 @@ CT_ARCH_ARCH="powerpc64le"
|
|||
CT_KERNEL_LINUX=y
|
||||
CT_LINUX_V_3_10=y
|
||||
CT_GLIBC_V_2_17=y
|
||||
CT_BINUTILS_V_2_42=y
|
||||
CT_GCC_V_14=y
|
||||
CT_CC_LANG_CXX=y
|
||||
CT_GETTEXT_NEEDED=y
|
||||
|
|
|
|||
|
|
@ -12,5 +12,7 @@ CT_KERNEL_LINUX=y
|
|||
CT_LINUX_V_4_19=y
|
||||
CT_LIBC_MUSL=y
|
||||
CT_MUSL_V_1_2_5=y
|
||||
CT_BINUTILS_V_2_42=y
|
||||
CT_GCC_V_14=y
|
||||
CT_CC_LANG_CXX=y
|
||||
CT_GETTEXT_NEEDED=y
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ declare_with_version! { RENAMED(RENAMED_VERSION) = [
|
|||
("clippy::into_iter_on_array", "array_into_iter"),
|
||||
#[clippy::version = ""]
|
||||
("clippy::invalid_atomic_ordering", "invalid_atomic_ordering"),
|
||||
#[clippy::version = "CURRENT_RUSTC_VERSION"]
|
||||
#[clippy::version = "1.88.0"]
|
||||
("clippy::invalid_null_ptr_usage", "invalid_null_arguments"),
|
||||
#[clippy::version = ""]
|
||||
("clippy::invalid_ref", "invalid_value"),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ fn main() {
|
|||
&root_path.join("src/doc/rustc"),
|
||||
&root_path.join("src/doc/rustdoc"),
|
||||
],
|
||||
|path, _is_dir| walk::filter_dirs(path),
|
||||
|path, _is_dir| filter_dirs(path),
|
||||
&mut |entry, contents| {
|
||||
if !contents.contains(VERSION_PLACEHOLDER) {
|
||||
return;
|
||||
|
|
@ -27,3 +27,9 @@ fn main() {
|
|||
},
|
||||
);
|
||||
}
|
||||
|
||||
fn filter_dirs(path: &std::path::Path) -> bool {
|
||||
// tidy would skip some paths that we do want to process
|
||||
let allow = ["library/stdarch"];
|
||||
walk::filter_dirs(path) && !allow.iter().any(|p| path.ends_with(p))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -334,9 +334,9 @@ fn check_impl(
|
|||
|
||||
if js_lint {
|
||||
if bless {
|
||||
eprintln!("linting javascript files");
|
||||
} else {
|
||||
eprintln!("linting javascript files and applying suggestions");
|
||||
} else {
|
||||
eprintln!("linting javascript files");
|
||||
}
|
||||
let res = rustdoc_js::lint(outdir, librustdoc_path, tools_path, bless);
|
||||
if res.is_err() {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ LL | const N: C::M = 4u8;
|
|||
|
|
||||
= note: expected associated type `<C as O>::M`
|
||||
found type `u8`
|
||||
= note: the associated type `<C as O>::M` is defined as `u8` in the implementation, but the where-bound `C` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
help: consider constraining the associated type `<C as O>::M` to `u8`
|
||||
|
|
||||
LL | impl<C: O<M = u8>> U<C> for u16 {
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ LL | fn make() -> Self::Ty { 0u8 }
|
|||
found type `u8`
|
||||
= help: consider constraining the associated type `<A2<T> as Tr>::Ty` to `u8` or calling a method that returns `<A2<T> as Tr>::Ty`
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
|
||||
= note: the associated type `<A2<T> as Tr>::Ty` is defined as `u8` in the implementation, but the where-bound `A2<T>` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/defaults-specialization.rs:44:29
|
||||
|
|
@ -89,6 +91,8 @@ LL | fn make() -> Self::Ty { true }
|
|||
|
|
||||
= note: expected associated type `<B2<T> as Tr>::Ty`
|
||||
found type `bool`
|
||||
= note: the associated type `<B2<T> as Tr>::Ty` is defined as `bool` in the implementation, but the where-bound `B2<T>` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/defaults-specialization.rs:87:32
|
||||
|
|
@ -121,6 +125,8 @@ help: a method is available that returns `<B<()> as Tr>::Ty`
|
|||
|
|
||||
LL | fn make() -> Self::Ty {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
|
||||
= note: the associated type `<B<()> as Tr>::Ty` is defined as `bool` in the implementation, but the where-bound `B<()>` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/defaults-specialization.rs:89:33
|
||||
|
|
@ -153,6 +159,8 @@ help: a method is available that returns `<B2<()> as Tr>::Ty`
|
|||
|
|
||||
LL | fn make() -> Self::Ty {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ consider calling `Tr::make`
|
||||
= note: the associated type `<B2<()> as Tr>::Ty` is defined as `bool` in the implementation, but the where-bound `B2<()>` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error: aborting due to 9 previous errors; 1 warning emitted
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
// Regression test for issue #149910.
|
||||
// The compiler previously incorrectly claimed that the local param-env bound
|
||||
// shadowed the global impl, but they are actually the same.
|
||||
|
||||
trait Trait {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
impl<T> Trait for T {
|
||||
type Assoc = T;
|
||||
}
|
||||
|
||||
fn foo<T: Trait>(x: T::Assoc) -> u32 {
|
||||
x //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/param-env-shadowing-false-positive.rs:14:5
|
||||
|
|
||||
LL | fn foo<T: Trait>(x: T::Assoc) -> u32 {
|
||||
| --- expected `u32` because of return type
|
||||
LL | x
|
||||
| ^ expected `u32`, found associated type
|
||||
|
|
||||
= note: expected type `u32`
|
||||
found associated type `<T as Trait>::Assoc`
|
||||
help: consider constraining the associated type `<T as Trait>::Assoc` to `u32`
|
||||
|
|
||||
LL | fn foo<T: Trait<Assoc = u32>>(x: T::Assoc) -> u32 {
|
||||
| +++++++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
17
tests/ui/associated-types/param-env-shadowing-gat.rs
Normal file
17
tests/ui/associated-types/param-env-shadowing-gat.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Regression test for issue #149910.
|
||||
// This ensures that the diagnostics logic handles Generic Associated Types (GATs)
|
||||
// correctly without crashing (ICE).
|
||||
|
||||
trait Trait {
|
||||
type Assoc<T>;
|
||||
}
|
||||
|
||||
impl<T> Trait for T {
|
||||
type Assoc<U> = U;
|
||||
}
|
||||
|
||||
fn foo<T: Trait>(x: T::Assoc<T>) -> u32 {
|
||||
x //~ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
18
tests/ui/associated-types/param-env-shadowing-gat.stderr
Normal file
18
tests/ui/associated-types/param-env-shadowing-gat.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/param-env-shadowing-gat.rs:14:5
|
||||
|
|
||||
LL | fn foo<T: Trait>(x: T::Assoc<T>) -> u32 {
|
||||
| --- expected `u32` because of return type
|
||||
LL | x
|
||||
| ^ expected `u32`, found associated type
|
||||
|
|
||||
= note: expected type `u32`
|
||||
found associated type `<T as Trait>::Assoc<T>`
|
||||
help: consider constraining the associated type `<T as Trait>::Assoc<T>` to `u32`
|
||||
|
|
||||
LL | fn foo<T: Trait<Assoc<T> = u32>>(x: T::Assoc<T>) -> u32 {
|
||||
| ++++++++++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
// Regression test for issue #149910.
|
||||
// We want to tell the user about param_env shadowing here.
|
||||
|
||||
trait Trait {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
impl<T> Trait for T {
|
||||
type Assoc = T;
|
||||
}
|
||||
|
||||
fn foo<T: Trait>(x: T) -> T::Assoc {
|
||||
x
|
||||
//~^ ERROR mismatched types
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/param-env-shadowing-issue-149910.rs:13:5
|
||||
|
|
||||
LL | fn foo<T: Trait>(x: T) -> T::Assoc {
|
||||
| - -------- expected `<T as Trait>::Assoc` because of return type
|
||||
| |
|
||||
| found this type parameter
|
||||
LL | x
|
||||
| ^ expected associated type, found type parameter `T`
|
||||
|
|
||||
= note: expected associated type `<T as Trait>::Assoc`
|
||||
found type parameter `T`
|
||||
= note: the associated type `<T as Trait>::Assoc` is defined as `T` in the implementation, but the where-bound `T` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | fn foo<T: Trait<Assoc = T>>(x: T) -> T::Assoc {
|
||||
| +++++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
16
tests/ui/const-generics/mgca/struct-ctor-in-array-len.rs
Normal file
16
tests/ui/const-generics/mgca/struct-ctor-in-array-len.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Regression test for https://github.com/rust-lang/rust/issues/141738
|
||||
//
|
||||
// Using a struct constructor as an array repeat count with
|
||||
// `min_generic_const_args` used to ICE with "unexpected `DefKind`
|
||||
// for const alias to resolve to: Ctor(Struct, Const)".
|
||||
// It should now produce a proper type error.
|
||||
|
||||
#![feature(min_generic_const_args)]
|
||||
//~^ WARN the feature `min_generic_const_args` is incomplete
|
||||
|
||||
struct S;
|
||||
|
||||
fn main() {
|
||||
let _b = [0; S];
|
||||
//~^ ERROR the constant `S` is not of type `usize`
|
||||
}
|
||||
19
tests/ui/const-generics/mgca/struct-ctor-in-array-len.stderr
Normal file
19
tests/ui/const-generics/mgca/struct-ctor-in-array-len.stderr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/struct-ctor-in-array-len.rs:8:12
|
||||
|
|
||||
LL | #![feature(min_generic_const_args)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: the constant `S` is not of type `usize`
|
||||
--> $DIR/struct-ctor-in-array-len.rs:14:14
|
||||
|
|
||||
LL | let _b = [0; S];
|
||||
| ^^^^^^ expected `usize`, found `S`
|
||||
|
|
||||
= note: the length of array `[{integer}; S]` must be type `usize`
|
||||
|
||||
error: aborting due to 1 previous error; 1 warning emitted
|
||||
|
||||
7
tests/ui/macros/write-missing-destination.rs
Normal file
7
tests/ui/macros/write-missing-destination.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// Check that `write!` without a destination gives a helpful error message.
|
||||
// See https://github.com/rust-lang/rust/issues/152493
|
||||
|
||||
fn main() {
|
||||
write!("S");
|
||||
//~^ ERROR requires a destination and format arguments
|
||||
}
|
||||
8
tests/ui/macros/write-missing-destination.stderr
Normal file
8
tests/ui/macros/write-missing-destination.stderr
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
error: requires a destination and format arguments, like `write!(dest, "format string", args...)`
|
||||
--> $DIR/write-missing-destination.rs:5:5
|
||||
|
|
||||
LL | write!("S");
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
@ -21,6 +21,8 @@ LL | ()
|
|||
found unit type `()`
|
||||
= help: consider constraining the associated type `<T as Foo>::Assoc` to `()` or calling a method that returns `<T as Foo>::Assoc`
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
|
||||
= note: the associated type `<T as Foo>::Assoc` is defined as `()` in the implementation, but the where-bound `T` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/specialization-default-projection.rs:32:5
|
||||
|
|
@ -37,6 +39,8 @@ LL | generic::<()>()
|
|||
found associated type `<() as Foo>::Assoc`
|
||||
= help: consider constraining the associated type `<() as Foo>::Assoc` to `()`
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
|
||||
= note: the associated type `<() as Foo>::Assoc` is defined as `()` in the implementation, but the where-bound `()` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ LL | ()
|
|||
found unit type `()`
|
||||
= help: consider constraining the associated type `<T as Foo>::Assoc` to `()` or calling a method that returns `<T as Foo>::Assoc`
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
|
||||
= note: the associated type `<T as Foo>::Assoc` is defined as `()` in the implementation, but the where-bound `T` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/specialization-default-projection.rs:32:5
|
||||
|
|
@ -37,6 +39,8 @@ LL | generic::<()>()
|
|||
found associated type `<() as Foo>::Assoc`
|
||||
= help: consider constraining the associated type `<() as Foo>::Assoc` to `()`
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
|
||||
= note: the associated type `<() as Foo>::Assoc` is defined as `()` in the implementation, but the where-bound `()` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ LL | Box::new(self)
|
|||
|
|
||||
= note: expected associated type `<T as Example>::Output`
|
||||
found struct `Box<T>`
|
||||
= note: the associated type `<T as Example>::Output` is defined as `Box<T>` in the implementation, but the where-bound `T` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/specialization-default-types.rs:29:5
|
||||
|
|
@ -33,6 +35,8 @@ LL | Example::generate(t)
|
|||
found associated type `<T as Example>::Output`
|
||||
= help: consider constraining the associated type `<T as Example>::Output` to `Box<T>`
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
|
||||
= note: the associated type `<T as Example>::Output` is defined as `Box<T>` in the implementation, but the where-bound `T` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ LL | Box::new(self)
|
|||
|
|
||||
= note: expected associated type `<T as Example>::Output`
|
||||
found struct `Box<T>`
|
||||
= note: the associated type `<T as Example>::Output` is defined as `Box<T>` in the implementation, but the where-bound `T` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/specialization-default-types.rs:29:5
|
||||
|
|
@ -33,6 +35,8 @@ LL | Example::generate(t)
|
|||
found associated type `<T as Example>::Output`
|
||||
= help: consider constraining the associated type `<T as Example>::Output` to `Box<T>`
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
|
||||
= note: the associated type `<T as Example>::Output` is defined as `Box<T>` in the implementation, but the where-bound `T` shadows this definition
|
||||
see issue #152409 <https://github.com/rust-lang/rust/issues/152409> for more information
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue