[PATCH] X86: Rewrite

Matthias Braun matze at braunis.de
Mon Jun 29 14:00:27 PDT 2015


Hi echristo, ahatanak, ab,

This is a new version of http://reviews.llvm.org/D10260.

It turned out that when you specify an integer register in inline asm on
x86 you get the register of the required type size back. That means that
X86TargetLowering::getRegForInlineAsmConstraint() has to accept any of
the integer registers and adapt its size to the given target size which
may be any 8/16/32/64 bit sized type. Surprisingly that means given a
constraint of "{ax}" and a type of MVT::F32 we need to return X86::EAX.

This change makes this face explicit, the previous code seemed like
working by accident because there it never returned an error once a
register was found. On the other hand this rewrite allows to actually
return errors for invalid situations like requesting an integer register
for an i128 type.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10813

Files:
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86RegisterInfo.cpp
  lib/Target/X86/X86RegisterInfo.h
  test/CodeGen/X86/asm-mismatched-types.ll
  test/CodeGen/X86/asm-reject-reg-type-mismatch.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10813.28706.patch
Type: text/x-patch
Size: 12526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150629/d65e0895/attachment.bin>


More information about the llvm-commits mailing list