diff --git a/cranelift/codegen/src/isa/aarch64/inst/mod.rs b/cranelift/codegen/src/isa/aarch64/inst/mod.rs index 518de54d21d7..06c1f26d8946 100644 --- a/cranelift/codegen/src/isa/aarch64/inst/mod.rs +++ b/cranelift/codegen/src/isa/aarch64/inst/mod.rs @@ -2657,7 +2657,16 @@ impl Inst { } s } - &Inst::Ret { .. } => "ret".to_string(), + &Inst::Ret { ref rets } => { + let mut s = "ret".to_string(); + for ret in rets { + use std::fmt::Write; + let preg = pretty_print_reg(ret.preg, &mut empty_allocs); + let vreg = pretty_print_reg(ret.vreg, allocs); + write!(&mut s, " {}={}", vreg, preg).unwrap(); + } + s + } &Inst::AuthenticatedRet { key, is_hint, .. } => { let key = match key { APIKey::A => "a", diff --git a/cranelift/codegen/src/isa/riscv64/inst/mod.rs b/cranelift/codegen/src/isa/riscv64/inst/mod.rs index c0c3d0c1fc35..956909df3e9d 100644 --- a/cranelift/codegen/src/isa/riscv64/inst/mod.rs +++ b/cranelift/codegen/src/isa/riscv64/inst/mod.rs @@ -1406,8 +1406,16 @@ impl Inst { } s } - &Inst::Ret { .. } => { - format!("ret") + &Inst::Ret { ref rets } => { + let mut s = "ret".to_string(); + let mut empty_allocs = AllocationConsumer::default(); + for ret in rets { + use std::fmt::Write; + let preg = format_reg(ret.preg, &mut empty_allocs); + let vreg = format_reg(ret.vreg, allocs); + write!(&mut s, " {}={}", vreg, preg).unwrap(); + } + s } &MInst::Extend { diff --git a/cranelift/codegen/src/isa/s390x/inst/mod.rs b/cranelift/codegen/src/isa/s390x/inst/mod.rs index 88a40a928b5a..3804a980cae0 100644 --- a/cranelift/codegen/src/isa/s390x/inst/mod.rs +++ b/cranelift/codegen/src/isa/s390x/inst/mod.rs @@ -3145,9 +3145,16 @@ impl Inst { } s } - &Inst::Ret { link, .. } => { + &Inst::Ret { link, ref rets } => { debug_assert_eq!(link, gpr(14)); - format!("br {}", show_reg(link)) + let mut s = format!("br {}", show_reg(link)); + for ret in rets { + use std::fmt::Write; + let preg = pretty_print_reg(ret.preg, &mut empty_allocs); + let vreg = pretty_print_reg(ret.vreg, allocs); + write!(&mut s, " {}={}", vreg, preg).unwrap(); + } + s } &Inst::Jump { dest } => { let dest = dest.to_string(); diff --git a/cranelift/codegen/src/isa/x64/inst/mod.rs b/cranelift/codegen/src/isa/x64/inst/mod.rs index 3a000b721846..0d1bf0a0beef 100644 --- a/cranelift/codegen/src/isa/x64/inst/mod.rs +++ b/cranelift/codegen/src/isa/x64/inst/mod.rs @@ -1537,7 +1537,16 @@ impl PrettyPrint for Inst { s } - Inst::Ret { .. } => "ret".to_string(), + Inst::Ret { rets } => { + let mut s = "ret".to_string(); + for ret in rets { + use std::fmt::Write; + let preg = regs::show_reg(ret.preg); + let vreg = pretty_print_reg(ret.vreg, 8, allocs); + write!(&mut s, " {}={}", vreg, preg).unwrap(); + } + s + } Inst::JmpKnown { dst } => { format!("{} {}", ljustify("jmp".to_string()), dst.to_string())