misc: Fix VecPredReg coding style

* get_bits -> getBits
* set_bits -> setBits
* set_raw -> setRaw
* get_raw -> getRaw

Change-Id: I57c0217dc399b7e1c5b007ed862d7ed221d5ac0b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44505
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Giacomo Travaglini
2021-04-14 12:52:26 +01:00
parent 921d370135
commit 8e5e603041
3 changed files with 12 additions and 12 deletions

View File

@@ -693,13 +693,13 @@ ThreadContext::readVecPredReg(const RegId &reg_id) const
size_t num_bits = reg.NUM_BITS;
uint8_t *bytes = (uint8_t *)result.data.data();
while (num_bits > 8) {
reg.set_bits(offset, 8, *bytes);
reg.setBits(offset, 8, *bytes);
offset += 8;
num_bits -= 8;
bytes++;
}
if (num_bits)
reg.set_bits(offset, num_bits, *bytes);
reg.setBits(offset, num_bits, *bytes);
return reg;
}

View File

@@ -2623,7 +2623,7 @@ let {{
code +='''
const SElement& srcElem1 = auxPOp1[i];'''
code += '''
destPred.set_raw(i, 0);
destPred.setRaw(i, 0);
PDest_xd[i] = srcElem1;'''
else:
if unpackHalf == Unpack.High:
@@ -2836,8 +2836,8 @@ let {{
ArmISA::VecPredRegContainer tmpPredC;
auto auxPOp1 = tmpPredC.as<Element>();
for (unsigned i = 0; i < eCount; ++i) {
uint8_t v = POp1_x.get_raw(i);
auxPOp1.set_raw(i, v);
uint8_t v = POp1_x.getRaw(i);
auxPOp1.setRaw(i, v);
}
PDest_x[0] = 0;'''
else:
@@ -2854,7 +2854,7 @@ let {{
AA64FpDest_x[i] = auxOp1[eCount - i - 1];'''
else:
code += '''
destPred.set_raw(i, auxPOp1.get_raw(eCount - i - 1));'''
destPred.setRaw(i, auxPOp1.getRaw(eCount - i - 1));'''
code += '''
}'''
iop = ArmInstObjParams(name, 'Sve' + Name, 'SveUnaryUnpredOp',

View File

@@ -118,18 +118,18 @@ class VecPredRegT
/// Return an element of the predicate register as it appears
/// in the raw (untyped) internal representation
uint8_t
get_raw(size_t idx) const
getRaw(size_t idx) const
{
return container.get_bits(idx * (Packed ? 1 : sizeof(VecElem)),
return container.getBits(idx * (Packed ? 1 : sizeof(VecElem)),
(Packed ? 1 : sizeof(VecElem)));
}
/// Write a raw value in an element of the predicate register
template<bool Condition = !Const>
std::enable_if_t<Condition>
set_raw(size_t idx, uint8_t val)
setRaw(size_t idx, uint8_t val)
{
container.set_bits(idx * (Packed ? 1 : sizeof(VecElem)),
container.setBits(idx * (Packed ? 1 : sizeof(VecElem)),
(Packed ? 1 : sizeof(VecElem)), val);
}
@@ -302,7 +302,7 @@ class VecPredRegContainer
/// Returns a subset of bits starting from a specific element in the
/// container.
uint8_t
get_bits(size_t idx, uint8_t nbits) const
getBits(size_t idx, uint8_t nbits) const
{
assert(nbits > 0 && nbits <= 8 && (idx + nbits - 1) < NumBits);
uint8_t v = 0;
@@ -317,7 +317,7 @@ class VecPredRegContainer
/// Set a subset of bits starting from a specific element in the
/// container.
void
set_bits(size_t idx, uint8_t nbits, uint8_t bval)
setBits(size_t idx, uint8_t nbits, uint8_t bval)
{
assert(nbits > 0 && nbits <= 8 && (idx + nbits - 1) < NumBits);
for (int i = 0; i < nbits; ++i, ++idx) {