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

Method gen_load

cranelift/codegen/src/isa/aarch64/inst/mod.rs:209–248  ·  view source on GitHub ↗

Generic constructor for a load (zero-extending where appropriate).

(into_reg: Writable<Reg>, mem: AMode, ty: Type, flags: MemFlagsData)

Source from the content-addressed store, hash-verified

207
208 /// Generic constructor for a load (zero-extending where appropriate).
209 pub fn gen_load(into_reg: Writable<Reg>, mem: AMode, ty: Type, flags: MemFlagsData) -> Inst {
210 match ty {
211 I8 => Inst::ULoad8 {
212 rd: into_reg,
213 mem,
214 flags,
215 },
216 I16 => Inst::ULoad16 {
217 rd: into_reg,
218 mem,
219 flags,
220 },
221 I32 => Inst::ULoad32 {
222 rd: into_reg,
223 mem,
224 flags,
225 },
226 I64 => Inst::ULoad64 {
227 rd: into_reg,
228 mem,
229 flags,
230 },
231 _ => {
232 if ty.is_vector() || ty.is_float() {
233 let bits = ty_bits(ty);
234 let rd = into_reg;
235
236 match bits {
237 128 => Inst::FpuLoad128 { rd, mem, flags },
238 64 => Inst::FpuLoad64 { rd, mem, flags },
239 32 => Inst::FpuLoad32 { rd, mem, flags },
240 16 => Inst::FpuLoad16 { rd, mem, flags },
241 _ => unimplemented!("gen_load({})", ty),
242 }
243 } else {
244 unimplemented!("gen_load({})", ty);
245 }
246 }
247 }
248 }
249
250 /// Generic constructor for a store.
251 pub fn gen_store(mem: AMode, from_reg: Reg, ty: Type, flags: MemFlagsData) -> Inst {

Callers

nothing calls this directly

Calls 3

ty_bitsFunction · 0.85
is_vectorMethod · 0.45
is_floatMethod · 0.45

Tested by

no test coverage detected