-void CodeEmitterGen::emitInstrOpBits(std::ostream &o,
- const std::vector<RecordVal> &Vals,
- std::map<std::string, unsigned> &OpOrder,
- std::map<std::string, bool> &OpContinuous)
-{
- for (unsigned f = 0, e = Vals.size(); f != e; ++f) {
- if (Vals[f].getPrefix()) {
- BitsInit *FieldInitializer = (BitsInit*)Vals[f].getValue();
-
- // Scan through the field looking for bit initializers of the current
- // variable...
- for (int i = FieldInitializer->getNumBits()-1; i >= 0; --i) {
- Init *I = FieldInitializer->getBit(i);
- if (BitInit *BI = dynamic_cast<BitInit*>(I)) {
- DEBUG(o << " // bit init: f: " << f << ", i: " << i << "\n");
- } else if (UnsetInit *UI = dynamic_cast<UnsetInit*>(I)) {
- DEBUG(o << " // unset init: f: " << f << ", i: " << i << "\n");
- } else if (VarBitInit *VBI = dynamic_cast<VarBitInit*>(I)) {
- TypedInit *TI = VBI->getVariable();
- if (VarInit *VI = dynamic_cast<VarInit*>(TI)) {
- // If the bits of the field are laid out consecutively in the
- // instruction, then instead of separately ORing in bits, just
- // mask and shift the entire field for efficiency.
- if (OpContinuous[VI->getName()]) {
- // already taken care of in the loop above, thus there is no
- // need to individually OR in the bits
+void CodeEmitterGen::reverseBits(std::vector<Record*> &Insts) {
+ for (std::vector<Record*>::iterator I = Insts.begin(), E = Insts.end();
+ I != E; ++I) {
+ Record *R = *I;
+ if (R->getName() == "PHI" ||
+ R->getName() == "INLINEASM" ||
+ R->getName() == "DBG_LABEL" ||
+ R->getName() == "EH_LABEL" ||
+ R->getName() == "GC_LABEL" ||
+ R->getName() == "DECLARE" ||
+ R->getName() == "EXTRACT_SUBREG" ||
+ R->getName() == "INSERT_SUBREG" ||
+ R->getName() == "IMPLICIT_DEF" ||
+ R->getName() == "SUBREG_TO_REG") continue;
+
+ BitsInit *BI = R->getValueAsBitsInit("Inst");