Changeset 3119 in CLRX


Ignore:
Timestamp:
Jun 2, 2017, 3:04:40 PM (21 months ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Fixed modifying instrRVUs for special cases (checking whether instrRVU.regField is not ASMFIELD_NONE).
Fixed testcases in GCNRegVarUsage.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdasm/GCNAssembler.cpp

    r3118 r3119  
    13791379            (dataToWrite ? ASMRVU_WRITE : 0);
    13801380    // check fcmpswap
    1381     if ((gcnInsn.mode & GCN_MHALFWRITE) != 0 && dataToWrite)
     1381    if ((gcnInsn.mode & GCN_MHALFWRITE) != 0 && dataToWrite &&
     1382            gcnAsm->instrRVUs[0].regField != ASMFIELD_NONE)
    13821383    {   // fix access
    13831384        AsmRegVarUsage& rvu = gcnAsm->instrRVUs[0];
     
    15611562    {
    15621563        AsmRegVarUsage* rvus = gcnAsm->instrRVUs;
    1563         rvus[0].regField = (rvus[0].regField==GCNFIELD_VOP_VDST) ? GCNFIELD_VOP3_VDST :
    1564                         GCNFIELD_VOP3_SDST0;
     1564        if (rvus[0].regField != ASMFIELD_NONE)
     1565            rvus[0].regField = (rvus[0].regField==GCNFIELD_VOP_VDST) ? GCNFIELD_VOP3_VDST :
     1566                            GCNFIELD_VOP3_SDST0;
    15651567        if (rvus[2].regField != ASMFIELD_NONE)
    15661568            rvus[2].regField = GCNFIELD_VOP3_SRC0;
     
    29902992    // check fcmpswap
    29912993    bool vdataDivided = false;
    2992     if ((gcnInsn.mode & GCN_MHALFWRITE) != 0 && vdataToWrite && !haveLds)
     2994    if ((gcnInsn.mode & GCN_MHALFWRITE) != 0 && vdataToWrite && !haveLds &&
     2995        gcnAsm->instrRVUs[0].regField != ASMFIELD_NONE)
    29932996    {   // fix access
    29942997        AsmRegVarUsage& rvu = gcnAsm->instrRVUs[0];
     
    30273030   
    30283031    if (haveTfe && (vdataDivided ||
    3029             gcnAsm->instrRVUs[0].rwFlags!=(ASMRVU_READ|ASMRVU_WRITE)))
     3032            gcnAsm->instrRVUs[0].rwFlags!=(ASMRVU_READ|ASMRVU_WRITE)) &&
     3033            gcnAsm->instrRVUs[0].regField != ASMFIELD_NONE)
    30303034    {   // fix for tfe
    30313035        const cxuint rvuId = (vdataDivided ? 4 : 0);
     
    32683272    // check fcmpswap
    32693273    bool vdataDivided = false;
    3270     if ((gcnInsn.mode & GCN_MHALFWRITE) != 0 && vdataToWrite)
     3274    if ((gcnInsn.mode & GCN_MHALFWRITE) != 0 && vdataToWrite &&
     3275        gcnAsm->instrRVUs[0].regField != ASMFIELD_NONE)
    32713276    {   // fix access
    32723277        AsmRegVarUsage& rvu = gcnAsm->instrRVUs[0];
     
    32833288   
    32843289    if (haveTfe && (vdataDivided ||
    3285             gcnAsm->instrRVUs[0].rwFlags!=(ASMRVU_READ|ASMRVU_WRITE)))
     3290            gcnAsm->instrRVUs[0].rwFlags!=(ASMRVU_READ|ASMRVU_WRITE)) &&
     3291       gcnAsm->instrRVUs[0].regField != ASMFIELD_NONE)
    32863292    {   // fix for tfe
    32873293        const cxuint rvuId = (vdataDivided ? 4 : 0);
     
    36783684    }
    36793685   
    3680     if (haveTfe && vdstReg)
     3686    if (haveTfe && vdstReg && gcnAsm->instrRVUs[0].regField != ASMFIELD_NONE)
    36813687    {   // fix for tfe
    36823688        AsmRegVarUsage& rvu = gcnAsm->instrRVUs[0];
  • CLRadeonExtender/trunk/tests/amdasm/GCNRegVarUsage.cpp

    r3053 r3119  
    13521352            { 88, "rcx4", 3, 5, GCNFIELD_FLAT_ADDR, ASMRVU_READ, 1 },
    13531353            { 88, "rbx4", 1, 3, GCNFIELD_FLAT_DATA, ASMRVU_READ, 1 },
    1354             { 88, "rex5", 7, 8, GCNFIELD_FLAT_VDSTLAST, ASMRVU_READ|ASMRVU_WRITE, 1 },
    13551354            // flat_atomic_add_x2 rex5[5:7], rcx4[3:4], rbx4[1:2] tfe glc
    13561355            { 96, "rex5", 5, 7, GCNFIELD_FLAT_VDST, ASMRVU_WRITE, 1 },
     
    13851384            { 152, nullptr, 256+91, 256+93, GCNFIELD_FLAT_ADDR, ASMRVU_READ, 0 },
    13861385            { 152, nullptr, 256+14, 256+16, GCNFIELD_FLAT_DATA, ASMRVU_READ, 0 },
    1387             { 152, nullptr, 256+41, 256+42, GCNFIELD_FLAT_VDSTLAST,
    1388                         ASMRVU_READ|ASMRVU_WRITE, 0 },
    13891386        },
    13901387        true, ""
Note: See TracChangeset for help on using the changeset viewer.