Skip to content

Widening vector instructions vd and vs constraint related bug #30

@KKKHHHLLL

Description

@KKKHHHLLL

In the execution function of Vwaddu_vxMicro, the vd and vs overlap constraint check is conducted as follows:
const uint32_t num_microops = 1 << std::max<int64_t>(0, vtype_vlmul(machInst.vtype8) + 1);

if ((machInst.vs2 <= machInst.vd) && (machInst.vd < (machInst.vs2 + num_microops - 1))) {
    // A destination vector register group can overlap a source vector
    // register group if The destination EEW is greater than the source
    // EEW, the source EMUL is at least 1, and the overlap is in the
    // highest- numbered part of the destination register group.
    std::string error =
        csprintf("Unsupported overlap in Vs2 and Vd for Widening op");
    return std::make_shared<IllegalInstFault>(error, machInst);
}

But the num_microops calculated here actually is the EMUL of destination vector register group, and it's added up with source vector index vs2 to check overlap. The add by 1 operation in calculating num_microops should be cancled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions