harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chunr...@apache.org
Subject svn commit: r706374 [1/2] - in /harmony/enhanced/drlvm/trunk/vm: jitrino/src/codegenerator/ia32/ jitrino/src/jet/ jitrino/src/optimizer/ jitrino/src/shared/ port/src/encoder/ia32_em64t/ vmcore/src/lil/em64t/ vmcore/src/lil/ia32/ vmcore/src/thread/helpe...
Date Mon, 20 Oct 2008 19:18:03 GMT
Author: chunrong
Date: Mon Oct 20 12:18:01 2008
New Revision: 706374

URL: http://svn.apache.org/viewvc?rev=706374&view=rev
Log:
Rolling back r673297 and r672239, since some specjvm2008 failures are observed, while re-opening HARMONY-5037

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CopyExpansion.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32EarlyPropagation.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc2.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc3.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h
    harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h
    harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_defs.h
    harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_prvt.h
    harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_tabl.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/encoder.h
    harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/encoder.inl
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/em64t/lil_code_generator_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/em64t/m2n_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/lil_code_generator_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/m2n_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/stack_iterator_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/helpers/thread_helpers_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp Mon Oct 20 12:18:01 2008
@@ -939,9 +939,7 @@
 
     if(srcType != dstType) {
 #ifdef _EM64T_
-        Opnd* aux = irm->newOpnd(irm->getTypeManager().getUInt32Type());
-        node->appendInst(irm->newCopyPseudoInst(Mnemonic_MOV, aux, src));
-        node->appendInst(irm->newInstEx(Mnemonic_MOVZX, 1, dst, aux));
+        node->appendInst(irm->newInstEx(Mnemonic_MOVZX, 1, dst, src));
 #else
         node->appendInst(irm->newCopyPseudoInst(Mnemonic_MOV, dst, src));
 #endif

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.cpp Mon Oct 20 12:18:01 2008
@@ -102,7 +102,6 @@
 Constraint Constraint::getAliasConstraint(OpndSize s, U_32 offset)const
 {
     OpndSize sz=(OpndSize)size;
-    OpndExt e = (OpndExt)ext;
     if (s==OpndSize_Default){
         s=getDefaultSize(kind);
         if (s==OpndSize_Any)
@@ -135,7 +134,7 @@
         newMask=mask;
     }
     if (newMask==0) newKind&=~OpndKind_Reg;
-    return newKind==OpndKind_Null?Constraint():Constraint( (OpndKind)newKind, s, e, newMask);
+    return newKind==OpndKind_Null?Constraint():Constraint( (OpndKind)newKind, s, newMask);
 }
 
 //_________________________________________________________________________________________________
@@ -182,7 +181,7 @@
 RegName Constraint::getAliasRegName(RegName regName, U_32 offset)const
 {
     RegName rn=getAliasRegName(regName, (OpndSize)size, offset);
-    return contains(Constraint(rn,(OpndExt)ext))?rn:RegName_Null;
+    return contains(rn)?rn:RegName_Null;
 }
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.h?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Constraint.h Mon Oct 20 12:18:01 2008
@@ -72,7 +72,7 @@
     For OpndKind_Reg and sub-kinds initializes the mask field to 0xffff
     */
     Constraint(OpndKind k)
-        :mask(OpndKind_Reg&k?0xffff:0), size(OpndSize_Any), ext(OpndExt_Any), kind(k)
+        :mask(OpndKind_Reg&k?0xffff:0), size(OpndSize_Any), kind(k)
     { assert(k!=OpndKind_Null); }
 
     /** Creates a constraint of the specified OpndKind k and OpndSize s
@@ -82,27 +82,17 @@
     If k contains OpndKind_Reg the constructor initializes the mask field to 0xffff
     */
     Constraint(OpndKind k, OpndSize s)
-        :mask(OpndKind_Reg&k?0xffff:0), size(s), ext(OpndExt_Any), kind(k)
+        :mask(OpndKind_Reg&k?0xffff:0), size(s), kind(k)
     { assert(k!=OpndKind_Null && size!=OpndSize_Null); }
 
-    /** Creates a constraint of the specified OpndKind k, OpndSize s and OpndExt e
-
-    Both k and s cannot be _Null.
-
-    If k contains OpndKind_Reg the constructor initializes the mask field to 0xffff
-    */
-    Constraint(OpndKind k, OpndSize s, OpndExt e)
-        :mask(OpndKind_Reg&k?0xffff:0), size(s), ext(e), kind(k)
-    { assert(k!=OpndKind_Null && size!=OpndSize_Null); }
-
-    /** Creates a constraint of the specified OpndKind, OpndSize, OpndExt and register mask m
+    /** Creates a constraint of the specified OpndKind, OpndSize, and register mask m
 
     Both k and s cannot be _Null, and k must contain be OpndKind_Reg if mask is not null
 
     For OpndKind_Reg and sub-kinds initializes the mask field to 0xffff
     */
-    Constraint(OpndKind k, OpndSize s, OpndExt e, U_32 m)
-        :mask(m), size(s), ext(e), kind(k)
+    Constraint(OpndKind k, OpndSize s, U_32 m)
+        :mask(m), size(s), kind(k)
     {   assert(k!=OpndKind_Null && size!=OpndSize_Null); assert(mask==0||(OpndKind_Reg&k)!=0);  }
 
     /** Creates a constraint corresponding to the specified physical register RegName
@@ -113,8 +103,8 @@
 
     The mask field of the constraint is initialized to the mask corresponding to the specified register
     */
-    Constraint(RegName reg, OpndExt e = OpndExt_Any)
-        :mask(getRegMask(reg)), size(getRegSize(reg)), ext(e), kind(getRegKind(reg)) {}
+    Constraint(RegName reg)
+        :mask(getRegMask(reg)), size(getRegSize(reg)), kind(getRegKind(reg)) {}
 
     
     Constraint(const char * str){ fullValue = 0; str=parse(str); assert(str!=NULL); }
@@ -129,12 +119,6 @@
     /** returns the mask field of the constraint */
     U_32 getMask()const{ return mask; }
 
-    /** returns the ext field of the constraint */
-    OpndExt getExt()const {return (OpndExt)ext; }
-    
-    /** sets the ext field of the constraint */
-    void setExt(U_32 e){ext=e; }
-    
     /** sets the mask field of the constraint */
     void setMask(U_32 m){ mask=m; }
 
@@ -233,8 +217,7 @@
     union{
         struct {
             U_32  mask:16;
-            U_32  size:6;
-            U_32  ext:2;
+            U_32  size:8;
             U_32  kind:8;
         };
         U_32  fullValue;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CopyExpansion.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CopyExpansion.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CopyExpansion.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CopyExpansion.cpp Mon Oct 20 12:18:01 2008
@@ -409,7 +409,7 @@
                         if (toOpnd == fromOpnd){
                             continue;
                         } else if (toOpnd->isPlacedIn(OpndKind_Reg) && fromOpnd->isPlacedIn(OpndKind_Reg)){
-                            if ( equals(toOpnd->getRegName(),fromOpnd->getRegName()) )
+                            if (toOpnd->getRegName()==fromOpnd->getRegName())
                                 continue;
                         }else{
 #ifdef _EM64T_

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32EarlyPropagation.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32EarlyPropagation.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32EarlyPropagation.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32EarlyPropagation.cpp Mon Oct 20 12:18:01 2008
@@ -62,9 +62,6 @@
 static bool isTypeConversionAllowed(Opnd* fromOpnd, Opnd* toOpnd) {
     Type * fromType = fromOpnd->getType();
     Type * toType = toOpnd->getType();
-    if (fromType->isFloatingPoint() != toType->isFloatingPoint()) {
-        return false;
-    }
     bool fromIsGCType = fromType->isObject() || fromType->isManagedPtr();
     bool toIsGCType = toType->isObject() || toType->isManagedPtr();
     return fromIsGCType == toIsGCType;
@@ -156,17 +153,8 @@
                     U_32 defOpndId = defOpnd->getId();
                     OpndInfo * opndInfo = opndInfos + defOpndId;
                     bool instHandled=false;
-                    bool typeConvOk = srcOpnd->getSize() == defOpnd->getSize() && isTypeConversionAllowed(srcOpnd, defOpnd);
-                    bool kindsAreOk = true;
-                    // this is caused by the fact that FPReg and XMMReg can not be merged in the same Constraint
-                    // there might be a problem with replacing operads of different reg kinds
-                    // if src and def has different reg kinds the inst must be skipped
-                    if(srcOpnd->canBePlacedIn(OpndKind_FPReg) || defOpnd->canBePlacedIn(OpndKind_FPReg)) {
-                        Constraint srcConstr = srcOpnd->getConstraint(Opnd::ConstraintKind_Calculated);
-                        Constraint defConstr = defOpnd->getConstraint(Opnd::ConstraintKind_Calculated);
-                        kindsAreOk = ! (srcConstr&defConstr).isNull();
-                    }
-                    if (typeConvOk && kindsAreOk && opndInfo->defCount == 1 && ! srcOpnd->isPlacedIn(OpndKind_Reg)){
+                    bool typeConvOk = isTypeConversionAllowed(srcOpnd, defOpnd);
+                    if (typeConvOk && opndInfo->defCount == 1 && ! srcOpnd->isPlacedIn(OpndKind_Reg)){
                         if (!defOpnd->hasAssignedPhysicalLocation()){
                             opndInfo->sourceInst = inst;
                             opndInfo->sourceOpndId = srcOpnd->getId();

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp Mon Oct 20 12:18:01 2008
@@ -99,16 +99,16 @@
     switch(regKind) {
     case OpndKind_GPReg:
         return Constraint(OpndKind_GPReg, 
-                          Constraint::getDefaultSize(OpndKind_GPReg), OpndExt_None, 0xff);
+                          Constraint::getDefaultSize(OpndKind_GPReg), 0xff);
     case OpndKind_XMMReg:
         return Constraint(OpndKind_XMMReg,
-                          Constraint::getDefaultSize(OpndKind_XMMReg), OpndExt_None, 0xff);
+                          Constraint::getDefaultSize(OpndKind_XMMReg), 0xff);
     case OpndKind_FPReg:
         return Constraint(OpndKind_FPReg,
-                          Constraint::getDefaultSize(OpndKind_FPReg), OpndExt_None, 0x1);
+                          Constraint::getDefaultSize(OpndKind_FPReg), 0x1);
     case OpndKind_StatusReg:
         return Constraint(OpndKind_StatusReg,
-                        Constraint::getDefaultSize(OpndKind_StatusReg), OpndExt_None, 0x1);
+                        Constraint::getDefaultSize(OpndKind_StatusReg), 0x1);
     default: 
         break;
     }
@@ -129,6 +129,14 @@
 };
 
 //_________________________________________________________________________________________________
+bool Encoder::matches(Constraint co, Constraint ci, U_32 opndRoles,
+                      bool allowAliases)
+{
+    return co.isNull() || !(ci&co).isNull() || 
+        (allowAliases && !(ci.getAliasConstraint(co.getSize())&co).isNull());
+}
+
+//_________________________________________________________________________________________________
 const Encoder::OpcodeGroup * 
 Encoder::findOpcodeGroup(const FindInfo& fi)
 {
@@ -169,7 +177,11 @@
         }
     }
     for (U_32 i = 0, n = fi.opndCount; i < n; i++) {
-        Constraint co = fi.opndConstraints[i];
+        U_32 idx = fi.isExtended ? og->extendedToNativeMap[i] : i;
+        Constraint co=fi.opndConstraints[idx];
+        if (any) {
+            co = Constraint(OpndKind_Any, co.getSize());
+        }
         if (!isOpndAllowed(og, i, co, fi.isExtended, any))
             return false;
     }
@@ -177,29 +189,6 @@
 }
 
 //_________________________________________________________________________________________________
