Get a type with the same number of lanes as this type, but with lanes that are half the number of bits.
(self)
| 171 | /// Get a type with the same number of lanes as this type, but with lanes that are half the |
| 172 | /// number of bits. |
| 173 | pub fn half_width(self) -> Option<Self> { |
| 174 | Some(self.replace_lanes(match self.lane_type() { |
| 175 | I16 => I8, |
| 176 | I32 => I16, |
| 177 | I64 => I32, |
| 178 | I128 => I64, |
| 179 | F32 => F16, |
| 180 | F64 => F32, |
| 181 | F128 => F64, |
| 182 | _ => return None, |
| 183 | })) |
| 184 | } |
| 185 | |
| 186 | /// Get a type with the same number of lanes as this type, but with lanes that are twice the |
| 187 | /// number of bits. |
no test coverage detected