use crate::prelude::*;
-pub fn bin_op_to_intcc(bin_op: BinOp, signed: bool) -> Option<IntCC> {
+pub(crate) fn bin_op_to_intcc(bin_op: BinOp, signed: bool) -> Option<IntCC> {
use BinOp::*;
use IntCC::*;
Some(match bin_op {
rhs: Value,
) -> CValue<'tcx> {
let intcc = crate::num::bin_op_to_intcc(bin_op, signed).unwrap();
- let val = codegen_icmp(fx, intcc, lhs, rhs);
+ let val = fx.bcx.ins().icmp(intcc, lhs, rhs);
let val = fx.bcx.ins().bint(types::I8, val);
CValue::by_val(val, fx.layout_of(fx.tcx.types.bool))
}
-pub fn codegen_binop<'tcx>(
+pub(crate) fn codegen_binop<'tcx>(
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
bin_op: BinOp,
in_lhs: CValue<'tcx>,
}
}
-pub fn trans_bool_binop<'tcx>(
+pub(crate) fn trans_bool_binop<'tcx>(
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
bin_op: BinOp,
in_lhs: CValue<'tcx>,
CValue::by_val(res, fx.layout_of(fx.tcx.types.bool))
}
-pub fn trans_int_binop<'tcx>(
+pub(crate) fn trans_int_binop<'tcx>(
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
bin_op: BinOp,
in_lhs: CValue<'tcx>,
CValue::by_val(val, in_lhs.layout())
}
-pub fn trans_checked_int_binop<'tcx>(
+pub(crate) fn trans_checked_int_binop<'tcx>(
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
bin_op: BinOp,
in_lhs: CValue<'tcx>,
out_place.to_cvalue(fx)
}
-pub fn trans_float_binop<'tcx>(
+pub(crate) fn trans_float_binop<'tcx>(
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
bin_op: BinOp,
in_lhs: CValue<'tcx>,
CValue::by_val(res, in_lhs.layout())
}
-pub fn trans_ptr_binop<'tcx>(
+pub(crate) fn trans_ptr_binop<'tcx>(
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
bin_op: BinOp,
in_lhs: CValue<'tcx>,