comparison src/share/vm/utilities/globalDefinitions.hpp @ 20804:7848fc12602b

Merge with jdk8u40-b25
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Tue, 07 Apr 2015 14:58:49 +0200
parents 52b4284cb496 b6a8cc1e0d92
children be896a1983c0
comparison
equal deleted inserted replaced
20184:84105dcdb05b 20804:7848fc12602b
555 // convert the operand to double, avoiding a dependency on __fabsf which 555 // convert the operand to double, avoiding a dependency on __fabsf which
556 // doesn't exist in early versions of Solaris 8. 556 // doesn't exist in early versions of Solaris 8.
557 inline double fabsd(double value) { 557 inline double fabsd(double value) {
558 return fabs(value); 558 return fabs(value);
559 } 559 }
560
561 //----------------------------------------------------------------------------------------------------
562 // Special casts
563 // Cast floats into same-size integers and vice-versa w/o changing bit-pattern
564 typedef union {
565 jfloat f;
566 jint i;
567 } FloatIntConv;
568
569 typedef union {
570 jdouble d;
571 jlong l;
572 julong ul;
573 } DoubleLongConv;
574
575 inline jint jint_cast (jfloat x) { return ((FloatIntConv*)&x)->i; }
576 inline jfloat jfloat_cast (jint x) { return ((FloatIntConv*)&x)->f; }
577
578 inline jlong jlong_cast (jdouble x) { return ((DoubleLongConv*)&x)->l; }
579 inline julong julong_cast (jdouble x) { return ((DoubleLongConv*)&x)->ul; }
580 inline jdouble jdouble_cast (jlong x) { return ((DoubleLongConv*)&x)->d; }
560 581
561 inline jint low (jlong value) { return jint(value); } 582 inline jint low (jlong value) { return jint(value); }
562 inline jint high(jlong value) { return jint(value >> 32); } 583 inline jint high(jlong value) { return jint(value >> 32); }
563 584
564 // the fancy casts are a hopefully portable way 585 // the fancy casts are a hopefully portable way