Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b0e55a8

Browse files
nagisaest31
authored andcommittedDec 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.
1 parent 7f2d2af commit b0e55a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+945
-355
lines changed
 

‎src/libcore/clone.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,16 @@ clone_impl! { i8 }
153153
clone_impl! { i16 }
154154
clone_impl! { i32 }
155155
clone_impl! { i64 }
156+
#[cfg(not(stage0))]
157+
clone_impl! { i128 }
156158

157159
clone_impl! { usize }
158160
clone_impl! { u8 }
159161
clone_impl! { u16 }
160162
clone_impl! { u32 }
161163
clone_impl! { u64 }
164+
#[cfg(not(stage0))]
165+
clone_impl! { u128 }
162166

163167
clone_impl! { f32 }
164168
clone_impl! { f64 }

‎src/libcore/cmp.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,8 @@ mod impls {
681681
partial_eq_impl! {
682682
bool char usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64
683683
}
684+
#[cfg(not(stage0))]
685+
partial_eq_impl! { u128 i128 }
684686

685687
macro_rules! eq_impl {
686688
($($t:ty)*) => ($(
@@ -690,6 +692,8 @@ mod impls {
690692
}
691693

692694
eq_impl! { () bool char usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
695+
#[cfg(not(stage0))]
696+
eq_impl! { u128 i128 }
693697

694698
macro_rules! partial_ord_impl {
695699
($($t:ty)*) => ($(
@@ -779,6 +783,8 @@ mod impls {
779783
}
780784

781785
ord_impl! { char usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
786+
#[cfg(not(stage0))]
787+
ord_impl! { u128 i128 }
782788

783789
#[unstable(feature = "never_type_impls", issue = "35121")]
784790
impl PartialEq for ! {

0 commit comments

Comments
 (0)
Please sign in to comment.