@@ -160,33 +160,17 @@ macro_rules! test_reduction_float_min_max {
160
160
// targets:
161
161
if i == $id:: lanes( ) - 1 &&
162
162
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. ,
177
164
"[A]: nan at {} => {} | {:?}" ,
178
165
i, v. min_element( ) , v) ;
179
166
180
167
// If we replace all the elements in the vector
181
168
// up-to the `i-th` lane with `NaN`s, the result
182
169
// is still always `-3.` unless all elements of
183
170
// the vector are `NaN`s:
184
- //
185
- // This is also broken:
186
171
for j in 0 ..i {
187
172
v = v. replace( j, n) ;
188
- assert!( v. min_element( ) . is_nan( ) ,
189
- // FIXME: ^^^ should be -3.
173
+ assert_eq!( v. min_element( ) , -3. ,
190
174
"[B]: nan at {} => {} | {:?}" ,
191
175
i, v. min_element( ) , v) ;
192
176
}
@@ -280,34 +264,17 @@ macro_rules! test_reduction_float_min_max {
280
264
// targets:
281
265
if i == $id:: lanes( ) - 1 &&
282
266
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.
267
+ assert_eq!( v. max_element( ) , -3. ,
298
268
"[A]: nan at {} => {} | {:?}" ,
299
269
i, v. max_element( ) , v) ;
300
270
301
271
// If we replace all the elements in the vector
302
272
// up-to the `i-th` lane with `NaN`s, the result
303
273
// is still always `-3.` unless all elements of
304
274
// the vector are `NaN`s:
305
- //
306
- // This is also broken:
307
275
for j in 0 ..i {
308
276
v = v. replace( j, n) ;
309
- assert!( v. max_element( ) . is_nan( ) ,
310
- // FIXME: ^^^ should be -3.
277
+ assert_eq!( v. max_element( ) , -3. ,
311
278
"[B]: nan at {} => {} | {:?}" ,
312
279
i, v. max_element( ) , v) ;
313
280
}
0 commit comments