Add load and store instructions.

Define a MemFlags class, currently holding a notrap and aligned flag.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-11 09:54:55 -07:00
parent 0c3771bccb
commit aad6ebebb5
12 changed files with 227 additions and 45 deletions

View File

@@ -10,7 +10,7 @@ use std::fmt::{self, Display, Formatter};
use std::str::FromStr;
use std::ops::{Deref, DerefMut};
use ir::{Value, Type, Ebb, JumpTable, SigRef, FuncRef, StackSlot};
use ir::{Value, Type, Ebb, JumpTable, SigRef, FuncRef, StackSlot, MemFlags};
use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64, Offset32, Uoffset32};
use ir::condcodes::*;
use ir::types;
@@ -252,6 +252,20 @@ pub enum InstructionData {
args: [Value; 2],
offset: Uoffset32,
},
Load {
opcode: Opcode,
ty: Type,
flags: MemFlags,
arg: Value,
offset: Offset32,
},
Store {
opcode: Opcode,
ty: Type,
flags: MemFlags,
args: [Value; 2],
offset: Offset32,
},
}
/// A variable list of `Value` operands used for function call arguments and passing arguments to