hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
changeset 11190 d561d41f241a
parent 10519 fb373fa38321
child 11637 030466036615
equal deleted inserted replaced
11189:c1ad8528ae68 11190:d561d41f241a
   853     Sync       = 1 << 6,
   853     Sync       = 1 << 6,
   854     MemIssue   = 1 << 5,
   854     MemIssue   = 1 << 5,
   855     Lookaside  = 1 << 4
   855     Lookaside  = 1 << 4
   856   };
   856   };
   857 
   857 
   858   // test if x is within signed immediate range for nbits
       
   859   static bool is_simm(intptr_t x, int nbits) { return -( intptr_t(1) << nbits-1 )  <= x   &&   x  <  ( intptr_t(1) << nbits-1 ); }
       
   860 
       
   861   // test if -4096 <= x <= 4095
       
   862   static bool is_simm13(intptr_t x) { return is_simm(x, 13); }
       
   863 
       
   864   static bool is_in_wdisp_range(address a, address b, int nbits) {
   858   static bool is_in_wdisp_range(address a, address b, int nbits) {
   865     intptr_t d = intptr_t(b) - intptr_t(a);
   859     intptr_t d = intptr_t(b) - intptr_t(a);
   866     return is_simm(d, nbits + 2);
   860     return is_simm(d, nbits + 2);
   867   }
   861   }
   868 
   862 
  1201 
  1195 
  1202   bool use_cbcond(Label& L) {
  1196   bool use_cbcond(Label& L) {
  1203     if (!UseCBCond || cbcond_before()) return false;
  1197     if (!UseCBCond || cbcond_before()) return false;
  1204     intptr_t x = intptr_t(target_distance(L)) - intptr_t(pc());
  1198     intptr_t x = intptr_t(target_distance(L)) - intptr_t(pc());
  1205     assert( (x & 3) == 0, "not word aligned");
  1199     assert( (x & 3) == 0, "not word aligned");
  1206     return is_simm(x, 12);
  1200     return is_simm12(x);
  1207   }
  1201   }
  1208 
  1202 
  1209   // Tells assembler you know that next instruction is delayed
  1203   // Tells assembler you know that next instruction is delayed
  1210   Assembler* delayed() {
  1204   Assembler* delayed() {
  1211 #ifdef CHECK_DELAY
  1205 #ifdef CHECK_DELAY