MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / half_width

Method half_width

cranelift/codegen/src/ir/types.rs:173–184  ·  view source on GitHub ↗

Get a type with the same number of lanes as this type, but with lanes that are half the number of bits.

(self)

Source from the content-addressed store, hash-verified

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.

Callers 2

split_lanesMethod · 0.45
resolveMethod · 0.45

Calls 2

replace_lanesMethod · 0.80
lane_typeMethod · 0.45

Tested by

no test coverage detected