Esempio n. 1
0
 /** Return a string rep of the operand (ie the effective address) */
 public String toString() {
   String addr = (base == null) ? "<0" : "<[" + base + "]";
   if (index != null) {
     addr += "+[" + index;
     switch (scale) {
       case 0:
         addr += "]";
         break;
       case 1:
         addr += "*2]";
         break;
       case 2:
         addr += "*4]";
         break;
       case 3:
         addr += "*8]";
         break;
       default:
         OptimizingCompilerException.UNREACHABLE();
     }
   }
   if (!disp.isZero()) {
     addr += "+" + disp.toInt();
   }
   switch (size) {
     case 1:
       addr += ">B";
       break;
     case 2:
       addr += ">W";
       break;
     case 4:
       addr += ">DW";
       break;
     case 8:
       addr += ">QW";
       break;
     case 16:
       addr += ">PARAGRAPH";
       break;
     default:
       OptimizingCompilerException.UNREACHABLE();
   }
   if (loc != null && guard != null) {
     addr += " (" + loc + ", " + guard + ")";
   } else if (loc != null) {
     addr += " (" + loc + ")";
   } else if (guard != null) {
     addr += " (" + guard + ")";
   }
   return addr;
 }
  /** Is a specified condition operand 'safe' to transfer into an FCMP instruction? */
  private boolean fpConditionOK(ConditionOperand c) {
    // FCOMI sets ZF, PF, and CF as follows:
    // Compare Results      ZF     PF      CF
    // left > right          0      0       0
    // left < right          0      0       1
    // left == right         1      0       0
    // UNORDERED             1      1       1
    switch (c.value) {
      case ConditionOperand.CMPL_EQUAL:
        return false; // (ZF == 1) but ordered
      case ConditionOperand.CMPL_NOT_EQUAL:
        return false; // (ZF == 0) but unordered
      case ConditionOperand.CMPG_LESS:
        return false; // (CF == 1) but ordered
      case ConditionOperand.CMPG_GREATER_EQUAL:
        return false; // (CF == 0) but unordered
      case ConditionOperand.CMPG_LESS_EQUAL:
        return false; // (CF == 1 || ZF == 1) but ordered
      case ConditionOperand.CMPG_GREATER:
        return false; // (CF == 0 && ZF == 0) but unordered

      case ConditionOperand.CMPL_GREATER:
        return true; // (CF == 0 && ZF == 0) and ordered
      case ConditionOperand.CMPL_LESS_EQUAL:
        return true; // (CF == 1 || ZF == 1) and unordered
      case ConditionOperand.CMPL_GREATER_EQUAL:
        return true; // (CF == 0) and ordered
      case ConditionOperand.CMPL_LESS:
        return true; // (CF == 1) and unordered
      default:
        OptimizingCompilerException.UNREACHABLE();
        return false; // keep jikes happy
    }
  }
Esempio n. 3
0
 /**
  * Get a constructor object for this compiler phase
  *
  * @return exception/null as this phase can't be created
  */
 public Constructor<CompilerPhase> getClassConstructor() {
   OptimizingCompilerException.UNREACHABLE();
   return null;
 }