Add adjust_sp_imm instruction. Note: This enables using rsp and rbp as normal registers. Which is... wrong.

This commit is contained in:
Tyler McMullen
2017-11-27 15:32:28 -08:00
committed by Jakob Stoklund Olesen
parent 32509ebacd
commit ffab87318e
9 changed files with 32 additions and 4 deletions

View File

@@ -241,6 +241,7 @@ pub enum InstructionData {
src: RegUnit,
dst: RegUnit,
},
AdjustSpImm { opcode: Opcode, offset: Offset32 },
RegSpill {
opcode: Opcode,
arg: Value,

View File

@@ -140,8 +140,8 @@ pub fn allocatable_registers(
flags: &shared_settings::Flags,
) -> AllocatableSet {
let mut regs = AllocatableSet::new();
regs.take(GPR, RU::rsp as RegUnit);
regs.take(GPR, RU::rbp as RegUnit);
//regs.take(GPR, RU::rsp as RegUnit);
//regs.take(GPR, RU::rbp as RegUnit);
// 32-bit arch only has 8 registers.
if !flags.is_64bit() {

View File

@@ -359,6 +359,7 @@ impl<'a> Verifier<'a> {
Store { .. } |
RegMove { .. } |
CopySpecial { .. } |
AdjustSpImm { .. } |
Trap { .. } |
CondTrap { .. } |
NullAry { .. } => {}

View File

@@ -407,6 +407,7 @@ pub fn write_operands(
write!(w, " %{} -> %{}", src, dst)
}
}
AdjustSpImm { offset, .. } => write!(w, " {}", offset),
RegSpill { arg, src, dst, .. } => {
if let Some(isa) = isa {
let regs = isa.register_info();