harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r649809 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32: Ia32APIMagics.cpp Ia32IRManager.cpp
Date Sat, 19 Apr 2008 13:42:02 GMT
Author: mfursov
Date: Sat Apr 19 06:41:51 2008
New Revision: 649809

URL: http://svn.apache.org/viewvc?rev=649809&view=rev
Log:
Fix for HARMONY-5757 [drlvm][jit][opt][performance] j.l.Float.floatToIntBits implementation
on magics

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.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=649809&r1=649808&r2=649809&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 Sat Apr
19 06:41:51 2008
@@ -107,6 +107,8 @@
 DECLARE_HELPER_INLINER(String_compareTo_Handler_x_String_x_I);
 DECLARE_HELPER_INLINER(String_regionMatches_Handler_x_I_x_String_x_I_x_I_x_Z);
 DECLARE_HELPER_INLINER(String_indexOf_Handler_x_String_x_I_x_I);
+DECLARE_HELPER_INLINER(Float_floatToRawIntBits_x_F_x_I);
+DECLARE_HELPER_INLINER(Float_intBitsToFloat_x_I_x_F);
 
 void APIMagicsHandlerSession::runImpl() {
     CompilationContext* cc = getCompilationContext();
@@ -152,6 +154,12 @@
                             } else if (!strcmp(methodName, "numberOfTrailingZeros") &&
!strcmp(signature, "(J)I")) {
                                 handlers.push_back(new (tmpMM) Long_numberOfTrailingZeros_Handler_x_J_x_I(irm,
callInst, md));
                             }
+                        } else if (!strcmp(className, "java/lang/Float")) {
+                            if (!strcmp(methodName, "floatToRawIntBits") && !strcmp(signature,
"(F)I")) {
+                                handlers.push_back(new (tmpMM) Float_floatToRawIntBits_x_F_x_I(irm,
callInst, md));
+                            } else if (!strcmp(methodName, "intBitsToFloat") && !strcmp(signature,
"(I)F")) {
+                                handlers.push_back(new (tmpMM) Float_intBitsToFloat_x_I_x_F(irm,
callInst, md));
+                            }
                         } else if (mathAsMagic && !strcmp(className, "java/lang/Math"))
{
                             if (!strcmp(signature, "(D)D")) { 
                                 if (!strcmp(methodName, "sqrt")) {                      
            
@@ -247,6 +255,24 @@
     irm->newInstEx(Mnemonic_CMOVZ, 1, r1, r1, r2)->insertBefore(callInst);
     irm->newInstEx(Mnemonic_SUB, 1, res, irm->newImmOpnd(i32Type, 31), r1)->insertBefore(callInst);
 
+    callInst->unlink();
+}
+
+void Float_floatToRawIntBits_x_F_x_I::run() {
+
+    Opnd* arg = getCallSrc(callInst, 0);
+    Opnd* res = getCallDst(callInst);
+
+    irm->newCopyPseudoInst(Mnemonic_MOV, res, arg)->insertBefore(callInst);
+    callInst->unlink();
+}
+
+void Float_intBitsToFloat_x_I_x_F::run() {
+
+    Opnd* arg = getCallSrc(callInst, 0);
+    Opnd* res = getCallDst(callInst);
+
+    irm->newCopyPseudoInst(Mnemonic_MOV, res, arg)->insertBefore(callInst);
     callInst->unlink();
 }
 

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=649809&r1=649808&r2=649809&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 Sat Apr
19 06:41:51 2008
@@ -1166,6 +1166,14 @@
     }else if (targetKind==OpndKind_Mem && sourceKind==OpndKind_FPReg){
         targetOpnd->setMemOpndAlignment(Opnd::MemOpndAlignment_16);
         return newInst(Mnemonic_FSTP, targetOpnd, sourceOpnd);
+    }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 ((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 (
         (targetKind==OpndKind_FPReg && sourceKind==OpndKind_XMMReg)||
         (targetKind==OpndKind_XMMReg && sourceKind==OpndKind_FPReg)



Mime
View raw message