-// Float Register Class
-//-----------------------------------------------------------------------------
-
-// find the first available color in the range [Start,End] depending on the
-// type of the Node (i.e., float/double)
-
-int SparcFloatRegClass::findFloatColor(const LiveRange *const LR,
- unsigned Start,
- unsigned End,
- bool IsColorUsedArr[] ) const
-{
-
- bool ColorFound = false;
- unsigned c;
-
- if( LR->getTypeID() == Type::DoubleTyID ) {
-
- // find first unused color for a double
- for( c=Start; c < End ;c+= 2){
- if( ! IsColorUsedArr[ c ] && ! IsColorUsedArr[ c+1 ])
- { ColorFound=true; break; }
- }
-
- } else {
-
- // find first unused color for a single
- for( c=Start; c < End; c++) {
- if( ! IsColorUsedArr[ c ] ) { ColorFound=true; break; }
- }
- }
-
- if( ColorFound ) return c;
- else return -1;
-}
-
-
-
-
-
-void SparcFloatRegClass::colorIGNode(IGNode * Node,bool IsColorUsedArr[]) const
-{
-
- /* Algorithm:
-
- If the LR is a double try to allocate f32 - f63
- If the above fails or LR is single precision
- If the LR does not interfere with a call
- start allocating from f0
- Else start allocating from f6
- If a color is still not found because LR interferes with a call
- Search in f0 - f6. If found mark for spill across calls.
- If a color is still not fond, mark for spilling
- */
-
-
- LiveRange * LR = Node->getParentLR();
+// Float Register Class - method for coloring a node in the interference graph.
+//
+// Algorithm:
+//
+// If the LR is a double try to allocate f32 - f63
+// If the above fails or LR is single precision
+// If the LR does not interfere with a call
+// start allocating from f0
+// Else start allocating from f6
+// If a color is still not found because LR interferes with a call
+// Search in f0 - f6. If found mark for spill across calls.
+// If a color is still not fond, mark for spilling
+//
+//----------------------------------------------------------------------------
+void SparcFloatRegClass::colorIGNode(IGNode * Node,
+ vector<bool> &IsColorUsedArr) const{
+ LiveRange *LR = Node->getParentLR();
+
+ // Mark the second color for double-precision registers:
+ // This is UGLY and should be merged into nearly identical code
+ // in RegClass::colorIGNode that handles the first color.
+ //