-bool Encoder::matches(Constraint co, Constraint ci)
-{
-    Constraint cc = ci&co;   
-    return  co.isNull() || ( !cc.isNull() && EncoderBase::extAllowed(co.getExt(),ci.getExt()) );
-}
-
-Constraint
-Encoder::expandImmediate(Constraint co) {
-    assert(co.getKind() == OpndKind_Imm);
-    OpndSize newSize = OpndSize_Null; 
-    switch (co.getSize()) {
-    case OpndSize_8:
-        newSize = OpndSize_16;
-        break;
-    case OpndSize_16:
-        newSize = OpndSize_32;
-        break;
-    default:;
-    }
-    return newSize == OpndSize_Null ? Constraint() :
-        Constraint((OpndKind)co.getKind(), newSize, co.getExt(), co.getMask());
-}
-//_________________________________________________________________________________________________
 bool 
 Encoder::isOpndAllowed(const Encoder::OpcodeGroup * og, U_32 i, Constraint co, bool isExtended, bool any)
 {
@@ -208,22 +197,10 @@
 
         Constraint ci=og->opndConstraints[idx];
 
-        assert(!ci.isNull());
-        
-        // Strict matching
-        if (matches(co, ci)) {
-            return true;
-        }
-        
-        // Try to match with extended immediate.
-        if (any && co.getKind() == OpndKind_Imm) {
-            while (!(co = expandImmediate(co)).isNull()) {
-                if (matches(co, ci)) {
-                    return true;
-                }
-            }
+        if (!matches(co, ci, Encoder::getOpndRoles(og->opndRoles,idx), any && (!(Encoder::getOpndRoles(og->opndRoles,idx)&Inst::OpndRole_Def) || getBaseConditionMnemonic(og->mnemonic) == Mnemonic_SETcc))) {
+            return false;
         }
-        return false;
+        return true;
 }
 
 //_________________________________________________________________________________________________
@@ -242,12 +219,11 @@
         const Opnd * p = opnds[idx];
         Constraint c = p->getConstraint(Opnd::ConstraintKind_Location);
 
-        OpndExt ext = p->getConstraint(Opnd::ConstraintKind_Calculated).getExt();
         OpndSize sz = inst->opcodeGroup->opndConstraints[args.count()].getSize();
     
         switch( c.getKind() ) {
         case OpndKind_Imm:
-            args.add(EncoderBase::Operand(sz, p->getImmValue(), ext));
+            args.add(EncoderBase::Operand(sz, p->getImmValue()));
             break;
         case OpndKind_Mem:
             {
@@ -286,8 +262,7 @@
                     baseReg,
                     indexReg,
                     NULL == pscale ? 0 : (unsigned char)pscale->getImmValue(),
-                    disp,
-                    ext);
+                    disp);
                 args.add( o );
                 // Emit prefix here - so it relates to the real instruction
                 // emitted alter, rather that to the hidden MOV inserted above
@@ -305,7 +280,7 @@
             // with different size
             RegName reg = Constraint::getAliasRegName(opndReg, sz);
             assert(reg != RegName_Null);
-            args.add(EncoderBase::Operand(reg,ext));
+            args.add(EncoderBase::Operand(reg));
             }
             break;
         }
@@ -354,8 +329,8 @@
         if(!((Constraint)og.opndConstraints[j]).canBeMergedWith(od.opndConstraints[j]))
             return false;
 
-        Constraint ogConstr = ((Constraint)og.opndConstraints[j]).intersectWith(Constraint((OpndKind)(OpndKind_Reg|OpndKind_Imm), OpndSize_Any, OpndExt_Any, 0xFFFF));
-        Constraint odConstr = ((Constraint)od.opndConstraints[j]).intersectWith(Constraint((OpndKind)(OpndKind_Reg|OpndKind_Imm), OpndSize_Any, OpndExt_Any, 0xFFFF));
+        Constraint ogConstr = ((Constraint)og.opndConstraints[j]).intersectWith(Constraint((OpndKind)(OpndKind_Reg|OpndKind_Imm),OpndSize_Any,0xFFFF));
+        Constraint odConstr = ((Constraint)od.opndConstraints[j]).intersectWith(Constraint((OpndKind)(OpndKind_Reg|OpndKind_Imm),OpndSize_Any,0xFFFF));
 
         Constraint::CompareResult compareResult = ogConstr.compare(odConstr);
 
@@ -444,14 +419,12 @@
     for (unsigned k=0; k<od.opndRoles.count; k++) {
         if (opcode->opnds[k].reg != RegName_Null) {
             // exact Register specified
-            od.opndConstraints[k] = Constraint(opcode->opnds[k].reg, opcode->opnds[k].ext);
+            od.opndConstraints[k] = Constraint(opcode->opnds[k].reg);
         }
         else {
-            od.opndConstraints[k] = Constraint(
-                opcode->opnds[k].kind, 
-                opcode->opnds[k].size == OpndSize_Null ? OpndSize_Any : opcode->opnds[k].size,
-                opcode->opnds[k].ext
-            );
+            od.opndConstraints[k] = Constraint(opcode->opnds[k].kind, 
+                opcode->opnds[k].size == OpndSize_Null ? 
+                                        OpndSize_Any : opcode->opnds[k].size);
         }
     }
 }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.h?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.h Mon Oct 20 12:18:01 2008
@@ -68,8 +68,7 @@
         const OpcodeGroup * opcodeGroup;
     };
 
-    static bool matches(Constraint co, Constraint ci);
-    static Constraint expandImmediate(Constraint co);
+    static bool matches(Constraint co, Constraint ci, U_32 opndRoles, bool allowAliases);
     static const OpcodeGroup* findOpcodeGroup(const FindInfo& fi);
     static bool matches(const OpcodeGroup* og, const FindInfo& fi, bool any);
     static bool isOpndAllowed(const Encoder::OpcodeGroup * og, U_32 i, Constraint co, bool isExtended, bool any);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp Mon Oct 20 12:18:01 2008
@@ -338,7 +338,7 @@
 }
 
 I_32 GCSafePointsInfo::getOffsetFromImmediate(Opnd* offsetOpnd) const {
-    if (offsetOpnd->isPlacedIn(OpndKind_Imm)) {
+    if (offsetOpnd->isPlacedIn(OpndKind_Immediate)) {
         if (offsetOpnd->getImmValue() == 0 && offsetOpnd->getRuntimeInfo()!=NULL) {
             irm.resolveRuntimeInfo(offsetOpnd);
         }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp Mon Oct 20 12:18:01 2008
@@ -1122,7 +1122,6 @@
     Opnd* temp_hi = irManager->newOpnd(int32type);
     Opnd* zero = irManager->newImmOpnd(int32type, 0);
     Opnd* one = irManager->newImmOpnd(int32type, 1);
-    Opnd* one8 = irManager->newImmOpnd(tm.getInt8Type(), 1);
     //
 
     newSubGFG();
@@ -1283,10 +1282,10 @@
                             // ^^^divisor now in edi:ebx and ecx:esi
 
                             // shift both divisor and dividend right on 1 bit
-    /* shr edx, 1       */  newInst(Mnemonic_SHR, edx, one8);
-    /* rcr eax, 1       */  newInst(Mnemonic_RCR, eax, one8);
-    /* ror edi, 1       */  newInst(Mnemonic_ROR, edi, one8);
-    /* rcr ebx, 1       */  newInst(Mnemonic_RCR, ebx, one8);
+    /* shr edx, 1       */  newInst(Mnemonic_SHR, edx, one);
+    /* rcr eax, 1       */  newInst(Mnemonic_RCR, eax, one);
+    /* ror edi, 1       */  newInst(Mnemonic_ROR, edi, one);
+    /* rcr ebx, 1       */  newInst(Mnemonic_RCR, ebx, one);
 
     //
     // FIXME: workarounding WebMaker problem, which does not like 
@@ -1314,18 +1313,14 @@
     /* shrd eax, edx, CL*/  newInst(Mnemonic_SHRD, eax, edx, ecx);
     /* shr  edx, CL   */    newInst(Mnemonic_SHR, edx, ecx);
 #else
-//    Opnd* trueECX = irManager->getRegOpnd(RegName_ECX);
-    Opnd* trueECX   = irManager->newOpnd(tm.getInt32Type()/*, Constraint(RegName_ECX)*/);
+    Opnd* trueECX = irManager->getRegOpnd(RegName_ECX);
     newInst(Mnemonic_MOV, trueECX, ecx);
-//    Opnd* ecxCL   = irManager->getRegOpnd(RegName_CL);
-    Opnd* ecxCL   = irManager->newOpnd(tm.getInt8Type(), Constraint(RegName_CL));
-    newInst(Mnemonic_MOV, ecxCL, trueECX);
     //~FIXME
-    /* shrd ebx, edi, CL*/  newInst(Mnemonic_SHRD, ebx, edi, ecxCL);
-    /* shrd eax, edx, CL*/  newInst(Mnemonic_SHRD, eax, edx, ecxCL);
-    /* shr  edx, CL   */    newInst(Mnemonic_SHR, edx, ecxCL);
+    /* shrd ebx, edi, CL*/  newInst(Mnemonic_SHRD, ebx, edi, trueECX);
+    /* shrd eax, edx, CL*/  newInst(Mnemonic_SHRD, eax, edx, trueECX);
+    /* shr  edx, CL   */    newInst(Mnemonic_SHR, edx, trueECX);
 #endif
-    /* rol  edi, 1    */    newInst(Mnemonic_ROL, edi, one8);
+    /* rol  edi, 1    */    newInst(Mnemonic_ROL, edi, one);
                             // get quotient
     /* div    ebx     */    newInst(Mnemonic_DIV, 2, edx, eax, edx, eax, ebx, NULL);
     /* mov ebx, temp_lo*/   newInst(Mnemonic_MOV, ebx, temp_lo);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp Mon Oct 20 12:18:01 2008
@@ -96,7 +96,7 @@
 //_____________________________________________________________________________________________
 Opnd * IRManager::newOpnd(Type * type, Constraint c)
 {
-    c.intersectWith(Constraint(OpndKind_Any, getTypeSize(type), extByType(type->tag)));
+    c.intersectWith(Constraint(OpndKind_Any, getTypeSize(type)));
     assert(!c.isNull());
     Opnd * opnd=new(memoryManager) Opnd(opndId++, type, c);
     addOpnd(opnd);
@@ -234,7 +234,7 @@
 //_____________________________________________________________________________________________
 Opnd * IRManager::newRegOpnd(Type * type, RegName reg)
 {
-    Opnd * opnd = newOpnd(type, Constraint(getRegKind(reg), OpndSize_Any, extByType(type->tag)));
+    Opnd * opnd = newOpnd(type, Constraint(getRegKind(reg)));
     opnd->assignRegName(reg);
     return opnd;
 }
@@ -297,16 +297,14 @@
 //_____________________________________________________________________________________________
 Constraint IRManager::createInitialConstraint(Type::Tag t)const
 {
-    OpndSize sz = getTypeSize(t);
-    OpndExt ext = extByType(t); 
-    
+    OpndSize sz=getTypeSize(t);
     if (t==Type::Single||t==Type::Double||t==Type::Float)
-        return Constraint(OpndKind_XMMReg, sz, ext)|Constraint(OpndKind_Mem, sz, ext);
+        return Constraint(OpndKind_XMMReg, sz)|Constraint(OpndKind_Mem, sz);
     if (sz<=Constraint::getDefaultSize(OpndKind_GPReg))
-        return Constraint(OpndKind_GPReg, sz, ext)|Constraint(OpndKind_Mem, sz, ext)|Constraint(OpndKind_Imm, sz, ext);
+        return Constraint(OpndKind_GPReg, sz)|Constraint(OpndKind_Mem, sz)|Constraint(OpndKind_Imm, sz);
     if (sz==OpndSize_64)
-        return Constraint(OpndKind_Mem, sz, ext)|Constraint(OpndKind_Imm, sz, ext); // imm before lowering
-    return Constraint(OpndKind_Memory, sz, ext);
+        return Constraint(OpndKind_Mem, sz)|Constraint(OpndKind_Imm, sz); // imm before lowering
+    return Constraint(OpndKind_Memory, sz);
 }
 
 //_____________________________________________________________________________________________
@@ -1019,25 +1017,10 @@
 
     assert(tmpRegName!=RegName_Null);
     Opnd * tmp=getRegOpnd(tmpRegName);
-
-    if(sourceOpnd->getSize() != targetOpnd->getSize()) {
-        assert(sourceOpnd->getSize() > targetOpnd->getSize());
-        tmpRegName = getAliasReg(tmpRegName,targetOpnd->getSize());
-        assert(tmpRegName!=RegName_Null);
-        Opnd* shortSrc = newMemOpnd(targetOpnd->getType(),
-                                    sourceOpnd->getMemOpndKind(),
-                                    sourceOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Base),
-                                    sourceOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Index),
-                                    sourceOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Scale),
-                                    sourceOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement),
-                                    sourceOpnd->getSegReg());
-        appendToInstList(instList, newCopyPseudoInst(Mnemonic_MOV, shortSrc, sourceOpnd));
-        sourceOpnd = shortSrc;
-    }
-
     Opnd * tmpAdjusted=newRegOpnd(targetOpnd->getType(), tmpRegName);
     Opnd * tmpRegStackOpnd = newMemOpnd(tmp->getType(), MemOpndKind_StackAutoLayout, getRegOpnd(STACK_REG), 0); 
 
