[LLVMdev] Newbie: Basic stuff

Chris Lattner sabre at nondot.org
Tue Dec 4 23:17:39 CST 2007


On Dec 4, 2007, at 9:02 PM, Sanjiv Gupta wrote:

> What does MIOperandInfo exactly mean while defining an Operand class?
>
> e.g. here
>
> class X86MemOperand<string printMethod> : Operand<iPTR> {
>   let PrintMethod = printMethod;
>   let MIOperandInfo = (ops ptr_rc, i8imm, ptr_rc, i32imm);
> }

This declares X86MemOperand as an "Operand", in the selection DAG  
sense.  In the selection DAG, the type of this operand is iPTR (either  
i32 or i64 on x86).

MIOperandInfo specifies the number and types of MachineInstr operands  
(MachineOperand) that the dag operand corresponds to.  See this doc  
(Representing X86 addressing modes in MachineInstrs):
http://llvm.org/docs/CodeGenerator.html#x86

... for a description of what each of these is.

-Chris


More information about the LLVMdev mailing list