Remove support for vector icmp for now

Real simd support will need an overhaul in the future anyway. For now it
only complicates the code.
This commit is contained in:
bjorn3 2022-01-09 17:39:00 +01:00
parent 8ace43e650
commit 78e2d4a275
1 changed files with 15 additions and 31 deletions

View File

@ -17,22 +17,7 @@ fn validate_simd_type(fx: &mut FunctionCx<'_, '_, '_>, intrinsic: Symbol, span:
macro simd_cmp { macro simd_cmp {
($fx:expr, $cc:ident|$cc_f:ident($x:ident, $y:ident) -> $ret:ident) => { ($fx:expr, $cc:ident|$cc_f:ident($x:ident, $y:ident) -> $ret:ident) => {
let vector_ty = clif_vector_type($fx.tcx, $x.layout()); // FIXME use vector icmp when possible
if let Some(vector_ty) = vector_ty {
let x = $x.load_scalar($fx);
let y = $y.load_scalar($fx);
let val = if vector_ty.lane_type().is_float() {
$fx.bcx.ins().fcmp(FloatCC::$cc_f, x, y)
} else {
$fx.bcx.ins().icmp(IntCC::$cc, x, y)
};
// HACK This depends on the fact that icmp for vectors represents bools as 0 and !0, not 0 and 1.
let val = $fx.bcx.ins().raw_bitcast(vector_ty, val);
$ret.write_cvalue($fx, CValue::by_val(val, $ret.layout()));
} else {
simd_pair_for_each_lane( simd_pair_for_each_lane(
$fx, $fx,
$x, $x,
@ -47,7 +32,6 @@ macro simd_cmp {
bool_to_zero_or_max_uint(fx, res_lane_layout, res_lane) bool_to_zero_or_max_uint(fx, res_lane_layout, res_lane)
}, },
); );
}
}, },
($fx:expr, $cc_u:ident|$cc_s:ident|$cc_f:ident($x:ident, $y:ident) -> $ret:ident) => { ($fx:expr, $cc_u:ident|$cc_s:ident|$cc_f:ident($x:ident, $y:ident) -> $ret:ident) => {
// FIXME use vector icmp when possible // FIXME use vector icmp when possible