Commit 5fa78525 authored by Connor Abbott's avatar Connor Abbott

bifrost: Add fp16 compare instructions

parent 05378626
......@@ -443,6 +443,7 @@ static FMAOpInfo findFMAOpInfo(unsigned op)
opCmp = op & ~0x7;
break;
case FMAFcmp:
case FMAFcmp16:
opCmp = op & ~0x1fff;
break;
case FMAThreeSrc:
......@@ -728,6 +729,7 @@ enum ADDSrcType {
ADDTwoSrcFmod16Commutative,
ADDThreeSrc,
ADDFcmp,
ADDFcmp16,
ADDTexCompact, // texture instruction with embedded sampler
ADDTex, // texture instruction with sampler/etc. in uniform port
ADDVaryingInterp,
......@@ -819,6 +821,7 @@ static const ADDOpInfo ADDOpInfos[] = {
{ 0x10000, "MAX.v2f16", ADDTwoSrcFmod16Commutative },
{ 0x12000, "MIN.v2f16", ADDTwoSrcFmod16Commutative },
{ 0x14000, "ADD.v2f16", ADDTwoSrcFmod16 },
{ 0x17000, "FCMP.D3D", ADDFcmp16 },
{ 0x178c0, "ADD.i32", ADDTwoSrc },
{ 0x17900, "ADD.v2i16", ADDTwoSrc },
{ 0x17ac0, "SUB.i32", ADDTwoSrc },
......@@ -894,6 +897,7 @@ static ADDOpInfo findADDOpInfo(unsigned op)
opCmp = op & ~0xfff;
break;
case ADDFcmp:
case ADDFcmp16:
opCmp = op & ~0x7ff;
break;
case ADDTexCompact:
......@@ -955,8 +959,12 @@ static void DumpADD(uint64_t word, Regs regs, Regs nextRegs, uint64_t *consts, u
if (info.srcType == ADDTwoSrcFmod) {
// output modifiers
DumpOutputMod(bits(ADD.op, 8, 10));
} else if (info.srcType == ADDFcmp) {
} else if (info.srcType == ADDFcmp || info.srcType == ADDFcmp16) {
DumpFCMP(bits(ADD.op, 3, 6));
if (info.srcType == ADDFcmp)
printf(".f32");
else
printf(".v2f16");
}
printf(" ");
......@@ -1220,6 +1228,13 @@ static void DumpADD(uint64_t word, Regs regs, Regs nextRegs, uint64_t *consts, u
printf("abs(");
}
DumpSrc(ADD.src0, regs, consts, false);
switch ((ADD.op >> 6) & 0x3) {
case 3:
printf(".x");
break;
default:
break;
}
if (ADD.op & 0x100) {
printf(")");
}
......@@ -1228,9 +1243,31 @@ static void DumpADD(uint64_t word, Regs regs, Regs nextRegs, uint64_t *consts, u
printf("abs(");
}
DumpSrc(ADD.op & 0x7, regs, consts, false);
switch ((ADD.op >> 6) & 0x3) {
case 1:
case 3:
printf(".x");
break;
case 2:
printf(".y");
break;
case 0:
break;
default:
printf(".unk");
break;
}
if (ADD.op & 0x200) {
printf(")");
}
break;
case ADDFcmp16:
DumpSrc(ADD.src0, regs, consts, false);
Dump16Swizzle((ADD.op >> 6) & 0x3);
printf(", ");
DumpSrc(ADD.op & 0x7, regs, consts, false);
Dump16Swizzle((ADD.op >> 8) & 0x3);
break;
}
if (info.hasDataReg) {
printf(", R%d", dataReg);
......
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