aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/PPCRegisterInfo.td
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-10-29 18:26:45 +0000
committerDale Johannesen <dalej@apple.com>2008-10-29 18:26:45 +0000
commitb73cd82d869edfa111b20b958f826be511be7687 (patch)
treee47d7c63447025d87a75367ed896ec60d8083caa /lib/Target/PowerPC/PPCRegisterInfo.td
parent7e1cf741f7ababa2bdd659936f9f18075adcb447 (diff)
downloadexternal_llvm-b73cd82d869edfa111b20b958f826be511be7687.zip
external_llvm-b73cd82d869edfa111b20b958f826be511be7687.tar.gz
external_llvm-b73cd82d869edfa111b20b958f826be511be7687.tar.bz2
Add a RM pseudoreg for the rounding mode, which
allows ppcf128->int conversion to work with DeadInstructionElimination. This is now turned off but RM is harmless. It does not do a complete job of modeling the rounding mode. Revert marking MFCR as using all 7 CR subregisters; while correct, this caused the problem in PR 2964, plus the local RA crash noted in the comments. This was needed to make DeadInstructionElimination, but as we are not running that, it is backed out for now. Eventually it should go back in and the other problems fixed where they're broken. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCRegisterInfo.td')
-rw-r--r--lib/Target/PowerPC/PPCRegisterInfo.td10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.td b/lib/Target/PowerPC/PPCRegisterInfo.td
index 0b529ca..9e15a55 100644
--- a/lib/Target/PowerPC/PPCRegisterInfo.td
+++ b/lib/Target/PowerPC/PPCRegisterInfo.td
@@ -254,6 +254,16 @@ def CTR8 : SPR<9, "ctr">, DwarfRegNum<[66]>;
// VRsave register
def VRSAVE: SPR<256, "VRsave">, DwarfRegNum<[107]>;
+// 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,
+// but this is not achieved by saving and restoring it as with
+// most registers, it has to be done in code; to make this work all the
+// return and call instructions are described as Uses of RM, so instructions
+// that do nothing but change RM will not get deleted.
+// Also, in the architecture it is not really a SPR; 512 is arbitrary.
+def RM: SPR<512, "**ROUNDING MODE**">, DwarfRegNum<[0]>;
+
/// Register classes
// Allocate volatiles first
// then nonvolatiles in reverse order since stmw/lmw save from rN to r31