Skip to content

Commit 57d25ef

Browse files
committed
Use simplified version of bool_to_zero_or_max_uint in simd_cmp
1 parent d4d2b24 commit 57d25ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/intrinsics/simd.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ macro simd_cmp($fx:expr, $cc_u:ident|$cc_s:ident|$cc_f:ident($x:ident, $y:ident)
2929
ty::Float(_) => fx.bcx.ins().fcmp(FloatCC::$cc_f, x_lane, y_lane),
3030
_ => unreachable!("{:?}", lane_layout.ty),
3131
};
32-
bool_to_zero_or_max_uint(fx, res_lane_layout, res_lane)
32+
33+
let ty = fx.clif_type(res_lane_layout.ty).unwrap();
34+
35+
let res_lane = fx.bcx.ins().bint(ty, res_lane);
36+
let res_lane = fx.bcx.ins().ineg(res_lane);
37+
38+
CValue::by_val(res_lane, res_lane_layout)
3339
},
3440
);
3541
}

0 commit comments

Comments
 (0)