summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-12-08 18:07:32 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-12-08 18:07:32 +0000
commitc4925d4c02dc8f8d51cb2653b5e7a99f6c9fd7d7 (patch)
treec315141775be96ba80f8efd9112f196c0364ded2 /runtime
parent1495a8e6409238bca28a33fd47913e382a85ea79 (diff)
parentd2ec87d84057174d4884ee16f652cbcfd31362e9 (diff)
downloadart-c4925d4c02dc8f8d51cb2653b5e7a99f6c9fd7d7.tar.gz
art-c4925d4c02dc8f8d51cb2653b5e7a99f6c9fd7d7.tar.bz2
art-c4925d4c02dc8f8d51cb2653b5e7a99f6c9fd7d7.zip
Merge "[optimizing compiler] Add REM_FLOAT and REM_DOUBLE"
Diffstat (limited to 'runtime')
-rw-r--r--runtime/arch/x86/entrypoints_init_x86.cc8
-rw-r--r--runtime/arch/x86/quick_entrypoints_x86.S29
-rw-r--r--runtime/arch/x86_64/entrypoints_init_x86_64.cc4
-rw-r--r--runtime/arch/x86_64/quick_entrypoints_x86_64.S2
4 files changed, 39 insertions, 4 deletions
diff --git a/runtime/arch/x86/entrypoints_init_x86.cc b/runtime/arch/x86/entrypoints_init_x86.cc
index 48d6c805f4..a1215420a4 100644
--- a/runtime/arch/x86/entrypoints_init_x86.cc
+++ b/runtime/arch/x86/entrypoints_init_x86.cc
@@ -29,6 +29,10 @@ namespace art {
extern "C" uint32_t art_quick_is_assignable(const mirror::Class* klass,
const mirror::Class* ref_class);
+// fmod entrypointes.
+extern "C" double art_quick_fmod(double, double);
+extern "C" float art_quick_fmodf(float, float);
+
void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints,
PortableEntryPoints* ppoints, QuickEntryPoints* qpoints) {
// Interpreter
@@ -105,9 +109,9 @@ void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints,
// points->pCmpgFloat = NULL; // Not needed on x86.
// points->pCmplDouble = NULL; // Not needed on x86.
// points->pCmplFloat = NULL; // Not needed on x86.
- // qpoints->pFmod = NULL; // Not needed on x86.
+ qpoints->pFmod = art_quick_fmod;
// qpoints->pL2d = NULL; // Not needed on x86.
- // qpoints->pFmodf = NULL; // Not needed on x86.
+ qpoints->pFmodf = art_quick_fmodf;
// qpoints->pL2f = NULL; // Not needed on x86.
// points->pD2iz = NULL; // Not needed on x86.
// points->pF2iz = NULL; // Not needed on x86.
diff --git a/runtime/arch/x86/quick_entrypoints_x86.S b/runtime/arch/x86/quick_entrypoints_x86.S
index 1ce01c46f1..0bfa1ce688 100644
--- a/runtime/arch/x86/quick_entrypoints_x86.S
+++ b/runtime/arch/x86/quick_entrypoints_x86.S
@@ -795,6 +795,35 @@ END_FUNCTION art_quick_memcpy
NO_ARG_DOWNCALL art_quick_test_suspend, artTestSuspendFromCode, ret
+DEFINE_FUNCTION art_quick_fmod
+ subl LITERAL(12), %esp // alignment padding
+ CFI_ADJUST_CFA_OFFSET(12)
+ PUSH ebx // pass arg4 b.hi
+ PUSH edx // pass arg3 b.lo
+ PUSH ecx // pass arg2 a.hi
+ PUSH eax // pass arg1 a.lo
+ SETUP_GOT_NOSAVE ebx // clobbers EBX
+ call PLT_SYMBOL(fmod) // (jdouble a, jdouble b)
+ fstpl (%esp) // pop return value off fp stack
+ movsd (%esp), %xmm0 // place into %xmm0
+ addl LITERAL(28), %esp // pop arguments
+ CFI_ADJUST_CFA_OFFSET(-28)
+ ret
+END_FUNCTION art_quick_fmod
+
+DEFINE_FUNCTION art_quick_fmodf
+ PUSH eax // alignment padding
+ PUSH ecx // pass arg2 b
+ PUSH eax // pass arg1 a
+ SETUP_GOT_NOSAVE ebx // clobbers EBX
+ call PLT_SYMBOL(fmodf) // (jfloat a, jfloat b)
+ fstps (%esp) // pop return value off fp stack
+ movss (%esp), %xmm0 // place into %xmm0
+ addl LITERAL(12), %esp // pop arguments
+ CFI_ADJUST_CFA_OFFSET(-12)
+ ret
+END_FUNCTION art_quick_fmodf
+
DEFINE_FUNCTION art_quick_d2l
PUSH eax // alignment padding
PUSH ecx // pass arg2 a.hi
diff --git a/runtime/arch/x86_64/entrypoints_init_x86_64.cc b/runtime/arch/x86_64/entrypoints_init_x86_64.cc
index a2766f7c52..2cfcfed209 100644
--- a/runtime/arch/x86_64/entrypoints_init_x86_64.cc
+++ b/runtime/arch/x86_64/entrypoints_init_x86_64.cc
@@ -110,9 +110,9 @@ void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints,
// points->pCmpgFloat = NULL; // Not needed on x86.
// points->pCmplDouble = NULL; // Not needed on x86.
// points->pCmplFloat = NULL; // Not needed on x86.
- // qpoints->pFmod = NULL; // Not needed on x86.
+ qpoints->pFmod = fmod;
// qpoints->pL2d = NULL; // Not needed on x86.
- // qpoints->pFmodf = NULL; // Not needed on x86.
+ qpoints->pFmodf = fmodf;
// qpoints->pL2f = NULL; // Not needed on x86.
// points->pD2iz = NULL; // Not needed on x86.
// points->pF2iz = NULL; // Not needed on x86.
diff --git a/runtime/arch/x86_64/quick_entrypoints_x86_64.S b/runtime/arch/x86_64/quick_entrypoints_x86_64.S
index a80e7d2989..7f85ab71b4 100644
--- a/runtime/arch/x86_64/quick_entrypoints_x86_64.S
+++ b/runtime/arch/x86_64/quick_entrypoints_x86_64.S
@@ -1101,6 +1101,8 @@ UNIMPLEMENTED art_quick_lmul
UNIMPLEMENTED art_quick_lshl
UNIMPLEMENTED art_quick_lshr
UNIMPLEMENTED art_quick_lushr
+UNIMPLEMENTED art_quick_fmod
+UNIMPLEMENTED art_quick_fmodf
THREE_ARG_REF_DOWNCALL art_quick_set8_instance, artSet8InstanceFromCode, RETURN_IF_EAX_ZERO
THREE_ARG_REF_DOWNCALL art_quick_set16_instance, artSet16InstanceFromCode, RETURN_IF_EAX_ZERO