Accessing InstrFormat.td fields

When I setup my InstrFormat fields, I added some custom fields specific
for my backend. How do I access these from inside LLVM?

For example:

class InstrFormat<dag outs, dag ins, string asmstr, list<dag> pattern>

        : Instruction {

    let Namespace = "AMD";

    dag OutOperandList = outs;

    dag InOperandList = ins;

    let Pattern = pattern;

    let AsmString = asmstr;

    OpCodeModifier ocmod;

}

How do I set/read the ocmod struct from either SelectCode or a separate
phase? Is there an example of this?

Micah Villmow

Systems Engineer

Advanced Technology & Performance

Advanced Micro Devices Inc.

4555 Great America Pkwy,

Santa Clara, CA. 95054

P: 408-572-6219

F: 408-572-6596

X86 instruction formats have extra bits as well. See X86InstrFormats.td, X86InstrInfo.h, and X86CodeEmitter.cpp to see how they are accessed. However, these are static data so I don’t think you can modify them.

Evan