mem-ruby: Fix clang-14 compilation warning "use of bitwise"
Clang Version 14 throws a warning "use of bitwise '&/|' with boolean operands" for cases where bitwise operations are used where boolean operations are intended. This occurred in "WriteMast.hh", "data.isa", and "decode.cc" where boolean values were being compared using the bitwise operands. While bitwise operations are equivalent, they have been changed to boolean operations in this patch to avoid the clang-14 warning. Change-Id: Ic7583e13a325661712c75c8e1b234c4878832352 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64172 Reviewed-by: Tom Rollet <tom.rollet@huawei.com> Reviewed-by: Kunal Pai <kunpai@ucdavis.edu> Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Bobby Bruce
parent
abad2d6532
commit
6e182b025d
@@ -342,7 +342,7 @@ let {{
|
||||
''', flagType="none", buildCc=False)
|
||||
buildRegDataInst("qdadd", '''
|
||||
int32_t midRes;
|
||||
resTemp = saturateOp<32>(midRes, Op2_sw, Op2_sw) |
|
||||
resTemp = saturateOp<32>(midRes, Op2_sw, Op2_sw) ||
|
||||
saturateOp<32>(midRes, Op1_sw, midRes);
|
||||
Dest = midRes;
|
||||
''', flagType="saturate", buildNonCc=False)
|
||||
@@ -377,7 +377,7 @@ let {{
|
||||
''', flagType="none", buildCc=False)
|
||||
buildRegDataInst("qdsub", '''
|
||||
int32_t midRes;
|
||||
resTemp = saturateOp<32>(midRes, Op2_sw, Op2_sw) |
|
||||
resTemp = saturateOp<32>(midRes, Op2_sw, Op2_sw) ||
|
||||
saturateOp<32>(midRes, Op1_sw, midRes, true);
|
||||
Dest = midRes;
|
||||
''', flagType="saturate", buildNonCc=False)
|
||||
|
||||
@@ -300,7 +300,7 @@ Decode::squash(const DynInstPtr &inst, ThreadID tid)
|
||||
// Using PCState::branching() will send execution on the
|
||||
// fallthrough and this will not be caught at execution (since
|
||||
// branch was correctly predicted taken)
|
||||
toFetch->decodeInfo[tid].branchTaken = inst->readPredTaken() |
|
||||
toFetch->decodeInfo[tid].branchTaken = inst->readPredTaken() ||
|
||||
inst->isUncondCtrl();
|
||||
|
||||
toFetch->decodeInfo[tid].squashInst = inst;
|
||||
|
||||
@@ -170,7 +170,7 @@ class WriteMask
|
||||
{
|
||||
assert(mSize == writeMask.mSize);
|
||||
for (int i = 0; i < mSize; i++) {
|
||||
mMask[i] = (mMask.at(i)) & (writeMask.mMask.at(i));
|
||||
mMask[i] = (mMask.at(i)) && (writeMask.mMask.at(i));
|
||||
}
|
||||
|
||||
if (writeMask.mAtomic) {
|
||||
@@ -184,7 +184,7 @@ class WriteMask
|
||||
{
|
||||
assert(mSize == writeMask.mSize);
|
||||
for (int i = 0; i < mSize; i++) {
|
||||
mMask[i] = (mMask.at(i)) | (writeMask.mMask.at(i));
|
||||
mMask[i] = (mMask.at(i)) || (writeMask.mMask.at(i));
|
||||
}
|
||||
|
||||
if (writeMask.mAtomic) {
|
||||
|
||||
Reference in New Issue
Block a user