Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #103069

Merged
merged 22 commits into from
Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
43bcc71
refactor: use grep -E/-F instead of fgrep/egrep
kxxt Sep 21, 2022
6135aff
simplify
kxxt Sep 26, 2022
4cf30c0
Improved documentation for `std::io::Error`
StackOverflowExcept1on Oct 7, 2022
dbb4271
checktools: fix comments
RalfJung Oct 14, 2022
b8bb406
remove leading newlines from integer primitive doc examples
Oct 14, 2022
0313fbe
Update browser-ui-test version to fix some flaky tests
GuillaumeGomez Oct 14, 2022
f95e853
Tweak grammar
joshtriplett Oct 14, 2022
9787321
Clean up rust-logo rustdoc GUI test
GuillaumeGomez Oct 14, 2022
c9948f5
Fix `Duration::{try_,}from_secs_f{32,64}(-0.0)`
beetrees Oct 14, 2022
c46185b
Bugfix: keep TLS data in sync
raoulstrackx Oct 13, 2022
3c00626
Add some tidy-alphabetical
Noratrieb Oct 14, 2022
1b8012f
Also run alphabetical check in src and library
Noratrieb Oct 14, 2022
b00cb04
Sort target features alphabetically
Noratrieb Oct 14, 2022
f72d76d
Rollup merge of #102092 - kxxt:patch-1, r=joshtriplett
matthiaskrgr Oct 14, 2022
fbb0c31
Rollup merge of #102781 - StackOverflowExcept1on:master, r=joshtriplett
matthiaskrgr Oct 14, 2022
d47b755
Rollup merge of #103017 - fortanix:raoul/sgx_tls_fix, r=ChrisDenton
matthiaskrgr Oct 14, 2022
9f22530
Rollup merge of #103039 - RalfJung:checktools, r=Dylan-DPC
matthiaskrgr Oct 14, 2022
1a5d8a5
Rollup merge of #103045 - lukas-code:blank-lines, r=GuillaumeGomez
matthiaskrgr Oct 14, 2022
fa1279f
Rollup merge of #103047 - GuillaumeGomez:update-browser-ui-test, r=no…
matthiaskrgr Oct 14, 2022
62a9c32
Rollup merge of #103054 - GuillaumeGomez:cleanup-rust-logo-test, r=no…
matthiaskrgr Oct 14, 2022
03a521b
Rollup merge of #103059 - beetrees:duration-from-negative-zero, r=thomcc
matthiaskrgr Oct 14, 2022
a96f1a8
Rollup merge of #103067 - Nilstrieb:tidy-likes-the-alphabet, r=jackh726
matthiaskrgr Oct 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 112 additions & 96 deletions compiler/rustc_codegen_ssa/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,25 @@ pub const RUSTC_SPECIFIC_FEATURES: &[&str] = &["crt-static"];
// if it doesn't, to_llvm_feature in llvm_util in rustc_codegen_llvm needs to be adapted

const ARM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
// tidy-alphabetical-start
("aclass", Some(sym::arm_target_feature)),
("mclass", Some(sym::arm_target_feature)),
("rclass", Some(sym::arm_target_feature)),
("dsp", Some(sym::arm_target_feature)),
("neon", Some(sym::arm_target_feature)),
("aes", Some(sym::arm_target_feature)),
("crc", Some(sym::arm_target_feature)),
("crypto", Some(sym::arm_target_feature)),
("aes", Some(sym::arm_target_feature)),
("sha2", Some(sym::arm_target_feature)),
("i8mm", Some(sym::arm_target_feature)),
("d32", Some(sym::arm_target_feature)),
("dotprod", Some(sym::arm_target_feature)),
("dsp", Some(sym::arm_target_feature)),
("fp-armv8", Some(sym::arm_target_feature)),
("i8mm", Some(sym::arm_target_feature)),
("mclass", Some(sym::arm_target_feature)),
("neon", Some(sym::arm_target_feature)),
("rclass", Some(sym::arm_target_feature)),
("sha2", Some(sym::arm_target_feature)),
// This is needed for inline assembly, but shouldn't be stabilized as-is
// since it should be enabled per-function using #[instruction_set], not
// #[target_feature].
("thumb-mode", Some(sym::arm_target_feature)),
("thumb2", Some(sym::arm_target_feature)),
("v5te", Some(sym::arm_target_feature)),
("v6", Some(sym::arm_target_feature)),
("v6k", Some(sym::arm_target_feature)),
Expand All @@ -33,118 +41,115 @@ const ARM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
("vfp2", Some(sym::arm_target_feature)),
("vfp3", Some(sym::arm_target_feature)),
("vfp4", Some(sym::arm_target_feature)),
("fp-armv8", Some(sym::arm_target_feature)),
// This is needed for inline assembly, but shouldn't be stabilized as-is
// since it should be enabled per-function using #[instruction_set], not
// #[target_feature].
("thumb-mode", Some(sym::arm_target_feature)),
("thumb2", Some(sym::arm_target_feature)),
("d32", Some(sym::arm_target_feature)),
// tidy-alphabetical-end
];

