src/share/vm/opto/regmask.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8076276 Cdiff src/share/vm/opto/regmask.cpp

src/share/vm/opto/regmask.cpp

Print this page
rev 8344 : 8076276: Add support for AVX512
Reviewed-by: kvn, roland
Contributed-by: michael.c.berg@intel.com

*** 112,126 **** 0 ); //============================================================================= bool RegMask::is_vector(uint ireg) { ! return (ireg == Op_VecS || ireg == Op_VecD || ireg == Op_VecX || ireg == Op_VecY); } int RegMask::num_registers(uint ireg) { switch(ireg) { case Op_VecY: return 8; case Op_VecX: return 4; case Op_VecD: --- 112,129 ---- 0 ); //============================================================================= bool RegMask::is_vector(uint ireg) { ! return (ireg == Op_VecS || ireg == Op_VecD || ! ireg == Op_VecX || ireg == Op_VecY || ireg == Op_VecZ ); } int RegMask::num_registers(uint ireg) { switch(ireg) { + case Op_VecZ: + return 16; case Op_VecY: return 8; case Op_VecX: return 4; case Op_VecD:
*** 231,241 **** } // True for both the empty mask and for a bit pair return true; } ! static int low_bits[3] = { 0x55555555, 0x11111111, 0x01010101 }; //------------------------------find_first_set--------------------------------- // Find the lowest-numbered register set in the mask. Return the // HIGHEST register number in the set, or BAD if no sets. // Works also for size 1. OptoReg::Name RegMask::find_first_set(const int size) const { --- 234,245 ---- } // True for both the empty mask and for a bit pair return true; } ! // only indicies of power 2 are accessed, so index 3 is only filled in for storage. ! static int low_bits[5] = { 0x55555555, 0x11111111, 0x01010101, 0x00000000, 0x00010001 }; //------------------------------find_first_set--------------------------------- // Find the lowest-numbered register set in the mask. Return the // HIGHEST register number in the set, or BAD if no sets. // Works also for size 1. OptoReg::Name RegMask::find_first_set(const int size) const {
*** 252,262 **** //------------------------------clear_to_sets---------------------------------- // Clear out partial bits; leave only aligned adjacent bit pairs void RegMask::clear_to_sets(const int size) { if (size == 1) return; ! assert(2 <= size && size <= 8, "update low bits table"); assert(is_power_of_2(size), "sanity"); int low_bits_mask = low_bits[size>>2]; for (int i = 0; i < RM_SIZE; i++) { int bits = _A[i]; int sets = (bits & low_bits_mask); --- 256,266 ---- //------------------------------clear_to_sets---------------------------------- // Clear out partial bits; leave only aligned adjacent bit pairs void RegMask::clear_to_sets(const int size) { if (size == 1) return; ! assert(2 <= size && size <= 16, "update low bits table"); assert(is_power_of_2(size), "sanity"); int low_bits_mask = low_bits[size>>2]; for (int i = 0; i < RM_SIZE; i++) { int bits = _A[i]; int sets = (bits & low_bits_mask);
*** 266,275 **** --- 270,282 ---- sets |= (sets>>1); // Smear 1 hi-bit into a set if (size > 2) { sets |= (sets>>2); // Smear 2 hi-bits into a set if (size > 4) { sets |= (sets>>4); // Smear 4 hi-bits into a set + if (size > 8) { + sets |= (sets>>8); // Smear 8 hi-bits into a set + } } } _A[i] = sets; } verify_sets(size);
*** 277,287 **** //------------------------------smear_to_sets---------------------------------- // Smear out partial bits to aligned adjacent bit sets void RegMask::smear_to_sets(const int size) { if (size == 1) return; ! assert(2 <= size && size <= 8, "update low bits table"); assert(is_power_of_2(size), "sanity"); int low_bits_mask = low_bits[size>>2]; for (int i = 0; i < RM_SIZE; i++) { int bits = _A[i]; int sets = 0; --- 284,294 ---- //------------------------------smear_to_sets---------------------------------- // Smear out partial bits to aligned adjacent bit sets void RegMask::smear_to_sets(const int size) { if (size == 1) return; ! assert(2 <= size && size <= 16, "update low bits table"); assert(is_power_of_2(size), "sanity"); int low_bits_mask = low_bits[size>>2]; for (int i = 0; i < RM_SIZE; i++) { int bits = _A[i]; int sets = 0;
*** 292,312 **** sets |= (sets<<1); // Smear 1 lo-bit into a set if (size > 2) { sets |= (sets<<2); // Smear 2 lo-bits into a set if (size > 4) { sets |= (sets<<4); // Smear 4 lo-bits into a set } } _A[i] = sets; } verify_sets(size); } //------------------------------is_aligned_set-------------------------------- bool RegMask::is_aligned_sets(const int size) const { if (size == 1) return true; ! assert(2 <= size && size <= 8, "update low bits table"); assert(is_power_of_2(size), "sanity"); int low_bits_mask = low_bits[size>>2]; // Assert that the register mask contains only bit sets. for (int i = 0; i < RM_SIZE; i++) { int bits = _A[i]; --- 299,322 ---- sets |= (sets<<1); // Smear 1 lo-bit into a set if (size > 2) { sets |= (sets<<2); // Smear 2 lo-bits into a set if (size > 4) { sets |= (sets<<4); // Smear 4 lo-bits into a set + if (size > 8) { + sets |= (sets<<8); // Smear 8 lo-bits into a set + } } } _A[i] = sets; } verify_sets(size); } //------------------------------is_aligned_set-------------------------------- bool RegMask::is_aligned_sets(const int size) const { if (size == 1) return true; ! assert(2 <= size && size <= 16, "update low bits table"); assert(is_power_of_2(size), "sanity"); int low_bits_mask = low_bits[size>>2]; // Assert that the register mask contains only bit sets. for (int i = 0; i < RM_SIZE; i++) { int bits = _A[i];
*** 328,338 **** //------------------------------is_bound_set----------------------------------- // Return TRUE if the mask contains one adjacent set of bits and no other bits. // Works also for size 1. int RegMask::is_bound_set(const int size) const { if( is_AllStack() ) return false; ! assert(1 <= size && size <= 8, "update low bits table"); int bit = -1; // Set to hold the one bit allowed for (int i = 0; i < RM_SIZE; i++) { if (_A[i] ) { // Found some bits if (bit != -1) return false; // Already had bits, so fail --- 338,348 ---- //------------------------------is_bound_set----------------------------------- // Return TRUE if the mask contains one adjacent set of bits and no other bits. // Works also for size 1. int RegMask::is_bound_set(const int size) const { if( is_AllStack() ) return false; ! assert(1 <= size && size <= 16, "update low bits table"); int bit = -1; // Set to hold the one bit allowed for (int i = 0; i < RM_SIZE; i++) { if (_A[i] ) { // Found some bits if (bit != -1) return false; // Already had bits, so fail
*** 344,357 **** return false; // Require adjacent bit set and no more bits } else { // Else its a split-set case if (((-1) & ~(bit-1)) != _A[i]) return false; // Found many bits, so fail i++; // Skip iteration forward and check high part ! // The lower 24 bits should be 0 since it is split case and size <= 8. ! int set = bit>>24; set = set & -set; // Remove sign extension. ! set = (((set << size) - 1) >> 8); if (i >= RM_SIZE || _A[i] != set) return false; // Require expected low bits in next word } } } --- 354,369 ---- return false; // Require adjacent bit set and no more bits } else { // Else its a split-set case if (((-1) & ~(bit-1)) != _A[i]) return false; // Found many bits, so fail i++; // Skip iteration forward and check high part ! // The lower (32-size) bits should be 0 since it is split case. ! int clear_bit_size = 32-size; ! int shift_back_size = 32-clear_bit_size; ! int set = bit>>clear_bit_size; set = set & -set; // Remove sign extension. ! set = (((set << size) - 1) >> shift_back_size); if (i >= RM_SIZE || _A[i] != set) return false; // Require expected low bits in next word } } }
*** 373,383 **** } //------------------------------Size------------------------------------------- // Compute size of register mask in bits uint RegMask::Size() const { ! extern uint8_t bitsInByte[256]; uint sum = 0; for( int i = 0; i < RM_SIZE; i++ ) sum += bitsInByte[(_A[i]>>24) & 0xff] + bitsInByte[(_A[i]>>16) & 0xff] + --- 385,395 ---- } //------------------------------Size------------------------------------------- // Compute size of register mask in bits uint RegMask::Size() const { ! extern uint8_t bitsInByte[512]; uint sum = 0; for( int i = 0; i < RM_SIZE; i++ ) sum += bitsInByte[(_A[i]>>24) & 0xff] + bitsInByte[(_A[i]>>16) & 0xff] +
src/share/vm/opto/regmask.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File