Wire up D2I and F2I for x86, and implement a trivial Lmul.
Change-Id: I6a8b84a7691392eb87af066fb4835191512ae832
diff --git a/src/oat/runtime/support_math.cc b/src/oat/runtime/support_math.cc
index 7c6e0b1..cbffc2b 100644
--- a/src/oat/runtime/support_math.cc
+++ b/src/oat/runtime/support_math.cc
@@ -62,6 +62,10 @@
return -1;
}
+int64_t Lmul(int64_t a, int64_t b) {
+ return a * b;
+}
+
extern "C" int64_t artLdivFromCode(int64_t a, int64_t b) {
return a / b;
}
diff --git a/src/oat/runtime/x86/oat_support_entrypoints_x86.cc b/src/oat/runtime/x86/oat_support_entrypoints_x86.cc
index 6720e3e..7ded2d1 100644
--- a/src/oat/runtime/x86/oat_support_entrypoints_x86.cc
+++ b/src/oat/runtime/x86/oat_support_entrypoints_x86.cc
@@ -71,6 +71,7 @@
extern int32_t CmplDouble(double a, double b);
extern int32_t CmpgFloat(float a, float b);
extern int32_t CmplFloat(float a, float b);
+extern int64_t Lmul(int64_t a, int64_t b);
extern "C" int32_t art_idiv_from_code(int32_t, int32_t);
extern "C" int32_t art_idivmod_from_code(int32_t, int32_t);
extern "C" int64_t art_ldiv_from_code(int64_t, int64_t);
@@ -163,31 +164,31 @@
points->pCmpgFloat = CmpgFloat;
points->pCmplDouble = CmplDouble;
points->pCmplFloat = CmplFloat;
- //points->pDadd = NULL;
- //points->pDdiv = NULL;
- //points->pDmul = NULL;
- //points->pDsub = NULL;
+ //points->pDadd = NULL; // Not needed on x86.
+ //points->pDdiv = NULL; // Not needed on x86.
+ //points->pDmul = NULL; // Not needed on x86.
+ //points->pDsub = NULL; // Not needed on x86.
//points->pF2d = NULL;
//points->pFmod = NULL;
//points->pI2d = NULL;
//points->pL2d = NULL;
//points->pD2f = NULL;
- //points->pFadd = NULL;
- //points->pFdiv = NULL;
+ //points->pFadd = NULL; // Not needed on x86.
+ //points->pFdiv = NULL; // Not needed on x86.
//points->pFmodf = NULL;
- //points->pFmul = NULL;
- //points->pFsub = NULL;
+ //points->pFmul = NULL; // Not needed on x86.
+ //points->pFsub = NULL; // Not needed on x86.
//points->pI2f = NULL;
//points->pL2f = NULL;
- //points->pD2iz = NULL;
- //points->pF2iz = NULL;
+ points->pD2iz = D2I;
+ points->pF2iz = F2I;
points->pIdiv = art_idiv_from_code;
points->pIdivmod = art_idivmod_from_code;
points->pD2l = D2L;
points->pF2l = F2L;
points->pLdiv = art_ldiv_from_code;
points->pLdivmod = art_ldivmod_from_code;
- //points->pLmul = NULL;
+ points->pLmul = Lmul;
points->pShlLong = art_lshl_from_code;
points->pShrLong = art_lshr_from_code;
points->pUshrLong = art_lushr_from_code;