Add operand kind and format for unsigned 128-bit immediates

This commit is contained in:
Andrew Brown
2019-07-23 11:02:52 -07:00
committed by Dan Gohman
parent 5ded38ce3e
commit 407d24c013
7 changed files with 71 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
use cranelift_codegen::ir::immediates::Uimm128;
use cranelift_codegen::ir::{Ebb, Function, Inst, InstructionData, Signature};
use serde_derive::{Deserialize, Serialize};
@@ -261,6 +262,14 @@ pub fn get_inst_data(inst_index: Inst, func: &Function) -> SerInstData {
opcode: opcode.to_string(),
imm: imm.to_string(),
},
InstructionData::UnaryImm128 { opcode, imm } => {
let data = func.dfg.constants.get(imm);
let uimm128 = Uimm128::from(&data[..]);
SerInstData::UnaryImm {
opcode: opcode.to_string(),
imm: uimm128.to_string(),
}
}
InstructionData::UnaryIeee32 { opcode, imm } => SerInstData::UnaryIeee32 {
opcode: opcode.to_string(),
imm: imm.to_string(),