From a38eee9ea1bd00395ed97e7898cd1cd772f73d22 Mon Sep 17 00:00:00 2001 From: est31 Date: Wed, 4 Jan 2017 03:04:27 +0100 Subject: [PATCH] i128 shift intrinsics --- library/compiler-builtins/README.md | 6 +++--- library/compiler-builtins/build.rs | 3 --- library/compiler-builtins/src/int/shift.rs | 7 ++++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/library/compiler-builtins/README.md b/library/compiler-builtins/README.md index 8e81dde84a57..8a8c2d174f65 100644 --- a/library/compiler-builtins/README.md +++ b/library/compiler-builtins/README.md @@ -193,8 +193,8 @@ features = ["c"] These builtins are needed to support 128-bit integers, which are in the process of being added to Rust. -- [ ] ashlti3.c -- [ ] ashrti3.c +- [x] ashlti3.c +- [x] ashrti3.c - [ ] divti3.c - [ ] fixdfti.c - [ ] fixsfti.c @@ -204,7 +204,7 @@ These builtins are needed to support 128-bit integers, which are in the process - [ ] floattisf.c - [ ] floatuntidf.c - [ ] floatuntisf.c -- [ ] lshrti3.c +- [x] lshrti3.c - [ ] modti3.c - [x] muloti4.c - [x] multi3.c diff --git a/library/compiler-builtins/build.rs b/library/compiler-builtins/build.rs index 0ecb0d0c60b5..082592541d00 100644 --- a/library/compiler-builtins/build.rs +++ b/library/compiler-builtins/build.rs @@ -178,8 +178,6 @@ fn main() { sources.extend(&["absvti2.c", "addtf3.c", "addvti3.c", - "ashlti3.c", - "ashrti3.c", "clzti2.c", "cmpti2.c", "ctzti2.c", @@ -198,7 +196,6 @@ fn main() { "floatuntidf.c", "floatuntisf.c", "floatuntixf.c", - "lshrti3.c", "modti3.c", "multf3.c", "mulvti3.c", diff --git a/library/compiler-builtins/src/int/shift.rs b/library/compiler-builtins/src/int/shift.rs index 9338f07ce7e4..5c8dd5c6a470 100644 --- a/library/compiler-builtins/src/int/shift.rs +++ b/library/compiler-builtins/src/int/shift.rs @@ -1,4 +1,3 @@ -#[cfg(not(all(feature = "c", target_arch = "x86")))] use int::{Int, LargeInt}; macro_rules! ashl { @@ -58,12 +57,18 @@ macro_rules! lshr { #[cfg(not(all(feature = "c", target_arch = "x86")))] ashl!(__ashldi3: u64); +ashl!(__ashlti3: u128); + #[cfg(not(all(feature = "c", target_arch = "x86")))] ashr!(__ashrdi3: i64); +ashr!(__ashrti3: i128); + #[cfg(not(all(feature = "c", target_arch = "x86")))] lshr!(__lshrdi3: u64); +lshr!(__lshrti3: u128); + #[cfg(test)] mod tests { use qc::{I64, U64};