Add const_addr instruction

This new instruction calculates the effective address of a constant in the constant pool using LEA (x86).
This commit is contained in:
Andrew Brown
2020-03-20 14:15:47 -07:00
parent fa35d88878
commit 65856987cd
4 changed files with 44 additions and 0 deletions

View File

@@ -1542,6 +1542,21 @@ pub(crate) fn define(
.operands_out(vec![a]),
);
let constant =
&Operand::new("constant", &imm.pool_constant).with_doc("A constant in the constant pool");
let address = &Operand::new("address", iAddr);
ig.push(
Inst::new(
"const_addr",
r#"
Calculate the base address of a value in the constant pool.
"#,
&formats.unary_const,
)
.operands_in(vec![constant])
.operands_out(vec![address]),
);
let mask = &Operand::new("mask", &imm.uimm128)
.with_doc("The 16 immediate bytes used for selecting the elements to shuffle");
let Tx16 = &TypeVar::new(