Commit bd836eb5 authored by Lyude Paul's avatar Lyude Paul

BifrostDisasm: Fix all warnings

parent a63e552c
......@@ -108,8 +108,9 @@ static unsigned GetRegToWrite(RegWriteUnit unit, Regs regs)
return regs.reg2;
case RegWrite3:
return regs.reg3;
case RegWriteNone:
default: /* RegWriteNone */
assert(0);
return 0;
}
}
......@@ -125,19 +126,19 @@ static void DumpRegs(Regs srcs)
}
if (ctrl.readReg1)
printf("port 1: R%d ", srcs.reg1);
printf("port 1: R%" PRId64 " ", srcs.reg1);
if (ctrl.FMAWriteUnit == RegWrite2)
printf("port 2: R%d (write FMA) ", srcs.reg2);
printf("port 2: R%" PRId64 " (write FMA) ", srcs.reg2);
else if (ctrl.ADDWriteUnit == RegWrite2)
printf("port 2: R%d (write ADD) ", srcs.reg2);
printf("port 2: R%" PRId64 " (write ADD) ", srcs.reg2);
if (ctrl.FMAWriteUnit == RegWrite3)
printf("port 3: R%d (write FMA) ", srcs.reg3);
printf("port 3: R%" PRId64 " (write FMA) ", srcs.reg3);
else if (ctrl.ADDWriteUnit == RegWrite3)
printf("port 3: R%d (write ADD) ", srcs.reg3);
printf("port 3: R%" PRId64 " (write ADD) ", srcs.reg3);
else if (ctrl.readReg3)
printf("port 3: R%d (read) ", srcs.reg3);
printf("port 3: R%" PRId64 " (read) ", srcs.reg3);
if (srcs.uniformConst) {
if (srcs.uniformConst & 0x80) {
......@@ -184,8 +185,8 @@ static void DumpSrc(unsigned src, Regs srcs, uint64_t *consts, bool isFMA)
printf("R%d", reg);
break;
}
case 1: printf("R%d", srcs.reg1); break;
case 2: printf("R%d", srcs.reg3); break;
case 1: printf("R%" PRId64, srcs.reg1); break;
case 2: printf("R%" PRId64, srcs.reg3); break;
case 3:
if (isFMA)
printf("0");
......@@ -380,7 +381,7 @@ static const FMAOpInfo FMAOpInfos[] = {
static FMAOpInfo findFMAOpInfo(unsigned op)
{
for (int i = 0; i < ARRAY_SIZE(FMAOpInfos); i++) {
for (unsigned i = 0; i < ARRAY_SIZE(FMAOpInfos); i++) {
unsigned opCmp;
switch (FMAOpInfos[i].srcType) {
case FMAOneSrc:
......@@ -656,7 +657,7 @@ static const ADDOpInfo ADDOpInfos[] = {
static ADDOpInfo findADDOpInfo(unsigned op)
{
for (int i = 0; i < ARRAY_SIZE(ADDOpInfos); i++) {
for (unsigned i = 0; i < ARRAY_SIZE(ADDOpInfos); i++) {
unsigned opCmp;
switch (ADDOpInfos[i].srcType) {
case ADDOneSrc:
......@@ -957,7 +958,7 @@ struct AluInstr {
void DumpInstr(const AluInstr &instr, Regs nextRegs, uint64_t *consts, unsigned dataReg)
{
printf("# regs: %016" PRIx32 "\n", instr.regBits);
printf("# regs: %016" PRIx64 "\n", instr.regBits);
Regs regs;
memcpy((char *) &regs, (char *) &instr.regBits, sizeof(regs));
DumpRegs(regs);
......@@ -980,7 +981,7 @@ struct Header {
void DumpHeader(Header header)
{
if (header.clauseType != 0) {
printf("id(%d)", header.scoreboardIndex);
printf("id(%" PRId64 "u)", header.scoreboardIndex);
if (header.scoreboardDeps != 0) {
printf(", next-wait(");
bool first = true;
......@@ -998,8 +999,8 @@ void DumpHeader(Header header)
printf("\n");
}
printf("# clause type %d, next clause type %d\n",
header.clauseType, header.nextClauseType);
printf("# clause type %" PRId64 ", next clause type %" PRId64 "\n",
header.clauseType, header.nextClauseType);
}
void DumpClause(uint32_t *words, unsigned *size)
......@@ -1198,9 +1199,9 @@ void DumpClause(uint32_t *words, unsigned *size)
}
printf("}\n");
for (int i = 0; i < numConsts; i++) {
printf("# const%d: %08x\n", 2 * i, consts[i] & 0xffffffff);
printf("# const%d: %08x\n", 2 * i + 1, consts[i] >> 32);
for (unsigned i = 0; i < numConsts; i++) {
printf("# const%d: %08lx\n", 2 * i, consts[i] & 0xffffffff);
printf("# const%d: %08" PRIx64 "\n", 2 * i + 1, consts[i] >> 32);
}
}
......
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