Skip to content

Commit cd1785b

Browse files
committed
PR feedback
1 parent 00d6c50 commit cd1785b

19 files changed

+14
-85
lines changed

Cargo.toml

-8
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
resolver = "1"
33
members = [
44
"crates/*",
5-
"examples"
6-
"crates/stdarch-verify",
7-
"crates/core_arch",
8-
"crates/std_detect",
9-
"crates/stdarch-gen-loongarch",
10-
"crates/stdarch-gen2",
11-
"crates/intrinsic-test",
12-
"examples/"
135
]
146
exclude = [
157
"crates/wasm-assert-instr-tests"

crates/core_arch/src/arm_shared/neon/mod.rs

+7-66
Original file line numberDiff line numberDiff line change
@@ -11,89 +11,33 @@ use crate::{core_arch::simd::*, hint::unreachable_unchecked, intrinsics::simd::*
1111
#[cfg(test)]
1212
use stdarch_test::assert_instr;
1313

14-
#[unstable(feature = "stdarch_internal", issue = "none")]
1514
pub(crate) trait AsUnsigned {
1615
type Unsigned: ?Sized;
17-
unsafe fn as_unsigned(self) -> Self::Unsigned;
16+
fn as_unsigned(self) -> Self::Unsigned;
1817
}
1918

20-
#[unstable(feature = "stdarch_internal", issue = "none")]
2119
pub(crate) trait AsSigned {
2220
type Signed: ?Sized;
23-
unsafe fn as_signed(self) -> Self::Signed;
24-
}
25-
26-
macro_rules! impl_sign_conversions {
27-
($(($signed:ty, $unsigned:ty))*) => ($(
28-
#[cfg_attr(
29-
not(target_arch = "arm"),
30-
stable(feature = "neon_intrinsics", since = "1.59.0")
31-
)]
32-
#[cfg_attr(
33-
target_arch = "arm",
34-
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
35-
)]
36-
impl AsUnsigned for $signed {
37-
type Unsigned = $unsigned;
38-
39-
#[inline]
40-
unsafe fn as_unsigned(self) -> $unsigned {
41-
crate::mem::transmute(self)
42-
}
43-
}
44-
45-
#[cfg_attr(
46-
not(target_arch = "arm"),
47-
stable(feature = "neon_intrinsics", since = "1.59.0")
48-
)]
49-
#[cfg_attr(
50-
target_arch = "arm",
51-
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
52-
)]
53-
impl AsSigned for $unsigned {
54-
type Signed = $signed;
55-
56-
#[inline]
57-
unsafe fn as_signed(self) -> $signed {
58-
crate::mem::transmute(self)
59-
}
60-
}
61-
)*)
21+
fn as_signed(self) -> Self::Signed;
6222
}
6323

6424
macro_rules! impl_sign_conversions_neon {
6525
($(($signed:ty, $unsigned:ty))*) => ($(
66-
#[cfg_attr(
67-
not(target_arch = "arm"),
68-
stable(feature = "neon_intrinsics", since = "1.59.0")
69-
)]
70-
#[cfg_attr(
71-
target_arch = "arm",
72-
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
73-
)]
7426
impl AsUnsigned for $signed {
7527
type Unsigned = $unsigned;
7628

7729
#[inline]
78-
unsafe fn as_unsigned(self) -> $unsigned {
79-
crate::mem::transmute(self)
30+
fn as_unsigned(self) -> $unsigned {
31+
unsafe { transmute(self) }
8032
}
8133
}
8234

83-
#[cfg_attr(
84-
not(target_arch = "arm"),
85-
stable(feature = "neon_intrinsics", since = "1.59.0")
86-
)]
87-
#[cfg_attr(
88-
target_arch = "arm",
89-
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
90-
)]
9135
impl AsSigned for $unsigned {
9236
type Signed = $signed;
9337

9438
#[inline]
95-
unsafe fn as_signed(self) -> $signed {
96-
crate::mem::transmute(self)
39+
fn as_signed(self) -> $signed {
40+
unsafe { transmute(self) }
9741
}
9842
}
9943
)*)
@@ -1121,7 +1065,7 @@ pub struct poly64x2x4_t(
11211065
pub poly64x2_t,
11221066
);
11231067

1124-
impl_sign_conversions! {
1068+
impl_sign_conversions_neon! {
11251069
(i8, u8)
11261070
(i16, u16)
11271071
(i32, u32)
@@ -1150,9 +1094,6 @@ impl_sign_conversions! {
11501094
(uint64x2_t, int64x2_t)
11511095
(uint8x16_t, int8x16_t)
11521096
(uint8x8_t, int8x8_t)
1153-
}
1154-
1155-
impl_sign_conversions_neon! {
11561097
(int16x4x2_t, uint16x4x2_t)
11571098
(int16x4x3_t, uint16x4x3_t)
11581099
(int16x4x4_t, uint16x4x4_t)
File renamed without changes.
File renamed without changes.

crates/stdarch-verify/src/lib.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -116,29 +116,25 @@ fn functions(input: TokenStream, dirs: &[&str]) -> TokenStream {
116116
quote! { None }
117117
};
118118

119-
let required_const = find_required_const("rustc_args_required_const", &f.attrs);
120119
let mut const_generics_indices =
121120
find_required_const("rustc_legacy_const_generics", &f.attrs);
122-
if !required_const.is_empty() && !const_generics_indices.is_empty() {
121+
if !const_generics_indices.is_empty() {
123122
panic!(
124123
"Can't have both #[rustc_args_required_const] and \
125124
#[rustc_legacy_const_generics]"
126125
);
127126
}
128127

129-
// Newer intrinsics don't have legacy support - assume they belong at the end of the argument list
130-
if required_const.is_empty() && const_generics_indices.is_empty() {
128+
// Newer intrinsics don't have legacy support:
129+
// Thus assume they belong at the end of the argument list
130+
if const_generics_indices.is_empty() {
131131
const_generics_indices =
132132
(arguments.len()..(arguments.len() + const_arguments.len())).collect();
133133
}
134134

135-
// The list of required consts, used to verify the arguments, comes from either the
136-
// `rustc_args_required_const` or the `rustc_legacy_const_generics` attribute.
137-
let required_const = if required_const.is_empty() {
138-
const_generics_indices.clone()
139-
} else {
140-
required_const
141-
};
135+
// The list of required consts, used to verify the arguments, comes
136+
// from the `rustc_legacy_const_generics` attribute.
137+
let required_const = const_generics_indices.clone();
142138

143139
const_generics_indices.sort();
144140
for (idx, ty) in const_generics_indices

0 commit comments

Comments
 (0)