const AARCH64_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
// FEAT_AdvSimd & FEAT_FP
("neon", None),
// FEAT_FP16
("fp16", None),
// FEAT_SVE
("sve", None),
// tidy-alphabetical-start
// FEAT_AES
("aes", None),
// FEAT_BF16
("bf16", None),
// FEAT_BTI
("bti", None),
// FEAT_CRC
("crc", None),
// FEAT_RAS
("ras", None),
// FEAT_LSE
("lse", None),
// FEAT_RDM
("rdm", None),
// FEAT_RCPC
("rcpc", None),
// FEAT_RCPC2
("rcpc2", None),
// FEAT_DotProd
("dotprod", None),
// FEAT_TME
("tme", None),
// FEAT_FHM
("fhm", None),
// FEAT_DIT
("dit", None),
// FEAT_FLAGM
("flagm", None),
// FEAT_SSBS
("ssbs", None),
// FEAT_SB
("sb", None),
// FEAT_PAUTH (address authentication)
("paca", None),
// FEAT_PAUTH (generic authentication)
("pacg", None),
// FEAT_DotProd
("dotprod", None),
// FEAT_DPB
("dpb", None),
// FEAT_DPB2
("dpb2", None),
// FEAT_SVE2
("sve2", None),
// FEAT_SVE2_AES
("sve2-aes", None),
// FEAT_SVE2_SM4
("sve2-sm4", None),
// FEAT_SVE2_SHA3
("sve2-sha3", None),
// FEAT_SVE2_BitPerm
("sve2-bitperm", None),
// FEAT_FRINTTS
("frintts", None),
// FEAT_I8MM
("i8mm", None),
// FEAT_F32MM
("f32mm", None),
// FEAT_F64MM
("f64mm", None),
// FEAT_BF16
("bf16", None),
// FEAT_RAND
("rand", None),
// FEAT_BTI
("bti", None),
// FEAT_MTE
("mte", None),
// FEAT_JSCVT
("jsconv", None),
// FEAT_FCMA
("fcma", None),
// FEAT_AES
("aes", None),
// FEAT_FHM
("fhm", None),
// FEAT_FLAGM
("flagm", None),
// FEAT_FP16
("fp16", None),
// FEAT_FRINTTS
("frintts", None),
// FEAT_I8MM
("i8mm", None),
// FEAT_JSCVT
("jsconv", None),
// FEAT_LOR
("lor", None),
// FEAT_LSE
("lse", None),
// FEAT_MTE
("mte", None),
// FEAT_AdvSimd & FEAT_FP
("neon", None),
// FEAT_PAUTH (address authentication)
("paca", None),
// FEAT_PAUTH (generic authentication)
("pacg", None),
// FEAT_PAN
("pan", None),
// FEAT_PMUv3
("pmuv3", None),
// FEAT_RAND
("rand", None),
// FEAT_RAS
("ras", None),
// FEAT_RCPC
("rcpc", None),
// FEAT_RCPC2
("rcpc2", None),
// FEAT_RDM
("rdm", None),
// FEAT_SB
("sb", None),
// FEAT_SHA1 & FEAT_SHA256
("sha2", None),
// FEAT_SHA512 & FEAT_SHA3
("sha3", None),
// FEAT_SM3 & FEAT_SM4
("sm4", None),
// FEAT_PAN
("pan", None),
// FEAT_LOR
("lor", None),
// FEAT_VHE
("vh", None),
// FEAT_PMUv3
("pmuv3", None),
// FEAT_SPE
("spe", None),
// FEAT_SSBS
("ssbs", None),
// FEAT_SVE
("sve", None),
// FEAT_SVE2
("sve2", None),
// FEAT_SVE2_AES
("sve2-aes", None),
// FEAT_SVE2_BitPerm
("sve2-bitperm", None),
// FEAT_SVE2_SHA3
("sve2-sha3", None),
// FEAT_SVE2_SM4
("sve2-sm4", None),
// FEAT_TME
("tme", None),
("v8.1a", Some(sym::aarch64_ver_target_feature)),
("v8.2a", Some(sym::aarch64_ver_target_feature)),
("v8.3a", Some(sym::aarch64_ver_target_feature)),
("v8.4a", Some(sym::aarch64_ver_target_feature)),
("v8.5a", Some(sym::aarch64_ver_target_feature)),
("v8.6a", Some(sym::aarch64_ver_target_feature)),
("v8.7a", Some(sym::aarch64_ver_target_feature)),
// FEAT_VHE
("vh", None),
// tidy-alphabetical-end
];

