diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-02-13 21:08:15 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-02-27 19:25:16 +0000 |
| commit | dd582bd7db1645b643133ff5e3133e55de15d841 (patch) | |
| tree | 516292e2dedd19a5ffac425bdd2b221bead3c3dd /compiler/rustc_codegen_ssa/src | |
| parent | 43ee4d15bf201f72c36abd7f02961df87dead441 (diff) | |
| download | rust-dd582bd7db1645b643133ff5e3133e55de15d841.tar.gz rust-dd582bd7db1645b643133ff5e3133e55de15d841.zip | |
Implement checked Shl/Shr at MIR building.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 3d856986fb4..13c4fa132d8 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -663,17 +663,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { }; bx.checked_binop(oop, input_ty, lhs, rhs) } - mir::BinOp::Shl | mir::BinOp::Shr => { - let lhs_llty = bx.cx().val_ty(lhs); - let rhs_llty = bx.cx().val_ty(rhs); - let invert_mask = common::shift_mask_val(bx, lhs_llty, rhs_llty, true); - let outer_bits = bx.and(rhs, invert_mask); - - let of = bx.icmp(IntPredicate::IntNE, outer_bits, bx.cx().const_null(rhs_llty)); - let val = self.codegen_scalar_binop(bx, op, lhs, rhs, input_ty); - - (val, of) - } _ => bug!("Operator `{:?}` is not a checkable operator", op), }; |
