Remove the HeapLoad/HeapStore instruction formats.

These formats are not used any longer after the heap_load and heap_store
instructions were replaced by heap_addr.

Also drop the Uoffset32 immediate operand type which isn't used either.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-20 14:21:41 -07:00
parent d3f3fdf5af
commit 0f21fd342a
7 changed files with 5 additions and 158 deletions

View File

@@ -14,7 +14,7 @@ use cretonne::ir::{Function, Ebb, Opcode, Value, Type, FunctionName, CallConv, S
ExtFuncData, SigRef, FuncRef, StackSlot, ValueLoc, ArgumentLoc, MemFlags,
GlobalVar, GlobalVarData, Heap, HeapData, HeapStyle, HeapBase};
use cretonne::ir::types::VOID;
use cretonne::ir::immediates::{Imm64, Uimm32, Offset32, Uoffset32, Ieee32, Ieee64};
use cretonne::ir::immediates::{Imm64, Uimm32, Offset32, Ieee32, Ieee64};
use cretonne::ir::entities::AnyEntity;
use cretonne::ir::instructions::{InstructionFormat, InstructionData, VariableArgs};
use cretonne::isa::{self, TargetIsa, Encoding, RegUnit};
@@ -585,22 +585,6 @@ impl<'a> Parser<'a> {
}
}
// Match and consume an optional uoffset32 immediate.
//
// Note that this will match an empty string as an empty offset, and that if an offset is
// present, it must contain a `+` sign.
fn optional_uoffset32(&mut self) -> Result<Uoffset32> {
if let Some(Token::Integer(text)) = self.token() {
self.consume();
// Lexer just gives us raw text that looks like an integer.
// Parse it as a `Uoffset32` to check for overflow and other issues.
text.parse().map_err(|e| self.error(e))
} else {
// A uoffset32 operand can be absent.
Ok(Uoffset32::new(0))
}
}
// Match and consume an Ieee32 immediate.
fn match_ieee32(&mut self, err_msg: &str) -> Result<Ieee32> {
if let Some(Token::Float(text)) = self.token() {
@@ -2141,29 +2125,6 @@ impl<'a> Parser<'a> {
offset,
}
}
InstructionFormat::HeapLoad => {
let addr = self.match_value("expected SSA value address")?;
let offset = self.optional_uoffset32()?;
InstructionData::HeapLoad {
opcode,
arg: addr,
offset,
}
}
InstructionFormat::HeapStore => {
let arg = self.match_value("expected SSA value operand")?;
self.match_token(
Token::Comma,
"expected ',' between operands",
)?;
let addr = self.match_value("expected SSA value address")?;
let offset = self.optional_uoffset32()?;
InstructionData::HeapStore {
opcode,
args: [arg, addr],
offset,
}
}
InstructionFormat::HeapAddr => {
let heap = self.match_heap("expected heap identifier").and_then(|h| {
ctx.get_heap(h, &self.loc)