diff options
author | Dale Johannesen <dalej@apple.com> | 2009-09-18 20:15:22 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-09-18 20:15:22 +0000 |
commit | 8dffc819c5f4326700262e7d1ff906d0d44ca906 (patch) | |
tree | e90ff366c9ca3dac7230f43eb926583ceca597cc /lib/Target/PowerPC/PPCRegisterInfo.td | |
parent | e220c4b3d97bbdc9f6e8cf040942514612349c41 (diff) | |
download | external_llvm-8dffc819c5f4326700262e7d1ff906d0d44ca906.zip external_llvm-8dffc819c5f4326700262e7d1ff906d0d44ca906.tar.gz external_llvm-8dffc819c5f4326700262e7d1ff906d0d44ca906.tar.bz2 |
Model the carry bit on ppc32. Without this we could
move a SUBFC (etc.) below the SUBFE (etc.) that consumed
the carry bit. Add missing ADDIC8, noticed along the way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCRegisterInfo.td')
-rw-r--r-- | lib/Target/PowerPC/PPCRegisterInfo.td | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.td b/lib/Target/PowerPC/PPCRegisterInfo.td index 140f5df..049e893 100644 --- a/lib/Target/PowerPC/PPCRegisterInfo.td +++ b/lib/Target/PowerPC/PPCRegisterInfo.td @@ -255,6 +255,11 @@ def CTR8 : SPR<9, "ctr">, DwarfRegNum<[66]>; // VRsave register def VRSAVE: SPR<256, "VRsave">, DwarfRegNum<[107]>; +// Carry bit. In the architecture this is really bit 0 of the XER register +// (which really is SPR register 1); this is the only bit interesting to a +// compiler. +def CARRY: SPR<1, "ca">, DwarfRegNum<[0]>; + // FP rounding mode: bits 30 and 31 of the FP status and control register // This is not allocated as a normal register; it appears only in // Uses and Defs. The ABI says it needs to be preserved by a function, @@ -377,3 +382,6 @@ def CRRC : RegisterClass<"PPC", [i32], 32, [CR0, CR1, CR5, CR6, CR7, CR2, def CTRRC : RegisterClass<"PPC", [i32], 32, [CTR]>; def CTRRC8 : RegisterClass<"PPC", [i64], 64, [CTR8]>; def VRSAVERC : RegisterClass<"PPC", [i32], 32, [VRSAVE]>; +def CARRYRC : RegisterClass<"PPC", [i32], 32, [CARRY]> { + let CopyCost = -1; +} |