Skip to content

Commit d67b2d9

Browse files
committed
Remove the absv implementation, it isn't needed by Rust
1 parent 4ab4465 commit d67b2d9

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

src/lib.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -118,23 +118,3 @@ impl IndexMut<RangeFull> for U64 {
118118
unsafe { &mut *(self as *const _ as *mut u64) }
119119
}
120120
}
121-
122-
macro_rules! absv_i2 {
123-
($intrinsic:ident : $ty:ty) => {
124-
#[no_mangle]
125-
pub extern "C" fn $intrinsic(x: $ty) -> $ty {
126-
let n = <$ty>::bits();
127-
if x == 1 << (n - 1) {
128-
panic!();
129-
}
130-
let y = x >> (n - 1);
131-
(x ^ y) - y
132-
}
133-
134-
}
135-
}
136-
137-
absv_i2!(__absvsi2: i32);
138-
absv_i2!(__absvdi2: i64);
139-
// TODO(rust-lang/35118)?
140-
// absv_i2!(__absvti2, i128);

src/test.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,6 @@ use std::panic;
22

33
use quickcheck::TestResult;
44

5-
macro_rules! absv_i2 {
6-
($intrinsic:ident: $ty:ident) => {
7-
#[test]
8-
fn $intrinsic() {
9-
assert!(panic::catch_unwind(|| ::$intrinsic(::std::$ty::MIN)).is_err());
10-
assert_eq!(::$intrinsic(::std::$ty::MIN + 1), ::std::$ty::MAX);
11-
assert_eq!(::$intrinsic(::std::$ty::MIN + 2), ::std::$ty::MAX - 1);
12-
assert_eq!(::$intrinsic(-1), 1);
13-
assert_eq!(::$intrinsic(-2), 2);
14-
assert_eq!(::$intrinsic(0), 0);
15-
assert_eq!(::$intrinsic(1), 1);
16-
assert_eq!(::$intrinsic(2), 2);
17-
assert_eq!(::$intrinsic(2), 2);
18-
assert_eq!(::$intrinsic(::std::$ty::MAX - 1), ::std::$ty::MAX - 1);
19-
assert_eq!(::$intrinsic(::std::$ty::MAX), ::std::$ty::MAX);
20-
}
21-
}
22-
}
23-
24-
absv_i2!(__absvsi2: i32);
25-
absv_i2!(__absvdi2: i64);
26-
// TODO(rust-lang/35118)?
27-
// absv_i2!(__absvti2: i128);
28-
295
quickcheck! {
306
fn udivmoddi4(n: (u32, u32), d: (u32, u32)) -> TestResult {
317
let n = ::U64 { low: n.0, high: n.1 }[..];

0 commit comments

Comments
 (0)