Fixing truncate. Previously we were emitting truncate from r16 to r8 as
movw. That is we promote the destination operand to r16. So %CH = TRUNC_R16_R8 %BP is emitted as movw %bp, %cx. This is incorrect. If %cl is live, it would be clobbered. Ideally we want to do the opposite, that is emitted it as movb ??, %ch But this is not possible since %bp does not have a r8 sub-register. We are now defining a new register class R16_ which is a subclass of R16 containing only those 16-bit registers that have r8 sub-registers (i.e. AX - DX). We isel the truncate to two instructions, a MOV16to16_ to copy the value to the R16_ class, followed by a TRUNC_R16_R8. Due to bug 770, the register colaescer is not going to coalesce between R16 and R16_. That will be fixed later so we can eliminate the MOV16to16_. Right now, it can only be eliminated if we are lucky that source and destination registers are the same. llvm-svn: 28164
Showing
- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp 7 additions, 6 deletionsllvm/lib/Target/X86/X86ATTAsmPrinter.cpp
- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp 38 additions, 0 deletionsllvm/lib/Target/X86/X86ISelDAGToDAG.cpp
- llvm/lib/Target/X86/X86InstrInfo.cpp 1 addition, 0 deletionsllvm/lib/Target/X86/X86InstrInfo.cpp
- llvm/lib/Target/X86/X86InstrInfo.td 25 additions, 7 deletionsllvm/lib/Target/X86/X86InstrInfo.td
- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp 7 additions, 6 deletionsllvm/lib/Target/X86/X86IntelAsmPrinter.cpp
- llvm/lib/Target/X86/X86RegisterInfo.cpp 18 additions, 6 deletionsllvm/lib/Target/X86/X86RegisterInfo.cpp
- llvm/lib/Target/X86/X86RegisterInfo.td 4 additions, 0 deletionsllvm/lib/Target/X86/X86RegisterInfo.td
Loading
Please register or sign in to comment