Pārlūkot izejas kodu

i128 shift intrinsics

est31 8 gadi atpakaļ
vecāks
revīzija
1e27c3f937
3 mainītis faili ar 9 papildinājumiem un 7 dzēšanām
  1. 3 3
      README.md
  2. 0 3
      build.rs
  3. 6 1
      src/int/shift.rs

+ 3 - 3
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

+ 0 - 3
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",

+ 6 - 1
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};