8149488: Incorrect declaration of bitsInByte in regmask.cpp
Corrected BITS_IN_BYTE_ARRAY_SIZE value as 256 for all bitsInByte usage. Reviewed-by: dlong, mcberg, thartmann, vlivanov
This commit is contained in:
parent
cce84da126
commit
28e72b2675
@ -31,7 +31,7 @@
|
|||||||
// BitsInByte is a lookup table which tells the number of bits that
|
// BitsInByte is a lookup table which tells the number of bits that
|
||||||
// are in the looked-up number. It is very useful in VectorSet_Size.
|
// are in the looked-up number. It is very useful in VectorSet_Size.
|
||||||
|
|
||||||
uint8_t bitsInByte[256] = {
|
uint8_t bitsInByte[BITS_IN_BYTE_ARRAY_SIZE] = {
|
||||||
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
|
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
|
||||||
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
|
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
|
||||||
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
|
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include "libadt/set.hpp"
|
#include "libadt/set.hpp"
|
||||||
|
|
||||||
|
#define BITS_IN_BYTE_ARRAY_SIZE 256
|
||||||
|
|
||||||
// Vector Sets - An Abstract Data Type
|
// Vector Sets - An Abstract Data Type
|
||||||
//INTERFACE
|
//INTERFACE
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ bool RegMask::is_UP() const {
|
|||||||
//------------------------------Size-------------------------------------------
|
//------------------------------Size-------------------------------------------
|
||||||
// Compute size of register mask in bits
|
// Compute size of register mask in bits
|
||||||
uint RegMask::Size() const {
|
uint RegMask::Size() const {
|
||||||
extern uint8_t bitsInByte[512];
|
extern uint8_t bitsInByte[BITS_IN_BYTE_ARRAY_SIZE];
|
||||||
uint sum = 0;
|
uint sum = 0;
|
||||||
for( int i = 0; i < RM_SIZE; i++ )
|
for( int i = 0; i < RM_SIZE; i++ )
|
||||||
sum +=
|
sum +=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user