Fix x86 type conversions. test-art-host-oat passes.
- test-art-host-oat enabled in test builds.
- Created inline versions of float-to-int and double-to-int.
- Fixed calls to helper functions for long-to-float/double and
float/double-to-long.
- Removed storePair and replaced its use with storeBaseDispWide (fixes
iput-wide and aput-wide with doubles).
- Renamed helper functions to have art_ prefix.
- Fixed move-exception to store the result back.
- Fixed floating point comparison when the destination reg is the same as
a source. The typing would get confused since the source is floating
point, but the result is int, and a clobber is needed to overwrite the
expected result type. A similar thing happens in float/double-to-int.
Change-Id: I0a876072254411aa42d6acadb8723be030727219
diff --git a/src/compiler_llvm/art_module.ll b/src/compiler_llvm/art_module.ll
index a2da2b6..caef683 100644
--- a/src/compiler_llvm/art_module.ll
+++ b/src/compiler_llvm/art_module.ll
@@ -160,10 +160,10 @@
; Math
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-declare i64 @D2L(double)
-declare i32 @D2I(double)
-declare i64 @F2L(float)
-declare i32 @F2I(float)
+declare i64 @art_d2l(double)
+declare i32 @art_d2i(double)
+declare i64 @art_f2l(float)
+declare i32 @art_f2i(float)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Temporary runtime support, will be removed in the future
diff --git a/src/compiler_llvm/generated/art_module.cc b/src/compiler_llvm/generated/art_module.cc
index b3963ef..cd93542 100644
--- a/src/compiler_llvm/generated/art_module.cc
+++ b/src/compiler_llvm/generated/art_module.cc
@@ -911,49 +911,49 @@
AttrListPtr func_art_check_put_array_element_from_code_PAL;
func_art_check_put_array_element_from_code->setAttributes(func_art_check_put_array_element_from_code_PAL);
-Function* func_D2L = mod->getFunction("D2L");
-if (!func_D2L) {
-func_D2L = Function::Create(
+Function* func_art_d2l = mod->getFunction("art_d2l");
+if (!func_art_d2l) {
+func_art_d2l = Function::Create(
/*Type=*/FuncTy_31,
/*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"D2L", mod); // (external, no body)
-func_D2L->setCallingConv(CallingConv::C);
+ /*Name=*/"art_d2l", mod); // (external, no body)
+func_art_d2l->setCallingConv(CallingConv::C);
}
-AttrListPtr func_D2L_PAL;
-func_D2L->setAttributes(func_D2L_PAL);
+AttrListPtr func_art_d2l_PAL;
+func_art_d2l->setAttributes(func_art_d2l_PAL);
-Function* func_D2I = mod->getFunction("D2I");
-if (!func_D2I) {
-func_D2I = Function::Create(
+Function* func_art_d2i = mod->getFunction("art_d2i");
+if (!func_art_d2i) {
+func_art_d2i = Function::Create(
/*Type=*/FuncTy_32,
/*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"D2I", mod); // (external, no body)
-func_D2I->setCallingConv(CallingConv::C);
+ /*Name=*/"art_d2i", mod); // (external, no body)
+func_art_d2i->setCallingConv(CallingConv::C);
}
-AttrListPtr func_D2I_PAL;
-func_D2I->setAttributes(func_D2I_PAL);
+AttrListPtr func_art_d2i_PAL;
+func_art_d2i->setAttributes(func_art_d2i_PAL);
-Function* func_F2L = mod->getFunction("F2L");
-if (!func_F2L) {
-func_F2L = Function::Create(
+Function* func_art_f2l = mod->getFunction("art_f2l");
+if (!func_art_f2l) {
+func_art_f2l = Function::Create(
/*Type=*/FuncTy_33,
/*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"F2L", mod); // (external, no body)
-func_F2L->setCallingConv(CallingConv::C);
+ /*Name=*/"art_f2l", mod); // (external, no body)
+func_art_f2l->setCallingConv(CallingConv::C);
}
-AttrListPtr func_F2L_PAL;
-func_F2L->setAttributes(func_F2L_PAL);
+AttrListPtr func_art_f2l_PAL;
+func_art_f2l->setAttributes(func_art_f2l_PAL);
-Function* func_F2I = mod->getFunction("F2I");
-if (!func_F2I) {
-func_F2I = Function::Create(
+Function* func_art_f2i = mod->getFunction("art_f2i");
+if (!func_art_f2i) {
+func_art_f2i = Function::Create(
/*Type=*/FuncTy_34,
/*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"F2I", mod); // (external, no body)
-func_F2I->setCallingConv(CallingConv::C);
+ /*Name=*/"art_f2i", mod); // (external, no body)
+func_art_f2i->setCallingConv(CallingConv::C);
}
-AttrListPtr func_F2I_PAL;
-func_F2I->setAttributes(func_F2I_PAL);
+AttrListPtr func_art_f2i_PAL;
+func_art_f2i->setAttributes(func_art_f2i_PAL);
Function* func_art_mark_gc_card_from_code = mod->getFunction("art_mark_gc_card_from_code");
if (!func_art_mark_gc_card_from_code) {
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 3f3e0ad..3f640ee 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -801,11 +801,11 @@
break;
case Instruction::FLOAT_TO_INT:
- EmitInsn_FPToInt(ARGS, kFloat, kInt, F2I);
+ EmitInsn_FPToInt(ARGS, kFloat, kInt, art_f2i);
break;
case Instruction::FLOAT_TO_LONG:
- EmitInsn_FPToInt(ARGS, kFloat, kLong, F2L);
+ EmitInsn_FPToInt(ARGS, kFloat, kLong, art_f2l);
break;
case Instruction::FLOAT_TO_DOUBLE:
@@ -813,11 +813,11 @@
break;
case Instruction::DOUBLE_TO_INT:
- EmitInsn_FPToInt(ARGS, kDouble, kInt, D2I);
+ EmitInsn_FPToInt(ARGS, kDouble, kInt, art_d2i);
break;
case Instruction::DOUBLE_TO_LONG:
- EmitInsn_FPToInt(ARGS, kDouble, kLong, D2L);
+ EmitInsn_FPToInt(ARGS, kDouble, kLong, art_d2l);
break;
case Instruction::DOUBLE_TO_FLOAT:
diff --git a/src/compiler_llvm/runtime_support_func_list.h b/src/compiler_llvm/runtime_support_func_list.h
index 5cf2374..62729c6 100644
--- a/src/compiler_llvm/runtime_support_func_list.h
+++ b/src/compiler_llvm/runtime_support_func_list.h
@@ -66,7 +66,7 @@
V(FixStub, art_fix_stub_from_code) \
V(ProxyInvokeHandler, art_proxy_invoke_handler_from_code) \
V(DecodeJObjectInThread, art_decode_jobject_in_thread) \
- V(D2L, D2L) \
- V(D2I, D2I) \
- V(F2L, F2L) \
- V(F2I, F2I)
+ V(art_d2l, art_d2l) \
+ V(art_d2i, art_d2i) \
+ V(art_f2l, art_f2l) \
+ V(art_f2i, art_f2i)
diff --git a/src/compiler_llvm/runtime_support_llvm.cc b/src/compiler_llvm/runtime_support_llvm.cc
index b0d59ea..a31c27e 100644
--- a/src/compiler_llvm/runtime_support_llvm.cc
+++ b/src/compiler_llvm/runtime_support_llvm.cc
@@ -595,7 +595,7 @@
#undef EXTERNAL_LINKAGE
static void* art_find_compiler_runtime_func(char const* name) {
-// TODO: If target support some math func, use the target's version. (e.g. D2I -> __aeabi_d2iz)
+// TODO: If target support some math func, use the target's version. (e.g. art_d2i -> __aeabi_d2iz)
static const char* const names[] = {
#define DEFINE_ENTRY(NAME) #NAME ,
#include "compiler_runtime_func_list.h"