Skip to content
  • Jakob Stoklund Olesen's avatar
    Add an I64Regs register class for 64-bit registers. · 5ad3b353
    Jakob Stoklund Olesen authored
    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.
    
    llvm-svn: 178522
    5ad3b353
Loading