File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,11 @@ fn simd_reduce_bool<'tcx>(
250
250
let lane = fx. bcx. ins( ) . band_imm( lane, 1 ) ; // mask to boolean
251
251
res_val = f( fx, res_val, lane) ;
252
252
}
253
+ let res_val = if fx. bcx. func. dfg. value_type( res_val) != types:: I8 {
254
+ fx. bcx. ins( ) . ireduce( types:: I8 , res_val)
255
+ } else {
256
+ res_val
257
+ } ;
253
258
let res = CValue :: by_val( res_val, ret. layout( ) ) ;
254
259
ret. write_cvalue( fx, res) ;
255
260
}
@@ -284,7 +289,11 @@ macro simd_cmp {
284
289
if let Some ( vector_ty) = vector_ty {
285
290
let x = $x. load_scalar( $fx) ;
286
291
let y = $y. load_scalar( $fx) ;
287
- let val = $fx. bcx. ins( ) . icmp( IntCC :: $cc, x, y) ;
292
+ let val = if vector_ty. lane_type( ) . is_float( ) {
293
+ $fx. bcx. ins( ) . fcmp( FloatCC :: $cc_f, x, y)
294
+ } else {
295
+ $fx. bcx. ins( ) . icmp( IntCC :: $cc, x, y)
296
+ } ;
288
297
289
298
// HACK This depends on the fact that icmp for vectors represents bools as 0 and !0, not 0 and 1.
290
299
let val = $fx. bcx. ins( ) . raw_bitcast( vector_ty, val) ;
You can’t perform that action at this time.
0 commit comments