const AARCH64_TIED_FEATURES: &[&[&str]] = &[
&["paca", "pacg"], // Together these represent `pauth` in LLVM
];

const X86_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
// tidy-alphabetical-start
("adx", None),
("aes", None),
("avx", None),
Expand Down Expand Up @@ -194,69 +199,80 @@ const X86_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
("xsavec", None),
("xsaveopt", None),
("xsaves", None),
// tidy-alphabetical-end
];

const HEXAGON_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
// tidy-alphabetical-start
("hvx", Some(sym::hexagon_target_feature)),
("hvx-length128b", Some(sym::hexagon_target_feature)),
// tidy-alphabetical-end
];

const POWERPC_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
// tidy-alphabetical-start
("altivec", Some(sym::powerpc_target_feature)),
("power8-altivec", Some(sym::powerpc_target_feature)),
("power9-altivec", Some(sym::powerpc_target_feature)),
("power8-vector", Some(sym::powerpc_target_feature)),
("power9-altivec", Some(sym::powerpc_target_feature)),
("power9-vector", Some(sym::powerpc_target_feature)),
("vsx", Some(sym::powerpc_target_feature)),
// tidy-alphabetical-end
];

const MIPS_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
// tidy-alphabetical-start
("fp64", Some(sym::mips_target_feature)),
("msa", Some(sym::mips_target_feature)),
("virt", Some(sym::mips_target_feature)),
// tidy-alphabetical-end
];

const RISCV_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
("m", Some(sym::riscv_target_feature)),
// tidy-alphabetical-start
("a", Some(sym::riscv_target_feature)),
("c", Some(sym::riscv_target_feature)),
("f", Some(sym::riscv_target_feature)),
("d", Some(sym::riscv_target_feature)),
("e", Some(sym::riscv_target_feature)),
("f", Some(sym::riscv_target_feature)),
("m", Some(sym::riscv_target_feature)),
("v", Some(sym::riscv_target_feature)),
("zfinx", Some(sym::riscv_target_feature)),
("zdinx", Some(sym::riscv_target_feature)),
("zhinx", Some(sym::riscv_target_feature)),
("zhinxmin", Some(sym::riscv_target_feature)),
("zfh", Some(sym::riscv_target_feature)),
("zfhmin", Some(sym::riscv_target_feature)),
("zba", Some(sym::riscv_target_feature)),
("zbb", Some(sym::riscv_target_feature)),
("zbc", Some(sym::riscv_target_feature)),
("zbs", Some(sym::riscv_target_feature)),
("zbkb", Some(sym::riscv_target_feature)),
("zbkc", Some(sym::riscv_target_feature)),
("zbkx", Some(sym::riscv_target_feature)),
("zbs", Some(sym::riscv_target_feature)),
("zdinx", Some(sym::riscv_target_feature)),
("zfh", Some(sym::riscv_target_feature)),
("zfhmin", Some(sym::riscv_target_feature)),
("zfinx", Some(sym::riscv_target_feature)),
("zhinx", Some(sym::riscv_target_feature)),
("zhinxmin", Some(sym::riscv_target_feature)),
("zk", Some(sym::riscv_target_feature)),
("zkn", Some(sym::riscv_target_feature)),
("zknd", Some(sym::riscv_target_feature)),
("zkne", Some(sym::riscv_target_feature)),
("zknh", Some(sym::riscv_target_feature)),
("zksed", Some(sym::riscv_target_feature)),
("zksh", Some(sym::riscv_target_feature)),
("zkr", Some(sym::riscv_target_feature)),
("zkn", Some(sym::riscv_target_feature)),
("zks", Some(sym::riscv_target_feature)),
("zk", Some(sym::riscv_target_feature)),
("zksed", Some(sym::riscv_target_feature)),
("zksh", Some(sym::riscv_target_feature)),
("zkt", Some(sym::riscv_target_feature)),
// tidy-alphabetical-end
];

