[meta] Make Builders build() instead of finish();
This commit is contained in:
@@ -135,7 +135,7 @@ impl InstructionFormatBuilder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn finish(self) -> InstructionFormat {
|
pub fn build(self) -> InstructionFormat {
|
||||||
let typevar_operand = if self.typevar_operand.is_some() {
|
let typevar_operand = if self.typevar_operand.is_some() {
|
||||||
self.typevar_operand
|
self.typevar_operand
|
||||||
} else if self.has_value_list || self.num_value_operands > 0 {
|
} else if self.has_value_list || self.num_value_operands > 0 {
|
||||||
@@ -213,7 +213,7 @@ impl FormatRegistry {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let format = inst_format.finish();
|
let format = inst_format.build();
|
||||||
|
|
||||||
// Compute key.
|
// Compute key.
|
||||||
let imm_keys = format
|
let imm_keys = format
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ impl<'format_reg> InstructionGroupBuilder<'format_reg> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn push(&mut self, builder: InstructionBuilder) {
|
pub fn push(&mut self, builder: InstructionBuilder) {
|
||||||
self.instructions.push(builder.finish(self.format_registry));
|
self.instructions.push(builder.build(self.format_registry));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn finish(self) -> InstructionGroup {
|
pub fn build(self) -> InstructionGroup {
|
||||||
InstructionGroup {
|
InstructionGroup {
|
||||||
_name: self._name,
|
_name: self._name,
|
||||||
_doc: self._doc,
|
_doc: self._doc,
|
||||||
@@ -300,7 +300,7 @@ impl InstructionBuilder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
fn finish(self, format_registry: &FormatRegistry) -> Instruction {
|
fn build(self, format_registry: &FormatRegistry) -> Instruction {
|
||||||
let operands_in = self.operands_in.unwrap_or_else(Vec::new);
|
let operands_in = self.operands_in.unwrap_or_else(Vec::new);
|
||||||
let operands_out = self.operands_out.unwrap_or_else(Vec::new);
|
let operands_out = self.operands_out.unwrap_or_else(Vec::new);
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ impl OperandBuilder {
|
|||||||
self.doc = Some(doc.into());
|
self.doc = Some(doc.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
pub fn finish(self) -> Operand {
|
pub fn build(self) -> Operand {
|
||||||
let doc = match self.doc {
|
let doc = match self.doc {
|
||||||
Some(doc) => Some(doc),
|
Some(doc) => Some(doc),
|
||||||
None => match &self.kind.fields {
|
None => match &self.kind.fields {
|
||||||
@@ -215,7 +215,7 @@ impl OperandKindBuilder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn finish(self) -> OperandKind {
|
pub fn build(self) -> OperandKind {
|
||||||
let default_member = match self.default_member {
|
let default_member = match self.default_member {
|
||||||
Some(default_member) => Some(default_member),
|
Some(default_member) => Some(default_member),
|
||||||
None => match &self.fields {
|
None => match &self.fields {
|
||||||
@@ -261,7 +261,7 @@ impl OperandKindBuilder {
|
|||||||
|
|
||||||
impl Into<OperandKind> for &TypeVar {
|
impl Into<OperandKind> for &TypeVar {
|
||||||
fn into(self) -> OperandKind {
|
fn into(self) -> OperandKind {
|
||||||
OperandKindBuilder::new("value", OperandKindFields::TypeVar(self.into())).finish()
|
OperandKindBuilder::new("value", OperandKindFields::TypeVar(self.into())).build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl Into<OperandKind> for &OperandKind {
|
impl Into<OperandKind> for &OperandKind {
|
||||||
@@ -272,7 +272,7 @@ impl Into<OperandKind> for &OperandKind {
|
|||||||
|
|
||||||
/// Helper to create an operand in definitions files.
|
/// Helper to create an operand in definitions files.
|
||||||
pub fn create_operand(name: &'static str, kind: impl Into<OperandKind>) -> Operand {
|
pub fn create_operand(name: &'static str, kind: impl Into<OperandKind>) -> Operand {
|
||||||
OperandBuilder::new(name, kind.into()).finish()
|
OperandBuilder::new(name, kind.into()).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Helper to create an operand with a documentation in definitions files.
|
/// Helper to create an operand with a documentation in definitions files.
|
||||||
@@ -281,5 +281,5 @@ pub fn create_operand_doc(
|
|||||||
kind: impl Into<OperandKind>,
|
kind: impl Into<OperandKind>,
|
||||||
doc: &'static str,
|
doc: &'static str,
|
||||||
) -> Operand {
|
) -> Operand {
|
||||||
OperandBuilder::new(name, kind.into()).doc(doc).finish()
|
OperandBuilder::new(name, kind.into()).doc(doc).build()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ impl IsaRegsBuilder {
|
|||||||
/// 2. There are no identical classes under different names.
|
/// 2. There are no identical classes under different names.
|
||||||
/// 3. Classes are sorted topologically such that all subclasses have a
|
/// 3. Classes are sorted topologically such that all subclasses have a
|
||||||
/// higher index that the superclass.
|
/// higher index that the superclass.
|
||||||
pub fn finish(self) -> IsaRegs {
|
pub fn build(self) -> IsaRegs {
|
||||||
for reg_bank in self.banks.values() {
|
for reg_bank in self.banks.values() {
|
||||||
for i1 in reg_bank.classes.iter() {
|
for i1 in reg_bank.classes.iter() {
|
||||||
for i2 in reg_bank.classes.iter() {
|
for i2 in reg_bank.classes.iter() {
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ impl SettingGroupBuilder {
|
|||||||
/// 2. in the list above.
|
/// 2. in the list above.
|
||||||
///
|
///
|
||||||
/// Assign `byte_offset` and `bit_offset` fields in all settings.
|
/// Assign `byte_offset` and `bit_offset` fields in all settings.
|
||||||
pub fn finish(self) -> SettingGroup {
|
pub fn build(self) -> SettingGroup {
|
||||||
let mut group = SettingGroup {
|
let mut group = SettingGroup {
|
||||||
name: self.name,
|
name: self.name,
|
||||||
settings: Vec::new(),
|
settings: Vec::new(),
|
||||||
|
|||||||
@@ -59,10 +59,10 @@ impl TypeVar {
|
|||||||
let (scalar_type, num_lanes) = match value_type {
|
let (scalar_type, num_lanes) = match value_type {
|
||||||
ValueType::BV(bitvec_type) => {
|
ValueType::BV(bitvec_type) => {
|
||||||
let bits = bitvec_type.lane_bits() as RangeBound;
|
let bits = bitvec_type.lane_bits() as RangeBound;
|
||||||
return TypeVar::new(name, doc, builder.bitvecs(bits..bits).finish());
|
return TypeVar::new(name, doc, builder.bitvecs(bits..bits).build());
|
||||||
}
|
}
|
||||||
ValueType::Special(special_type) => {
|
ValueType::Special(special_type) => {
|
||||||
return TypeVar::new(name, doc, builder.specials(vec![special_type]).finish());
|
return TypeVar::new(name, doc, builder.specials(vec![special_type]).build());
|
||||||
}
|
}
|
||||||
ValueType::Lane(lane_type) => (lane_type, 1),
|
ValueType::Lane(lane_type) => (lane_type, 1),
|
||||||
ValueType::Vector(vec_type) => {
|
ValueType::Vector(vec_type) => {
|
||||||
@@ -86,7 +86,7 @@ impl TypeVar {
|
|||||||
builder.bools(bits..bits)
|
builder.bools(bits..bits)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
TypeVar::new(name, doc, builder.finish())
|
TypeVar::new(name, doc, builder.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a fresh copy of self, named after `name`. Can only be called on non-derived typevars.
|
/// Get a fresh copy of self, named after `name`. Can only be called on non-derived typevars.
|
||||||
@@ -814,7 +814,7 @@ impl TypeSetBuilder {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn finish(self) -> TypeSet {
|
pub fn build(self) -> TypeSet {
|
||||||
let min_lanes = if self.includes_scalars { 1 } else { 2 };
|
let min_lanes = if self.includes_scalars { 1 } else { 2 };
|
||||||
;
|
;
|
||||||
let bools = range_to_set(self.bools.to_range(1..MAX_BITS, None))
|
let bools = range_to_set(self.bools.to_range(1..MAX_BITS, None))
|
||||||
@@ -841,7 +841,7 @@ impl TypeSetBuilder {
|
|||||||
.bitvecs(Interval::All)
|
.bitvecs(Interval::All)
|
||||||
.specials(ValueType::all_special_types().collect())
|
.specials(ValueType::all_special_types().collect())
|
||||||
.includes_scalars(true)
|
.includes_scalars(true)
|
||||||
.finish()
|
.build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -911,7 +911,7 @@ fn range_to_set(range: Option<Range>) -> NumSet {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_typevar_builder() {
|
fn test_typevar_builder() {
|
||||||
let type_set = TypeSetBuilder::new().ints(Interval::All).finish();
|
let type_set = TypeSetBuilder::new().ints(Interval::All).build();
|
||||||
assert_eq!(type_set.lanes, num_set![1]);
|
assert_eq!(type_set.lanes, num_set![1]);
|
||||||
assert!(type_set.floats.is_empty());
|
assert!(type_set.floats.is_empty());
|
||||||
assert_eq!(type_set.ints, num_set![8, 16, 32, 64]);
|
assert_eq!(type_set.ints, num_set![8, 16, 32, 64]);
|
||||||
@@ -919,7 +919,7 @@ fn test_typevar_builder() {
|
|||||||
assert!(type_set.bitvecs.is_empty());
|
assert!(type_set.bitvecs.is_empty());
|
||||||
assert!(type_set.specials.is_empty());
|
assert!(type_set.specials.is_empty());
|
||||||
|
|
||||||
let type_set = TypeSetBuilder::new().bools(Interval::All).finish();
|
let type_set = TypeSetBuilder::new().bools(Interval::All).build();
|
||||||
assert_eq!(type_set.lanes, num_set![1]);
|
assert_eq!(type_set.lanes, num_set![1]);
|
||||||
assert!(type_set.floats.is_empty());
|
assert!(type_set.floats.is_empty());
|
||||||
assert!(type_set.ints.is_empty());
|
assert!(type_set.ints.is_empty());
|
||||||
@@ -927,7 +927,7 @@ fn test_typevar_builder() {
|
|||||||
assert!(type_set.bitvecs.is_empty());
|
assert!(type_set.bitvecs.is_empty());
|
||||||
assert!(type_set.specials.is_empty());
|
assert!(type_set.specials.is_empty());
|
||||||
|
|
||||||
let type_set = TypeSetBuilder::new().floats(Interval::All).finish();
|
let type_set = TypeSetBuilder::new().floats(Interval::All).build();
|
||||||
assert_eq!(type_set.lanes, num_set![1]);
|
assert_eq!(type_set.lanes, num_set![1]);
|
||||||
assert_eq!(type_set.floats, num_set![32, 64]);
|
assert_eq!(type_set.floats, num_set![32, 64]);
|
||||||
assert!(type_set.ints.is_empty());
|
assert!(type_set.ints.is_empty());
|
||||||
@@ -939,7 +939,7 @@ fn test_typevar_builder() {
|
|||||||
.floats(Interval::All)
|
.floats(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.includes_scalars(false)
|
.includes_scalars(false)
|
||||||
.finish();
|
.build();
|
||||||
assert_eq!(type_set.lanes, num_set![2, 4, 8, 16, 32, 64, 128, 256]);
|
assert_eq!(type_set.lanes, num_set![2, 4, 8, 16, 32, 64, 128, 256]);
|
||||||
assert_eq!(type_set.floats, num_set![32, 64]);
|
assert_eq!(type_set.floats, num_set![32, 64]);
|
||||||
assert!(type_set.ints.is_empty());
|
assert!(type_set.ints.is_empty());
|
||||||
@@ -951,7 +951,7 @@ fn test_typevar_builder() {
|
|||||||
.floats(Interval::All)
|
.floats(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.includes_scalars(true)
|
.includes_scalars(true)
|
||||||
.finish();
|
.build();
|
||||||
assert_eq!(type_set.lanes, num_set![1, 2, 4, 8, 16, 32, 64, 128, 256]);
|
assert_eq!(type_set.lanes, num_set![1, 2, 4, 8, 16, 32, 64, 128, 256]);
|
||||||
assert_eq!(type_set.floats, num_set![32, 64]);
|
assert_eq!(type_set.floats, num_set![32, 64]);
|
||||||
assert!(type_set.ints.is_empty());
|
assert!(type_set.ints.is_empty());
|
||||||
@@ -959,7 +959,7 @@ fn test_typevar_builder() {
|
|||||||
assert!(type_set.bitvecs.is_empty());
|
assert!(type_set.bitvecs.is_empty());
|
||||||
assert!(type_set.specials.is_empty());
|
assert!(type_set.specials.is_empty());
|
||||||
|
|
||||||
let type_set = TypeSetBuilder::new().ints(16..64).finish();
|
let type_set = TypeSetBuilder::new().ints(16..64).build();
|
||||||
assert_eq!(type_set.lanes, num_set![1]);
|
assert_eq!(type_set.lanes, num_set![1]);
|
||||||
assert_eq!(type_set.ints, num_set![16, 32, 64]);
|
assert_eq!(type_set.ints, num_set![16, 32, 64]);
|
||||||
assert!(type_set.floats.is_empty());
|
assert!(type_set.floats.is_empty());
|
||||||
@@ -971,13 +971,13 @@ fn test_typevar_builder() {
|
|||||||
#[test]
|
#[test]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn test_typevar_builder_too_high_bound_panic() {
|
fn test_typevar_builder_too_high_bound_panic() {
|
||||||
TypeSetBuilder::new().ints(16..2 * MAX_BITS).finish();
|
TypeSetBuilder::new().ints(16..2 * MAX_BITS).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn test_typevar_builder_inverted_bounds_panic() {
|
fn test_typevar_builder_inverted_bounds_panic() {
|
||||||
TypeSetBuilder::new().ints(32..16).finish();
|
TypeSetBuilder::new().ints(32..16).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -986,14 +986,14 @@ fn test_as_bool() {
|
|||||||
.simd_lanes(2..8)
|
.simd_lanes(2..8)
|
||||||
.ints(8..8)
|
.ints(8..8)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.finish();
|
.build();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
a.lane_of(),
|
a.lane_of(),
|
||||||
TypeSetBuilder::new().ints(8..8).floats(32..32).finish()
|
TypeSetBuilder::new().ints(8..8).floats(32..32).build()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Test as_bool with disjoint intervals.
|
// Test as_bool with disjoint intervals.
|
||||||
let mut a_as_bool = TypeSetBuilder::new().simd_lanes(2..8).finish();
|
let mut a_as_bool = TypeSetBuilder::new().simd_lanes(2..8).build();
|
||||||
a_as_bool.bools = num_set![8, 32];
|
a_as_bool.bools = num_set![8, 32];
|
||||||
assert_eq!(a.as_bool(), a_as_bool);
|
assert_eq!(a.as_bool(), a_as_bool);
|
||||||
|
|
||||||
@@ -1001,93 +1001,93 @@ fn test_as_bool() {
|
|||||||
.simd_lanes(1..8)
|
.simd_lanes(1..8)
|
||||||
.ints(8..8)
|
.ints(8..8)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.finish();
|
.build();
|
||||||
let mut b_as_bool = TypeSetBuilder::new().simd_lanes(1..8).finish();
|
let mut b_as_bool = TypeSetBuilder::new().simd_lanes(1..8).build();
|
||||||
b_as_bool.bools = num_set![1, 8, 32];
|
b_as_bool.bools = num_set![1, 8, 32];
|
||||||
assert_eq!(b.as_bool(), b_as_bool);
|
assert_eq!(b.as_bool(), b_as_bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_forward_images() {
|
fn test_forward_images() {
|
||||||
let empty_set = TypeSetBuilder::new().finish();
|
let empty_set = TypeSetBuilder::new().build();
|
||||||
|
|
||||||
// Half vector.
|
// Half vector.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(1..32)
|
.simd_lanes(1..32)
|
||||||
.finish()
|
.build()
|
||||||
.half_vector(),
|
.half_vector(),
|
||||||
TypeSetBuilder::new().simd_lanes(1..16).finish()
|
TypeSetBuilder::new().simd_lanes(1..16).build()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Double vector.
|
// Double vector.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(1..32)
|
.simd_lanes(1..32)
|
||||||
.finish()
|
.build()
|
||||||
.double_vector(),
|
.double_vector(),
|
||||||
TypeSetBuilder::new().simd_lanes(2..64).finish()
|
TypeSetBuilder::new().simd_lanes(2..64).build()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(128..256)
|
.simd_lanes(128..256)
|
||||||
.finish()
|
.build()
|
||||||
.double_vector(),
|
.double_vector(),
|
||||||
TypeSetBuilder::new().simd_lanes(256..256).finish()
|
TypeSetBuilder::new().simd_lanes(256..256).build()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Half width.
|
// Half width.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().ints(8..32).finish().half_width(),
|
TypeSetBuilder::new().ints(8..32).build().half_width(),
|
||||||
TypeSetBuilder::new().ints(8..16).finish()
|
TypeSetBuilder::new().ints(8..16).build()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().floats(32..32).finish().half_width(),
|
TypeSetBuilder::new().floats(32..32).build().half_width(),
|
||||||
empty_set
|
empty_set
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().floats(32..64).finish().half_width(),
|
TypeSetBuilder::new().floats(32..64).build().half_width(),
|
||||||
TypeSetBuilder::new().floats(32..32).finish()
|
TypeSetBuilder::new().floats(32..32).build()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().bools(1..8).finish().half_width(),
|
TypeSetBuilder::new().bools(1..8).build().half_width(),
|
||||||
empty_set
|
empty_set
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().bools(1..32).finish().half_width(),
|
TypeSetBuilder::new().bools(1..32).build().half_width(),
|
||||||
TypeSetBuilder::new().bools(8..16).finish()
|
TypeSetBuilder::new().bools(8..16).build()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Double width.
|
// Double width.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().ints(8..32).finish().double_width(),
|
TypeSetBuilder::new().ints(8..32).build().double_width(),
|
||||||
TypeSetBuilder::new().ints(16..64).finish()
|
TypeSetBuilder::new().ints(16..64).build()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().ints(32..64).finish().double_width(),
|
TypeSetBuilder::new().ints(32..64).build().double_width(),
|
||||||
TypeSetBuilder::new().ints(64..64).finish()
|
TypeSetBuilder::new().ints(64..64).build()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().floats(32..32).finish().double_width(),
|
TypeSetBuilder::new().floats(32..32).build().double_width(),
|
||||||
TypeSetBuilder::new().floats(64..64).finish()
|
TypeSetBuilder::new().floats(64..64).build()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().floats(32..64).finish().double_width(),
|
TypeSetBuilder::new().floats(32..64).build().double_width(),
|
||||||
TypeSetBuilder::new().floats(64..64).finish()
|
TypeSetBuilder::new().floats(64..64).build()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().bools(1..16).finish().double_width(),
|
TypeSetBuilder::new().bools(1..16).build().double_width(),
|
||||||
TypeSetBuilder::new().bools(16..32).finish()
|
TypeSetBuilder::new().bools(16..32).build()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().bools(32..64).finish().double_width(),
|
TypeSetBuilder::new().bools(32..64).build().double_width(),
|
||||||
TypeSetBuilder::new().bools(64..64).finish()
|
TypeSetBuilder::new().bools(64..64).build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_backward_images() {
|
fn test_backward_images() {
|
||||||
let empty_set = TypeSetBuilder::new().finish();
|
let empty_set = TypeSetBuilder::new().build();
|
||||||
|
|
||||||
// LaneOf.
|
// LaneOf.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@@ -1095,13 +1095,13 @@ fn test_backward_images() {
|
|||||||
.simd_lanes(1..1)
|
.simd_lanes(1..1)
|
||||||
.ints(8..8)
|
.ints(8..8)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::LaneOf),
|
.preimage(DerivedFunc::LaneOf),
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.ints(8..8)
|
.ints(8..8)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.finish()
|
.build()
|
||||||
);
|
);
|
||||||
assert_eq!(empty_set.preimage(DerivedFunc::LaneOf), empty_set);
|
assert_eq!(empty_set.preimage(DerivedFunc::LaneOf), empty_set);
|
||||||
|
|
||||||
@@ -1110,14 +1110,14 @@ fn test_backward_images() {
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(1..4)
|
.simd_lanes(1..4)
|
||||||
.bools(1..64)
|
.bools(1..64)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::AsBool),
|
.preimage(DerivedFunc::AsBool),
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(1..4)
|
.simd_lanes(1..4)
|
||||||
.ints(Interval::All)
|
.ints(Interval::All)
|
||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.floats(Interval::All)
|
.floats(Interval::All)
|
||||||
.finish()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Double vector.
|
// Double vector.
|
||||||
@@ -1125,7 +1125,7 @@ fn test_backward_images() {
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(1..1)
|
.simd_lanes(1..1)
|
||||||
.ints(8..8)
|
.ints(8..8)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::DoubleVector)
|
.preimage(DerivedFunc::DoubleVector)
|
||||||
.size(),
|
.size(),
|
||||||
0
|
0
|
||||||
@@ -1135,13 +1135,13 @@ fn test_backward_images() {
|
|||||||
.simd_lanes(1..16)
|
.simd_lanes(1..16)
|
||||||
.ints(8..16)
|
.ints(8..16)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::DoubleVector),
|
.preimage(DerivedFunc::DoubleVector),
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(1..8)
|
.simd_lanes(1..8)
|
||||||
.ints(8..16)
|
.ints(8..16)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Half vector.
|
// Half vector.
|
||||||
@@ -1149,7 +1149,7 @@ fn test_backward_images() {
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(256..256)
|
.simd_lanes(256..256)
|
||||||
.ints(8..8)
|
.ints(8..8)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::HalfVector)
|
.preimage(DerivedFunc::HalfVector)
|
||||||
.size(),
|
.size(),
|
||||||
0
|
0
|
||||||
@@ -1158,12 +1158,12 @@ fn test_backward_images() {
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(64..128)
|
.simd_lanes(64..128)
|
||||||
.bools(1..32)
|
.bools(1..32)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::HalfVector),
|
.preimage(DerivedFunc::HalfVector),
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(128..256)
|
.simd_lanes(128..256)
|
||||||
.bools(1..32)
|
.bools(1..32)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Half width.
|
// Half width.
|
||||||
@@ -1172,7 +1172,7 @@ fn test_backward_images() {
|
|||||||
.ints(64..64)
|
.ints(64..64)
|
||||||
.floats(64..64)
|
.floats(64..64)
|
||||||
.bools(64..64)
|
.bools(64..64)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::HalfWidth)
|
.preimage(DerivedFunc::HalfWidth)
|
||||||
.size(),
|
.size(),
|
||||||
0
|
0
|
||||||
@@ -1181,12 +1181,12 @@ fn test_backward_images() {
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(64..256)
|
.simd_lanes(64..256)
|
||||||
.bools(1..64)
|
.bools(1..64)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::HalfWidth),
|
.preimage(DerivedFunc::HalfWidth),
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(64..256)
|
.simd_lanes(64..256)
|
||||||
.bools(16..64)
|
.bools(16..64)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Double width.
|
// Double width.
|
||||||
@@ -1195,7 +1195,7 @@ fn test_backward_images() {
|
|||||||
.ints(8..8)
|
.ints(8..8)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.bools(1..8)
|
.bools(1..8)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::DoubleWidth)
|
.preimage(DerivedFunc::DoubleWidth)
|
||||||
.size(),
|
.size(),
|
||||||
0
|
0
|
||||||
@@ -1205,13 +1205,13 @@ fn test_backward_images() {
|
|||||||
.simd_lanes(1..16)
|
.simd_lanes(1..16)
|
||||||
.ints(8..16)
|
.ints(8..16)
|
||||||
.floats(32..64)
|
.floats(32..64)
|
||||||
.finish()
|
.build()
|
||||||
.preimage(DerivedFunc::DoubleWidth),
|
.preimage(DerivedFunc::DoubleWidth),
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(1..16)
|
.simd_lanes(1..16)
|
||||||
.ints(8..8)
|
.ints(8..8)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.finish()
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1221,7 +1221,7 @@ fn test_typeset_singleton_panic_nonsingleton_types() {
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(8..8)
|
.ints(8..8)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.finish()
|
.build()
|
||||||
.get_singleton();
|
.get_singleton();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1231,7 +1231,7 @@ fn test_typeset_singleton_panic_nonsingleton_lanes() {
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(1..2)
|
.simd_lanes(1..2)
|
||||||
.floats(32..32)
|
.floats(32..32)
|
||||||
.finish()
|
.build()
|
||||||
.get_singleton();
|
.get_singleton();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1239,25 +1239,22 @@ fn test_typeset_singleton_panic_nonsingleton_lanes() {
|
|||||||
fn test_typeset_singleton() {
|
fn test_typeset_singleton() {
|
||||||
use crate::shared::types as shared_types;
|
use crate::shared::types as shared_types;
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().ints(16..16).finish().get_singleton(),
|
TypeSetBuilder::new().ints(16..16).build().get_singleton(),
|
||||||
ValueType::Lane(shared_types::Int::I16.into())
|
ValueType::Lane(shared_types::Int::I16.into())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new().floats(64..64).build().get_singleton(),
|
||||||
.floats(64..64)
|
|
||||||
.finish()
|
|
||||||
.get_singleton(),
|
|
||||||
ValueType::Lane(shared_types::Float::F64.into())
|
ValueType::Lane(shared_types::Float::F64.into())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new().bools(1..1).finish().get_singleton(),
|
TypeSetBuilder::new().bools(1..1).build().get_singleton(),
|
||||||
ValueType::Lane(shared_types::Bool::B1.into())
|
ValueType::Lane(shared_types::Bool::B1.into())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.simd_lanes(4..4)
|
.simd_lanes(4..4)
|
||||||
.ints(32..32)
|
.ints(32..32)
|
||||||
.finish()
|
.build()
|
||||||
.get_singleton(),
|
.get_singleton(),
|
||||||
LaneType::from(shared_types::Int::I32).by(4)
|
LaneType::from(shared_types::Int::I32).by(4)
|
||||||
);
|
);
|
||||||
@@ -1268,7 +1265,7 @@ fn test_typevar_functions() {
|
|||||||
let x = TypeVar::new(
|
let x = TypeVar::new(
|
||||||
"x",
|
"x",
|
||||||
"i16 and up",
|
"i16 and up",
|
||||||
TypeSetBuilder::new().ints(16..64).finish(),
|
TypeSetBuilder::new().ints(16..64).build(),
|
||||||
);
|
);
|
||||||
assert_eq!(x.half_width().name, "half_width(x)");
|
assert_eq!(x.half_width().name, "half_width(x)");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@@ -1276,7 +1273,7 @@ fn test_typevar_functions() {
|
|||||||
"double_width(half_width(x))"
|
"double_width(half_width(x))"
|
||||||
);
|
);
|
||||||
|
|
||||||
let x = TypeVar::new("x", "up to i32", TypeSetBuilder::new().ints(8..32).finish());
|
let x = TypeVar::new("x", "up to i32", TypeSetBuilder::new().ints(8..32).build());
|
||||||
assert_eq!(x.double_width().name, "double_width(x)");
|
assert_eq!(x.double_width().name, "double_width(x)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ impl TransformGroupBuilder {
|
|||||||
self.transforms.push(transform);
|
self.transforms.push(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn finish_and_add_to(self, owner: &mut TransformGroups) -> TransformGroupIndex {
|
pub fn build_and_add_to(self, owner: &mut TransformGroups) -> TransformGroupIndex {
|
||||||
let next_id = owner.next_key();
|
let next_id = owner.next_key();
|
||||||
owner.add(TransformGroup {
|
owner.add(TransformGroup {
|
||||||
name: self.name,
|
name: self.name,
|
||||||
@@ -410,7 +410,7 @@ fn test_double_custom_legalization() {
|
|||||||
format.insert(InstructionFormatBuilder::new("nullary"));
|
format.insert(InstructionFormatBuilder::new("nullary"));
|
||||||
let mut inst_group = InstructionGroupBuilder::new("test", "", &format);
|
let mut inst_group = InstructionGroupBuilder::new("test", "", &format);
|
||||||
inst_group.push(InstructionBuilder::new("dummy", "doc"));
|
inst_group.push(InstructionBuilder::new("dummy", "doc"));
|
||||||
let inst_group = inst_group.finish();
|
let inst_group = inst_group.build();
|
||||||
let dummy_inst = inst_group.by_name("dummy");
|
let dummy_inst = inst_group.by_name("dummy");
|
||||||
|
|
||||||
let mut transform_group = TransformGroupBuilder::new("test", "doc");
|
let mut transform_group = TransformGroupBuilder::new("test", "doc");
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use crate::shared::Definitions as SharedDefinitions;
|
|||||||
|
|
||||||
fn define_settings(_shared: &SettingGroup) -> SettingGroup {
|
fn define_settings(_shared: &SettingGroup) -> SettingGroup {
|
||||||
let setting = SettingGroupBuilder::new("arm32");
|
let setting = SettingGroupBuilder::new("arm32");
|
||||||
setting.finish()
|
setting.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn define_regs() -> IsaRegs {
|
fn define_regs() -> IsaRegs {
|
||||||
@@ -45,7 +45,7 @@ fn define_regs() -> IsaRegs {
|
|||||||
let builder = RegClassBuilder::new_toplevel("FLAG", flag_reg);
|
let builder = RegClassBuilder::new_toplevel("FLAG", flag_reg);
|
||||||
regs.add_class(builder);
|
regs.add_class(builder);
|
||||||
|
|
||||||
regs.finish()
|
regs.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
pub fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
||||||
@@ -57,7 +57,7 @@ pub fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
|||||||
"arm32 specific instruction set",
|
"arm32 specific instruction set",
|
||||||
&shared_defs.format_registry,
|
&shared_defs.format_registry,
|
||||||
)
|
)
|
||||||
.finish();
|
.build();
|
||||||
|
|
||||||
// CPU modes for 32-bit ARM and Thumb2.
|
// CPU modes for 32-bit ARM and Thumb2.
|
||||||
let mut a32 = CpuMode::new("A32");
|
let mut a32 = CpuMode::new("A32");
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use crate::shared::Definitions as SharedDefinitions;
|
|||||||
|
|
||||||
fn define_settings(_shared: &SettingGroup) -> SettingGroup {
|
fn define_settings(_shared: &SettingGroup) -> SettingGroup {
|
||||||
let setting = SettingGroupBuilder::new("arm64");
|
let setting = SettingGroupBuilder::new("arm64");
|
||||||
setting.finish()
|
setting.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn define_registers() -> IsaRegs {
|
fn define_registers() -> IsaRegs {
|
||||||
@@ -41,7 +41,7 @@ fn define_registers() -> IsaRegs {
|
|||||||
let builder = RegClassBuilder::new_toplevel("FLAG", flag_reg);
|
let builder = RegClassBuilder::new_toplevel("FLAG", flag_reg);
|
||||||
regs.add_class(builder);
|
regs.add_class(builder);
|
||||||
|
|
||||||
regs.finish()
|
regs.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
pub fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
||||||
@@ -53,7 +53,7 @@ pub fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
|||||||
"arm64 specific instruction set",
|
"arm64 specific instruction set",
|
||||||
&shared_defs.format_registry,
|
&shared_defs.format_registry,
|
||||||
)
|
)
|
||||||
.finish();
|
.build();
|
||||||
|
|
||||||
let mut a64 = CpuMode::new("A64");
|
let mut a64 = CpuMode::new("A64");
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ fn define_settings(shared: &SettingGroup) -> SettingGroup {
|
|||||||
predicate!(shared_enable_simd && supports_f && supports_d),
|
predicate!(shared_enable_simd && supports_f && supports_d),
|
||||||
);
|
);
|
||||||
|
|
||||||
setting.finish()
|
setting.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn define_registers() -> IsaRegs {
|
fn define_registers() -> IsaRegs {
|
||||||
@@ -79,7 +79,7 @@ fn define_registers() -> IsaRegs {
|
|||||||
let builder = RegClassBuilder::new_toplevel("FPR", float_regs);
|
let builder = RegClassBuilder::new_toplevel("FPR", float_regs);
|
||||||
regs.add_class(builder);
|
regs.add_class(builder);
|
||||||
|
|
||||||
regs.finish()
|
regs.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
pub fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
||||||
@@ -91,7 +91,7 @@ pub fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
|||||||
"riscv specific instruction set",
|
"riscv specific instruction set",
|
||||||
&shared_defs.format_registry,
|
&shared_defs.format_registry,
|
||||||
)
|
)
|
||||||
.finish();
|
.build();
|
||||||
|
|
||||||
// CPU modes for 32-bit and 64-bit operation.
|
// CPU modes for 32-bit and 64-bit operation.
|
||||||
let mut rv_32 = CpuMode::new("RV32");
|
let mut rv_32 = CpuMode::new("RV32");
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ pub fn define(format_registry: &FormatRegistry) -> InstructionGroup {
|
|||||||
let iWord = &TypeVar::new(
|
let iWord = &TypeVar::new(
|
||||||
"iWord",
|
"iWord",
|
||||||
"A scalar integer machine word",
|
"A scalar integer machine word",
|
||||||
TypeSetBuilder::new().ints(32..64).finish(),
|
TypeSetBuilder::new().ints(32..64).build(),
|
||||||
);
|
);
|
||||||
let nlo = &operand_doc("nlo", iWord, "Low part of numerator");
|
let nlo = &operand_doc("nlo", iWord, "Low part of numerator");
|
||||||
let nhi = &operand_doc("nhi", iWord, "High part of numerator");
|
let nhi = &operand_doc("nhi", iWord, "High part of numerator");
|
||||||
@@ -103,7 +103,7 @@ pub fn define(format_registry: &FormatRegistry) -> InstructionGroup {
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.floats(Interval::All)
|
.floats(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let IntTo = &TypeVar::new(
|
let IntTo = &TypeVar::new(
|
||||||
"IntTo",
|
"IntTo",
|
||||||
@@ -111,7 +111,7 @@ pub fn define(format_registry: &FormatRegistry) -> InstructionGroup {
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(32..64)
|
.ints(32..64)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", Float);
|
let x = &operand("x", Float);
|
||||||
let a = &operand("a", IntTo);
|
let a = &operand("a", IntTo);
|
||||||
@@ -242,5 +242,5 @@ pub fn define(format_registry: &FormatRegistry) -> InstructionGroup {
|
|||||||
.operands_out(vec![y, rflags]),
|
.operands_out(vec![y, rflags]),
|
||||||
);
|
);
|
||||||
|
|
||||||
ig.finish()
|
ig.build()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,5 +289,5 @@ pub fn define(shared: &mut SharedDefinitions, x86_instructions: &InstructionGrou
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
group.finish_and_add_to(&mut shared.transform_groups);
|
group.build_and_add_to(&mut shared.transform_groups);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,5 +38,5 @@ pub fn define() -> IsaRegs {
|
|||||||
let builder = RegClassBuilder::subclass_of("FPR8", fpr, 0, 8);
|
let builder = RegClassBuilder::subclass_of("FPR8", fpr, 0, 8);
|
||||||
regs.add_class(builder);
|
regs.add_class(builder);
|
||||||
|
|
||||||
regs.finish()
|
regs.build()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,5 +83,5 @@ pub fn define(shared: &SettingGroup) -> SettingGroup {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
settings.finish()
|
settings.build()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,39 +12,39 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
// This is primarliy used in control flow instructions.
|
// This is primarliy used in control flow instructions.
|
||||||
let ebb = create("ebb", "An extended basic block in the same function.")
|
let ebb = create("ebb", "An extended basic block in the same function.")
|
||||||
.default_member("destination")
|
.default_member("destination")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(ebb);
|
kinds.push(ebb);
|
||||||
|
|
||||||
// A reference to a stack slot declared in the function preamble.
|
// A reference to a stack slot declared in the function preamble.
|
||||||
let stack_slot = create("stack_slot", "A stack slot").finish();
|
let stack_slot = create("stack_slot", "A stack slot").build();
|
||||||
kinds.push(stack_slot);
|
kinds.push(stack_slot);
|
||||||
|
|
||||||
// A reference to a global value.
|
// A reference to a global value.
|
||||||
let global_value = create("global_value", "A global value.").finish();
|
let global_value = create("global_value", "A global value.").build();
|
||||||
kinds.push(global_value);
|
kinds.push(global_value);
|
||||||
|
|
||||||
// A reference to a function signature declared in the function preamble.
|
// A reference to a function signature declared in the function preamble.
|
||||||
// This is used to provide the call signature in a call_indirect instruction.
|
// This is used to provide the call signature in a call_indirect instruction.
|
||||||
let sig_ref = create("sig_ref", "A function signature.").finish();
|
let sig_ref = create("sig_ref", "A function signature.").build();
|
||||||
kinds.push(sig_ref);
|
kinds.push(sig_ref);
|
||||||
|
|
||||||
// A reference to an external function declared in the function preamble.
|
// A reference to an external function declared in the function preamble.
|
||||||
// This is used to provide the callee and signature in a call instruction.
|
// This is used to provide the callee and signature in a call instruction.
|
||||||
let func_ref = create("func_ref", "An external function.").finish();
|
let func_ref = create("func_ref", "An external function.").build();
|
||||||
kinds.push(func_ref);
|
kinds.push(func_ref);
|
||||||
|
|
||||||
// A reference to a jump table declared in the function preamble.
|
// A reference to a jump table declared in the function preamble.
|
||||||
let jump_table = create("jump_table", "A jump table.")
|
let jump_table = create("jump_table", "A jump table.")
|
||||||
.default_member("table")
|
.default_member("table")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(jump_table);
|
kinds.push(jump_table);
|
||||||
|
|
||||||
// A reference to a heap declared in the function preamble.
|
// A reference to a heap declared in the function preamble.
|
||||||
let heap = create("heap", "A heap.").finish();
|
let heap = create("heap", "A heap.").build();
|
||||||
kinds.push(heap);
|
kinds.push(heap);
|
||||||
|
|
||||||
// A reference to a table declared in the function preamble.
|
// A reference to a table declared in the function preamble.
|
||||||
let table = create("table", "A table.").finish();
|
let table = create("table", "A table.").build();
|
||||||
kinds.push(table);
|
kinds.push(table);
|
||||||
|
|
||||||
// A variable-sized list of value operands. Use for Ebb and function call arguments.
|
// A variable-sized list of value operands. Use for Ebb and function call arguments.
|
||||||
@@ -58,7 +58,7 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
returned from an instruction.
|
returned from an instruction.
|
||||||
"#,
|
"#,
|
||||||
)
|
)
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(varargs);
|
kinds.push(varargs);
|
||||||
|
|
||||||
return kinds;
|
return kinds;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
// IntType type.
|
// IntType type.
|
||||||
let imm64 = Builder::new_imm("imm64")
|
let imm64 = Builder::new_imm("imm64")
|
||||||
.doc("A 64-bit immediate integer.")
|
.doc("A 64-bit immediate integer.")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(imm64);
|
kinds.push(imm64);
|
||||||
|
|
||||||
// An unsigned 8-bit immediate integer operand.
|
// An unsigned 8-bit immediate integer operand.
|
||||||
@@ -20,13 +20,13 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
// immediate bit counts on shift instructions.
|
// immediate bit counts on shift instructions.
|
||||||
let uimm8 = Builder::new_imm("uimm8")
|
let uimm8 = Builder::new_imm("uimm8")
|
||||||
.doc("An 8-bit immediate unsigned integer.")
|
.doc("An 8-bit immediate unsigned integer.")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(uimm8);
|
kinds.push(uimm8);
|
||||||
|
|
||||||
// An unsigned 32-bit immediate integer operand.
|
// An unsigned 32-bit immediate integer operand.
|
||||||
let uimm32 = Builder::new_imm("uimm32")
|
let uimm32 = Builder::new_imm("uimm32")
|
||||||
.doc("A 32-bit immediate unsigned integer.")
|
.doc("A 32-bit immediate unsigned integer.")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(uimm32);
|
kinds.push(uimm32);
|
||||||
|
|
||||||
// A 32-bit immediate signed offset.
|
// A 32-bit immediate signed offset.
|
||||||
@@ -36,7 +36,7 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
let offset32 = Builder::new_imm("offset32")
|
let offset32 = Builder::new_imm("offset32")
|
||||||
.doc("A 32-bit immediate signed offset.")
|
.doc("A 32-bit immediate signed offset.")
|
||||||
.default_member("offset")
|
.default_member("offset")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(offset32);
|
kinds.push(offset32);
|
||||||
|
|
||||||
// A 32-bit immediate floating point operand.
|
// A 32-bit immediate floating point operand.
|
||||||
@@ -44,7 +44,7 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
// IEEE 754-2008 binary32 interchange format.
|
// IEEE 754-2008 binary32 interchange format.
|
||||||
let ieee32 = Builder::new_imm("ieee32")
|
let ieee32 = Builder::new_imm("ieee32")
|
||||||
.doc("A 32-bit immediate floating point number.")
|
.doc("A 32-bit immediate floating point number.")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(ieee32);
|
kinds.push(ieee32);
|
||||||
|
|
||||||
// A 64-bit immediate floating point operand.
|
// A 64-bit immediate floating point operand.
|
||||||
@@ -52,7 +52,7 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
// IEEE 754-2008 binary64 interchange format.
|
// IEEE 754-2008 binary64 interchange format.
|
||||||
let ieee64 = Builder::new_imm("ieee64")
|
let ieee64 = Builder::new_imm("ieee64")
|
||||||
.doc("A 64-bit immediate floating point number.")
|
.doc("A 64-bit immediate floating point number.")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(ieee64);
|
kinds.push(ieee64);
|
||||||
|
|
||||||
// An immediate boolean operand.
|
// An immediate boolean operand.
|
||||||
@@ -62,7 +62,7 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
let boolean = Builder::new_imm("boolean")
|
let boolean = Builder::new_imm("boolean")
|
||||||
.doc("An immediate boolean.")
|
.doc("An immediate boolean.")
|
||||||
.rust_type("bool")
|
.rust_type("bool")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(boolean);
|
kinds.push(boolean);
|
||||||
|
|
||||||
// A condition code for comparing integer values.
|
// A condition code for comparing integer values.
|
||||||
@@ -83,7 +83,7 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
.doc("An integer comparison condition code.")
|
.doc("An integer comparison condition code.")
|
||||||
.default_member("cond")
|
.default_member("cond")
|
||||||
.rust_type("ir::condcodes::IntCC")
|
.rust_type("ir::condcodes::IntCC")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(intcc);
|
kinds.push(intcc);
|
||||||
|
|
||||||
// A condition code for comparing floating point values. This enumerated operand kind is used
|
// A condition code for comparing floating point values. This enumerated operand kind is used
|
||||||
@@ -107,7 +107,7 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
.doc("A floating point comparison condition code")
|
.doc("A floating point comparison condition code")
|
||||||
.default_member("cond")
|
.default_member("cond")
|
||||||
.rust_type("ir::condcodes::FloatCC")
|
.rust_type("ir::condcodes::FloatCC")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(floatcc);
|
kinds.push(floatcc);
|
||||||
|
|
||||||
// Flags for memory operations like :clif:inst:`load` and :clif:inst:`store`.
|
// Flags for memory operations like :clif:inst:`load` and :clif:inst:`store`.
|
||||||
@@ -115,14 +115,14 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
.doc("Memory operation flags")
|
.doc("Memory operation flags")
|
||||||
.default_member("flags")
|
.default_member("flags")
|
||||||
.rust_type("ir::MemFlags")
|
.rust_type("ir::MemFlags")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(memflags);
|
kinds.push(memflags);
|
||||||
|
|
||||||
// A register unit in the current target ISA.
|
// A register unit in the current target ISA.
|
||||||
let regunit = Builder::new_imm("regunit")
|
let regunit = Builder::new_imm("regunit")
|
||||||
.doc("A register unit in the target ISA")
|
.doc("A register unit in the target ISA")
|
||||||
.rust_type("isa::RegUnit")
|
.rust_type("isa::RegUnit")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(regunit);
|
kinds.push(regunit);
|
||||||
|
|
||||||
// A trap code indicating the reason for trapping.
|
// A trap code indicating the reason for trapping.
|
||||||
@@ -138,7 +138,7 @@ pub fn define() -> Vec<OperandKind> {
|
|||||||
.doc("A trap reason code.")
|
.doc("A trap reason code.")
|
||||||
.default_member("code")
|
.default_member("code")
|
||||||
.rust_type("ir::TrapCode")
|
.rust_type("ir::TrapCode")
|
||||||
.finish();
|
.build();
|
||||||
kinds.push(trapcode);
|
kinds.push(trapcode);
|
||||||
|
|
||||||
return kinds;
|
return kinds;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(Interval::All)
|
.ints(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let Bool = &TypeVar::new(
|
let Bool = &TypeVar::new(
|
||||||
@@ -65,19 +65,19 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let iB = &TypeVar::new(
|
let iB = &TypeVar::new(
|
||||||
"iB",
|
"iB",
|
||||||
"A scalar integer type",
|
"A scalar integer type",
|
||||||
TypeSetBuilder::new().ints(Interval::All).finish(),
|
TypeSetBuilder::new().ints(Interval::All).build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let iAddr = &TypeVar::new(
|
let iAddr = &TypeVar::new(
|
||||||
"iAddr",
|
"iAddr",
|
||||||
"An integer address type",
|
"An integer address type",
|
||||||
TypeSetBuilder::new().ints(32..64).finish(),
|
TypeSetBuilder::new().ints(32..64).build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let Testable = &TypeVar::new(
|
let Testable = &TypeVar::new(
|
||||||
@@ -86,7 +86,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(Interval::All)
|
.ints(Interval::All)
|
||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let TxN = &TypeVar::new(
|
let TxN = &TypeVar::new(
|
||||||
@@ -98,7 +98,7 @@ pub fn define(
|
|||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.includes_scalars(false)
|
.includes_scalars(false)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let Any = &TypeVar::new(
|
let Any = &TypeVar::new(
|
||||||
@@ -110,7 +110,7 @@ pub fn define(
|
|||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.includes_scalars(true)
|
.includes_scalars(true)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let Mem = &TypeVar::new(
|
let Mem = &TypeVar::new(
|
||||||
@@ -120,7 +120,7 @@ pub fn define(
|
|||||||
.ints(Interval::All)
|
.ints(Interval::All)
|
||||||
.floats(Interval::All)
|
.floats(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let MemTo = &TypeVar::new(
|
let MemTo = &TypeVar::new(
|
||||||
@@ -130,7 +130,7 @@ pub fn define(
|
|||||||
.ints(Interval::All)
|
.ints(Interval::All)
|
||||||
.floats(Interval::All)
|
.floats(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let addr = &operand("addr", iAddr);
|
let addr = &operand("addr", iAddr);
|
||||||
@@ -261,7 +261,7 @@ pub fn define(
|
|||||||
let Entry = &TypeVar::new(
|
let Entry = &TypeVar::new(
|
||||||
"Entry",
|
"Entry",
|
||||||
"A scalar integer type",
|
"A scalar integer type",
|
||||||
TypeSetBuilder::new().ints(Interval::All).finish(),
|
TypeSetBuilder::new().ints(Interval::All).build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let entry = &operand_doc("entry", Entry, "entry of jump table");
|
let entry = &operand_doc("entry", Entry, "entry of jump table");
|
||||||
@@ -589,7 +589,7 @@ pub fn define(
|
|||||||
let iExt8 = &TypeVar::new(
|
let iExt8 = &TypeVar::new(
|
||||||
"iExt8",
|
"iExt8",
|
||||||
"An integer type with more than 8 bits",
|
"An integer type with more than 8 bits",
|
||||||
TypeSetBuilder::new().ints(16..64).finish(),
|
TypeSetBuilder::new().ints(16..64).build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", iExt8);
|
let x = &operand("x", iExt8);
|
||||||
let a = &operand("a", iExt8);
|
let a = &operand("a", iExt8);
|
||||||
@@ -679,7 +679,7 @@ pub fn define(
|
|||||||
let iExt16 = &TypeVar::new(
|
let iExt16 = &TypeVar::new(
|
||||||
"iExt16",
|
"iExt16",
|
||||||
"An integer type with more than 16 bits",
|
"An integer type with more than 16 bits",
|
||||||
TypeSetBuilder::new().ints(32..64).finish(),
|
TypeSetBuilder::new().ints(32..64).build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", iExt16);
|
let x = &operand("x", iExt16);
|
||||||
let a = &operand("a", iExt16);
|
let a = &operand("a", iExt16);
|
||||||
@@ -769,7 +769,7 @@ pub fn define(
|
|||||||
let iExt32 = &TypeVar::new(
|
let iExt32 = &TypeVar::new(
|
||||||
"iExt32",
|
"iExt32",
|
||||||
"An integer type with more than 32 bits",
|
"An integer type with more than 32 bits",
|
||||||
TypeSetBuilder::new().ints(64..64).finish(),
|
TypeSetBuilder::new().ints(64..64).build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", iExt32);
|
let x = &operand("x", iExt32);
|
||||||
let a = &operand("a", iExt32);
|
let a = &operand("a", iExt32);
|
||||||
@@ -939,7 +939,7 @@ pub fn define(
|
|||||||
let HeapOffset = &TypeVar::new(
|
let HeapOffset = &TypeVar::new(
|
||||||
"HeapOffset",
|
"HeapOffset",
|
||||||
"An unsigned heap offset",
|
"An unsigned heap offset",
|
||||||
TypeSetBuilder::new().ints(32..64).finish(),
|
TypeSetBuilder::new().ints(32..64).build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let H = &operand("H", heap);
|
let H = &operand("H", heap);
|
||||||
@@ -968,7 +968,7 @@ pub fn define(
|
|||||||
let TableOffset = &TypeVar::new(
|
let TableOffset = &TypeVar::new(
|
||||||
"TableOffset",
|
"TableOffset",
|
||||||
"An unsigned table offset",
|
"An unsigned table offset",
|
||||||
TypeSetBuilder::new().ints(32..64).finish(),
|
TypeSetBuilder::new().ints(32..64).build(),
|
||||||
);
|
);
|
||||||
let T = &operand("T", table);
|
let T = &operand("T", table);
|
||||||
let p = &operand("p", TableOffset);
|
let p = &operand("p", TableOffset);
|
||||||
@@ -1337,7 +1337,7 @@ pub fn define(
|
|||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.simd_lanes(1..128)
|
.simd_lanes(1..128)
|
||||||
.includes_scalars(true)
|
.includes_scalars(true)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let x = &operand_doc("x", Any128, "Low-numbered lanes");
|
let x = &operand_doc("x", Any128, "Low-numbered lanes");
|
||||||
@@ -1903,7 +1903,7 @@ pub fn define(
|
|||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.includes_scalars(true)
|
.includes_scalars(true)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", bits);
|
let x = &operand("x", bits);
|
||||||
let y = &operand("y", bits);
|
let y = &operand("y", bits);
|
||||||
@@ -2272,7 +2272,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.floats(Interval::All)
|
.floats(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let Cond = &operand("Cond", floatcc);
|
let Cond = &operand("Cond", floatcc);
|
||||||
let x = &operand("x", Float);
|
let x = &operand("x", Float);
|
||||||
@@ -2628,7 +2628,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let BoolTo = &TypeVar::new(
|
let BoolTo = &TypeVar::new(
|
||||||
@@ -2637,7 +2637,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let x = &operand("x", Bool);
|
let x = &operand("x", Bool);
|
||||||
@@ -2665,7 +2665,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.bools(Interval::All)
|
.bools(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", Bool);
|
let x = &operand("x", Bool);
|
||||||
let a = &operand("a", BoolTo);
|
let a = &operand("a", BoolTo);
|
||||||
@@ -2692,7 +2692,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(Interval::All)
|
.ints(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", Bool);
|
let x = &operand("x", Bool);
|
||||||
let a = &operand("a", IntTo);
|
let a = &operand("a", IntTo);
|
||||||
@@ -2731,7 +2731,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(Interval::All)
|
.ints(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let IntTo = &TypeVar::new(
|
let IntTo = &TypeVar::new(
|
||||||
@@ -2740,7 +2740,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(Interval::All)
|
.ints(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", Int);
|
let x = &operand("x", Int);
|
||||||
let a = &operand("a", IntTo);
|
let a = &operand("a", IntTo);
|
||||||
@@ -2771,7 +2771,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(Interval::All)
|
.ints(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", Int);
|
let x = &operand("x", Int);
|
||||||
let a = &operand("a", IntTo);
|
let a = &operand("a", IntTo);
|
||||||
@@ -2822,7 +2822,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.floats(Interval::All)
|
.floats(Interval::All)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", Float);
|
let x = &operand("x", Float);
|
||||||
let a = &operand("a", FloatTo);
|
let a = &operand("a", FloatTo);
|
||||||
@@ -2976,7 +2976,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(16..64)
|
.ints(16..64)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
let x = &operand("x", WideInt);
|
let x = &operand("x", WideInt);
|
||||||
let lo = &operand_doc("lo", &WideInt.half_width(), "The low bits of `x`");
|
let lo = &operand_doc("lo", &WideInt.half_width(), "The low bits of `x`");
|
||||||
@@ -3006,7 +3006,7 @@ pub fn define(
|
|||||||
TypeSetBuilder::new()
|
TypeSetBuilder::new()
|
||||||
.ints(8..32)
|
.ints(8..32)
|
||||||
.simd_lanes(Interval::All)
|
.simd_lanes(Interval::All)
|
||||||
.finish(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let lo = &operand("lo", NarrowInt);
|
let lo = &operand("lo", NarrowInt);
|
||||||
@@ -3033,5 +3033,5 @@ pub fn define(
|
|||||||
.is_ghost(true),
|
.is_ghost(true),
|
||||||
);
|
);
|
||||||
|
|
||||||
ig.finish()
|
ig.build()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -766,8 +766,8 @@ pub fn define(insts: &InstructionGroup, immediates: &OperandKinds) -> TransformG
|
|||||||
|
|
||||||
let mut groups = TransformGroups::new();
|
let mut groups = TransformGroups::new();
|
||||||
|
|
||||||
narrow.finish_and_add_to(&mut groups);
|
narrow.build_and_add_to(&mut groups);
|
||||||
let expand_id = expand.finish_and_add_to(&mut groups);
|
let expand_id = expand.build_and_add_to(&mut groups);
|
||||||
|
|
||||||
// Expansions using CPU flags.
|
// Expansions using CPU flags.
|
||||||
let mut expand_flags = TransformGroupBuilder::new(
|
let mut expand_flags = TransformGroupBuilder::new(
|
||||||
@@ -802,12 +802,12 @@ pub fn define(insts: &InstructionGroup, immediates: &OperandKinds) -> TransformG
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
expand_flags.finish_and_add_to(&mut groups);
|
expand_flags.build_and_add_to(&mut groups);
|
||||||
|
|
||||||
// XXX The order of declarations unfortunately matters to be compatible with the Python code.
|
// XXX The order of declarations unfortunately matters to be compatible with the Python code.
|
||||||
// When it's all migrated, we can put this next to the narrow/expand finish_and_add_to calls
|
// When it's all migrated, we can put this next to the narrow/expand build_and_add_to calls
|
||||||
// above.
|
// above.
|
||||||
widen.finish_and_add_to(&mut groups);
|
widen.build_and_add_to(&mut groups);
|
||||||
|
|
||||||
groups
|
groups
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,5 +160,5 @@ pub fn define() -> SettingGroup {
|
|||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
settings.finish()
|
settings.build()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user