Skip to content

i128 and u128 support #37900

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

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0d3cac9
Such large. Very 128. Much bits.
nagisa Aug 23, 2016
331432d
Tests for the 128 bit integers
nagisa Aug 23, 2016
002f9a1
Feature gate the 128 bit types
nagisa Aug 23, 2016
660c12c
Cleanup FIXMEs
nagisa Aug 23, 2016
2f0457d
Fix LEB128 to work with the stage1
nagisa Aug 24, 2016
1e203f5
Tidy
nagisa Aug 24, 2016
3a31265
Makefiles support for rustc_i128 crate
nagisa Aug 24, 2016
c6b5c91
Wrapping<i128> and attempt at LLVM 3.7 compat
nagisa Aug 24, 2016
275b4d5
Fix parse-fail and compile-fail tests
nagisa Aug 24, 2016
ad743e0
impl Step for iu128
nagisa Aug 24, 2016
aa5adb7
Add a way to retrieve constant value in 128 bits
nagisa Aug 25, 2016
eb44eb3
Implement emit_iu128 for json serialiser
nagisa Aug 27, 2016
af9fe30
Fix i128 alignment calculation
nagisa Sep 27, 2016
792fecf
Fix rebase fallout
nagisa Sep 27, 2016
ac942a2
WIP intrinsics
nagisa Oct 2, 2016
236da89
Fix rebase fallout
est31 Nov 20, 2016
231485f
Use LLVMRustConstInt128Get on stage1 too
est31 Nov 20, 2016
36269e3
Compilation fixes
est31 Nov 20, 2016
42b6518
Make rustdoc aware of the primitive i128 type
est31 Nov 21, 2016
231cf20
Fix intrinsics and expand tests
est31 Nov 24, 2016
a8fb346
intrinsics : uabs and iabs
est31 Nov 25, 2016
f609586
Fix warning on 64 bit
est31 Nov 26, 2016
e08e34b
Move from RUSTC_CRATES to TARGET_CRATES
est31 Nov 27, 2016
bcf7f93
40 -> 39, as ceil(log10(2^128)) == 39
est31 Nov 28, 2016
73e142e
UGLY hack around an ICE bc of stage0
est31 Dec 1, 2016
249f7b6
Always use Rust based intrinsics on Windows
est31 Dec 4, 2016
1f2ed68
Try to fix some things
est31 Dec 5, 2016
1edc590
libcompiler_builtins: don't codegen dead code call to eh_personality
est31 Dec 7, 2016
8958e7c
Remove unimplemented() function
est31 Dec 7, 2016
c004f88
Port to wrapping_* and unchecked_* operations
est31 Dec 8, 2016
93c3584
Tidy
est31 Dec 8, 2016
2175095
Windows x64 ABI requires i128 params to be passed as reference
est31 Dec 10, 2016
93ee9f5
intrinsics: try to return everything via {u,i}128ret to match LLVM
est31 Dec 12, 2016
dc57f52
Fix another windows ABI mistake
est31 Dec 14, 2016
a66b8b0
Tidy
est31 Dec 14, 2016
53925c4
Fix rebase fallout
est31 Dec 14, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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).
  • Loading branch information
est31 committed Dec 15, 2016
commit 249f7b6a6ab8f86cd233950bf6d3abb587ccff44
6 changes: 4 additions & 2 deletions src/libcompiler_builtins/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
#![crate_name = "compiler_builtins"]
#![crate_type = "rlib"]
#![feature(staged_api)]
#![cfg_attr(any(target_pointer_width="32", target_pointer_width="16"),
#![cfg_attr(any(target_pointer_width="32", target_pointer_width="16", target_os="windows",
target_arch="mips64"),
feature(core_intrinsics, core_float))]
#![feature(associated_consts)]
#![cfg_attr(not(stage0), feature(i128_type))]

#![allow(non_camel_case_types, unused_variables)]

#[cfg(any(target_pointer_width="32", target_pointer_width="16"))]
#[cfg(any(target_pointer_width="32", target_pointer_width="16", target_os="windows",
target_arch="mips64"))]
pub mod reimpls {

#![allow(unused_comparisons)]
Expand Down
2 changes: 2 additions & 0 deletions src/tools/tidy/src/pal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
//! exceptions:
//!
//! - core may not have platform-specific code
//! - libcompiler_builtins may have platform-specific code
//! - liballoc_system may have platform-specific code
//! - liballoc_jemalloc may have platform-specific code
//! - libpanic_abort may have platform-specific code
Expand Down Expand Up @@ -53,6 +54,7 @@ const EXCEPTION_PATHS: &'static [&'static str] = &[
// std crates
"src/liballoc_jemalloc",
"src/liballoc_system",
"src/libcompiler_builtins",
"src/liblibc",
"src/libpanic_abort",
"src/libpanic_unwind",
Expand Down