mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 06:14:49 +02:00
6953477: Increase portability and flexibility of building Hotspot
A collection of portability improvements including shared code support for PPC, ARM platforms, software floating point, cross compilation support and improvements in error crash detail. Reviewed-by: phh, never, coleenp, dholmes
This commit is contained in:
parent
c45761e2a8
commit
b95c7e9523
113 changed files with 1669 additions and 559 deletions
|
@ -191,6 +191,121 @@ JRT_LEAF(jdouble, SharedRuntime::drem(jdouble x, jdouble y))
|
|||
return ((jdouble)fmod((double)x,(double)y));
|
||||
JRT_END
|
||||
|
||||
#ifdef __SOFTFP__
|
||||
JRT_LEAF(jfloat, SharedRuntime::fadd(jfloat x, jfloat y))
|
||||
return x + y;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jfloat, SharedRuntime::fsub(jfloat x, jfloat y))
|
||||
return x - y;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jfloat, SharedRuntime::fmul(jfloat x, jfloat y))
|
||||
return x * y;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jfloat, SharedRuntime::fdiv(jfloat x, jfloat y))
|
||||
return x / y;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jdouble, SharedRuntime::dadd(jdouble x, jdouble y))
|
||||
return x + y;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jdouble, SharedRuntime::dsub(jdouble x, jdouble y))
|
||||
return x - y;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jdouble, SharedRuntime::dmul(jdouble x, jdouble y))
|
||||
return x * y;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jdouble, SharedRuntime::ddiv(jdouble x, jdouble y))
|
||||
return x / y;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jfloat, SharedRuntime::i2f(jint x))
|
||||
return (jfloat)x;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jdouble, SharedRuntime::i2d(jint x))
|
||||
return (jdouble)x;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(jdouble, SharedRuntime::f2d(jfloat x))
|
||||
return (jdouble)x;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::fcmpl(float x, float y))
|
||||
return x>y ? 1 : (x==y ? 0 : -1); /* x<y or is_nan*/
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::fcmpg(float x, float y))
|
||||
return x<y ? -1 : (x==y ? 0 : 1); /* x>y or is_nan */
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::dcmpl(double x, double y))
|
||||
return x>y ? 1 : (x==y ? 0 : -1); /* x<y or is_nan */
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::dcmpg(double x, double y))
|
||||
return x<y ? -1 : (x==y ? 0 : 1); /* x>y or is_nan */
|
||||
JRT_END
|
||||
|
||||
// Functions to return the opposite of the aeabi functions for nan.
|
||||
JRT_LEAF(int, SharedRuntime::unordered_fcmplt(float x, float y))
|
||||
return (x < y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::unordered_dcmplt(double x, double y))
|
||||
return (x < y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::unordered_fcmple(float x, float y))
|
||||
return (x <= y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::unordered_dcmple(double x, double y))
|
||||
return (x <= y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::unordered_fcmpge(float x, float y))
|
||||
return (x >= y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::unordered_dcmpge(double x, double y))
|
||||
return (x >= y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::unordered_fcmpgt(float x, float y))
|
||||
return (x > y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(int, SharedRuntime::unordered_dcmpgt(double x, double y))
|
||||
return (x > y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
|
||||
JRT_END
|
||||
|
||||
// Intrinsics make gcc generate code for these.
|
||||
float SharedRuntime::fneg(float f) {
|
||||
return -f;
|
||||
}
|
||||
|
||||
double SharedRuntime::dneg(double f) {
|
||||
return -f;
|
||||
}
|
||||
|
||||
#endif // __SOFTFP__
|
||||
|
||||
#if defined(__SOFTFP__) || defined(E500V2)
|
||||
// Intrinsics make gcc generate code for these.
|
||||
double SharedRuntime::dabs(double f) {
|
||||
return (f <= (double)0.0) ? (double)0.0 - f : f;
|
||||
}
|
||||
|
||||
double SharedRuntime::dsqrt(double f) {
|
||||
return sqrt(f);
|
||||
}
|
||||
#endif
|
||||
|
||||
JRT_LEAF(jint, SharedRuntime::f2i(jfloat x))
|
||||
if (g_isnan(x))
|
||||
|
@ -2046,6 +2161,8 @@ int AdapterHandlerTable::_equals;
|
|||
int AdapterHandlerTable::_hits;
|
||||
int AdapterHandlerTable::_compact;
|
||||
|
||||
#endif
|
||||
|
||||
class AdapterHandlerTableIterator : public StackObj {
|
||||
private:
|
||||
AdapterHandlerTable* _table;
|
||||
|
@ -2081,7 +2198,6 @@ class AdapterHandlerTableIterator : public StackObj {
|
|||
}
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -2619,7 +2735,6 @@ JRT_LEAF(void, SharedRuntime::OSR_migration_end( intptr_t* buf) )
|
|||
FREE_C_HEAP_ARRAY(intptr_t,buf);
|
||||
JRT_END
|
||||
|
||||
#ifndef PRODUCT
|
||||
bool AdapterHandlerLibrary::contains(CodeBlob* b) {
|
||||
AdapterHandlerTableIterator iter(_adapters);
|
||||
while (iter.has_next()) {
|
||||
|
@ -2629,21 +2744,24 @@ bool AdapterHandlerLibrary::contains(CodeBlob* b) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void AdapterHandlerLibrary::print_handler(CodeBlob* b) {
|
||||
void AdapterHandlerLibrary::print_handler_on(outputStream* st, CodeBlob* b) {
|
||||
AdapterHandlerTableIterator iter(_adapters);
|
||||
while (iter.has_next()) {
|
||||
AdapterHandlerEntry* a = iter.next();
|
||||
if ( b == CodeCache::find_blob(a->get_i2c_entry()) ) {
|
||||
tty->print("Adapter for signature: ");
|
||||
tty->print_cr("%s i2c: " INTPTR_FORMAT " c2i: " INTPTR_FORMAT " c2iUV: " INTPTR_FORMAT,
|
||||
a->fingerprint()->as_string(),
|
||||
a->get_i2c_entry(), a->get_c2i_entry(), a->get_c2i_unverified_entry());
|
||||
st->print("Adapter for signature: ");
|
||||
st->print_cr("%s i2c: " INTPTR_FORMAT " c2i: " INTPTR_FORMAT " c2iUV: " INTPTR_FORMAT,
|
||||
a->fingerprint()->as_string(),
|
||||
a->get_i2c_entry(), a->get_c2i_entry(), a->get_c2i_unverified_entry());
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
assert(false, "Should have found handler");
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
void AdapterHandlerLibrary::print_statistics() {
|
||||
_adapters->print_statistics();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue