John Criswell
2013-Nov-08 22:39 UTC
[LLVMdev] Emitting x86 Multi-Byte NOP in MachineFunctionPass
Dear All, I'm trying to emit one of the multi-byte NOP sequences for x86. Any one of the following NOP encodings will do: 0x66 0x90 0x0f 0x1f 0x00 0x0f 0x1f 0x40 0x00 In LLVM 3.1, there doesn't seem to be a multi-byte NOP in the TD files. Is there a way to get a MachineFunctionPass to emit one of these sequences (or to just tell it to emit a certain byte sequence into the code segment)? -- John T.
Rafael EspĂndola
2013-Dec-01 19:30 UTC
[LLVMdev] Emitting x86 Multi-Byte NOP in MachineFunctionPass
On 8 November 2013 17:39, John Criswell <criswell at illinois.edu> wrote:> Dear All, > > I'm trying to emit one of the multi-byte NOP sequences for x86. Any one of > the following NOP encodings will do: > > 0x66 0x90 > 0x0f 0x1f 0x00 > 0x0f 0x1f 0x40 0x00 > > In LLVM 3.1, there doesn't seem to be a multi-byte NOP in the TD files. > > Is there a way to get a MachineFunctionPass to emit one of these sequences > (or to just tell it to emit a certain byte sequence into the code segment)?The MC layer will produce that when aligning, so you might be able to just output a .align (assuming that 3.1 has those nops at the MC layer. Trunk does). Cheers, Rafael