pub fn maybe_from_i64(value: i64, scale_ty: Type) -> Option<UImm12Scaled> {
        let scale = scale_ty.bytes();
        assert!(scale.is_power_of_two());
        let scale = scale as i64;
        let limit = 4095 * scale;
        if value >= 0 && value <= limit && (value & (scale - 1)) == 0 {
            Some(UImm12Scaled {
                value: value as u16,
                scale_ty,
            })
        } else {
            None
        }
    }
/// Create a UImm12Scaled from a raw offset and the known scale type, if
/// possible.
Create a UImm12Scaled from a raw offset and the known scale type, if
possible.
Create a UImm12Scaled from a raw offset and the known scale type if possible .
pub fn maybe_from_i64(value: i64, scale_ty: Type) -> Option<UImm12Scaled> {
        let scale = scale_ty.bytes();
        assert!(scale.is_power_of_two());
        let scale = scale as i64;
        let limit = 4095 * scale;
        if value >= 0 && value <= limit && (value & (scale - 1)) == 0 {
            Some(UImm12Scaled {
                value: value as u16,
                scale_ty,
            })
        } else {
            None
        }
    }
pub fn maybe_from_i64 ( value : i64 , scale_ty : Type ) -> Option < UImm12Scaled > { let scale = scale_ty . bytes ( ) ; assert ! ( scale is_power_of_two ( ) ) ; let scale = scale as i64 ; let limit = 4095 * scale ; if value >= 0 && value <= limit && ( value & ( scale - 1 ) ) == 0 { Some ( UImm12Scaled { value : value as u16 , scale_ty , } ) } else { None } }
Create a UImm12Scaled from a raw offset and the known scale type, if
possible.
Create a UImm12Scaled from a raw offset and the known scale type if possible .
value
i64
scale_ty
Type
value
i64
scale_ty
Type