[PATH] Fixes for the amd64 JIT code

Hi,

The attached patch contains the following changes:

  • X86InstrInfo.cpp: Synchronize a few places with the code in X86CodeEmitter.cpp
  • X86CodeEmitter.cpp: Avoid the longer SIB encoding on amd64 if it is not neeed.

Zoltan

llvm.diff (3.35 KB)

Looks good. Thanks.

Evan

Hi,

  If this looks ok, could somebody check it in ?

               thanks

                   Zoltan

Evan Cheng-2 wrote:

Committed as revision 70929. Thanks.

Evan

Hi Zoltan,

I reported a bug which appears to be a duplicate of what you've been working
on: http://llvm.org/bugs/show_bug.cgi?id=4149

Could you maybe review my proposed patch? If it's completely fixed in
revision 70929 I can close the bug report.

Thanks!

Nicolas

Hi Zoltan,

The part that determines whether SIB byte is needed caused a lot of regressions last night (see Geryon-X86-64 etc.). I've reverted it for now. Please take a look.

Thanks,

Evan

Hi,

I can’t reproduce these failures on my linux machine. The test machine seems to be
running darwin. I suspect that the problem might be with RIP relative addressing, or with
the encoding of R12/R13, but the code seems to handle the latter, since it checks for
ESP/EBP which is the same as R12/R13.

Zoltan

Hi,

It looks like the problem was with the RIP relative addressing. The original patch mistakenly
removed the || DispForReloc part because I tough that the RIP relative addressing was done
by the SIB encodings, but it is actually done by the shorter ones.
The attached patch seems to work for me on linux and when simulating darwin by forcing some variables in X86TargetMachine.cpp to their darwin values.

Zoltan

sib.diff (612 Bytes)

Committed. Thanks!

Evan