rust/src
bors 481ba16439 Auto merge of #84339 - alexcrichton:llvm-fptoint-sat, r=nagisa
rustc: Use LLVM's new saturating float-to-int intrinsics

This commit updates rustc, with an applicable LLVM version, to use
LLVM's new `llvm.fpto{u,s}i.sat.*.*` intrinsics to implement saturating
floating-point-to-int conversions. This results in a little bit tighter
codegen for x86/x86_64, but the main purpose of this is to prepare for
upcoming changes to the WebAssembly backend in LLVM where wasm's
saturating float-to-int instructions will now be implemented with these
intrinsics.

This change allows simplifying a good deal of surrounding code, namely
removing a lot of wasm-specific behavior. WebAssembly no longer has any
special-casing of saturating arithmetic instructions and the need for
`fptoint_may_trap` is gone and all handling code for that is now
removed. This means that the only wasm-specific logic is in the
`fpto{s,u}i` instructions which only get used for "out of bounds is
undefined behavior". This does mean that for the WebAssembly target
specifically the Rust compiler will no longer be 100% compatible with
pre-LLVM 12 versions, but it seems like that's unlikely to be relied on
by too many folks.

Note that this change does immediately regress the codegen of saturating
float-to-int casts on WebAssembly due to the specialization of the LLVM
intrinsic not being present in our LLVM fork just yet. I'll be following
up with an LLVM update to pull in those patches, but affects a few other
SIMD things in flight for WebAssembly so I wanted to separate this change.

Eventually the entire `cast_float_to_int` function can be removed when
LLVM 12 is the minimum version, but that will require sinking the
complexity of it into other backends such as Cranelfit.
2021-04-23 18:35:49 +00:00
..
bootstrap Auto merge of #84289 - andersk:bootstrap-bulk-dir, r=Mark-Simulacrum 2021-04-22 07:47:06 +00:00
build_helper
ci Upgrade `expat` dependency in riscv64 to newer version. 2021-04-21 15:54:57 +02:00
doc Fix broken doc link 2021-04-20 17:10:20 -04:00
etc
librustdoc Auto merge of #84457 - jyn514:cleanup-crate, r=GuillaumeGomez 2021-04-23 15:45:52 +00:00
llvm-project@0ed6038a31 Update LLVM submodule 2021-04-21 15:22:46 +01:00
rustdoc-json-types
test Auto merge of #84339 - alexcrichton:llvm-fptoint-sat, r=nagisa 2021-04-23 18:35:49 +00:00
tools Use arrayvec 0.7, drop smallvec 0.6 2021-04-21 22:39:08 -07:00
README.md
stage0.txt
version

README.md

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.