Mesa (main): nouveau: use bool literals instead of integers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 2 21:18:36 UTC 2021


Module: Mesa
Branch: main
Commit: b1782965740032a2c66818d40d9a19020a3d917b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1782965740032a2c66818d40d9a19020a3d917b

Author: Filip Gawin <filip.gawin at zoho.com>
Date:   Wed Sep  1 16:39:49 2021 +0200

nouveau: use bool literals instead of integers

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12678>

---

 .../drivers/nouveau/codegen/nv50_ir_build_util.cpp |  2 +-
 .../drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp | 24 +++++++++++-----------
 .../drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp  |  2 +-
 .../drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp  |  4 ++--
 .../drivers/nouveau/codegen/nv50_ir_from_nir.cpp   |  2 +-
 .../drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp  |  2 +-
 .../drivers/nouveau/codegen/nv50_ir_peephole.cpp   |  2 +-
 src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp |  2 +-
 8 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
index feafbd147b6..20ed5cd5250 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
@@ -340,7 +340,7 @@ BuildUtil::mkClobber(DataFile f, uint32_t rMask, int unit)
       int base2 = (baseSize2[mask] >>  8) & 0xf;
       int size2 = (baseSize2[mask] >> 12) & 0xf;
       Instruction *insn = mkOp(OP_NOP, TYPE_NONE, NULL);
