[LLVMdev] [PATCH] Do not generate nopl instruction on CPUs that don't support it.

Mikulas Patocka mikulas at artax.karlin.mff.cuni.cz
Thu Nov 21 16:30:54 PST 2013



On Tue, 12 Nov 2013, Rafael EspĂ­ndola wrote:

> On 7 November 2013 18:31, Mikulas Patocka
> <mikulas at artax.karlin.mff.cuni.cz> wrote:
> >
> >
> > On Tue, 5 Nov 2013, Rafael EspĂ­ndola wrote:
> >
> >> Please include a testcase with the patch.
> >
> > I'm sending testcase here. Compile it with
> > "clang -O2 -march=k6-2 -c loop.c"
> 
> The test should be in the patch itself. It can use llvm-mc to check
> how the nops are expanded. The trick used by
> MachO/x86_32-optimal_nop.s is to use '.align X, 0x90'.

So put it there and commit it to llvm codebase. I'm not an expert in llvm, 
I just needed a patch to make it work on my computer.

> >> gas uses " nopl   0x0(%eax)" for k6_2. Are you sure it is a gas bug?
> >
> > Yes, it is gas bug. I should report it to binutils maintainers.
> 
> Thanks!
> 
> Cheers,
> Rafael

I already reported it to binutils maintainers and they fixed it.

Mikulas


More information about the llvm-dev mailing list