const WASM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
("simd128", None),
// tidy-alphabetical-start
("atomics", Some(sym::wasm_target_feature)),
("nontrapping-fptoint", Some(sym::wasm_target_feature)),
("bulk-memory", Some(sym::wasm_target_feature)),
("mutable-globals", Some(sym::wasm_target_feature)),
("nontrapping-fptoint", Some(sym::wasm_target_feature)),
("reference-types", Some(sym::wasm_target_feature)),
("sign-ext", Some(sym::wasm_target_feature)),
("simd128", None),
// tidy-alphabetical-end
];

const BPF_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[("alu32", Some(sym::bpf_target_feature))];
Expand Down
9 changes: 0 additions & 9 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ macro_rules! int_impl {
/// Basic usage:
///
/// ```
///
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".checked_rem(2), Some(1));")]
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".checked_rem(0), None);")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_rem(-1), None);")]
Expand Down Expand Up @@ -704,7 +703,6 @@ macro_rules! int_impl {
/// Basic usage:
///
/// ```
///
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".checked_neg(), Some(-5));")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_neg(), None);")]
/// ```
Expand Down Expand Up @@ -820,7 +818,6 @@ macro_rules! int_impl {
/// Basic usage:
///
/// ```
///
#[doc = concat!("assert_eq!((-5", stringify!($SelfT), ").checked_abs(), Some(5));")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.checked_abs(), None);")]
/// ```
Expand Down Expand Up @@ -1026,7 +1023,6 @@ macro_rules! int_impl {
/// Basic usage:
///
/// ```
///
#[doc = concat!("assert_eq!(10", stringify!($SelfT), ".saturating_mul(12), 120);")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.saturating_mul(10), ", stringify!($SelfT), "::MAX);")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.saturating_mul(10), ", stringify!($SelfT), "::MIN);")]
Expand Down Expand Up @@ -1085,7 +1081,6 @@ macro_rules! int_impl {
/// Basic usage:
///
/// ```
///
#[doc = concat!("assert_eq!((-4", stringify!($SelfT), ").saturating_pow(3), -64);")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.saturating_pow(2), ", stringify!($SelfT), "::MAX);")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.saturating_pow(3), ", stringify!($SelfT), "::MIN);")]
Expand Down Expand Up @@ -1498,7 +1493,6 @@ macro_rules! int_impl {
/// Basic usage:
///
/// ```
///
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_add(2), (7, false));")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (", stringify!($SelfT), "::MIN, true));")]
/// ```
Expand Down Expand Up @@ -1593,7 +1587,6 @@ macro_rules! int_impl {
/// Basic usage:
///
/// ```
///
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_sub(2), (3, false));")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.overflowing_sub(1), (", stringify!($SelfT), "::MAX, true));")]
/// ```
Expand Down Expand Up @@ -1703,7 +1696,6 @@ macro_rules! int_impl {
/// Basic usage:
///
/// ```
///
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_div(2), (2, false));")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.overflowing_div(-1), (", stringify!($SelfT), "::MIN, true));")]
/// ```
Expand Down Expand Up @@ -1766,7 +1758,6 @@ macro_rules! int_impl {
/// Basic usage:
///
/// ```
///
#[doc = concat!("assert_eq!(5", stringify!($SelfT), ".overflowing_rem(2), (1, false));")]
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.overflowing_rem(-1), (0, true));")]
/// ```
Expand Down
Loading