Use u32 in Type API (#4280)
Move from passing and returning u8 and u16 values to u32 in many of the functions. This removes a number of type conversions and gives a small compilation time speedup, around ~0.7% on my aarch64 machine. Copyright (c) 2022, Arm Limited.
This commit is contained in:
@@ -7,7 +7,7 @@ use std::ops::{Add, BitAnd, Not, Sub};
|
||||
|
||||
/// Returns the size (in bits) of a given type.
|
||||
pub fn ty_bits(ty: Type) -> usize {
|
||||
usize::from(ty.bits())
|
||||
ty.bits() as usize
|
||||
}
|
||||
|
||||
/// Is the type represented by an integer (not float) at the machine level?
|
||||
|
||||
@@ -208,7 +208,7 @@ macro_rules! isle_prelude_methods {
|
||||
|
||||
#[inline]
|
||||
fn ty_bits_u16(&mut self, ty: Type) -> u16 {
|
||||
ty.bits()
|
||||
ty.bits().try_into().unwrap()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
@@ -410,7 +410,7 @@ macro_rules! isle_prelude_methods {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn multi_lane(&mut self, ty: Type) -> Option<(u8, u16)> {
|
||||
fn multi_lane(&mut self, ty: Type) -> Option<(u32, u32)> {
|
||||
if ty.lane_count() > 1 {
|
||||
Some((ty.lane_bits(), ty.lane_count()))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user