-
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 #38482
i128 and u128 support #38482
Commits on Dec 30, 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 b0e55a8 - Browse repository at this point
Copy the full SHA b0e55a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for b526064 - Browse repository at this point
Copy the full SHA b526064View 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 d4d5be1 - Browse repository at this point
Copy the full SHA d4d5be1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e2b946 - Browse repository at this point
Copy the full SHA 4e2b946View 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 64de4e2 - Browse repository at this point
Copy the full SHA 64de4e2View commit details -
This commit includes manual merge conflict resolution changes from a rebase by @est31.
Configuration menu - View commit details
-
Copy full SHA for 64fbce6 - Browse repository at this point
Copy the full SHA 64fbce6View 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 ec1fdfe - Browse repository at this point
Copy the full SHA ec1fdfeView 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 d9eb756 - Browse repository at this point
Copy the full SHA d9eb756View commit details -
Configuration menu - View commit details
-
Copy full SHA for db2527a - Browse repository at this point
Copy the full SHA db2527aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 508fef5 - Browse repository at this point
Copy the full SHA 508fef5View 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 9aad2d5 - Browse repository at this point
Copy the full SHA 9aad2d5View 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 4ff620e - Browse repository at this point
Copy the full SHA 4ff620eView commit details -
Configuration menu - View commit details
-
Copy full SHA for bfa53cf - Browse repository at this point
Copy the full SHA bfa53cfView commit details -
This commit includes manual merge conflict resolution changes from a rebase by @est31.
Configuration menu - View commit details
-
Copy full SHA for 7a3704c - Browse repository at this point
Copy the full SHA 7a3704cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fd5d52 - Browse repository at this point
Copy the full SHA 5fd5d52View commit details -
Configuration menu - View commit details
-
Copy full SHA for 32d8d24 - Browse repository at this point
Copy the full SHA 32d8d24View 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 8bcb021 - Browse repository at this point
Copy the full SHA 8bcb021View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e99213 - Browse repository at this point
Copy the full SHA 9e99213View 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 85ec091 - Browse repository at this point
Copy the full SHA 85ec091View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc14a10 - Browse repository at this point
Copy the full SHA dc14a10View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2715367 - Browse repository at this point
Copy the full SHA 2715367View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13d49f5 - Browse repository at this point
Copy the full SHA 13d49f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b34f90 - Browse repository at this point
Copy the full SHA 3b34f90View commit details -
Configuration menu - View commit details
-
Copy full SHA for c79aba7 - Browse repository at this point
Copy the full SHA c79aba7View 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 317810d - Browse repository at this point
Copy the full SHA 317810dView 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 3e20462 - Browse repository at this point
Copy the full SHA 3e20462View 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 92e6c53 - Browse repository at this point
Copy the full SHA 92e6c53View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3be141f - Browse repository at this point
Copy the full SHA 3be141fView 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 53ff50a - Browse repository at this point
Copy the full SHA 53ff50aView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca73aff - Browse repository at this point
Copy the full SHA ca73affView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92163f1 - Browse repository at this point
Copy the full SHA 92163f1View 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 d71223a - Browse repository at this point
Copy the full SHA d71223aView commit details -
Fix another windows ABI mistake
...this time with the float intrinsics.
Configuration menu - View commit details
-
Copy full SHA for c3e3bc0 - Browse repository at this point
Copy the full SHA c3e3bc0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01dcb7f - Browse repository at this point
Copy the full SHA 01dcb7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8cbe725 - Browse repository at this point
Copy the full SHA 8cbe725View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd10c5a - Browse repository at this point
Copy the full SHA dd10c5aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a481fe - Browse repository at this point
Copy the full SHA 0a481feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 208c8f5 - Browse repository at this point
Copy the full SHA 208c8f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for e0e5377 - Browse repository at this point
Copy the full SHA e0e5377View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a853b0 - Browse repository at this point
Copy the full SHA 5a853b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9842d27 - Browse repository at this point
Copy the full SHA 9842d27View commit details -
Configuration menu - View commit details
-
Copy full SHA for ee6256b - Browse repository at this point
Copy the full SHA ee6256bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 86ce3a2 - Browse repository at this point
Copy the full SHA 86ce3a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d166ee9 - Browse repository at this point
Copy the full SHA d166ee9View commit details -
Fix warning when compiling on 64 bit Linux
Code is much simpler now as well.
Configuration menu - View commit details
-
Copy full SHA for 6b35963 - Browse repository at this point
Copy the full SHA 6b35963View commit details
Commits on Dec 31, 2016
-
Calculate discriminant bounds within 64 bits
Since discriminants do not support i128 yet, lets just calculate the boundaries within the 64 bits that are supported. This also avoids an issue with bootstrapping on 32 bit systems due to rust-lang#38727.
Configuration menu - View commit details
-
Copy full SHA for ee69cd7 - Browse repository at this point
Copy the full SHA ee69cd7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29e01af - Browse repository at this point
Copy the full SHA 29e01afView commit details