arch-riscv: Add template Vector1Vs1VdMaskDeclare

This commit adds a new template, Vector1Vs1VdMaskDeclare, to replace
the use of Vector1Vs1RdMaskDeclare in Vector1Vs1VdMaskFormat.

The change addresses the issue with the number of indices in srcRegIdxArr.
Only two indices are available in Vector1Vs1RdMaskDeclare, but instructions
that use Vector1Vs1VdMaskFormat, like 'vmsbf', require three indices
(for vs1, vs2(old_vd), and vm) to function correctly.

Change-Id: I0c966e11289ce07efcc3b0cc56948311289530ad
This commit is contained in:
QQeg
2024-01-26 15:18:07 +00:00
parent 31ffc11c57
commit 08ed87bc9d
2 changed files with 16 additions and 1 deletions

View File

@@ -1049,7 +1049,7 @@ def format Vector1Vs1VdMaskFormat(code, category, *flags){{
},
flags)
header_output = Vector1Vs1RdMaskDeclare.subst(iop)
header_output = Vector1Vs1VdMaskDeclare.subst(iop)
decoder_output = Vector1Vs1VdMaskConstructor.subst(iop)
exec_output = Vector1Vs1VdMaskExecute.subst(iop)
decode_block = VectorMaskDecodeBlock.subst(iop)

View File

@@ -951,6 +951,21 @@ Fault
}};
def template Vector1Vs1VdMaskDeclare {{
template<typename ElemType>
class %(class_name)s : public %(base_class)s {
private:
RegId srcRegIdxArr[3];
RegId destRegIdxArr[1];
bool vm;
public:
%(class_name)s(ExtMachInst _machInst);
Fault execute(ExecContext* xc, trace::InstRecord* traceData)const override;
using %(base_class)s::generateDisassembly;
};
}};
def template Vector1Vs1VdMaskConstructor {{