+
     if (unusedTmpRegName==RegName_Null)
         appendToInstList(instList, newInst(Mnemonic_MOV, tmpRegStackOpnd, tmp));
 
@@ -1067,23 +1050,21 @@
     }
 
     OpndSize sourceSize=sourceConstraint.getSize();
-    OpndSize targetSize=targetConstraint.getSize();
     U_32 sourceByteSize=getByteSize(sourceSize);
+    OpndKind targetKind=(OpndKind)targetConstraint.getKind();
+    OpndKind sourceKind=(OpndKind)sourceConstraint.getKind();
 
 #if defined(_DEBUG) || !defined(_EM64T_)
+    OpndSize targetSize=targetConstraint.getSize();
     assert(targetSize<=sourceSize); // only same size or truncating conversions are allowed
 #endif
 
-    if (targetOpnd->isPlacedIn(OpndKind_Reg)) {
-        if(sourceOpnd->isPlacedIn(OpndKind_Imm)
-            && sourceOpnd->getImmValue()==0
-            && targetOpnd->isPlacedIn(OpndKind_GPReg)
-            && !sourceOpnd->getRuntimeInfo()
-            && !(getRegMask(RegName_EFLAGS)&flagsRegUsageMask)) {
-                return newInst(Mnemonic_XOR,targetOpnd, targetOpnd);
+    if (targetKind&OpndKind_Reg) {
+        if(sourceOpnd->isPlacedIn(OpndKind_Imm) && sourceOpnd->getImmValue()==0 && targetKind==OpndKind_GPReg && 
+            !sourceOpnd->getRuntimeInfo() && !(getRegMask(RegName_EFLAGS)&flagsRegUsageMask)) {
+            return newInst(Mnemonic_XOR,targetOpnd, targetOpnd);
         }
-        else if (targetOpnd->isPlacedIn(OpndKind_XMMReg)
-            && sourceOpnd->getMemOpndKind()==MemOpndKind_ConstantArea) {
+        else if (targetKind==OpndKind_XMMReg && sourceOpnd->getMemOpndKind()==MemOpndKind_ConstantArea) {
 #ifdef _EM64T_
             Opnd * addr = NULL;
             Opnd * base = sourceOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Base);
@@ -1124,10 +1105,10 @@
         }
     }
 
-    if ( targetOpnd->isPlacedIn(OpndKind_GPReg_Mem) && 
-         (sourceOpnd->isPlacedIn(OpndKind_GPReg_Mem) || sourceOpnd->isPlacedIn(OpndKind_Imm))
+    if ( (targetKind==OpndKind_GPReg||targetKind==OpndKind_Mem) && 
+         (sourceKind==OpndKind_GPReg||sourceKind==OpndKind_Mem||sourceKind==OpndKind_Imm)
     ){
-        if (sourceOpnd->isPlacedIn(OpndKind_Mem) && targetOpnd->isPlacedIn(OpndKind_Mem)){
+        if (sourceKind==OpndKind_Mem && targetKind==OpndKind_Mem){
             Inst * instList=NULL;
 #ifndef _EM64T_
             U_32 targetByteSize=getByteSize(targetSize);
@@ -1155,88 +1136,47 @@
             return instList;
         }else{
 #ifdef _EM64T_
-            if((targetOpnd->getMemOpndKind() == MemOpndKind_StackAutoLayout)
-                && (sourceOpnd->isPlacedIn(OpndKind_Imm)) && (sourceOpnd->getSize() == OpndSize_64)) 
+            if((targetOpnd->getMemOpndKind() == MemOpndKind_StackAutoLayout) && (sourceKind==OpndKind_Imm) && (sourceOpnd->getSize() == OpndSize_64)) 
                 return newMemMovSequence(targetOpnd, sourceOpnd, regUsageMask, false);
             else 
 #else
             assert(sourceByteSize<=4);
 #endif
-            if (sourceSize != targetSize) {
-                if (sourceOpnd->isPlacedIn(OpndKind_Imm)) {
-                    sourceOpnd = newImmOpnd(targetOpnd->getType(),sourceOpnd->getImmValue());
-                } else if (sourceOpnd->isPlacedIn(OpndKind_Reg)) {
-                    if (/*sourceSize == OpndSize_32 && */sourceOpnd->getType()->isInteger() 
-                        //&& targetOpnd->getType()->isInteger()
-#ifdef _EM64T_
-                        || ( sourceSize == OpndSize_64 
-                             && sourceOpnd->getType()->isObject() 
-                             && targetOpnd->getType()->isCompressedReference() )
-                        //TODO verify if types match exactly?
-#endif
-                        ) {
-                        RegName regName = getAliasReg(sourceOpnd->getRegName(), targetSize);
-                        assert(regName != RegName_Null);
-                        Opnd* reg = newOpnd(typeManager.getSignedIntegerType(getByteSize(targetSize)), Constraint(regName));
-                        reg->assignRegName(regName);
-                        Inst * instList=NULL;
-                        appendToInstList(instList, newCopyPseudoInst(Mnemonic_MOV, reg, sourceOpnd));
-                        appendToInstList(instList, newInst(Mnemonic_MOV, targetOpnd, reg));
-                        return instList;
-                    } else {
-                        assert(0);
-                        return NULL;
-                    }
-                } else if (sourceOpnd->isPlacedIn(OpndKind_Mem)) {
-                    assert(sourceOpnd->getType()->isInteger() && targetOpnd->getType()->isInteger());
-                    assert(targetOpnd->isPlacedIn(OpndKind_GPReg));
-                    Opnd* shortSrc = newMemOpnd(targetOpnd->getType(),
-                                                sourceOpnd->getMemOpndKind(),
-                                                sourceOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Base),
-                                                sourceOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Index),
-                                                sourceOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Scale),
-                                                sourceOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement),
-                                                sourceOpnd->getSegReg());
-                    Inst * instList=NULL;
-                    appendToInstList(instList, newCopyPseudoInst(Mnemonic_MOV, shortSrc, sourceOpnd));
-                    appendToInstList(instList, newInst(Mnemonic_MOV, targetOpnd, shortSrc));
-                    return instList;
-                }
-            }
-            assert(targetOpnd->getSize() == sourceOpnd->getSize());
             return newInst(Mnemonic_MOV, targetOpnd, sourceOpnd); // must satisfy constraints
         }
-    }else if (targetOpnd->isPlacedIn(OpndKind_XMMReg_Mem)
-            && sourceOpnd->isPlacedIn(OpndKind_XMMReg_Mem)){
+    }else if ( 
+        (targetKind==OpndKind_XMMReg||targetKind==OpndKind_Mem) && 
+        (sourceKind==OpndKind_XMMReg||sourceKind==OpndKind_Mem)
+    ){
         targetOpnd->setMemOpndAlignment(Opnd::MemOpndAlignment_16);
         sourceOpnd->setMemOpndAlignment(Opnd::MemOpndAlignment_16);
         if (sourceByteSize==4){
             return newInst(Mnemonic_MOVSS,targetOpnd, sourceOpnd);
         }else if (sourceByteSize==8){
-            bool regsOnly = targetOpnd->isPlacedIn(OpndKind_XMMReg) && sourceOpnd->isPlacedIn(OpndKind_XMMReg);
+            bool regsOnly = targetKind==OpndKind_XMMReg && sourceKind==OpndKind_XMMReg;
             if (regsOnly && CPUID::isSSE2Supported()) {
                 return newInst(Mnemonic_MOVAPD, targetOpnd, sourceOpnd);
             } else  {
                 return newInst(Mnemonic_MOVSD, targetOpnd, sourceOpnd);
             }
         }
-    }else if (targetOpnd->isPlacedIn(OpndKind_FPReg) && sourceOpnd->isPlacedIn(OpndKind_Mem)){
+    }else if (targetKind==OpndKind_FPReg && sourceKind==OpndKind_Mem){
         sourceOpnd->setMemOpndAlignment(Opnd::MemOpndAlignment_16);
         return newInst(Mnemonic_FLD, targetOpnd, sourceOpnd);
-    }else if (targetOpnd->isPlacedIn(OpndKind_Mem) && sourceOpnd->isPlacedIn(OpndKind_FPReg)){
+    }else if (targetKind==OpndKind_Mem && sourceKind==OpndKind_FPReg){
         targetOpnd->setMemOpndAlignment(Opnd::MemOpndAlignment_16);
         return newInst(Mnemonic_FSTP, targetOpnd, sourceOpnd);
-    }else if (targetOpnd->isPlacedIn(OpndKind_XMMReg) && sourceOpnd->isPlacedIn(OpndKind_GPReg_Mem)){
-        if (sourceOpnd->isPlacedIn(OpndKind_Mem))
+    }else if (targetKind==OpndKind_XMMReg && (sourceKind==OpndKind_Mem || sourceKind==OpndKind_GPReg)){
+        if (sourceKind==OpndKind_Mem)
             sourceOpnd->setMemOpndAlignment(Opnd::MemOpndAlignment_16);
         return newInst(Mnemonic_MOVD, targetOpnd, sourceOpnd);
-    }else if (targetOpnd->isPlacedIn(OpndKind_GPReg_Mem) && sourceOpnd->isPlacedIn(OpndKind_XMMReg)){
-        if (targetOpnd->isPlacedIn(OpndKind_Mem))
+    }else if ((targetKind==OpndKind_Mem || targetKind==OpndKind_GPReg) && sourceKind==OpndKind_XMMReg){
+        if (targetKind==OpndKind_Mem)
             targetOpnd->setMemOpndAlignment(Opnd::MemOpndAlignment_16);
         return newInst(Mnemonic_MOVD, targetOpnd, sourceOpnd);
     }else if (
-        (targetOpnd->isPlacedIn(OpndKind_FPReg) && sourceOpnd->isPlacedIn(OpndKind_XMMReg))
-        || (targetOpnd->isPlacedIn(OpndKind_XMMReg) && sourceOpnd->isPlacedIn(OpndKind_FPReg))
+        (targetKind==OpndKind_FPReg && sourceKind==OpndKind_XMMReg)||
+        (targetKind==OpndKind_XMMReg && sourceKind==OpndKind_FPReg)
     ){
         Inst * instList=NULL;
         Opnd * tmp = newMemOpnd(targetOpnd->getType(), MemOpndKind_StackAutoLayout, getRegOpnd(STACK_REG), 0);
@@ -1255,34 +1195,35 @@
 
 Inst * IRManager::newPushPopSequence(Mnemonic mn, Opnd * opnd, U_32 regUsageMask)
 {
-    assert(opnd != NULL);
+    assert(opnd!=NULL);
 
-    if (opnd->isPlacedIn(OpndKind_Null))
+    Constraint constraint = opnd->getConstraint(Opnd::ConstraintKind_Location);
+    if (constraint.isNull())
         return newCopyPseudoInst(mn, opnd);
 
-    OpndSize size = opnd->getConstraint(Opnd::ConstraintKind_Location).getSize();
+    OpndKind kind=(OpndKind)constraint.getKind();
+    OpndSize size=constraint.getSize();
 
-    Inst * instList = NULL;
+    Inst * instList=NULL;
 
 #ifdef _EM64T_
-    if ( (opnd->isPlacedIn(OpndKind_GPReg_Mem) && size != OpndSize_32)
-        ||(opnd->isPlacedIn(OpndKind_Imm) && size < OpndSize_32)){
+    if ( ((kind==OpndKind_GPReg ||kind==OpndKind_Mem)&& size!=OpndSize_32)||(kind==OpndKind_Imm && size<OpndSize_32)){
             return newInst(mn, opnd);
 #else
-    if (opnd->isPlacedIn(OpndKind_GPReg_Mem) || opnd->isPlacedIn(OpndKind_Imm)){
-        if (size == OpndSize_32){
+    if ( kind==OpndKind_GPReg||kind==OpndKind_Mem||kind==OpndKind_Imm ){
+        if (size==OpndSize_32){
             return newInst(mn, opnd);
-        }else if (size < OpndSize_32){ 
-        }else if (size == OpndSize_64){
+        }else if (size<OpndSize_32){ 
+        }else if (size==OpndSize_64){
             if (mn==Mnemonic_PUSH){
-                Opnd * opndLo = newOpnd(typeManager.getUInt32Type());
+                Opnd * opndLo=newOpnd(typeManager.getUInt32Type());
                 appendToInstList(instList, newAliasPseudoInst(opndLo, opnd, 0)); 
-                Opnd * opndHi = newOpnd(typeManager.getIntPtrType());
+                Opnd * opndHi=newOpnd(typeManager.getIntPtrType());
                 appendToInstList(instList, newAliasPseudoInst(opndHi, opnd, 4)); 
                 appendToInstList(instList, newInst(Mnemonic_PUSH, opndHi));
                 appendToInstList(instList, newInst(Mnemonic_PUSH, opndLo));
             }else{
-                Opnd * opnds[2] = { newOpnd(typeManager.getUInt32Type()), newOpnd(typeManager.getInt32Type()) };
+                Opnd * opnds[2]={ newOpnd(typeManager.getUInt32Type()), newOpnd(typeManager.getInt32Type()) };
                 appendToInstList(instList, newInst(Mnemonic_POP, opnds[0])); 
                 appendToInstList(instList, newInst(Mnemonic_POP, opnds[1]));
                 appendToInstList(instList, newAliasPseudoInst(opnd, 2, opnds));
@@ -1291,20 +1232,20 @@
         }
 #endif
     }
-    Opnd * espOpnd = getRegOpnd(STACK_REG);
-    Opnd * tmp = newMemOpnd(opnd->getType(), MemOpndKind_StackManualLayout, espOpnd, 0); 
+    Opnd * espOpnd=getRegOpnd(STACK_REG);
+    Opnd * tmp=newMemOpnd(opnd->getType(), MemOpndKind_StackManualLayout, espOpnd, 0); 
 #ifdef _EM64T_
-    Opnd * sizeOpnd = newImmOpnd(typeManager.getInt32Type(), sizeof(POINTER_SIZE_INT));
-    if(opnd->isPlacedIn(OpndKind_Imm)) {
-        assert(mn == Mnemonic_PUSH);
+    Opnd * sizeOpnd=newImmOpnd(typeManager.getInt32Type(), sizeof(POINTER_SIZE_INT));
+    if(kind==OpndKind_Imm) {
+        assert(mn==Mnemonic_PUSH);
         appendToInstList(instList, newInst(Mnemonic_SUB, espOpnd, sizeOpnd));
         appendToInstList(instList, newMemMovSequence(tmp, opnd, regUsageMask));
-    } else if (opnd->isPlacedIn(OpndKind_GPReg)){
-        assert(mn == Mnemonic_PUSH);
+    } else if (kind == OpndKind_GPReg){
+        assert(mn==Mnemonic_PUSH);
         appendToInstList(instList, newInst(Mnemonic_SUB, espOpnd, sizeOpnd));
         appendToInstList(instList, newInst(Mnemonic_MOV, tmp, opnd));
     } else {
-        if (mn == Mnemonic_PUSH){
+        if (mn==Mnemonic_PUSH){
             appendToInstList(instList, newInst(Mnemonic_SUB, espOpnd, sizeOpnd));
             appendToInstList(instList, newCopySequence(tmp, opnd, regUsageMask));
         }else{
@@ -1313,11 +1254,11 @@
         }
     }
 #else
-    U_32 cb = getByteSize(size);
-    U_32 slotSize = 4; 
-    cb = (cb+slotSize-1)&~(slotSize-1);
-    Opnd * sizeOpnd = newImmOpnd(typeManager.getInt32Type(), cb);
-    if (mn == Mnemonic_PUSH){
+    U_32 cb=getByteSize(size);
+    U_32 slotSize=4; 
+    cb=(cb+slotSize-1)&~(slotSize-1);
+    Opnd * sizeOpnd=newImmOpnd(typeManager.getInt32Type(), cb);
+    if (mn==Mnemonic_PUSH){
         appendToInstList(instList, newInst(Mnemonic_SUB, espOpnd, sizeOpnd));
         appendToInstList(instList, newCopySequence(tmp, opnd, regUsageMask));
     }else{
@@ -1383,9 +1324,8 @@
     U_32 opndCount=getOpndCount();
     for (U_32 i=0; i<opndCount; i++){
         Opnd * opnd=getOpnd(i);
-        if (opnd->isPlacedIn(regKind)) {
+        if (opnd->isPlacedIn(regKind))
             gpTotalRegUsage |= getRegMask(opnd->getRegName());
-        }
     }
 }
 //_________________________________________________________________________________________________
@@ -1421,7 +1361,6 @@
         case Type::Int64:   
         case Type::UInt8:   
         case Type::UInt16:  
-        case Type::Char:  
         case Type::UInt32:  
         case Type::UInt64:  
         case Type::Single:  
@@ -1967,9 +1906,9 @@
                     Node* dispatchNode= dispatchEdge->getTargetNode();
                     if ((dispatchNode!=fg->getUnwindNode()) ||(checkOpnds[opnd] == (POINTER_SIZE_INT)-1
 #ifdef _EM64T_
-                          ||!Type::isCompressedReference(opnd->getType()->tag)
+                            ||!Type::isCompressedReference(opnd->getType()->tag)
 #endif
-                       )){
+                            )){
                         Node* throwBasicBlock = fg->createBlockNode();
                         ObjectType* excType = compilationInterface.findClassUsingBootstrapClassloader(NULL_POINTER_EXCEPTION);
                         assert(lastInst->getBCOffset()!=ILLEGAL_BC_MAPPING_VALUE);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h Mon Oct 20 12:18:01 2008
@@ -344,15 +344,6 @@
         }
     }
 
-    static OpndExt extByType(Type::Tag t) {
-        if( t == Type::Char || t == Type::Boolean || Type::isUnsignedInteger(t) ) {
-            return OpndExt_Zero; 
-        } else if( Type::isSignedInteger(t) ) {
-            return OpndExt_Signed; 
-        }
-        return OpndExt_Any;
-    }
-
     //-----------------------------------------------------------------------------------------------
     bool isOnlyPrologSuccessor(Node * bb) ;
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp Mon Oct 20 12:18:01 2008
@@ -38,7 +38,7 @@
     assert(r!=RegName_Null);
     memOpndKind=MemOpndKind_Null;
     regName=r;
-    constraints[ConstraintKind_Location]=Constraint(r,constraints[ConstraintKind_Calculated].getExt());
+    constraints[ConstraintKind_Location]=Constraint(r);
     checkConstraints();
 }
 
@@ -49,9 +49,7 @@
     if (constraints[ConstraintKind_Location].getKind() != OpndKind_Imm)
         runtimeInfo=NULL;
     immValue=v;
-    constraints[ConstraintKind_Location]=Constraint(OpndKind_Imm,
-                                                    constraints[ConstraintKind_Initial].getSize(),
-                                                    constraints[ConstraintKind_Initial].getExt());
+    constraints[ConstraintKind_Location]=Constraint(OpndKind_Imm, constraints[ConstraintKind_Initial].getSize());
     checkConstraints();
 }
 
@@ -61,9 +59,7 @@
     assert(_base||_index||_displacement);
     assert(!_scale||_index);
 
-    constraints[ConstraintKind_Location]=Constraint(OpndKind_Mem,
-                                                    constraints[ConstraintKind_Initial].getSize(),
-                                                    constraints[ConstraintKind_Initial].getExt());
+    constraints[ConstraintKind_Location]=Constraint(OpndKind_Mem, constraints[ConstraintKind_Initial].getSize());
     memOpndKind=k;
 
     checkConstraints();
@@ -295,7 +291,7 @@
             }
         }
             if (removeMemory) 
-                c = Constraint((OpndKind)(c.getKind() &~ OpndKind_Mem), c.getSize(), c.getExt(), c.getMask());
+                c = Constraint((OpndKind)(c.getKind() &~ OpndKind_Mem), c.getSize(), c.getMask());
         }
     }else{
         c = opnds[(idx - opndCount) / 4]->getMemOpndSubOpndConstraint((MemOpndSubOpndKind)((idx - opndCount) & 3));

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp Mon Oct 20 12:18:01 2008
@@ -336,14 +336,7 @@
 
     OpndSize srcSize=irManager.getTypeSize(srcType);
     OpndSize dstSize=irManager.getTypeSize(dstType);
-
-    if (dstSize!=srcSize && srcOpnd->isPlacedIn(OpndKind_Imm) && dstOpnd == NULL) {
-        int64 immValue = srcOpnd->getImmValue();
-        if (dstSize > srcSize || Type::constFits(immValue, dstType->tag)) {
-            return irManager.newImmOpnd(dstType, immValue);
-        }
-    }
-
+    
     if (dstSize==srcSize){ // trivial conversion
         if (dstOpnd==NULL && dstType == srcType) {
             dstOpnd=srcOpnd;
@@ -361,7 +354,7 @@
         if (dstOpnd==NULL)
             dstOpnd=irManager.newOpnd(dstType);
 #ifdef _EM64T_
-        appendInsts(irManager.newInstEx(srcType->isSignedInteger() & !isZeroExtend ? Mnemonic_MOVSX:Mnemonic_MOVZX, 1, dstOpnd, srcOpnd));
+            appendInsts(irManager.newInstEx(srcType->isSignedInteger() & !isZeroExtend ? Mnemonic_MOVSX:Mnemonic_MOVZX, 1, dstOpnd, srcOpnd));
 #else
         if (dstSize<OpndSize_64){
             appendInsts(irManager.newInstEx(srcType->isSignedInteger() && !isZeroExtend ? Mnemonic_MOVSX:Mnemonic_MOVZX, 1, dstOpnd, srcOpnd));
@@ -412,8 +405,7 @@
 #endif
 
             //load float value to FP0
-            Type* dType = irManager.getTypeManager().getDoubleType();
-            Opnd* fpResOpnd = irManager.newRegOpnd(dType, RegName_FP0);
+            Opnd* fpResOpnd = irManager.newOpnd(irManager.getTypeManager().getDoubleType());
             Inst* convInst = irManager.newInst(Mnemonic_FILD, fpResOpnd, int64Opnd);            
             appendInsts(convInst);
 
@@ -553,10 +545,6 @@
     Opnd * srcOpnd=(Opnd*)oph;
 
     Type * srcType=srcOpnd->getType();
-    if (dstOpnd == NULL && dstType == srcType) {
-        dstOpnd = srcOpnd;
-        return dstOpnd;
-    }
     bool converted=false;
     if (isIntegerType(srcType)){
         if (isIntegerType(dstType)){
@@ -700,11 +688,7 @@
 Opnd * InstCodeSelector::fpOp(Mnemonic mn, Type * dstType, Opnd * src1, Opnd * src2)
 {
     Opnd * dst=irManager.newOpnd(dstType);
-    Opnd * srcOpnd1 = src1->canBePlacedIn(OpndKind_XMMReg)? NULL : irManager.newOpnd(dstType);
-    srcOpnd1 = convert(src1, dstType, srcOpnd1);
-    Opnd * srcOpnd2 = src2->canBePlacedIn(OpndKind_XMMReg_Mem)? NULL : irManager.newOpnd(dstType);
-    srcOpnd2 = convert(src2, dstType, srcOpnd2);
-
+    Opnd * srcOpnd1=(Opnd*)convert(src1, dstType), * srcOpnd2=(Opnd*)convert(src2, dstType);
     appendInsts(irManager.newInstEx(mn, 1, dst, srcOpnd1, srcOpnd2));
     return dst;
 }
@@ -999,17 +983,15 @@
         case NegOp::F:
         {
             Type * dstType=irManager.getTypeFromTag(Type::Double);
-            dst = irManager.newOpnd(dstType, Constraint(OpndKind_FPReg, ((Opnd*)src)->getSize(), OpndExt_Any));
-            copyOpnd(dst,(Opnd*)src);
-            appendInsts(irManager.newInst(Mnemonic_FCHS,dst));
+            dst = irManager.newOpnd(dstType);
+            appendInsts(irManager.newInstEx(Mnemonic_FCHS,1,dst,(Opnd*)src));
             break;
         }
         case NegOp::S:
         {
             Type * dstType=irManager.getTypeFromTag(Type::Single);
-            dst = irManager.newOpnd(dstType, Constraint(OpndKind_FPReg, ((Opnd*)src)->getSize(), OpndExt_Any));
-            copyOpnd(dst,(Opnd*)src);
-            appendInsts(irManager.newInst(Mnemonic_FCHS,dst));
+            dst = irManager.newOpnd(dstType);
+            appendInsts(irManager.newInstEx(Mnemonic_FCHS,1,dst,(Opnd*)src));
             break;
         }
         default:
@@ -1206,9 +1188,9 @@
             dstType=irManager.getTypeFromTag(Type::Int64);
             dst=irManager.newOpnd(dstType);
 #ifndef _EM64T_
-            appendInsts(irManager.newI8PseudoInst(mn,1,dst,(Opnd*)convert(value, dstType),(Opnd*)convert(shiftAmount, typeManager.getInt8Type())));
+            appendInsts(irManager.newI8PseudoInst(mn,1,dst,(Opnd*)convert(value, dstType),(Opnd*)convert(shiftAmount, typeManager.getInt32Type())));
 #else
-            appendInsts(irManager.newInstEx(mn,1,dst,(Opnd*)convert(value, dstType),(Opnd*)convert(shiftAmount, typeManager.getInt8Type())));
+            appendInsts(irManager.newInstEx(mn,1,dst,(Opnd*)convert(value, dstType),(Opnd*)convert(shiftAmount, typeManager.getInt32Type())));
 #endif
             return dst;
         default:
@@ -1286,15 +1268,13 @@
                                          CG_OpndHandle*       src1,
                                          CG_OpndHandle*       src2, int ifNaNResult) 
 {
-    Opnd * dst8=irManager.newOpnd(typeManager.getUInt8Type());
     Opnd * dst=irManager.newOpnd(typeManager.getInt32Type());
     bool swapped=cmpToEflags(cmpOp, opType, (Opnd*)src1, (Opnd*)src2);
     ConditionMnemonic cm=getConditionMnemonicFromCompareOperator(cmpOp, opType);
     if (swapped) 
         cm=swapConditionMnemonic(cm);
-    appendInsts(irManager.newCopyPseudoInst(Mnemonic_MOV, dst8, irManager.newImmOpnd(typeManager.getUInt8Type(), 0)));
-    appendInsts(irManager.newInstEx(getMnemonic(Mnemonic_SETcc, cm), 1, dst8,dst8));
-    appendInsts(irManager.newInstEx(Mnemonic_MOVZX, 1, dst, dst8));
+    appendInsts(irManager.newCopyPseudoInst(Mnemonic_MOV, dst, irManager.newImmOpnd(typeManager.getInt32Type(), 0)));
+    appendInsts(irManager.newInstEx(getMnemonic(Mnemonic_SETcc, cm), 1, dst,dst));
     if (ifNaNResult == 1 || (ifNaNResult ==0 && ((opType==CompareOp::F) ||(opType==CompareOp::S) ||(opType==CompareOp::D)) && ((cmpOp == CompareOp::Geu) || (cmpOp == CompareOp::Gtu) || (cmpOp == CompareOp::Ne) || (cmpOp == CompareOp::Eq)))) {
         appendInsts(irManager.newInstEx(Mnemonic_CMOVP,1,dst,dst,irManager.newImmOpnd(typeManager.getInt32Type(), ifNaNResult)));
     }
@@ -1379,40 +1359,26 @@
         case CompareOp::F:
         {
             Type * srcType=irManager.getTypeFromTag(Type::Double);
-            Opnd * srcOpnd1 = src1->canBePlacedIn(OpndKind_XMMReg)? NULL : irManager.newOpnd(srcType);
-            srcOpnd1 = convert(src1, srcType, srcOpnd1);
-            Opnd * srcOpnd2;
-            if (src2) {
-                srcOpnd2 = src2->canBePlacedIn(OpndKind_XMMReg_Mem)? NULL : irManager.newOpnd(srcType);
-                srcOpnd2 = convert(src2, srcType, srcOpnd2);
-            } else {
+            Opnd * srcOpnd1=(Opnd*)convert(src1, srcType);
 #ifdef _EM64T_
-                Opnd * baseOpnd = irManager.newOpnd(typeManager.getUnmanagedPtrType(srcType));
-                srcOpnd2 = irManager.newFPConstantMemOpnd((double)0.0, baseOpnd, (BasicBlock*)currentBasicBlock);
+            Opnd * baseOpnd = irManager.newOpnd(typeManager.getUnmanagedPtrType(srcType));
+            Opnd * srcOpnd2=src2?(Opnd*)convert(src2, srcType):irManager.newFPConstantMemOpnd((double)0.0, baseOpnd, (BasicBlock*)currentBasicBlock);
 #else
-                srcOpnd2 = irManager.newFPConstantMemOpnd((double)0.0);
+            Opnd * srcOpnd2=src2?(Opnd*)convert(src2, srcType):irManager.newFPConstantMemOpnd((double)0.0);
 #endif
-            }
             appendInsts(irManager.newInst(Mnemonic_UCOMISD, srcOpnd1, srcOpnd2));
             break;
         }
         case CompareOp::S:
         {
             Type * srcType=irManager.getTypeFromTag(Type::Single);
-            Opnd * srcOpnd1 = src1->canBePlacedIn(OpndKind_XMMReg)? NULL : irManager.newOpnd(srcType);
-            srcOpnd1 = convert(src1, srcType, srcOpnd1);
-            Opnd * srcOpnd2;
-            if (src2) {
-                srcOpnd2 = src2->canBePlacedIn(OpndKind_XMMReg_Mem)? NULL : irManager.newOpnd(srcType);
-                srcOpnd2 = convert(src2, srcType, srcOpnd2);
-            } else {
+            Opnd * srcOpnd1=(Opnd*)convert(src1, srcType);
 #ifdef _EM64T_
-                Opnd * baseOpnd = irManager.newOpnd(typeManager.getUnmanagedPtrType(srcType));
-                srcOpnd2 = irManager.newFPConstantMemOpnd((float)0.0, baseOpnd, (BasicBlock*)currentBasicBlock);
+            Opnd * baseOpnd = irManager.newOpnd(typeManager.getUnmanagedPtrType(srcType));
+            Opnd * srcOpnd2=src2?(Opnd*)convert(src2, srcType):irManager.newFPConstantMemOpnd((float)0.0, baseOpnd, (BasicBlock*)currentBasicBlock);
 #else
-                srcOpnd2 = irManager.newFPConstantMemOpnd((float)0.0);
+            Opnd * srcOpnd2=src2?(Opnd*)convert(src2, srcType):irManager.newFPConstantMemOpnd((float)0.0);
 #endif
-            }
             appendInsts(irManager.newInst(Mnemonic_UCOMISS, srcOpnd1, srcOpnd2));
             break;
         }
@@ -2132,7 +2098,7 @@
 {
 #ifdef _EM64T_
     if(irManager.refsAreCompressed() && memType > Type::Float && memType!=Type::UnmanagedPtr) {
-        Opnd * opnd = irManager.newMemOpndAutoKind(typeManager.getUInt32Type(), addr);
+        Opnd * opnd = irManager.newMemOpndAutoKind(typeManager.getInt32Type(), addr);
         Opnd * dst = irManager.newOpnd(typeManager.getInt64Type());
         // loading compressed 32-bit managed address, ensure zero-extention
         copyOpnd(dst, opnd, true);
@@ -2169,7 +2135,7 @@
     if(irManager.refsAreCompressed() && memType > Type::Float && !src->getType()->isUnmanagedPtr()) {
         Type * unmanagedPtrType = typeManager.getUnmanagedPtrType(typeManager.getInt8Type());
         Opnd * heap_base = heapBaseOpnd(unmanagedPtrType, (POINTER_SIZE_INT)VMInterface::getHeapBase());
-        Opnd * compressed_src = irManager.newOpnd(src->getType());
+        Opnd * compressed_src = irManager.newOpnd(typeManager.compressType(src->getType()));
         Opnd * opnd = irManager.newMemOpndAutoKind(typeManager.compressType(src->getType()), addr);
         appendInsts(irManager.newInstEx(Mnemonic_SUB, 1, compressed_src, src, heap_base));
         appendInsts(irManager.newCopyPseudoInst(Mnemonic_MOV, opnd, compressed_src));
@@ -2489,7 +2455,7 @@
     Opnd* baseOpnd = irManager.newImmOpnd(typeManager.getUnmanagedPtrType(typeManager.getUIntPtrType()), (POINTER_SIZE_INT)ptr);
     Opnd* memOpnd = irManager.newMemOpnd(typeManager.getUIntPtrType(), MemOpndKind_Heap, baseOpnd, NULL, NULL, NULL);
     const Mnemonic mn = Mnemonic_ADD;
-    Inst* inst = irManager.newInst(mn, memOpnd,  irManager.newImmOpnd(typeManager.getInt8Type(), 1));
+    Inst* inst = irManager.newInst(mn, memOpnd,  irManager.newImmOpnd(typeManager.getUInt32Type(), 1));
     appendInsts(inst);
 }
 
@@ -2602,7 +2568,7 @@
 
     int64 heapBase = (int64) VMInterface::getVTableBase();
     Opnd * acc =  simpleOp_I8(Mnemonic_ADD, dstType, (Opnd *)base, irManager.newImmOpnd(dstType, Opnd::RuntimeInfo::Kind_VTableAddrOffset));
-    Opnd * sourceVTableAddr=irManager.newMemOpnd(typeManager.getUInt32Type(), acc, 0, 0, irManager.newImmOpnd(typeManager.getUInt32Type(), 0));
+    Opnd * sourceVTableAddr=irManager.newMemOpnd(typeManager.getInt32Type(), acc, 0, 0, irManager.newImmOpnd(typeManager.getUInt32Type(), 0));
     acc=irManager.newOpnd(dstType);
     appendInsts(irManager.newInstEx(Mnemonic_MOVZX, 1, acc, sourceVTableAddr));
     vtableAddr =  simpleOp_I8(Mnemonic_ADD, dstType, acc,  irManager.newImmOpnd(dstType, heapBase));
@@ -2832,8 +2798,8 @@
         assert(irManager.getTypeSize(opnds[1]->getType())==irManager.getTypeSize(opnds[2]->getType()));
         bool is64bit = irManager.getTypeSize(opnd1Type) == OpndSize_64;
 //        Type* opType = is64bit ? typeManager.getInt64Type():typeManager.getInt32Type();
-        Constraint ceax(OpndKind_GPReg, is64bit?OpndSize_64:OpndSize_32, OpndExt_Any, 1<<getRegIndex(is64bit?RegName_RAX:RegName_EAX));
-        Constraint cecx(OpndKind_GPReg, is64bit?OpndSize_64:OpndSize_32, OpndExt_Any, 1<<getRegIndex(is64bit?RegName_RCX:RegName_ECX));
+        Constraint ceax(OpndKind_GPReg, is64bit?OpndSize_64:OpndSize_32, 1<<getRegIndex(is64bit?RegName_RAX:RegName_EAX));
+        Constraint cecx(OpndKind_GPReg, is64bit?OpndSize_64:OpndSize_32, 1<<getRegIndex(is64bit?RegName_RCX:RegName_ECX));
         Opnd* eaxOpnd = irManager.newOpnd(opnds[1]->getType(), ceax);
         Opnd* ecxOpnd = irManager.newOpnd(opnds[2]->getType(), cecx);
 #else
@@ -2849,10 +2815,8 @@
         appendInsts(inst);
 
         //save the result
-        Opnd * dst8=irManager.newOpnd(typeManager.getUInt8Type());
-        appendInsts(irManager.newCopyPseudoInst(Mnemonic_MOV, dst8, irManager.newImmOpnd(typeManager.getUInt8Type(), 0)));
-        appendInsts(irManager.newInst(Mnemonic_SETZ,dst8));
-        appendInsts(irManager.newInstEx(Mnemonic_MOVZX, 1, dstOpnd, dst8));
+        appendInsts(irManager.newCopyPseudoInst(Mnemonic_MOV, dstOpnd, irManager.newImmOpnd(typeManager.getInt32Type(), 0)));
+        appendInsts(irManager.newInst(Mnemonic_SETZ, dstOpnd));
         break;
     }
     case AddValueProfileValue:
@@ -3229,7 +3193,11 @@
                                                  CG_OpndHandle* obj,
                                                  CG_OpndHandle* tauCheckedNull) 
 {
-    Opnd * dst=irManager.newOpnd(typeManager.getInt32Type()); // boolean is represented as int32
+#ifdef _EM64T_
+    Opnd * dst=irManager.newOpnd(typeManager.getInt64Type());
+#else
+    Opnd * dst=irManager.newOpnd(typeManager.getInt32Type());
+#endif
     Opnd * args[]={ (Opnd*)obj, irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, type) };
     CallInst * callInst=irManager.newRuntimeHelperCallInst(
         VM_RT_INSTANCEOF,

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp Mon Oct 20 12:18:01 2008
@@ -279,7 +279,8 @@
     // 2. Assigned to FPU - convert to FPU operations, to 
     //    avoid long FPU->mem->XMM chain
     // 3. Assigned to XMM - see #1
-    const bool xmm_way = src->canBePlacedIn(OpndKind_XMMReg);
+    const bool xmm_way = 
+        !(src->hasAssignedPhysicalLocation() && src->isPlacedIn(OpndKind_FPReg));
 
     if (!xmm_way) {
         //TODO: will add FPU later if measurements show it worths trying
@@ -508,9 +509,8 @@
                 nextmovopnd2 = next->getOpnd(nextmovuses.begin());
             }
             if (movopnd1->getId() == nextmovopnd2->getId() && 
-                !isMem(movopnd2) && !isMem(nextmovopnd1) && !isMem(movopnd1) &&
-                movopnd1->getSize() == movopnd2->getSize() &&
-                nextmovopnd1->getSize() == nextmovopnd2->getSize()
+                !isMem(movopnd2) && !isMem(nextmovopnd1) &&
+                !isMem(movopnd1)
                 )
             {
                 BitSet ls(irManager->getMemoryManager(), irManager->getOpndCount());
@@ -522,16 +522,7 @@
                 bool dstNotUsed = !ls.getBit(movopnd1->getId());
                 if (dstNotUsed)
                 {
-                    Inst* merged;
-                    // peephole pass can be used in various positions in pipeline
-                    // thus avoid inserting pseudo instructions in late stages
-                    // still try to be useful in early stages
-                    if (inst->hasKind(Inst::Kind_PseudoInst) && next->hasKind(Inst::Kind_PseudoInst)) {
-                        merged = irManager->newCopyPseudoInst(Mnemonic_MOV, nextmovopnd1, movopnd2);
-                    } else {
-                        merged = irManager->newInst(Mnemonic_MOV, nextmovopnd1, movopnd2);
-                    }
-                    merged->insertAfter(inst);
+                    irManager->newInst(Mnemonic_MOV, nextmovopnd1, movopnd2)->insertAfter(inst);
                     inst->unlink();
                     next->unlink();
                     return Changed_Node;
@@ -676,9 +667,8 @@
             if (minBit == maxBit) {
                 assert(minBit>=2);
                 if (Log::isEnabled()) Log::out()<<"I"<<inst->getId()<<" -> MUL with 2^"<<minBit<<std::endl;
-                Type* immType = irManager->getTypeManager().getUInt8Type();
-                irManager->newCopyPseudoInst(Mnemonic_MOV, dst, src1)->insertBefore(inst);
-                irManager->newInst(Mnemonic_SHL, dst, irManager->newImmOpnd(immType, minBit))->insertBefore(inst);
+                Type* int32Type = irManager->getTypeManager().getUInt32Type();
+                irManager->newInstEx(Mnemonic_SHL, 1, dst, src1, irManager->newImmOpnd(int32Type, minBit))->insertAfter(inst);
                 inst->unlink();
                 return Changed_Inst;
             }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc2.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc2.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc2.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc2.cpp Mon Oct 20 12:18:01 2008
@@ -454,7 +454,6 @@
 
     OpndKind k = (OpndKind)constrs.getKind(); 
     OpndSize s = constrs.getSize();
-    OpndExt e = constrs.getExt();
 
     registers.clear();
     RegMask mask = constrs.getMask();
@@ -465,7 +464,7 @@
             Register* r = new (mm) Register(mm);
             r->regmask = m,
             r->regname = getRegName(k, s, x);
-            r->constraint = Constraint(k, s, e, m);
+            r->constraint = Constraint(k, s, m);
             r->length = 0;
             r->beg=(Instnb)UINT_MAX;
             r->end=(Instnb)0;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc3.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc3.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc3.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc3.cpp Mon Oct 20 12:18:01 2008
@@ -632,25 +632,15 @@
         opndx.ignore = false;
 
         int ridx;
-        Constraint loc = opnd->getConstraint(Opnd::ConstraintKind_Location/*, OpndSize_Default*/);
+        Constraint loc = opnd->getConstraint(Opnd::ConstraintKind_Location, OpndSize_Default);
         if (loc.isNull())
         {// this operand is not allocated yet
-            loc = opnd->getConstraint(Opnd::ConstraintKind_Calculated/*, OpndSize_Default*/);
+            loc = opnd->getConstraint(Opnd::ConstraintKind_Calculated, OpndSize_Default);
             if ((ridx = registers.index(loc)) != -1)
             {// operand should be assigned to register
                 opndx.ridx  = ridx;
                 opndx.alloc = 0;
                 opndx.avail = loc.getMask() & registers[ridx].getMask();
-#if !defined(_EM64T_)
-                if (loc.getSize() == OpndSize_8 && loc.getMask() == 0xffff) { 
-                    // FIXME better check for mask ?
-                    // allow only low-byte regs to workaround platform irregularity
-                    opndx.avail &= (getRegMask(RegName_AL)
-                        |getRegMask(RegName_BL)
-                        |getRegMask(RegName_CL)
-                        |getRegMask(RegName_DL));
-                }
-#endif
                 opndx.nbavails = bitCount(opndx.avail);
                 assert(opndx.nbavails != 0);
                 opndx.spillcost = 1;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp Mon Oct 20 12:18:01 2008
@@ -946,9 +946,6 @@
             {
                 Constraint c(opline.opnd->getConstraint(Opnd::ConstraintKind_Initial));
                 update(opline.instx->inst, opline.opnd, c);
-                // sign extension mode is irrelevant to reg allocation but may affect calculations 
-                // so reset it to match any
-                c.setExt(OpndExt_Any);
                 opline.idx = registers.getIndex(c);
 
                 if (!tryRegister(opline, c, prefreg))
@@ -1021,7 +1018,7 @@
         return false;
 
     Constraint cx = c.getAliasConstraint(OpndSize_Default) & registers[opline.idx];
-    Constraint cr((OpndKind)cx.getKind(), c.getSize(), c.getExt(), cx.getMask());
+    Constraint cr((OpndKind)cx.getKind(), c.getSize(), cx.getMask());
 
 //  handle first instruction of the interval
 
@@ -1126,7 +1123,7 @@
         return false;
 
     Constraint cx = c.getAliasConstraint(OpndSize_Default) & registers[opline.idx];
-    Constraint cr((OpndKind)cx.getKind(), c.getSize(), c.getExt(), cx.getMask());
+    Constraint cr((OpndKind)cx.getKind(), c.getSize(), cx.getMask());
 
     Instx* begx = opline.instx;
     Instx* endx = begx;
@@ -1174,7 +1171,7 @@
         return false;
 
     Constraint ca = c.getAliasConstraint(OpndSize_Default) & registers[opline.idx];
-    Constraint cr((OpndKind)ca.getKind(), c.getSize(), c.getExt(), ca.getMask());
+    Constraint cr((OpndKind)ca.getKind(), c.getSize(), ca.getMask());
 
     Inst* inst = opline.instx->inst;
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp Mon Oct 20 12:18:01 2008
@@ -386,7 +386,7 @@
             // store the resulting I_32
             Opnd where32(i32, where.base(), where.disp(), 
                           where.index(), where.scale());
-            mov(where32, Opnd(i32, tmp)); //s0.as_opnd(i32));
+            mov(where32, Opnd(jobj, tmp)); //s0.as_opnd(i32));
         }
         runlock(s0);
     }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp Mon Oct 20 12:18:01 2008
@@ -114,46 +114,38 @@
     assert(!op0.is_imm());
 }
 
-static OpndExt default_arg_ext(jtype t) {
-    if (is_signed_int(t)) return OpndExt_Signed;
-    else if ( t == u16) return OpndExt_Zero;
-    else return OpndExt_None;
-}
-
 static void add_arg(EncoderBase::Operands& args, const Opnd& op, 
                     bool can_shrink = false)
 {
     OpndSize sz = to_size(op.jt());
-    OpndExt ext = default_arg_ext(op.jt());
     if (op.is_reg()) {
         RegName reg = devirt(op.reg(), op.jt());
         //::OpndKind kind = is_f(op.reg()) ? OpndKind_XMMReg : OpndKind_GPReg;
-        //args.add(EncoderBase::Operand(sz, kind, reg, ext));
-        args.add(EncoderBase::Operand(reg, ext));
+        //args.add(EncoderBase::Operand(sz, kind, reg));
+        args.add(EncoderBase::Operand(reg));
     }
     else if (op.is_mem()) {
         RegName base = op.base() != ar_x ? devirt(op.base()) : RegName_Null;
         RegName idx = op.index() == ar_x ? RegName_Null : devirt(op.index());
-        EncoderBase::Operand mem(sz, base, idx, op.scale(), op.disp(), ext);
+        EncoderBase::Operand mem(sz, base, idx, op.scale(), op.disp());
         args.add(mem);
     }
     else {
         assert(!is_f(op.jt()));
         if (op.jt() == i64) {
-            EncoderBase::Operand imm(sz, op.lval(), ext);
+            EncoderBase::Operand imm(sz, op.lval());
             args.add(imm);
         }
         else if (op.jt() == jobj) {
-            EncoderBase::Operand imm(sz, (int_ptr)(void*)op.lval(), ext);
+            EncoderBase::Operand imm(sz, (int_ptr)(void*)op.lval());
             args.add(imm);
         }
         else {
             assert(op.jt()<=i32);
             if (can_shrink && fits_i8(op.ival())) {
                 sz = OpndSize_8;
-                ext = OpndExt_Any;
             }
-            EncoderBase::Operand imm(sz, op.ival(), ext);
+            EncoderBase::Operand imm(sz, op.ival());
             args.add(imm);
         }
     }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h Mon Oct 20 12:18:01 2008
@@ -583,14 +583,6 @@
 extern JTypeDesc jtypes[num_jtypes];
 
 /**
- *@brief Tests whether specified #jtype represents signed integer value.
- */
-inline bool is_signed_int( jtype jt )
-{
-    return jt==i8 || jt==i16 || jt==i32 || jt==i64;
-}
-
-/**
  *@brief Tests whether specified #jtype represents floating point value.
  */
 inline bool is_f( jtype jt )

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h Mon Oct 20 12:18:01 2008
@@ -381,6 +381,7 @@
     //
     Opnd*    propagateCopy(Opnd*);
     Inst*    appendInst(Inst*);
+    Type*    getOpndTypeFromLdType(Type* ldType);
     Opnd*    createOpnd(Type*);
     PiOpnd*  createPiOpnd(Opnd *org);
     Opnd*    createTypeOpnd(ObjectType* type);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.cpp Mon Oct 20 12:18:01 2008
@@ -1321,17 +1321,5 @@
     return type_tag_names[t].name;
 }
 
-bool Type::constFits(int64 val, Tag tag) {
-    if (tag == Int8 || tag == UInt8) {
-        return (val & (int64)0x00000000000000FF) == val;
-    } else if (tag == Int16 || tag == UInt16 || tag == Char) {
-        return (val & (int64)0x000000000000FFFF) == val;
-    } else if (isIntegerOf4Bytes(tag)) {
-        return (val & (int64)0x00000000FFFFFFFF) == val;
-    } else {
-        assert(0); // implement if you need it
-    }
-    return false;
-}
 
 } //namespace Jitrino 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Type.h Mon Oct 20 12:18:01 2008
@@ -59,15 +59,15 @@
         // (1) Value types
         // --------------------
         //   (1.1) Built-in value types
-        Tau,    // essentially a void type, used for 
+        Tau,     // essentially a void type, used for 
         Void,    
         Boolean,
-        Char,   // unsigned 2-byte integer
-        IntPtr, // ptr-sized integer
+        Char,
+        IntPtr,  // ptr-sized integer
         Int8,
         Int16,
-        Int32,  // 4-byte integer
-        Int64,  // 8-byte integer
+        Int32, // 4-byte integer
+        Int64, // 8-byte integer
         UIntPtr, // unsigned ptr-sized integer
         UInt8,
         UInt16,
@@ -383,9 +383,7 @@
 #endif
     static bool isIntegerOf4Bytes(Tag tag) { return isIntegerOf4Signed(tag) || isIntegerOf4Unsigned(tag); }
     static bool isIntegerOf8Bytes(Tag tag) { return isIntegerOf8Signed(tag) || isIntegerOf8Unsigned(tag); }
-
-    // checks if a constant fits into type
-    static bool constFits(int64 val, Tag tag);
+    
 
 protected:
     virtual bool    _isFinalClass()    {return false;}
@@ -793,18 +791,6 @@
     void setLazyResolutionMode(bool flag) {lazyResolutionMode = flag;}
     bool isLazyResolutionMode() const {return lazyResolutionMode;}
 
-    Type* getIntegerType(int size, bool isSigned) {
-        switch (size) {
-        case 1: return isSigned ? int8Type  : uint8Type;
-        case 2: return isSigned ? int16Type : uint16Type;
-        case 4: return isSigned ? int32Type : uint32Type;
-        case 8: return isSigned ? int64Type : uint64Type;
-        default: assert(0); return int32Type;
-        } 
-    }
-    Type* getSignedIntegerType(int size) { return getIntegerType(size, true); }
-    Type* getUnsignedIntegerType(int size) { return getIntegerType(size, false);}
-
 private:
     MemoryManager& memManager;
     // singletons for the built-in types

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.cpp?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.cpp Mon Oct 20 12:18:01 2008
@@ -638,41 +638,32 @@
 /**
  *
  */
-bool EncoderBase::extAllowed(OpndExt opndExt, OpndExt instExt) {
-    if (instExt == opndExt || instExt == OpndExt_Any || opndExt == OpndExt_Any) {
-            return true;
-    }
-//asm("int3");
-assert(0);
-    return false;
-}
-
-/**
- *
- */
-static bool match(const EncoderBase::OpcodeDesc& odesc, 
-                      const EncoderBase::Operands& opnds) {
+static bool try_match(const EncoderBase::OpcodeDesc& odesc, 
+                      const EncoderBase::Operands& opnds, bool strict) {
                       
     assert(odesc.roles.count == opnds.count());
     
-    for(unsigned j = 0; j < odesc.roles.count; j++) {
-        const EncoderBase::OpndDesc& desc = odesc.opnds[j];
-        const EncoderBase::Operand& op = opnds[j];  
-        // location must match exactly
-        if ((desc.kind & op.kind()) != op.kind()) {
-//assert(0);
+    for(unsigned j=0; j<odesc.roles.count; j++) {
+        // - the location must match exactly
+        if ((odesc.opnds[j].kind & opnds[j].kind()) != opnds[j].kind()) {
             return false;
         }
-        // size must match exactly
-        if (desc.size != op.size()) {
-//assert(0);
-            return false;
+        if (strict) {
+            // the size must match exactly
+            if (odesc.opnds[j].size != opnds[j].size()) {
+                return false;
+            }
         }
-        // extentions should be consistent
-        if (!EncoderBase::extAllowed(op.ext(), desc.ext)) {
-            return false;
+        else {
+            // must match only for def operands, and dont care about use ones
+            // situations like 'mov r8, imm32/mov r32, imm8' so the 
+            // destination operand defines the overall size
+            if (EncoderBase::getOpndRoles(odesc.roles, j) & OpndRole_Def) {
+                if (odesc.opnds[j].size != opnds[j].size()) {
+                    return false;
+                }
+            }
         }
-        
     }
     return true;
 }
@@ -726,7 +717,9 @@
     if (opcodeIndex == NOHASH) {
         // fast-path did no work. try to lookup sequentially
         const OpcodeDesc * odesc = opcodes[mn];
-        for (int idx = 0; !odesc[idx].last; idx++) {
+        int idx = -1;
+        bool found = false;
+        for (idx=0; !odesc[idx].last; idx++) {
             const OpcodeDesc& opcode = odesc[idx];
             if (opcode.platf == OpcodeInfo::decoder) {
                 continue;
@@ -734,11 +727,28 @@
             if (opcode.roles.count != opnds.count()) {
                 continue;
             }
-            if (match(opcode, opnds)) {
-                opcodeIndex = idx;
+            if (try_match(opcode, opnds, true)) {
+                found = true;
                 break;
             }
         }
+        if (!found) {
+            for (idx=0; !odesc[idx].last; idx++) {
+                const OpcodeDesc& opcode = odesc[idx];
+                if (opcode.platf == OpcodeInfo::decoder) {
+                    continue;
+                }
+                if (opcode.roles.count != opnds.count()) {
+                    continue;
+                }
+                if (try_match(opcode, opnds, false)) {
+                    found = true;
+                    break;
+                }
+            }
+        }
+        assert(found);
+        opcodeIndex = idx;
 #ifdef ENCODER_USE_SUBHASH
         put(mn, hash, opcodeIndex);
 #endif
@@ -748,7 +758,6 @@
     assert(!odesc->last);
     assert(odesc->roles.count == opnds.count());
     assert(odesc->platf != OpcodeInfo::decoder);
-    assert(match(*odesc, opnds));
 #if !defined(_EM64T_)
     // tuning was done for IA32 only, so no size restriction on EM64T
     //assert(sizeof(OpcodeDesc)==128);

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_base.h Mon Oct 20 12:18:01 2008
@@ -103,11 +103,6 @@
      static char * prefix(char* stream, InstPrefix pref);
 
     /**
-     * @brief Determines if operand with opndExt suites the position with instExt.
-     */
-    static bool extAllowed(OpndExt opndExt, OpndExt instExt);
-
-    /**
      * @brief Returns #MnemonicDesc by the given Mnemonic.
      */
     static const MnemonicDesc * getMnemonicDesc(Mnemonic mn)
@@ -158,10 +153,6 @@
          */
         OpndSize        size;
         /**
-         * @brief Extention of the operand.
-         */
-        OpndExt         ext;
-        /**
          * @brief Appropriate RegName if operand must reside on a particular
          *        register (i.e. CWD/CDQ instructions), RegName_Null 
          *        otherwise.
@@ -310,13 +301,12 @@
         /**
          * @brief Initializes the instance with empty size and kind.
          */
-        Operand() : m_kind(OpndKind_Null), m_size(OpndSize_Null), m_ext(OpndExt_None), m_need_rex(false) {}
+        Operand() : m_kind(OpndKind_Null), m_size(OpndSize_Null), m_need_rex(false) {}
         /**
          * @brief Creates register operand from given RegName.
          */
-        Operand(RegName reg, OpndExt ext = OpndExt_None) : m_kind(getRegKind(reg)), 
-                               m_size(getRegSize(reg)),
-                               m_ext(ext), m_reg(reg) 
+        Operand(RegName reg) : m_kind(getRegKind(reg)), 
+                               m_size(getRegSize(reg)), m_reg(reg) 
         {
             hash_it();
         }
@@ -328,8 +318,9 @@
          * size and kind from the RegName. 
          * The provided size and kind must match the RegName's ones though.
          */
-        Operand(OpndSize sz, OpndKind kind, RegName reg, OpndExt ext = OpndExt_None) :
-            m_kind(kind), m_size(sz), m_ext(ext), m_reg(reg) 
+        Operand(OpndSize sz, OpndKind kind, RegName reg) : m_kind(kind), 
+                                                           m_size(sz), 
+                                                           m_reg(reg) 
         {
             assert(m_size == getRegSize(reg));
             assert(m_kind == getRegKind(reg));
@@ -338,24 +329,24 @@
         /**
          * @brief Creates immediate operand with the given size and value.
          */
-        Operand(OpndSize size, long long ival, OpndExt ext = OpndExt_None) :
-            m_kind(OpndKind_Imm), m_size(size), m_ext(ext), m_imm64(ival)
+        Operand(OpndSize size, long long ival) : m_kind(OpndKind_Imm), 
+                                                 m_size(size), m_imm64(ival)
         {
             hash_it();
         }
         /**
          * @brief Creates immediate operand of OpndSize_32.
          */
-        Operand(int ival, OpndExt ext = OpndExt_None) :
-            m_kind(OpndKind_Imm), m_size(OpndSize_32), m_ext(ext), m_imm64(ival)
+        Operand(int ival) : m_kind(OpndKind_Imm), m_size(OpndSize_32), 
+                            m_imm64(ival)
         {
             hash_it();
         }
         /**
          * @brief Creates immediate operand of OpndSize_16.
          */
-        Operand(short ival, OpndExt ext = OpndExt_None) :
-            m_kind(OpndKind_Imm), m_size(OpndSize_16), m_ext(ext), m_imm64(ival)
+        Operand(short ival) : m_kind(OpndKind_Imm), m_size(OpndSize_16), 
+                              m_imm64(ival)
         {
             hash_it();
         }
@@ -363,8 +354,8 @@
         /**
          * @brief Creates immediate operand of OpndSize_8.
          */
-        Operand(char ival, OpndExt ext = OpndExt_None) :
-            m_kind(OpndKind_Imm), m_size(OpndSize_8), m_ext(ext), m_imm64(ival)
+        Operand(char ival) : m_kind(OpndKind_Imm), m_size(OpndSize_8), 
+                             m_imm64(ival)
         {
             hash_it();
         }
@@ -373,7 +364,7 @@
          * @brief Creates memory operand.
          */
         Operand(OpndSize size, RegName base, RegName index, unsigned scale,
-                int disp, OpndExt ext = OpndExt_None) : m_kind(OpndKind_Mem), m_size(size), m_ext(ext)
+                int disp) : m_kind(OpndKind_Mem), m_size(size)
         {
             m_base = base;
             m_index = index;
@@ -385,8 +376,8 @@
         /**
          * @brief Creates memory operand with only base and displacement.
          */
-        Operand(OpndSize size, RegName base, int disp, OpndExt ext = OpndExt_None) :
-            m_kind(OpndKind_Mem), m_size(size), m_ext(ext)
+        Operand(OpndSize size, RegName base, int disp) : 
+                               m_kind(OpndKind_Mem), m_size(size)
         {
             m_base = base;
             m_index = RegName_Null;
@@ -406,10 +397,6 @@
          */
         OpndSize size(void) const { return m_size; }
         /**
-         * @brief Returns extention of the operand.
-         */
-        OpndExt ext(void) const { return m_ext; }
-        /**
          * @brief Returns hash of the operand.
          */
         unsigned hash(void) const { return m_hash; }
@@ -450,11 +437,6 @@
         bool is_mmxreg(void) const { return is_placed_in(OpndKind_MMXReg); }
 #endif
         /**
-         * @brief Tests whether operand is signed immediate operand.
-         */
-        //bool is_signed(void) const { assert(is_imm()); return m_is_signed; }
-        
-        /**
          * @brief Returns base of memory operand (RegName_Null if not memory).
          */
         RegName base(void) const { return is_mem() ? m_base : RegName_Null; }
@@ -508,7 +490,6 @@
         // general info
         OpndKind    m_kind;
         OpndSize    m_size;
-        OpndExt     m_ext;
         // complex address form support
         RegName     m_base;
         RegName     m_index;
@@ -583,7 +564,7 @@
 #ifdef _DEBUG
     /**
      * Verifies some presumptions about encoding data table. 
-     * Called automaticaly during statics initialization.
+     * Called automagicaly during statics initialization.
      */
     static int verify(void);
 #endif

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_defs.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_defs.h?rev=706374&r1=706373&r2=706374&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_defs.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/encoder/ia32_em64t/enc_defs.h Mon Oct 20 12:18:01 2008
@@ -104,7 +104,7 @@
     OpndKind_MaxRegKind     = OpndKind_StatusReg,   // a max existing kind of register
     OpndKind_MaxReg,                                // -'- + 1 to be used in array defs
     //
-    OpndKind_Imm            = 0x20,
+    OpndKind_Immediate      = 0x20, OpndKind_Imm=OpndKind_Immediate,
     OpndKind_Memory         = 0x40, OpndKind_Mem=OpndKind_Memory,
     //
     OpndKind_Reg            = 0x1F,
@@ -137,23 +137,10 @@
     OpndSize_128           = 0x20,
 #endif
     OpndSize_Max,
-    OpndSize_Any            = 0x3F,
+    OpndSize_Any            = 0xFF,
     OpndSize_Default        = OpndSize_Any
 };
 
-/**
- * Defines type of extention allowed for particular operand.
- * For example imul r32,r_m32,imm8 sign extend imm8 before performing multiplication.
- * To satisfy instruction constraints immediate operand should be either OpndExt_Signed
- * or OpndExt_Any.
- */     
-enum OpndExt {
-    OpndExt_None    = 0x0,
-    OpndExt_Signed  = 0x1,
-    OpndExt_Zero    = 0x2,
-    OpndExt_Any     = 0x3,
-};
-
 /** 
  * enum OpndRole defines the role of an operand in an instruction 
  * Can be used as mask to combine def and use. The complete def+use



Mime
View raw message