< prev index next >

src/cpu/sparc/vm/assembler_sparc.hpp

Print this page




 372     ASI_PRIMARY            = 0x80,
 373     ASI_PRIMARY_NOFAULT    = 0x82,
 374     ASI_PRIMARY_LITTLE     = 0x88,
 375     // 8x8-bit partial store
 376     ASI_PST8_PRIMARY       = 0xC0,
 377     // Block initializing store
 378     ASI_ST_BLKINIT_PRIMARY = 0xE2,
 379     // Most-Recently-Used (MRU) BIS variant
 380     ASI_ST_BLKINIT_MRU_PRIMARY = 0xF2
 381     // add more from book as needed
 382   };
 383 
 384  protected:
 385   // helpers
 386 
 387   // x is supposed to fit in a field "nbits" wide
 388   // and be sign-extended. Check the range.
 389 
 390   static void assert_signed_range(intptr_t x, int nbits) {
 391     assert(nbits == 32 || (-(1 << nbits-1) <= x  &&  x < ( 1 << nbits-1)),
 392            err_msg("value out of range: x=" INTPTR_FORMAT ", nbits=%d", x, nbits));
 393   }
 394 
 395   static void assert_signed_word_disp_range(intptr_t x, int nbits) {
 396     assert( (x & 3) == 0, "not word aligned");
 397     assert_signed_range(x, nbits + 2);
 398   }
 399 
 400   static void assert_unsigned_const(int x, int nbits) {
 401     assert( juint(x)  <  juint(1 << nbits), "unsigned constant out of range");
 402   }
 403 
 404   // fields: note bits numbered from LSB = 0,
 405   //  fields known by inclusive bit range
 406 
 407   static int fmask(juint hi_bit, juint lo_bit) {
 408     assert( hi_bit >= lo_bit  &&  0 <= lo_bit  &&  hi_bit < 32, "bad bits");
 409     return (1 << ( hi_bit-lo_bit + 1 )) - 1;
 410   }
 411 
 412   // inverse of u_field




 372     ASI_PRIMARY            = 0x80,
 373     ASI_PRIMARY_NOFAULT    = 0x82,
 374     ASI_PRIMARY_LITTLE     = 0x88,
 375     // 8x8-bit partial store
 376     ASI_PST8_PRIMARY       = 0xC0,
 377     // Block initializing store
 378     ASI_ST_BLKINIT_PRIMARY = 0xE2,
 379     // Most-Recently-Used (MRU) BIS variant
 380     ASI_ST_BLKINIT_MRU_PRIMARY = 0xF2
 381     // add more from book as needed
 382   };
 383 
 384  protected:
 385   // helpers
 386 
 387   // x is supposed to fit in a field "nbits" wide
 388   // and be sign-extended. Check the range.
 389 
 390   static void assert_signed_range(intptr_t x, int nbits) {
 391     assert(nbits == 32 || (-(1 << nbits-1) <= x  &&  x < ( 1 << nbits-1)),
 392            "value out of range: x=" INTPTR_FORMAT ", nbits=%d", x, nbits);
 393   }
 394 
 395   static void assert_signed_word_disp_range(intptr_t x, int nbits) {
 396     assert( (x & 3) == 0, "not word aligned");
 397     assert_signed_range(x, nbits + 2);
 398   }
 399 
 400   static void assert_unsigned_const(int x, int nbits) {
 401     assert( juint(x)  <  juint(1 << nbits), "unsigned constant out of range");
 402   }
 403 
 404   // fields: note bits numbered from LSB = 0,
 405   //  fields known by inclusive bit range
 406 
 407   static int fmask(juint hi_bit, juint lo_bit) {
 408     assert( hi_bit >= lo_bit  &&  0 <= lo_bit  &&  hi_bit < 32, "bad bits");
 409     return (1 << ( hi_bit-lo_bit + 1 )) - 1;
 410   }
 411 
 412   // inverse of u_field


< prev index next >