Skip to content

Commit d0d7003

Browse files
committed
Remove FIXME due to a LLVM bug
This bug has been resolved: bugs.llvm.org/show_bug.cgi?id=36982
1 parent ceafeeb commit d0d7003

File tree

2 files changed

+17
-38
lines changed

2 files changed

+17
-38
lines changed

src/api/reductions/min_max.rs

+16-37
Original file line numberDiff line numberDiff line change
@@ -160,35 +160,25 @@ macro_rules! test_reduction_float_min_max {
160160
// targets:
161161
if i == $id::lanes() - 1 &&
162162
target_with_broken_last_lane_nan {
163-
// FIXME:
164-
// https://github.com/rust-lang-nursery/packed_simd/issues/5
165-
//
166-
// If there is a NaN, the result should always
167-
// the smallest element, but currently when the
168-
// last element is NaN the current
169-
// implementation incorrectly returns NaN.
170-
//
171-
// The targets mentioned above use different
172-
// codegen that produces the correct result.
173-
//
174-
// These asserts detect if this behavior changes
175-
assert!(v.min_element().is_nan(),
176-
// FIXME: ^^^ should be -3.
163+
assert_eq!(v.min_element(), -3.,
177164
"[A]: nan at {} => {} | {:?}",
178165
i, v.min_element(), v);
179166

180167
// If we replace all the elements in the vector
181168
// up-to the `i-th` lane with `NaN`s, the result
182169
// is still always `-3.` unless all elements of
183170
// the vector are `NaN`s:
184-
//
185-
// This is also broken:
186171
for j in 0..i {
187172
v = v.replace(j, n);
188-
assert!(v.min_element().is_nan(),
189-
// FIXME: ^^^ should be -3.
173+
if j == i-1 {
174+
assert!(v.min_element().is_nan(),
190175
"[B]: nan at {} => {} | {:?}",
191176
i, v.min_element(), v);
177+
} else {
178+
assert_eq!(v.min_element(), -3.,
179+
"[B]: nan at {} => {} | {:?}",
180+
i, v.min_element(), v);
181+
}
192182
}
193183

194184
// We are done here, since we were in the last
@@ -280,36 +270,25 @@ macro_rules! test_reduction_float_min_max {
280270
// targets:
281271
if i == $id::lanes() - 1 &&
282272
target_with_broken_last_lane_nan {
283-
// FIXME:
284-
// https://github.com/rust-lang-nursery/packed_simd/issues/5
285-
//
286-
// If there is a NaN, the result should
287-
// always the largest element, but currently
288-
// when the last element is NaN the current
289-
// implementation incorrectly returns NaN.
290-
//
291-
// The targets mentioned above use different
292-
// codegen that produces the correct result.
293-
//
294-
// These asserts detect if this behavior
295-
// changes
296-
assert!(v.max_element().is_nan(),
297-
// FIXME: ^^^ should be -3.
273+
assert_eq!(v.max_element(), -3.,
298274
"[A]: nan at {} => {} | {:?}",
299275
i, v.max_element(), v);
300276

301277
// If we replace all the elements in the vector
302278
// up-to the `i-th` lane with `NaN`s, the result
303279
// is still always `-3.` unless all elements of
304280
// the vector are `NaN`s:
305-
//
306-
// This is also broken:
307281
for j in 0..i {
308282
v = v.replace(j, n);
309-
assert!(v.max_element().is_nan(),
310-
// FIXME: ^^^ should be -3.
283+
if j == i-1 {
284+
assert!(v.min_element().is_nan(),
285+
"[B]: nan at {} => {} | {:?}",
286+
i, v.min_element(), v);
287+
} else {
288+
assert_eq!(v.max_element(), -3.,
311289
"[B]: nan at {} => {} | {:?}",
312290
i, v.max_element(), v);
291+
}
313292
}
314293

315294
// We are done here, since we were in the last

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ mod api;
262262
mod codegen;
263263
mod sealed;
264264

265-
pub use crate::sealed::{Simd as SimdVector, Shuffle, SimdArray, Mask};
265+
pub use crate::sealed::{Mask, Shuffle, Simd as SimdVector, SimdArray};
266266

267267
/// Packed SIMD vector type.
268268
///

0 commit comments

Comments
 (0)