arch-vega: Implement V_XNOR_B32
Change-Id: Id23a8d984f227ca23a92adb6c7fde3b4627af054
This commit is contained in:
@@ -4217,8 +4217,7 @@ namespace VegaISA
|
||||
GPUStaticInst*
|
||||
Decoder::decode_OP_VOP2__V_XNOR_B32(MachInst iFmt)
|
||||
{
|
||||
fatal("Trying to decode instruction without a class\n");
|
||||
return nullptr;
|
||||
return new Inst_VOP2__V_XNOR_B32(&iFmt->iFmt_VOP2);
|
||||
}
|
||||
|
||||
GPUStaticInst*
|
||||
|
||||
@@ -8132,6 +8132,40 @@ namespace VegaISA
|
||||
void execute(GPUDynInstPtr) override;
|
||||
}; // Inst_VOP2__V_FMAC_F32
|
||||
|
||||
class Inst_VOP2__V_XNOR_B32 : public Inst_VOP2
|
||||
{
|
||||
public:
|
||||
Inst_VOP2__V_XNOR_B32(InFmt_VOP2*);
|
||||
~Inst_VOP2__V_XNOR_B32();
|
||||
|
||||
int
|
||||
getNumOperands() override
|
||||
{
|
||||
return numDstRegOperands() + numSrcRegOperands();
|
||||
} // getNumOperands
|
||||
|
||||
int numDstRegOperands() override { return 1; }
|
||||
int numSrcRegOperands() override { return 2; }
|
||||
|
||||
int
|
||||
getOperandSize(int opIdx) override
|
||||
{
|
||||
switch (opIdx) {
|
||||
case 0: //src_0
|
||||
return 4;
|
||||
case 1: //src_1
|
||||
return 4;
|
||||
case 2: //vdst
|
||||
return 4;
|
||||
default:
|
||||
fatal("op idx %i out of bounds\n", opIdx);
|
||||
return -1;
|
||||
}
|
||||
} // getOperandSize
|
||||
|
||||
void execute(GPUDynInstPtr) override;
|
||||
}; // Inst_VOP2__V_XNOR_B32
|
||||
|
||||
class Inst_VOP1__V_NOP : public Inst_VOP1
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -2181,6 +2181,40 @@ namespace VegaISA
|
||||
}
|
||||
}
|
||||
|
||||
vdst.write();
|
||||
} // execute
|
||||
// --- Inst_VOP2__V_XNOR_B32 class methods ---
|
||||
|
||||
Inst_VOP2__V_XNOR_B32::Inst_VOP2__V_XNOR_B32(InFmt_VOP2 *iFmt)
|
||||
: Inst_VOP2(iFmt, "v_xnor_b32")
|
||||
{
|
||||
setFlag(ALU);
|
||||
} // Inst_VOP2__V_XNOR_B32
|
||||
|
||||
Inst_VOP2__V_XNOR_B32::~Inst_VOP2__V_XNOR_B32()
|
||||
{
|
||||
} // ~Inst_VOP2__V_XNOR_B32
|
||||
|
||||
// --- description from .arch file ---
|
||||
// D.u = S1.u - S0.u;
|
||||
void
|
||||
Inst_VOP2__V_XNOR_B32::execute(GPUDynInstPtr gpuDynInst)
|
||||
{
|
||||
Wavefront *wf = gpuDynInst->wavefront();
|
||||
ConstVecOperandU32 src0(gpuDynInst, instData.SRC0);
|
||||
ConstVecOperandU32 src1(gpuDynInst, instData.VSRC1);
|
||||
VecOperandU32 vdst(gpuDynInst, instData.VDST);
|
||||
|
||||
src0.readSrc();
|
||||
src1.read();
|
||||
vdst.read();
|
||||
|
||||
for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
|
||||
if (wf->execMask(lane)) {
|
||||
vdst[lane] = ~(src0[lane] ^ src1[lane]);
|
||||
}
|
||||
}
|
||||
|
||||
vdst.write();
|
||||
} // execute
|
||||
} // namespace VegaISA
|
||||
|
||||
Reference in New Issue
Block a user