[LLVMdev] Support for bundles of MCInst?

Owen Anderson resistor at mac.com
Thu Nov 29 16:38:10 PST 2012


On Nov 29, 2012, at 4:30 PM, Evandro Menezes <emenezes at codeaurora.org> wrote:

> Owen,
> 
> On 11/29/12 18:16, Owen Anderson wrote:
>>> Will the size of the
>>> packet be properly accounted for by the MCObjectStreamer if we have to pad
>>> the packet (mainly for fetch alignment)?
>> The MC system (including relaxation) is capable of handling instructions with variable length encodings whose size can't be determined until the MCCodeEmitter step.
> Where could I find more information about how this is handled?

In terms of understanding the infrastructure, I don't know a better way than reading the code.
For implementing instructions with variable sizes is easy: the MCCodeEmitter just receivers a streamer to send encoded bytes to, and an MCInst to encode.  You can feed as many bytes to the streamer as you want.
For implementing relaxation, you're probably best off looking at an existing implementing.  X86AsmBackend might be a reasonable place to start.

--Owen



More information about the llvm-dev mailing list