Add an I64Regs register class for 64-bit registers.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 2 Apr 2013 04:08:54 +0000 (04:08 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 2 Apr 2013 04:08:54 +0000 (04:08 +0000)
commitfcb25e60f514e4dbceecef73ac229c61d6202ed2
tree65613c7c970530ae432864325879031c9d900f27
parent2a401959b9d5d7824e4296683e2467e5aafe01b7
Add an I64Regs register class for 64-bit registers.

We are going to use the same registers for 32-bit and 64-bit values, but
in two different register classes. The I64Regs register class has a
larger spill size and alignment.

The addition of an i64 register class confuses TableGen's type
inference, so it is necessary to clarify the type of some immediates and
the G0 register.

In 64-bit mode, pointers are i64 and should use the I64Regs register
class. Implement getPointerRegClass() to dynamically provide the pointer
register class depending on the subtarget. Use ptr_rc and iPTR for
memory operands.

Finally, add the i64 type to the IntRegs register class. This register
class is not used to hold i64 values, I64Regs is for that. The type is
required to appease TableGen's type checking in output patterns like this:

  def : Pat<(add i64:$a, i64:$b), (ADDrr $a, $b)>;

SPARC v9 uses the same ADDrr instruction for i32 and i64 additions, and
TableGen doesn't know to check the type of register sub-classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178522 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Sparc/SparcISelLowering.cpp
lib/Target/Sparc/SparcISelLowering.h
lib/Target/Sparc/SparcInstrInfo.td
lib/Target/Sparc/SparcRegisterInfo.cpp
lib/Target/Sparc/SparcRegisterInfo.h
lib/Target/Sparc/SparcRegisterInfo.td