Avoid extra register movement when lowering the x86 scalar_to_vector of a float value

This commit is contained in:
Andrew Brown
2019-08-22 13:59:32 -07:00
parent 00bedca274
commit 3dfc68afb1
5 changed files with 76 additions and 25 deletions

View File

@@ -264,6 +264,27 @@ impl LaneType {
ValueType::Vector(VectorType::new(*self, lanes.into()))
}
}
pub fn is_float(&self) -> bool {
match self {
LaneType::FloatType(_) => true,
_ => false,
}
}
pub fn is_int(&self) -> bool {
match self {
LaneType::IntType(_) => true,
_ => false,
}
}
pub fn is_bool(&self) -> bool {
match self {
LaneType::BoolType(_) => true,
_ => false,
}
}
}
impl fmt::Display for LaneType {