Add support for sdiv by 2^k and -2^k. Producing code like:
[oota-llvm.git] / lib / Target / PowerPC / PPC64RegisterInfo.td
1 //===- PPC64RegisterInfo.td - The PowerPC64 Register File --*- tablegen -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 //
11 //===----------------------------------------------------------------------===//
12
13 include "PowerPCRegisterInfo.td"
14
15 /// Register classes
16 // Allocate volatiles first
17 // then nonvolatiles in reverse order since stmw/lmw save from rN to r31
18 def GPRC : RegisterClass<"PPC64", i64, 64,
19      [R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12,
20       R30, R29, R28, R27, R26, R25, R24, R23, R22, R21, R20, R19, R18, R17,
21       R16, R15, R14, R13, R31, R0, R1, LR]>
22 {
23   let MethodProtos = [{
24     iterator allocation_order_begin(MachineFunction &MF) const;
25     iterator allocation_order_end(MachineFunction &MF) const;
26   }];
27   let MethodBodies = [{
28     GPRCClass::iterator
29     GPRCClass::allocation_order_begin(MachineFunction &MF) const {
30       return begin() + ((TargetAIX == PPCTarget) ? 1 : 0);
31     }
32     GPRCClass::iterator
33     GPRCClass::allocation_order_end(MachineFunction &MF) const {
34       if (hasFP(MF))
35         return end()-4;
36       else
37         return end()-3;
38     }
39   }];
40 }
41
42 def FPRC : RegisterClass<"PPC64", f64, 64, [F0, F1, F2, F3, F4, F5, F6, F7,
43   F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21,
44   F22, F23, F24, F25, F26, F27, F28, F29, F30, F31]>;
45
46 def CRRC : RegisterClass<"PPC64", i32, 32, [CR0, CR1, CR2, CR3, CR4, CR5, CR6, CR7]>;