Auto merge of #130426 - workingjubilee:rollup-63xnjry, r=workingjubilee

Rollup of 5 pull requests

Successful merges:

 - #127879 (Document futility of printing temporary pointers)
 - #130325 (Use -0.0 in `intrinsics::simd::reduce_add_unordered`)
 - #130336 (simplify `Build::update_existing_submodule`)
 - #130398 (Add system libs for LLVM when cross compiling for Windows)
 - #130420 (Register tool docs for `src/tools/build_helper`)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-09-16 07:14:55 +00:00
commit 170d6cb845
7 changed files with 55 additions and 10 deletions

View File

@ -2066,14 +2066,14 @@ macro_rules! arith_red {
};
}
arith_red!(simd_reduce_add_ordered: vector_reduce_add, vector_reduce_fadd, true, add, 0.0);
arith_red!(simd_reduce_add_ordered: vector_reduce_add, vector_reduce_fadd, true, add, -0.0);
arith_red!(simd_reduce_mul_ordered: vector_reduce_mul, vector_reduce_fmul, true, mul, 1.0);
arith_red!(
simd_reduce_add_unordered: vector_reduce_add,
vector_reduce_fadd_reassoc,
false,
add,
0.0
-0.0
);
arith_red!(
simd_reduce_mul_unordered: vector_reduce_mul,

View File

@ -220,7 +220,10 @@ fn main() {
let mut cmd = Command::new(&llvm_config);
cmd.arg(llvm_link_arg).arg("--libs");
if !is_crossed {
// Don't link system libs if cross-compiling unless targetting Windows.
// On Windows system DLLs aren't linked directly, instead import libraries are used.
// These import libraries are independent of the host.
if !is_crossed || target.contains("windows") {
cmd.arg("--system-libs");
}

View File

@ -975,9 +975,17 @@ pub trait UpperHex {
/// `p` formatting.
///
/// The `Pointer` trait should format its output as a memory location. This is commonly presented
/// as hexadecimal.
/// as hexadecimal. For more information on formatters, see [the module-level documentation][module].
///
/// For more information on formatters, see [the module-level documentation][module].
/// Printing of pointers is not a reliable way to discover how Rust programs are implemented.
/// The act of reading an address changes the program itself, and may change how the data is represented
/// in memory, and may affect which optimizations are applied to the code.
///
/// The printed pointer values are not guaranteed to be stable nor unique identifiers of objects.
/// Rust allows moving values to different memory locations, and may reuse the same memory locations
/// for different purposes.
///
/// There is no guarantee that the printed value can be converted back to a pointer.
///
/// [module]: ../../std/fmt/index.html
///

View File

@ -1013,6 +1013,14 @@ fn run(self, builder: &Builder<'_>) {
}
}
// NOTE: make sure to register these in `Builder::get_step_description`.
tool_doc!(
BuildHelper,
"src/tools/build_helper",
rustc_tool = false,
is_library = true,
crates = ["build_helper"]
);
tool_doc!(Rustdoc, "src/tools/rustdoc", crates = ["rustdoc", "rustdoc-json-types"]);
tool_doc!(Rustfmt, "src/tools/rustfmt", crates = ["rustfmt-nightly", "rustfmt-config_proc_macro"]);
tool_doc!(Clippy, "src/tools/clippy", crates = ["clippy_config", "clippy_utils"]);

View File

@ -944,6 +944,7 @@ macro_rules! describe {
doc::Bootstrap,
doc::Releases,
doc::RunMakeSupport,
doc::BuildHelper,
),
Kind::Dist => describe!(
dist::Docs,

View File

@ -552,11 +552,7 @@ fn update_existing_submodules(&self) {
// Look for `submodule.$name.path = $path`
// Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
let submodule = line.split_once(' ').unwrap().1;
let path = Path::new(submodule);
// Don't update the submodule unless it's already been cloned.
if GitInfo::new(false, path).is_managed_git_subrepository() {
self.config.update_submodule(submodule);
}
self.update_existing_submodule(submodule);
}
}

View File

@ -0,0 +1,29 @@
//@ revisions: x86_64 aarch64
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -O
//@[aarch64] only-aarch64
//@[x86_64] only-x86_64
//@[x86_64] compile-flags: -Ctarget-feature=+sse3
#![feature(portable_simd)]
#![feature(core_intrinsics)]
use std::intrinsics::simd as intrinsics;
use std::simd::*;
// Regression test for https://github.com/rust-lang/rust/issues/130028
// This intrinsic produces much worse code if you use +0.0 instead of -0.0 because
// +0.0 isn't as easy to algebraically reassociate, even using LLVM's reassoc attribute!
// It would emit about an extra fadd, depending on the architecture.
// CHECK-LABEL: reduce_fadd_negative_zero
pub unsafe fn reduce_fadd_negative_zero(v: f32x4) -> f32 {
// x86_64: addps
// x86_64-NEXT: movshdup
// x86_64-NEXT: addss
// x86_64-NOT: xorps
// aarch64: faddp
// aarch64-NEXT: faddp
// CHECK-NOT: {{f?}}add{{p?s*}}
// CHECK: ret
intrinsics::simd_reduce_add_unordered(v)
}