From 7fa84b70c330168292f36f2757b466e288a9189f Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Wed, 9 Jun 2004 21:54:59 +0000 Subject: [PATCH] Encode %fsr correctly; don't fail an assertion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14103 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SparcV9/SparcV9CodeEmitter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp index 54cbab49b4d..4f4f0b3b915 100644 --- a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp +++ b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp @@ -527,6 +527,15 @@ SparcV9CodeEmitter::getRealRegNum(unsigned fakeReg, DEBUG(std::cerr << "FP CC reg: " << fakeReg << "\n"); return fakeReg; } + case SparcV9RegInfo::SpecialRegClassID: { + // Currently only "special" reg is %fsr, which is encoded as 1 in + // instructions and 0 in SparcV9SpecialRegClass. + static const unsigned SpecialReg[] = { 1 }; + assert(fakeReg < sizeof(SpecialReg)/sizeof(SpecialReg[0]) + && "Special register out of bounds for SpecialReg map"); + DEBUG(std::cerr << "Special reg: " << SpecialReg[fakeReg] << "\n"); + return SpecialReg[fakeReg]; + } default: assert(0 && "Invalid unified register number in getRealRegNum"); return fakeReg;