Rename BinaryImm format to BinaryImm64
This commit is contained in:
@@ -64,7 +64,7 @@ pub(crate) fn define(shared_defs: &SharedDefinitions, regs: &IsaRegs) -> RecipeG
|
||||
|
||||
// R-type with an immediate shift amount instead of rs2.
|
||||
recipes.push(
|
||||
EncodingRecipeBuilder::new("Rshamt", &formats.binary_imm, 4)
|
||||
EncodingRecipeBuilder::new("Rshamt", &formats.binary_imm64, 4)
|
||||
.operands_in(vec![gpr])
|
||||
.operands_out(vec![gpr])
|
||||
.emit("put_rshamt(bits, in_reg0, imm.into(), out_reg0, sink);"),
|
||||
@@ -79,11 +79,11 @@ pub(crate) fn define(shared_defs: &SharedDefinitions, regs: &IsaRegs) -> RecipeG
|
||||
);
|
||||
|
||||
recipes.push(
|
||||
EncodingRecipeBuilder::new("Ii", &formats.binary_imm, 4)
|
||||
EncodingRecipeBuilder::new("Ii", &formats.binary_imm64, 4)
|
||||
.operands_in(vec![gpr])
|
||||
.operands_out(vec![gpr])
|
||||
.inst_predicate(InstructionPredicate::new_is_signed_int(
|
||||
&*formats.binary_imm,
|
||||
&*formats.binary_imm64,
|
||||
"imm",
|
||||
12,
|
||||
0,
|
||||
|
||||
@@ -926,11 +926,11 @@ pub(crate) fn define<'shared>(
|
||||
// XX /n ib with 8-bit immediate sign-extended.
|
||||
{
|
||||
recipes.add_template_inferred(
|
||||
EncodingRecipeBuilder::new("r_ib", &formats.binary_imm, 2)
|
||||
EncodingRecipeBuilder::new("r_ib", &formats.binary_imm64, 2)
|
||||
.operands_in(vec![gpr])
|
||||
.operands_out(vec![0])
|
||||
.inst_predicate(InstructionPredicate::new_is_signed_int(
|
||||
&*formats.binary_imm,
|
||||
&*formats.binary_imm64,
|
||||
"imm",
|
||||
8,
|
||||
0,
|
||||
@@ -947,11 +947,11 @@ pub(crate) fn define<'shared>(
|
||||
);
|
||||
|
||||
recipes.add_template_inferred(
|
||||
EncodingRecipeBuilder::new("f_ib", &formats.binary_imm, 2)
|
||||
EncodingRecipeBuilder::new("f_ib", &formats.binary_imm64, 2)
|
||||
.operands_in(vec![fpr])
|
||||
.operands_out(vec![0])
|
||||
.inst_predicate(InstructionPredicate::new_is_signed_int(
|
||||
&*formats.binary_imm,
|
||||
&*formats.binary_imm64,
|
||||
"imm",
|
||||
8,
|
||||
0,
|
||||
@@ -970,11 +970,11 @@ pub(crate) fn define<'shared>(
|
||||
// XX /n id with 32-bit immediate sign-extended.
|
||||
recipes.add_template(
|
||||
Template::new(
|
||||
EncodingRecipeBuilder::new("r_id", &formats.binary_imm, 5)
|
||||
EncodingRecipeBuilder::new("r_id", &formats.binary_imm64, 5)
|
||||
.operands_in(vec![gpr])
|
||||
.operands_out(vec![0])
|
||||
.inst_predicate(InstructionPredicate::new_is_signed_int(
|
||||
&*formats.binary_imm,
|
||||
&*formats.binary_imm64,
|
||||
"imm",
|
||||
32,
|
||||
0,
|
||||
@@ -2874,12 +2874,12 @@ pub(crate) fn define<'shared>(
|
||||
|
||||
{
|
||||
let has_small_offset =
|
||||
InstructionPredicate::new_is_signed_int(&*formats.binary_imm, "imm", 8, 0);
|
||||
InstructionPredicate::new_is_signed_int(&*formats.binary_imm64, "imm", 8, 0);
|
||||
|
||||
// XX /n, MI form with imm8.
|
||||
recipes.add_template(
|
||||
Template::new(
|
||||
EncodingRecipeBuilder::new("rcmp_ib", &formats.binary_imm, 2)
|
||||
EncodingRecipeBuilder::new("rcmp_ib", &formats.binary_imm64, 2)
|
||||
.operands_in(vec![gpr])
|
||||
.operands_out(vec![reg_rflags])
|
||||
.inst_predicate(has_small_offset)
|
||||
@@ -2897,12 +2897,12 @@ pub(crate) fn define<'shared>(
|
||||
);
|
||||
|
||||
let has_big_offset =
|
||||
InstructionPredicate::new_is_signed_int(&*formats.binary_imm, "imm", 32, 0);
|
||||
InstructionPredicate::new_is_signed_int(&*formats.binary_imm64, "imm", 32, 0);
|
||||
|
||||
// XX /n, MI form with imm32.
|
||||
recipes.add_template(
|
||||
Template::new(
|
||||
EncodingRecipeBuilder::new("rcmp_id", &formats.binary_imm, 5)
|
||||
EncodingRecipeBuilder::new("rcmp_id", &formats.binary_imm64, 5)
|
||||
.operands_in(vec![gpr])
|
||||
.operands_out(vec![reg_rflags])
|
||||
.inst_predicate(has_big_offset)
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::rc::Rc;
|
||||
|
||||
pub(crate) struct Formats {
|
||||
pub(crate) binary: Rc<InstructionFormat>,
|
||||
pub(crate) binary_imm: Rc<InstructionFormat>,
|
||||
pub(crate) binary_imm64: Rc<InstructionFormat>,
|
||||
pub(crate) branch: Rc<InstructionFormat>,
|
||||
pub(crate) branch_float: Rc<InstructionFormat>,
|
||||
pub(crate) branch_icmp: Rc<InstructionFormat>,
|
||||
@@ -78,7 +78,7 @@ impl Formats {
|
||||
|
||||
binary_imm8: Builder::new("BinaryImm8").value().imm(&imm.uimm8).build(),
|
||||
|
||||
binary_imm: Builder::new("BinaryImm").value().imm(&imm.imm64).build(),
|
||||
binary_imm64: Builder::new("BinaryImm64").value().imm(&imm.imm64).build(),
|
||||
|
||||
// The select instructions are controlled by the second VALUE operand.
|
||||
// The first VALUE operand is the controlling flag which has a derived type.
|
||||
|
||||
@@ -2215,7 +2215,7 @@ pub(crate) fn define(
|
||||
Like `icmp_imm`, but returns integer CPU flags instead of testing
|
||||
a specific condition code.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![f]),
|
||||
@@ -2460,7 +2460,7 @@ pub(crate) fn define(
|
||||
Polymorphic over all scalar integer types, but does not support vector
|
||||
types.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -2475,7 +2475,7 @@ pub(crate) fn define(
|
||||
Polymorphic over all scalar integer types, but does not support vector
|
||||
types.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -2489,7 +2489,7 @@ pub(crate) fn define(
|
||||
|
||||
This operation traps if the divisor is zero.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -2505,7 +2505,7 @@ pub(crate) fn define(
|
||||
representable in `B` bits two's complement. This only happens
|
||||
when `x = -2^{B-1}, Y = -1`.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -2519,7 +2519,7 @@ pub(crate) fn define(
|
||||
|
||||
This operation traps if the divisor is zero.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -2533,7 +2533,7 @@ pub(crate) fn define(
|
||||
|
||||
This operation traps if the divisor is zero.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -2552,7 +2552,7 @@ pub(crate) fn define(
|
||||
Polymorphic over all scalar integer types, but does not support vector
|
||||
types.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -2952,7 +2952,7 @@ pub(crate) fn define(
|
||||
Polymorphic over all scalar integer types, but does not support vector
|
||||
types.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -2969,7 +2969,7 @@ pub(crate) fn define(
|
||||
Polymorphic over all scalar integer types, but does not support vector
|
||||
types.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -2986,7 +2986,7 @@ pub(crate) fn define(
|
||||
Polymorphic over all scalar integer types, but does not support vector
|
||||
types.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -3031,7 +3031,7 @@ pub(crate) fn define(
|
||||
r#"
|
||||
Rotate left by immediate.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -3043,7 +3043,7 @@ pub(crate) fn define(
|
||||
r#"
|
||||
Rotate right by immediate.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -3118,7 +3118,7 @@ pub(crate) fn define(
|
||||
|
||||
The shift amount is masked to the size of ``x``.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -3132,7 +3132,7 @@ pub(crate) fn define(
|
||||
|
||||
The shift amount is masked to the size of the register.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
@@ -3146,7 +3146,7 @@ pub(crate) fn define(
|
||||
|
||||
The shift amount is masked to the size of the register.
|
||||
"#,
|
||||
&formats.binary_imm,
|
||||
&formats.binary_imm64,
|
||||
)
|
||||
.operands_in(vec![x, Y])
|
||||
.operands_out(vec![a]),
|
||||
|
||||
Reference in New Issue
Block a user