Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 1 | #include "SparcInternals.h" |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame^] | 2 | #include "llvm/CodeGen/IGNode.h" |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 3 | #include "llvm/Target/Sparc.h" |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame^] | 4 | #include <iostream> |
| 5 | using std::cerr; |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 6 | |
| 7 | //----------------------------------------------------------------------------- |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 8 | // Int Register Class - method for coloring a node in the interference graph. |
| 9 | // |
| 10 | // Algorithm: |
| 11 | // Record the colors/suggested colors of all neighbors. |
| 12 | // |
| 13 | // If there is a suggested color, try to allocate it |
| 14 | // If there is no call interf, try to allocate volatile, then non volatile |
| 15 | // If there is call interf, try to allocate non-volatile. If that fails |
| 16 | // try to allocate a volatile and insert save across calls |
| 17 | // If both above fail, spill. |
| 18 | // |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 19 | //----------------------------------------------------------------------------- |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 20 | void SparcIntRegClass::colorIGNode(IGNode * Node, bool IsColorUsedArr[]) const |
| 21 | { |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 22 | LiveRange * LR = Node->getParentLR(); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 23 | unsigned NumNeighbors = Node->getNumOfNeighbors(); // total # of neighbors |
| 24 | |
| 25 | for(unsigned n=0; n < NumNeighbors; n++) { // for each neigh |
| 26 | IGNode *NeighIGNode = Node->getAdjIGNode(n); |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 27 | LiveRange *NeighLR = NeighIGNode->getParentLR(); |
| 28 | |
| 29 | if( NeighLR->hasColor() ) // if has a color |
| 30 | IsColorUsedArr[ NeighLR->getColor() ] = true; // record that color |
| 31 | |
Ruchira Sasanka | b49865f | 2001-10-19 21:41:16 +0000 | [diff] [blame] | 32 | else if( NeighLR->hasSuggestedColor() ) { |
| 33 | |
| 34 | // if the neighbout can use the suggested color |
| 35 | if( NeighLR-> isSuggestedColorUsable() ) |
| 36 | IsColorUsedArr[ NeighLR->getSuggestedColor() ] = true; |
| 37 | } |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 38 | } |
| 39 | |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 40 | if( DEBUG_RA ) { |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame^] | 41 | cerr << "\nColoring LR [CallInt=" << LR->isCallInterference() <<"]:"; |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 42 | LR->printSet(); |
| 43 | } |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 44 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 45 | if( LR->hasSuggestedColor() ) { |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 46 | |
| 47 | unsigned SugCol = LR->getSuggestedColor(); |
| 48 | |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 49 | if( ! IsColorUsedArr[ SugCol ] ) { |
| 50 | |
Ruchira Sasanka | b49865f | 2001-10-19 21:41:16 +0000 | [diff] [blame] | 51 | if( LR->isSuggestedColorUsable() ) { |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 52 | |
| 53 | // if the suggested color is volatile, we should use it only if |
| 54 | // there are no call interferences. Otherwise, it will get spilled. |
| 55 | |
| 56 | if (DEBUG_RA) |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame^] | 57 | cerr << "\n -Coloring with sug color: " << SugCol; |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 58 | |
| 59 | LR->setColor( LR->getSuggestedColor() ); |
| 60 | return; |
| 61 | } |
| 62 | else if(DEBUG_RA) |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame^] | 63 | cerr << "\n Couldn't alloc Sug col - LR voloatile & calls interf"; |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 64 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 65 | } |
Ruchira Sasanka | 735d6e3 | 2001-10-18 22:38:52 +0000 | [diff] [blame] | 66 | else if ( DEBUG_RA ) { // can't allocate the suggested col |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 67 | cerr << " \n Could NOT allocate the suggested color (already used) "; |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame^] | 68 | LR->printSet(); cerr << "\n"; |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 69 | } |
| 70 | } |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 71 | |
| 72 | unsigned SearchStart; // start pos of color in pref-order |
| 73 | bool ColorFound= false; // have we found a color yet? |
| 74 | |
| 75 | //if this Node is between calls |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 76 | if( ! LR->isCallInterference() ) { |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 77 | |
| 78 | // start with volatiles (we can allocate volatiles safely) |
| 79 | SearchStart = SparcIntRegOrder::StartOfAllRegs; |
| 80 | } |
| 81 | else { |
| 82 | // start with non volatiles (no non-volatiles) |
| 83 | SearchStart = SparcIntRegOrder::StartOfNonVolatileRegs; |
| 84 | } |
| 85 | |
| 86 | unsigned c=0; // color |
| 87 | |
| 88 | // find first unused color |
| 89 | for( c=SearchStart; c < SparcIntRegOrder::NumOfAvailRegs; c++) { |
| 90 | if( ! IsColorUsedArr[ c ] ) { ColorFound = true; break; } |
| 91 | } |
| 92 | |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 93 | if( ColorFound) { |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 94 | LR->setColor(c); // first color found in preffered order |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame^] | 95 | if (DEBUG_RA) cerr << "\n Colored after first search with col " << c ; |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 96 | } |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 97 | |
| 98 | // if color is not found because of call interference |
| 99 | // try even finding a volatile color and insert save across calls |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 100 | // |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 101 | else if( LR->isCallInterference() ) |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 102 | { |
| 103 | // start from 0 - try to find even a volatile this time |
| 104 | SearchStart = SparcIntRegOrder::StartOfAllRegs; |
| 105 | |
| 106 | // find first unused volatile color |
| 107 | for(c=SearchStart; c < SparcIntRegOrder::StartOfNonVolatileRegs; c++) { |
| 108 | if( ! IsColorUsedArr[ c ] ) { ColorFound = true; break; } |
| 109 | } |
| 110 | |
| 111 | if( ColorFound) { |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 112 | LR->setColor(c); |
| 113 | // get the live range corresponding to live var |
| 114 | // since LR span across calls, must save across calls |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 115 | // |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 116 | LR->markForSaveAcrossCalls(); |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame^] | 117 | if(DEBUG_RA) cerr << "\n Colored after SECOND search with col " << c ; |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 118 | } |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 119 | } |
| 120 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 121 | |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 122 | // If we couldn't find a color regardless of call interference - i.e., we |
| 123 | // don't have either a volatile or non-volatile color left |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 124 | // |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 125 | if( !ColorFound ) |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 126 | LR->markForSpill(); // no color found - must spill |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 127 | |
| 128 | |
| 129 | if( DEBUG_RA) |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 130 | UltraSparcRegInfo::printReg( LR ); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 131 | |
| 132 | } |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | //----------------------------------------------------------------------------- |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 140 | // Float Register Class - method for coloring a node in the interference graph. |
| 141 | // |
| 142 | // Algorithm: |
| 143 | // |
| 144 | // If the LR is a double try to allocate f32 - f63 |
| 145 | // If the above fails or LR is single precision |
| 146 | // If the LR does not interfere with a call |
| 147 | // start allocating from f0 |
| 148 | // Else start allocating from f6 |
| 149 | // If a color is still not found because LR interferes with a call |
| 150 | // Search in f0 - f6. If found mark for spill across calls. |
| 151 | // If a color is still not fond, mark for spilling |
| 152 | // |
| 153 | //---------------------------------------------------------------------------- |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 154 | void SparcFloatRegClass::colorIGNode(IGNode * Node,bool IsColorUsedArr[]) const |
| 155 | { |
| 156 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 157 | LiveRange * LR = Node->getParentLR(); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 158 | unsigned NumNeighbors = Node->getNumOfNeighbors(); // total # of neighbors |
| 159 | |
| 160 | for(unsigned n=0; n < NumNeighbors; n++) { // for each neigh |
| 161 | IGNode *NeighIGNode = Node->getAdjIGNode(n); |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 162 | LiveRange *NeighLR = NeighIGNode->getParentLR(); |
| 163 | |
| 164 | if( NeighLR->hasColor() ) { // if neigh has a color |
| 165 | IsColorUsedArr[ NeighLR->getColor() ] = true; // record that color |
| 166 | if( NeighLR->getTypeID() == Type::DoubleTyID ) |
| 167 | IsColorUsedArr[ (NeighLR->getColor()) + 1 ] = true; |
| 168 | } |
| 169 | else if( NeighLR->hasSuggestedColor() ) { // if neigh has sugg color |
Ruchira Sasanka | b49865f | 2001-10-19 21:41:16 +0000 | [diff] [blame] | 170 | |
| 171 | if( NeighLR-> isSuggestedColorUsable() ) { |
| 172 | |
| 173 | // if the neighbout can use the suggested color |
| 174 | |
| 175 | IsColorUsedArr[ NeighLR->getSuggestedColor() ] = true; |
| 176 | if( NeighLR->getTypeID() == Type::DoubleTyID ) |
| 177 | IsColorUsedArr[ (NeighLR->getSuggestedColor()) + 1 ] = true; |
| 178 | } |
| 179 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | } |
| 183 | |
| 184 | |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 185 | // **NOTE: We don't check for call interferences in allocating suggested |
| 186 | // color in this class since ALL registers are volatile. If this fact |
| 187 | // changes, we should change the following part |
| 188 | //- see SparcIntRegClass::colorIGNode() |
| 189 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 190 | if( LR->hasSuggestedColor() ) { |
| 191 | if( ! IsColorUsedArr[ LR->getSuggestedColor() ] ) { |
| 192 | LR->setColor( LR->getSuggestedColor() ); |
| 193 | return; |
| 194 | } |
Ruchira Sasanka | 735d6e3 | 2001-10-18 22:38:52 +0000 | [diff] [blame] | 195 | else if (DEBUG_RA) { // can't allocate the suggested col |
Chris Lattner | 1e23ed7 | 2001-10-15 18:15:27 +0000 | [diff] [blame] | 196 | cerr << " Could NOT allocate the suggested color for LR "; |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame^] | 197 | LR->printSet(); cerr << "\n"; |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 198 | } |
| 199 | } |
| 200 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 201 | |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 202 | int ColorFound = -1; // have we found a color yet? |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 203 | bool isCallInterf = LR->isCallInterference(); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 204 | |
| 205 | // if value is a double - search the double only reigon (f32 - f63) |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 206 | // i.e. we try to allocate f32 - f63 first for doubles since singles |
| 207 | // cannot go there. By doing that, we provide more space for singles |
| 208 | // in f0 - f31 |
| 209 | // |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 210 | if( LR->getTypeID() == Type::DoubleTyID ) |
| 211 | ColorFound = findFloatColor( LR, 32, 64, IsColorUsedArr ); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 212 | |
| 213 | |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 214 | if( ColorFound >= 0 ) { // if we could find a color |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 215 | LR->setColor(ColorFound); |
| 216 | if( DEBUG_RA) UltraSparcRegInfo::printReg( LR ); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 217 | return; |
| 218 | } |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 219 | else { |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 220 | |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 221 | // if we didn't find a color becuase the LR was single precision or |
| 222 | // all f32-f63 range is filled, we try to allocate a register from |
| 223 | // the f0 - f31 region |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 224 | |
| 225 | unsigned SearchStart; // start pos of color in pref-order |
| 226 | |
| 227 | //if this Node is between calls (i.e., no call interferences ) |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 228 | if( ! isCallInterf ) { |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 229 | // start with volatiles (we can allocate volatiles safely) |
| 230 | SearchStart = SparcFloatRegOrder::StartOfAllRegs; |
| 231 | } |
| 232 | else { |
| 233 | // start with non volatiles (no non-volatiles) |
| 234 | SearchStart = SparcFloatRegOrder::StartOfNonVolatileRegs; |
| 235 | } |
| 236 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 237 | ColorFound = findFloatColor( LR, SearchStart, 32, IsColorUsedArr ); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 238 | } |
| 239 | |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 240 | |
| 241 | |
| 242 | if( ColorFound >= 0 ) { // if we could find a color |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 243 | LR->setColor(ColorFound); |
| 244 | if( DEBUG_RA) UltraSparcRegInfo::printReg( LR ); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 245 | return; |
| 246 | } |
Ruchira Sasanka | 0f5e988 | 2001-10-19 17:23:43 +0000 | [diff] [blame] | 247 | else if( isCallInterf ) { |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 248 | |
| 249 | // We are here because there is a call interference and no non-volatile |
| 250 | // color could be found. |
| 251 | // Now try to allocate even a volatile color |
| 252 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 253 | ColorFound = findFloatColor( LR, SparcFloatRegOrder::StartOfAllRegs, |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 254 | SparcFloatRegOrder::StartOfNonVolatileRegs, |
| 255 | IsColorUsedArr); |
| 256 | } |
| 257 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 258 | |
| 259 | |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 260 | if( ColorFound >= 0 ) { |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 261 | LR->setColor(ColorFound); // first color found in preffered order |
| 262 | LR->markForSaveAcrossCalls(); |
| 263 | if( DEBUG_RA) UltraSparcRegInfo::printReg( LR ); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 264 | return; |
| 265 | } |
| 266 | |
Ruchira Sasanka | 9144228 | 2001-09-30 23:16:47 +0000 | [diff] [blame] | 267 | |
| 268 | // we are here because no color could be found |
| 269 | |
| 270 | LR->markForSpill(); // no color found - must spill |
| 271 | if( DEBUG_RA) UltraSparcRegInfo::printReg( LR ); |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 272 | |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | |
| 276 | |
Ruchira Sasanka | d00982a | 2002-01-07 19:20:28 +0000 | [diff] [blame] | 277 | //----------------------------------------------------------------------------- |
| 278 | // Helper method for coloring a node of Float Reg class. |
| 279 | // Finds the first available color in the range [Start,End] depending on the |
| 280 | // type of the Node (i.e., float/double) |
| 281 | //----------------------------------------------------------------------------- |
| 282 | int SparcFloatRegClass::findFloatColor(const LiveRange *const LR, |
| 283 | unsigned Start, |
| 284 | unsigned End, |
| 285 | bool IsColorUsedArr[] ) const { |
| 286 | |
| 287 | bool ColorFound = false; |
| 288 | unsigned c; |
| 289 | |
| 290 | if( LR->getTypeID() == Type::DoubleTyID ) { |
| 291 | |
| 292 | // find first unused color for a double |
| 293 | for( c=Start; c < End ;c+= 2){ |
| 294 | if( ! IsColorUsedArr[ c ] && ! IsColorUsedArr[ c+1 ]) |
| 295 | { ColorFound=true; break; } |
| 296 | } |
| 297 | |
| 298 | } else { |
| 299 | |
| 300 | // find first unused color for a single |
| 301 | for( c=Start; c < End; c++) { |
| 302 | if( ! IsColorUsedArr[ c ] ) { ColorFound=true; break; } |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | if( ColorFound ) return c; |
| 307 | else return -1; |
| 308 | } |
| 309 | |
Ruchira Sasanka | 89fb46b | 2001-09-18 22:52:44 +0000 | [diff] [blame] | 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |