Define stack_load, stack_store, and stack_addr instructions.

This commit is contained in:
Jakob Stoklund Olesen
2017-04-10 13:20:41 -07:00
parent 7c3bc9d19f
commit 222ae8af22
10 changed files with 163 additions and 56 deletions

View File

@@ -5,8 +5,8 @@
use ir::types;
use ir::{InstructionData, DataFlowGraph, Cursor};
use ir::{Opcode, Type, Inst, Value, Ebb, JumpTable, SigRef, FuncRef, ValueList};
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64};
use ir::{Opcode, Type, Inst, Value, Ebb, JumpTable, SigRef, FuncRef, StackSlot, ValueList};
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64, Offset32};
use ir::condcodes::{IntCC, FloatCC};
/// Base trait for instruction builders.

View File

@@ -10,8 +10,8 @@ use std::fmt::{self, Display, Formatter};
use std::str::FromStr;
use std::ops::{Deref, DerefMut};
use ir::{Value, Type, Ebb, JumpTable, SigRef, FuncRef};
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64};
use ir::{Value, Type, Ebb, JumpTable, SigRef, FuncRef, StackSlot};
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64, Offset32};
use ir::condcodes::*;
use ir::types;
use ir::DataFlowGraph;
@@ -227,6 +227,19 @@ pub enum InstructionData {
sig_ref: SigRef,
args: ValueList,
},
StackLoad {
opcode: Opcode,
ty: Type,
stack_slot: StackSlot,
offset: Offset32,
},
StackStore {
opcode: Opcode,
ty: Type,
arg: Value,
stack_slot: StackSlot,
offset: Offset32,
},
}
/// A variable list of `Value` operands used for function call arguments and passing arguments to