-      if (1) { // size1 can't be 0
+      if (true) { // size1 can't be 0
          LValue *reg = new_LValue(func, f);
          reg->reg.size = size1 << unit;
          reg->reg.data.id = base + base1;
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
index 56bc9fc3cef..545477e0cd1 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
@@ -567,9 +567,9 @@ CodeEmitterGM107::emitCAL()
    const FlowInstruction *insn = this->insn->asFlow();
 
    if (insn->absolute) {
-      emitInsn(0xe2200000, 0); // JCAL
+      emitInsn(0xe2200000, false); // JCAL
    } else {
-      emitInsn(0xe2600000, 0); // CAL
+      emitInsn(0xe2600000, false); // CAL
    }
 
    if (!insn->srcExists(0) || insn->src(0).getFile() != FILE_MEMORY_CONST) {
@@ -595,7 +595,7 @@ CodeEmitterGM107::emitPCNT()
 {
    const FlowInstruction *insn = this->insn->asFlow();
 
-   emitInsn(0xe2b00000, 0);
+   emitInsn(0xe2b00000, false);
 
    if (!insn->srcExists(0) || insn->src(0).getFile() != FILE_MEMORY_CONST) {
       emitField(0x14, 24, insn->target.bb->binPos - (codeSize + 8));
@@ -617,7 +617,7 @@ CodeEmitterGM107::emitPBK()
 {
    const FlowInstruction *insn = this->insn->asFlow();
 
-   emitInsn(0xe2a00000, 0);
+   emitInsn(0xe2a00000, false);
 
    if (!insn->srcExists(0) || insn->src(0).getFile() != FILE_MEMORY_CONST) {
       emitField(0x14, 24, insn->target.bb->binPos - (codeSize + 8));
@@ -639,7 +639,7 @@ CodeEmitterGM107::emitPRET()
 {
    const FlowInstruction *insn = this->insn->asFlow();
 
-   emitInsn(0xe2700000, 0);
+   emitInsn(0xe2700000, false);
 
    if (!insn->srcExists(0) || insn->src(0).getFile() != FILE_MEMORY_CONST) {
       emitField(0x14, 24, insn->target.bb->binPos - (codeSize + 8));
@@ -661,7 +661,7 @@ CodeEmitterGM107::emitSSY()
 {
    const FlowInstruction *insn = this->insn->asFlow();
 
-   emitInsn(0xe2900000, 0);
+   emitInsn(0xe2900000, false);
 
    if (!insn->srcExists(0) || insn->src(0).getFile() != FILE_MEMORY_CONST) {
       emitField(0x14, 24, insn->target.bb->binPos - (codeSize + 8));
@@ -681,13 +681,13 @@ CodeEmitterGM107::emitSYNC()
 void
 CodeEmitterGM107::emitSAM()
 {
-   emitInsn(0xe3700000, 0);
+   emitInsn(0xe3700000, false);
 }
 
 void
 CodeEmitterGM107::emitRAM()
 {
-   emitInsn(0xe3800000, 0);
+   emitInsn(0xe3800000, false);
 }
 
 /*******************************************************************************
@@ -3880,7 +3880,7 @@ void
 SchedDataCalculatorGM107::setReuseFlag(Instruction *insn)
 {
    Instruction *next = insn->next;
-   BitSet defs(255, 1);
+   BitSet defs(255, true);
 
    if (!targ->isReuseSupported(insn))
       return;
@@ -4040,7 +4040,7 @@ SchedDataCalculatorGM107::setDelay(Instruction *insn, int delay,
 bool
 SchedDataCalculatorGM107::needRdDepBar(const Instruction *insn) const
 {
-   BitSet srcs(255, 1), defs(255, 1);
+   BitSet srcs(255, true), defs(255, true);
    int a, b;
 
    if (!targ->isBarrierRequired(insn))
@@ -4202,7 +4202,7 @@ SchedDataCalculatorGM107::insertBarriers(BasicBlock *bb)
    std::list<LiveBarUse> live_uses;
    std::list<LiveBarDef> live_defs;
    Instruction *insn, *next;
-   BitSet bars(6, 1);
+   BitSet bars(6, true);
    int bar_id;
 
    for (insn = bb->getEntry(); insn != NULL; insn = next) {
@@ -4278,7 +4278,7 @@ SchedDataCalculatorGM107::insertBarriers(BasicBlock *bb)
    }
 
    // Remove unnecessary barrier waits.
-   BitSet alive_bars(6, 1);
+   BitSet alive_bars(6, true);
    for (insn = bb->getEntry(); insn != NULL; insn = next) {
       int wr, rd, wt;
 
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index d6c8bf74cd3..1a0c63b7068 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -270,7 +270,7 @@ CodeEmitterNV50::emitFlagsWr(const Instruction *i)
       for (int d = 0; i->defExists(d); ++d)
          if (i->def(d).getFile() == FILE_FLAGS)
             flagsDef = d;
-      if (flagsDef >= 0 && 0) // TODO: enforce use of flagsDef at some point
+      if (flagsDef >= 0 && false) // TODO: enforce use of flagsDef at some point
          WARN("Instruction::flagsDef was not set properly\n");
    }
    if (flagsDef == 0 && i->defExists(1))
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
index 825d7f0ba67..c55aae3080d 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
@@ -2962,7 +2962,7 @@ CodeEmitterNVC0::getMinEncodingSize(const Instruction *i) const
 {
    const Target::OpInfo &info = targ->getOpInfo(i);
 
-   if (writeIssueDelays || info.minEncSize == 8 || 1)
+   if (writeIssueDelays || info.minEncSize == 8 || true)
       return 8;
 
    if (i->ftz || i->saturate || i->join)
@@ -2973,7 +2973,7 @@ CodeEmitterNVC0::getMinEncodingSize(const Instruction *i) const
       return 8;
 
    if (i->op == OP_PINTERP) {
-      if (i->getSampleMode() || 1) // XXX: grr, short op doesn't work
+      if (i->getSampleMode() || true) // XXX: grr, short op doesn't work
          return 8;
    } else
    if (i->op == OP_MOV && i->lanes != 0xf) {
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
index 37ad8a1a53b..a7a6c6a92f5 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -1706,7 +1706,7 @@ Converter::visit(nir_intrinsic_instr *insn)
          }
 
          TexInstruction *texi = mkTex(OP_TXF, TEX_TARGET_2D_MS_ARRAY, 0, 0, defs, srcs);
-         texi->tex.levelZero = 1;
+         texi->tex.levelZero = true;
          texi->tex.mask = mask;
          texi->tex.useOffsets = 0;
          texi->tex.r = 0xffff;
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index 3c0c9e79f1e..20b9ca8119a 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -2458,7 +2458,7 @@ Converter::handleFBFETCH(Value *dst[4])
    unsigned int c, d;
 
    texi->tex.target = TEX_TARGET_2D_MS_ARRAY;
-   texi->tex.levelZero = 1;
+   texi->tex.levelZero = true;
    texi->tex.useOffsets = 0;
 
    for (c = 0, d = 0; c < 4; ++c) {
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index f9424289059..f03c669fdcc 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -1737,7 +1737,7 @@ ModifierFolding::visit(BasicBlock *bb)
    for (i = bb->getEntry(); i; i = next) {
       next = i->next;
 
-      if (0 && i->op == OP_SUB) {
+      if (false && i->op == OP_SUB) {
          // turn "sub" into "add neg" (do we really want this ?)
          i->op = OP_ADD;
          i->src(0).mod = i->src(0).mod ^ Modifier(NV50_IR_MOD_NEG);
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
index 58544e8bd3e..b18a7a86fa8 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
@@ -2653,7 +2653,7 @@ RegAlloc::InsertConstraintsPass::insertConstraintMoves()
       Instruction *cst = *it;
       Instruction *mov;
 
-      if (cst->op == OP_SPLIT && 0) {
+      if (cst->op == OP_SPLIT && false) {
          // spilling splits is annoying, just make sure they're separate
          for (int d = 0; cst->defExists(d); ++d) {
             if (!cst->getDef(d)->refCount())



More information about the mesa-commit mailing list