nouveau: use bool literals instead of integers
authorFilip Gawin <filip.gawin@zoho.com>
Wed, 1 Sep 2021 14:39:49 +0000 (16:39 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 2 Sep 2021 21:08:00 +0000 (21:08 +0000)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12678>

src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gm107.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp

index feafbd1..20ed5cd 100644 (file)
@@ -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;
index 56bc9fc..545477e 100644 (file)
@@ -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;
 
index d6c8bf7..1a0c63b 100644 (file)
@@ -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))
index 825d7f0..c55aae3 100644 (file)
@@ -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) {
index 37ad8a1..a7a6c6a 100644 (file)
@@ -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;
index 3c0c9e7..20b9ca8 100644 (file)
@@ -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) {
index f942428..f03c669 100644 (file)
@@ -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);
index 58544e8..b18a7a8 100644 (file)
@@ -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())