Returns the parameter type used for the `IsleConstructor` variant provided.
(op: &Operand, ctor: IsleConstructor)
| 377 | /// Returns the parameter type used for the `IsleConstructor` variant |
| 378 | /// provided. |
| 379 | fn 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. |
no test coverage detected