Changeset 4799 in CLRX


Ignore:
Timestamp:
Jul 17, 2019, 5:15:41 PM (5 weeks ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Add SOPP instructions testcases for GFX10. Fix LGKMCNT range for GFX10.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r4798 r4799  
    625625    bool good = true;
    626626    const bool isGCN14 = (arch & ARCH_GCN_1_4)!=0;
     627    const bool isGCN15 = (arch & ARCH_GCN_1_5)!=0;
    627628    if (gcnEncSize==GCNEncSize::BIT64)
    628629        ASM_FAIL_BY_ERROR(instrPlace, "Only 32-bit size for SOPP encoding")
     
    664665            bool haveExpCnt = false;
    665666            bool haveVMCnt = false;
    666             imm16 = isGCN14 ? 0xcf7f : 0xf7f;
     667            imm16 = isGCN15 ? 0xff7f : (isGCN14 ? 0xcf7f : 0xf7f);
    667668            while (true)
    668669            {
     
    683684                        asmr.printWarning(funcNamePlace, "vmcnt was already defined");
    684685                    bitPos = 0;
    685                     bitMask = isGCN14 ? 63 : 15;
     686                    bitMask = (isGCN14 || isGCN15) ? 63 : 15;
    686687                    doVMCnt = haveVMCnt = true;
    687688                }
     
    691692                        asmr.printWarning(funcNamePlace, "lgkmcnt was already defined");
    692693                    bitPos = 8;
    693                     bitMask = 15;
     694                    bitMask = isGCN15 ? 63 : 15;
    694695                    haveLgkmCnt = true;
    695696                }
     
    721722                    if (value > bitMask)
    722723                        asmr.printWarning(argPlace, "Value out of range");
    723                     if (!isGCN14 || !doVMCnt)
     724                    if ((!isGCN14 && !isGCN15) || !doVMCnt)
    724725                        imm16 = (imm16 & ~(bitMask<<bitPos)) | ((value&bitMask)<<bitPos);
    725726                    else // vmcnt for GFX9
  • CLRadeonExtender/trunk/tests/amdasm/GCNAsmOpc15.cpp

    r4798 r4799  
    421421    { "    s_subvector_loop_begin s43, 0xd3b9", 0xbdabd3b9U, 0, false, true, "" },
    422422    { "    s_subvector_loop_end s43, 0xd3b9", 0xbe2bd3b9U, 0, false, true, "" },
     423    /* SOPP encoding */
     424    { "s_nop  0x0", 0xbf800000U, 0, false, true, "" },
     425    { "s_nop  7", 0xbf800007U, 0, false, true, "" },
     426    { "s_nop  644", 0xbf800284U, 0, false, true, "" },
     427    { "xv=6; xt=65; s_nop  xv+xt", 0xbf800047U, 0, false, true, "" },
     428    { "s_nop  xv+xt; xv=6; xt=65", 0xbf800047U, 0, false, true, "" },
     429    { "s_endpgm", 0xbf810000U, 0, false, true, "" },
     430    { "    s_wakeup\n", 0xbf830000U, 0, false, true, "" },
     431    { "    s_branch xxxx-8\nxxxx:\n", 0xbf82fffeU, 0, false, true, "" },
     432    { "xxxx:    s_branch xxxx-8\n", 0xbf82fffdU, 0, false, true, "" },
     433    { "    s_branch xxxx+8\nxxxx:\n", 0xbf820002U, 0, false, true, "" },
     434    { "    s_cbranch_scc0  xxxx-8\nxxxx:\n", 0xbf84fffeU, 0, false, true, "" },
     435    { "    s_cbranch_scc1  xxxx-8\nxxxx:\n", 0xbf85fffeU, 0, false, true, "" },
     436    { "    s_cbranch_vccz  xxxx-8\nxxxx:\n", 0xbf86fffeU, 0, false, true, "" },
     437    { "    s_cbranch_vccnz  xxxx-8\nxxxx:\n", 0xbf87fffeU, 0, false, true, "" },
     438    { "    s_cbranch_execz  xxxx-8\nxxxx:\n", 0xbf88fffeU, 0, false, true, "" },
     439    { "    s_cbranch_execnz  xxxx-8\nxxxx:\n", 0xbf89fffeU, 0, false, true, "" },
     440    { "s_barrier", 0xbf8a0000U, 0, false, true, "" },
     441    { "s_waitcnt       vmcnt(6) & expcnt(3) & lgkmcnt(13)\n",
     442        0xbf8c0d36U, 0, false, true, "" },
     443    { "s_waitcnt       vmcnt(22) & expcnt(3) & lgkmcnt(13)\n",
     444        0xbf8c4d36U, 0, false, true, "" },
     445    { "s_waitcnt       vmcnt(38) & expcnt(3) & lgkmcnt(13)\n",
     446        0xbf8c8d36U, 0, false, true, "" },
     447    { "s_waitcnt       vmcnt(54) & expcnt(3) & lgkmcnt(13)\n",
     448        0xbf8ccd36U, 0, false, true, "" },
     449    { "s_waitcnt       vmcnt(15) & expcnt(3) & lgkmcnt(13)\n",
     450        0xbf8c0d3fU, 0, false, true, "" },
     451    { "s_waitcnt       vmcnt(31) & expcnt(3) & lgkmcnt(13)\n",
     452        0xbf8c4d3fU, 0, false, true, "" },
     453    { "s_waitcnt       vmcnt(47) & expcnt(3) & lgkmcnt(13)\n",
     454        0xbf8c8d3fU, 0, false, true, "" },
     455    { "s_waitcnt       expcnt(3) & lgkmcnt(13)\n", 0xbf8ccd3fU, 0, false, true, "" },
     456    { "s_waitcnt       " "vmcnt(0) & expcnt(0) & lgkmcnt(0)\n",
     457        0xbf8c0000U, 0, false, true, "" },
     458    { "s_waitcnt  vmcnt(14) & expcnt(2)", 0xbf8c3f2eU, 0, false, true, "" },
     459    { "s_waitcnt  lgkmcnt(13) & expcnt(2)", 0xbf8ccd2fU, 0, false, true, "" },
     460    { "s_waitcnt  lgkmcnt(21) & expcnt(2)", 0xbf8cd52fU, 0, false, true, "" },
     461    { "s_waitcnt  lgkmcnt(44) & expcnt(2)", 0xbf8cec2fU, 0, false, true, "" },
     462    { "s_waitcnt  lgkmcnt(53) & expcnt(2)", 0xbf8cf52fU, 0, false, true, "" },
     463    { "        s_waitcnt       vmcnt(6) & expcnt(3) & lgkmcnt(53)\n",
     464        0xbf8c3536U, 0, false, true, "" },
    423465    { nullptr, 0, 0, false, false, 0 }
    424466};
Note: See TracChangeset for help on using the changeset viewer.