Add storeimm32 and storeimm64 syntax
These explicitly allow usage of storeimm32 and storeimm64 in the assembler syntax. It will also warn you if you try to store a value that's too large using the storeimm32 instruction Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -59,6 +59,8 @@ pub enum Inst {
|
||||
Load(Reg, Reg),
|
||||
Store(Reg, Reg),
|
||||
StoreImm(Reg, ImmValue),
|
||||
StoreImm32(Reg, ImmValue),
|
||||
StoreImm64(Reg, ImmValue),
|
||||
MemCopy(Reg, Reg),
|
||||
RegCopy(Reg, Reg),
|
||||
|
||||
@@ -101,6 +103,8 @@ impl Inst {
|
||||
STOREIMM64
|
||||
}
|
||||
}
|
||||
Inst::StoreImm32(_, _) => STOREIMM32,
|
||||
Inst::StoreImm64(_, _) => STOREIMM64,
|
||||
Inst::MemCopy(_, _) => MEMCOPY,
|
||||
Inst::RegCopy(_, _) => REGCOPY,
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ Inst: Inst = {
|
||||
"load" <d:Reg> "," <s:Reg> => Inst::Load(d, s),
|
||||
"store" <d:Reg> "," <s:Reg> => Inst::Store(d, s),
|
||||
"storeimm" <d:Reg> "," <s:ImmValue> => Inst::StoreImm(d, s),
|
||||
"storeimm32" <d:Reg> "," <s:ImmValue> => Inst::StoreImm32(d, s),
|
||||
"storeimm64" <d:Reg> "," <s:ImmValue> => Inst::StoreImm64(d, s),
|
||||
"memcopy" <d:Reg> "," <s:Reg> => Inst::MemCopy(d, s),
|
||||
"regcopy" <d:Reg> "," <s:Reg> => Inst::RegCopy(d, s),
|
||||
"nop" => Inst::Nop,
|
||||
|
||||
Reference in New Issue
Block a user