-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
i128 and u128 support #37900
i128 and u128 support #37900
Commits on Dec 15, 2016
-
Such large. Very 128. Much bits.
This commit introduces 128-bit integers. Stage 2 builds and produces a working compiler which understands and supports 128-bit integers throughout. The general strategy used is to have rustc_i128 module which provides aliases for iu128, equal to iu64 in stage9 and iu128 later. Since nowhere in rustc we rely on large numbers being supported, this strategy is good enough to get past the first bootstrap stages to end up with a fully working 128-bit capable compiler. In order for this strategy to work, number of locations had to be changed to use associated max_value/min_value instead of MAX/MIN constants as well as the min_value (or was it max_value?) had to be changed to use xor instead of shift so both 64-bit and 128-bit based consteval works (former not necessarily producing the right results in stage1). This commit includes manual merge conflict resolution changes from a rebase by @est31.
Configuration menu - View commit details
-
Copy full SHA for 0d3cac9 - Browse repository at this point
Copy the full SHA 0d3cac9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 331432d - Browse repository at this point
Copy the full SHA 331432dView commit details -
Feature gate the 128 bit types
Dangling a carrot in front of a donkey. This commit includes manual merge conflict resolution changes from a rebase by @est31.
Configuration menu - View commit details
-
Copy full SHA for 002f9a1 - Browse repository at this point
Copy the full SHA 002f9a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 660c12c - Browse repository at this point
Copy the full SHA 660c12cView commit details -
Fix LEB128 to work with the stage1
Stage 1 can’t really handle negative 128-bit literals, but an equivalent bit-not is fine
Configuration menu - View commit details
-
Copy full SHA for 2f0457d - Browse repository at this point
Copy the full SHA 2f0457dView commit details -
This commit includes manual merge conflict resolution changes from a rebase by @est31.
Configuration menu - View commit details
-
Copy full SHA for 1e203f5 - Browse repository at this point
Copy the full SHA 1e203f5View commit details -
Makefiles support for rustc_i128 crate
This commit includes manual merge conflict resolution changes from a rebase by @est31.
Configuration menu - View commit details
-
Copy full SHA for 3a31265 - Browse repository at this point
Copy the full SHA 3a31265View commit details -
Wrapping<i128> and attempt at LLVM 3.7 compat
This commit includes manual merge conflict resolution changes from a rebase by @est31.
Configuration menu - View commit details
-
Copy full SHA for c6b5c91 - Browse repository at this point
Copy the full SHA c6b5c91View commit details -
Configuration menu - View commit details
-
Copy full SHA for 275b4d5 - Browse repository at this point
Copy the full SHA 275b4d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad743e0 - Browse repository at this point
Copy the full SHA ad743e0View commit details -
Add a way to retrieve constant value in 128 bits
Fixes rebase fallout, makes code correct in presence of 128-bit constants. This commit includes manual merge conflict resolution changes from a rebase by @est31.
Configuration menu - View commit details
-
Copy full SHA for aa5adb7 - Browse repository at this point
Copy the full SHA aa5adb7View commit details -
Implement emit_iu128 for json serialiser
Causes ICEs otherwise while trying to dump AST
Configuration menu - View commit details
-
Copy full SHA for eb44eb3 - Browse repository at this point
Copy the full SHA eb44eb3View commit details -
Configuration menu - View commit details
-
Copy full SHA for af9fe30 - Browse repository at this point
Copy the full SHA af9fe30View commit details -
This commit includes manual merge conflict resolution changes from a rebase by @est31.
Configuration menu - View commit details
-
Copy full SHA for 792fecf - Browse repository at this point
Copy the full SHA 792fecfView commit details -
Configuration menu - View commit details
-
Copy full SHA for ac942a2 - Browse repository at this point
Copy the full SHA ac942a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 236da89 - Browse repository at this point
Copy the full SHA 236da89View commit details -
Use LLVMRustConstInt128Get on stage1 too
llvm::LLVMConstIntGetZExtValue doesn't accept values with more than 64 bits. This fixes an LLVM assertion error when compiling libcore with stage1: src/llvm/include/llvm/ADT/APInt.h:1336: uint64_t llvm::APInt::getZExtValue() const: Assertion `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
Configuration menu - View commit details
-
Copy full SHA for 231485f - Browse repository at this point
Copy the full SHA 231485fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 36269e3 - Browse repository at this point
Copy the full SHA 36269e3View commit details -
Make rustdoc aware of the primitive i128 type
Many thanks to ollie27 for spotting all the places.
Configuration menu - View commit details
-
Copy full SHA for 42b6518 - Browse repository at this point
Copy the full SHA 42b6518View commit details -
Configuration menu - View commit details
-
Copy full SHA for 231cf20 - Browse repository at this point
Copy the full SHA 231cf20View commit details -
Configuration menu - View commit details
-
Copy full SHA for a8fb346 - Browse repository at this point
Copy the full SHA a8fb346View commit details -
Configuration menu - View commit details
-
Copy full SHA for f609586 - Browse repository at this point
Copy the full SHA f609586View commit details -
Configuration menu - View commit details
-
Copy full SHA for e08e34b - Browse repository at this point
Copy the full SHA e08e34bView commit details -
Configuration menu - View commit details
-
Copy full SHA for bcf7f93 - Browse repository at this point
Copy the full SHA bcf7f93View commit details -
UGLY hack around an ICE bc of stage0
Current stage0 with version "1.14.0-beta.1 (d4aea2d 2016-11-15)" suffers from issue 37686. You can confirm this on master by running ./x.py test --stage 0 src/test/run-pass --test-args 37686 Add this workaround until there is a fix. No idea how it works, but it does work.
Configuration menu - View commit details
-
Copy full SHA for 73e142e - Browse repository at this point
Copy the full SHA 73e142eView commit details -
Always use Rust based intrinsics on Windows
The check inside compiler-rt file int_types.h to #define CRT_HAS_128BIT looks like: #if (defined(__LP64__) || defined(__wasm__)) && \ !(defined(__mips__) && defined(__clang__)) #define CRT_HAS_128BIT #endif Windows uses LLP64 instead of LP64, so it doesn't ship with the C based intrinsics. Also, add libcompiler_builtins to the list of crates that may have platform specific checks (like the ones we just added).
Configuration menu - View commit details
-
Copy full SHA for 249f7b6 - Browse repository at this point
Copy the full SHA 249f7b6View commit details -
* shift so that no panics are generated (otherwise results in linker error) * no_std as insurance to not get into issues with errors like "cannot satisfy dependencies so `rustc_i128` only shows up once" (pure guessing here, but it doesn't hurt...)
Configuration menu - View commit details
-
Copy full SHA for 1f2ed68 - Browse repository at this point
Copy the full SHA 1f2ed68View commit details -
libcompiler_builtins: don't codegen dead code call to eh_personality
There was a linker error on 32 bit platforms with optimisations turned off, complaining that there was an undefined reference to "rust_eh_personality", when compiling the rustc_const_math as stage1 artifact. Apparently the compiler_builtins crate includes a call to "rust_eh_personality". If compiled for 64 bits, this call doesn't appear, which explains why the linker error only happens on 32 bit platforms, and optimisations will get it removed on 32 bit as well. There were two origins of the call: 1. A for loop where apparently the compiler wasn't sure whether next() could panic or not, and therefore generated a landing pad for the worst case. The minimal reproducible example is "for _ in 0..sr { }". 2. A default impl of uabs where the compiler apparently wasn't sure either whether iabs() could panic or not. Many thanks to nagisa for contributing the fix. This commit also puts extern "C" to the intrinsics, as this is generally a good thing to do.
Configuration menu - View commit details
-
Copy full SHA for 1edc590 - Browse repository at this point
Copy the full SHA 1edc590View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8958e7c - Browse repository at this point
Copy the full SHA 8958e7cView commit details -
Port to wrapping_* and unchecked_* operations
Otherwise, we codegen panic calls which create problems with debug assertions turned on.
Configuration menu - View commit details
-
Copy full SHA for c004f88 - Browse repository at this point
Copy the full SHA c004f88View commit details -
Configuration menu - View commit details
-
Copy full SHA for 93c3584 - Browse repository at this point
Copy the full SHA 93c3584View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2175095 - Browse repository at this point
Copy the full SHA 2175095View commit details -
intrinsics: try to return everything via {u,i}128ret to match LLVM
on suggestion by nagisa.
Configuration menu - View commit details
-
Copy full SHA for 93ee9f5 - Browse repository at this point
Copy the full SHA 93ee9f5View commit details -
Fix another windows ABI mistake
...this time with the float intrinsics.
Configuration menu - View commit details
-
Copy full SHA for dc57f52 - Browse repository at this point
Copy the full SHA dc57f52View commit details -
Configuration menu - View commit details
-
Copy full SHA for a66b8b0 - Browse repository at this point
Copy the full SHA a66b8b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53925c4 - Browse repository at this point
Copy the full SHA 53925c4View commit details