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

Function isle_param_for_ctor

cranelift/codegen/meta/src/gen_asm.rs:379–397  ·  view source on GitHub ↗

Returns the parameter type used for the `IsleConstructor` variant provided.

(op: &Operand, ctor: IsleConstructor)

Source from the content-addressed store, hash-verified

377/// Returns the parameter type used for the `IsleConstructor` variant
378/// provided.
379fn isle_param_for_ctor(op: &Operand, ctor: IsleConstructor) -> String {
380 match op.location.kind() {
381 // Writable `RegMem` operands are special here: in one constructor
382 // it's operating on memory so the argument is `Amode` and in the
383 // other constructor it's operating on registers so the argument is
384 // a `Gpr`.
385 OperandKind::RegMem(_) if op.mutability.is_write() => match ctor {
386 IsleConstructor::RetMemorySideEffect => "SyntheticAmode".to_string(),
387 IsleConstructor::NoReturnSideEffect => "".to_string(),
388 IsleConstructor::RetGpr | IsleConstructor::ConsumesFlagsReturnsGpr => "Gpr".to_string(),
389 IsleConstructor::RetXmm => "Xmm".to_string(),
390 IsleConstructor::RetValueRegs => "ValueRegs".to_string(),
391 IsleConstructor::ProducesFlagsSideEffect => todo!(),
392 },
393
394 // everything else is the same as the "raw" variant
395 _ => isle_param_raw(op),
396 }
397}
398
399/// Returns the ISLE constructors that are going to be used when generating
400/// this instruction.

Callers 1

generate_isle_inst_declsFunction · 0.85

Calls 4

isle_param_rawFunction · 0.85
is_writeMethod · 0.80
kindMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected