Commit e953edfc by Antonio Maiorano

Subzero: fix warnings for VS 2019 x86 build

Bug: b/142132927 Change-Id: If3d63a8327ef8940dbeee7b49c1099adda7feab2 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/37275Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent e81e8b3c
......@@ -100,7 +100,7 @@ class GlobalContext {
CodeStats() { reset(); }
void reset() { Stats.fill(0); }
void update(CSTag Tag, uint32_t Count = 1) {
assert(Tag < Stats.size());
assert(static_cast<SizeT>(Tag) < Stats.size());
Stats[Tag] += Count;
}
void add(const CodeStats &Other) {
......
......@@ -509,7 +509,7 @@ public:
(Trunc8RcvrRegisters)[Entry.Val] = Entry.IsTrunc8Rcvr;
(AhRcvrRegisters)[Entry.Val] = Entry.IsAhRcvr;
(*RegisterAliases)[Entry.Val].resize(RegisterSet::Reg_NUM);
for (int J = 0; J < Entry.NumAliases; J++) {
for (SizeT J = 0; J < Entry.NumAliases; J++) {
SizeT Alias = Entry.Aliases[J];
assert(!(*RegisterAliases)[Entry.Val][Alias] && "Duplicate alias");
(*RegisterAliases)[Entry.Val].set(Alias);
......@@ -730,7 +730,7 @@ public:
/// representation of the vector.
static Type getInVectorElementType(Type Ty) {
assert(isVectorType(Ty));
assert(Ty < TableTypeX8632AttributesSize);
assert(static_cast<size_t>(Ty) < TableTypeX8632AttributesSize);
return TableTypeX8632Attributes[Ty].InVectorElementType;
}
......@@ -785,7 +785,7 @@ public:
/// @}
static Cond::BrCond getIcmp32Mapping(InstIcmp::ICond Cond) {
assert(Cond < TableIcmp32Size);
assert(static_cast<size_t>(Cond) < TableIcmp32Size);
return TableIcmp32[Cond].Mapping;
}
......
......@@ -3414,7 +3414,7 @@ void TargetX86Base<TraitsType>::lowerFcmpAndConsumer(const InstFcmp *Fcmp,
// ucomiss b, c /* but swap b,c order if SwapOperands==true */
// setcc a, C1
InstFcmp::FCond Condition = Fcmp->getCondition();
assert(Condition < Traits::TableFcmpSize);
assert(static_cast<size_t>(Condition) < Traits::TableFcmpSize);
if (Traits::TableFcmp[Condition].SwapScalarOperands)
std::swap(Src0, Src1);
const bool HasC1 = (Traits::TableFcmp[Condition].C1 != Traits::Cond::Br_None);
......@@ -3495,7 +3495,7 @@ void TargetX86Base<TraitsType>::lowerFcmpVector(const InstFcmp *Fcmp) {
llvm::report_fatal_error("Expected vector compare");
InstFcmp::FCond Condition = Fcmp->getCondition();
assert(Condition < Traits::TableFcmpSize);
assert(static_cast<size_t>(Condition) < Traits::TableFcmpSize);
if (Traits::TableFcmp[Condition].SwapVectorOperands)
std::swap(Src0, Src1);
......@@ -3721,7 +3721,7 @@ TargetX86Base<TraitsType>::lowerIcmp64(const InstIcmp *Icmp,
Operand *Src1 = legalize(Icmp->getSrc(1));
Variable *Dest = Icmp->getDest();
InstIcmp::ICond Condition = Icmp->getCondition();
assert(Condition < Traits::TableIcmp64Size);
assert(static_cast<size_t>(Condition) < Traits::TableIcmp64Size);
Operand *Src0LoRM = nullptr;
Operand *Src0HiRM = nullptr;
// Legalize the portions of Src0 that are going to be needed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment