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.
This commit is contained in:
parent
7f2d2afa91
commit
b0e55a83a8
87 changed files with 941 additions and 351 deletions
|
@ -64,6 +64,8 @@ use std::path::{Path, PathBuf};
|
|||
use std::rc::Rc;
|
||||
use std::slice;
|
||||
|
||||
use rustc_i128::u128;
|
||||
|
||||
bitflags! {
|
||||
flags Restrictions: u8 {
|
||||
const RESTRICTION_STMT_EXPR = 1 << 0,
|
||||
|
@ -2044,7 +2046,7 @@ impl<'a> Parser<'a> {
|
|||
pub fn mk_lit_u32(&mut self, i: u32, attrs: ThinVec<Attribute>) -> P<Expr> {
|
||||
let span = &self.span;
|
||||
let lv_lit = P(codemap::Spanned {
|
||||
node: LitKind::Int(i as u64, ast::LitIntType::Unsigned(UintTy::U32)),
|
||||
node: LitKind::Int(i as u128, ast::LitIntType::Unsigned(UintTy::U32)),
|
||||
span: *span
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue