Skip to content

Commit d02d3b9

Browse files
committed
Remove workaround buggy simd_fmax in LLVM6
Closes #7 .
1 parent 1f13563 commit d02d3b9

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/api/ops/vector_float_min_max.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,8 @@ macro_rules! impl_ops_vector_float_min_max {
1919
/// the input vector lanes.
2020
#[inline]
2121
pub fn max(self, x: Self) -> Self {
22-
// FIXME: https://github.com/gnzlbg/packed_simd/issues/7
23-
// use codegen::llvm::simd_fmin;
24-
// unsafe { Simd(simd_fmin(self.0, x.0)) }
25-
let mut r = self;
26-
for i in 0..$id::lanes() {
27-
let a = self.extract(i);
28-
let b = x.extract(i);
29-
r = r.replace(i, a.max(b))
30-
}
31-
r
22+
use codegen::llvm::simd_fmax;
23+
unsafe { Simd(simd_fmax(self.0, x.0)) }
3224
}
3325
}
3426
#[cfg(test)]

src/codegen/llvm.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,8 @@ extern "platform-intrinsic" {
8989
crate fn simd_select<M, T>(m: M, a: T, b: T) -> T;
9090

9191
crate fn simd_fmin<T>(a: T, b: T) -> T;
92-
// FIXME: https://github.com/gnzlbg/packed_simd/issues/7
93-
// crate fn simd_fmax<T>(a: T, b: T) -> T;
92+
crate fn simd_fmax<T>(a: T, b: T) -> T;
9493

9594
crate fn simd_fsqrt<T>(a: T) -> T;
96-
#[allow(dead_code)]
9795
crate fn simd_fma<T>(a: T, b: T, c: T) -> T;
9896
}

0 commit comments

Comments
 (0)