Baldrdash: implement support for sign-extension in returns;

This commit is contained in:
Benjamin Bouvier
2020-04-10 14:50:39 +02:00
parent 241c164e25
commit 5b8b75def0
4 changed files with 83 additions and 18 deletions

View File

@@ -2364,7 +2364,9 @@ fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(ctx: &mut C, insn: IRInst) {
//=============================================================================
// Helpers for instruction lowering.
fn ty_bits(ty: Type) -> usize {
/// Returns the size (in bits) of a given type.
pub fn ty_bits(ty: Type) -> usize {
match ty {
B1 => 1,
B8 | I8 => 8,