debug!("const_expr_unadjusted: te1={}, ty={:?}",
cx.tn().val_to_string(te1),
ty);
- let is_simd = ty.is_simd();
- let intype = if is_simd {
- ty.simd_type(cx.tcx())
- } else {
- ty
- };
- let is_float = intype.is_fp();
- let signed = intype.is_signed();
+ assert!(!ty.is_simd());
+ let is_float = ty.is_fp();
+ let signed = ty.is_signed();
let (te2, _) = const_expr(cx, &**e2, param_substs, fn_args);
ConstFCmp(cmp, te1, te2)
} else {
let cmp = base::bin_op_to_icmp_predicate(cx, b.node, signed);
- let bool_val = ConstICmp(cmp, te1, te2);
- if is_simd {
- // LLVM outputs an `< size x i1 >`, so we need to perform
- // a sign extension to get the correctly sized type.
- llvm::LLVMConstIntCast(bool_val, val_ty(te1).to_ref(), True)
- } else {
- bool_val
- }
+ ConstICmp(cmp, te1, te2)
}
},
} } // unsafe { match b.node {
let _icx = push_ctxt("trans_eager_binop");
let tcx = bcx.tcx();
- let is_simd = lhs_t.is_simd();
- let intype = if is_simd {
- lhs_t.simd_type(tcx)
- } else {
- lhs_t
- };
- let is_float = intype.is_fp();
- let is_signed = intype.is_signed();
+ assert!(!lhs_t.is_simd());
+ let is_float = lhs_t.is_fp();
+ let is_signed = lhs_t.is_signed();
let info = expr_info(binop_expr);
let binop_debug_loc = binop_expr.debug_loc();
ast::BiAdd => {
if is_float {
FAdd(bcx, lhs, rhs, binop_debug_loc)
- } else if is_simd {
- Add(bcx, lhs, rhs, binop_debug_loc)
} else {
let (newbcx, res) = with_overflow_check(
bcx, OverflowOp::Add, info, lhs_t, lhs, rhs, binop_debug_loc);
ast::BiSub => {
if is_float {
FSub(bcx, lhs, rhs, binop_debug_loc)
- } else if is_simd {
- Sub(bcx, lhs, rhs, binop_debug_loc)
} else {
let (newbcx, res) = with_overflow_check(
bcx, OverflowOp::Sub, info, lhs_t, lhs, rhs, binop_debug_loc);
ast::BiMul => {
if is_float {
FMul(bcx, lhs, rhs, binop_debug_loc)
- } else if is_simd {
- Mul(bcx, lhs, rhs, binop_debug_loc)
} else {
let (newbcx, res) = with_overflow_check(
bcx, OverflowOp::Mul, info, lhs_t, lhs, rhs, binop_debug_loc);
res
}
ast::BiEq | ast::BiNe | ast::BiLt | ast::BiGe | ast::BiLe | ast::BiGt => {
- if is_simd {
- base::compare_simd_types(bcx, lhs, rhs, intype, val_ty(lhs), op.node, binop_debug_loc)
- } else {
- base::compare_scalar_types(bcx, lhs, rhs, intype, op.node, binop_debug_loc)
- }
+ base::compare_scalar_types(bcx, lhs, rhs, lhs_t, op.node, binop_debug_loc)
}
_ => {
bcx.tcx().sess.span_bug(binop_expr.span, "unexpected binop");
let rhs = base::cast_shift_expr_rhs(bcx, ast::BinOp_::BiShr, lhs, rhs);
// #1877, #10183: Ensure that input is always valid
let rhs = shift_mask_rhs(bcx, rhs, binop_debug_loc);
- let tcx = bcx.tcx();
- let is_simd = lhs_t.is_simd();
- let intype = if is_simd {
- lhs_t.simd_type(tcx)
- } else {
- lhs_t
- };
- let is_signed = intype.is_signed();
+ let is_signed = lhs_t.is_signed();
if is_signed {
AShr(bcx, lhs, rhs, binop_debug_loc)
} else {