hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
changeset 25918 79e4c4d9f5c9
parent 24444 6620ba171a94
child 26693 f2910bf56d71
equal deleted inserted replaced
25917:4502b5680f05 25918:79e4c4d9f5c9
   165 typedef uint8_t  jubyte;
   165 typedef uint8_t  jubyte;
   166 typedef uint16_t jushort;
   166 typedef uint16_t jushort;
   167 typedef uint32_t juint;
   167 typedef uint32_t juint;
   168 typedef uint64_t julong;
   168 typedef uint64_t julong;
   169 
   169 
   170 //----------------------------------------------------------------------------------------------------
       
   171 // Special (possibly not-portable) casts
       
   172 // Cast floats into same-size integers and vice-versa w/o changing bit-pattern
       
   173 // %%%%%% These seem like standard C++ to me--how about factoring them out? - Ungar
       
   174 
       
   175 inline jint    jint_cast   (jfloat  x)           { return *(jint*   )&x; }
       
   176 inline jlong   jlong_cast  (jdouble x)           { return *(jlong*  )&x; }
       
   177 inline julong  julong_cast (jdouble x)           { return *(julong* )&x; }
       
   178 
       
   179 inline jfloat  jfloat_cast (jint    x)           { return *(jfloat* )&x; }
       
   180 inline jdouble jdouble_cast(jlong   x)           { return *(jdouble*)&x; }
       
   181 
   170 
   182 //----------------------------------------------------------------------------------------------------
   171 //----------------------------------------------------------------------------------------------------
   183 // Constant for jlong (specifying an long long canstant is C++ compiler specific)
   172 // Constant for jlong (specifying an long long canstant is C++ compiler specific)
   184 
   173 
   185 // Build a 64bit integer constant
   174 // Build a 64bit integer constant