Changeset 4803 in CLRX


Ignore:
Timestamp:
Jul 17, 2019, 10:24:14 PM (5 weeks ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Add SMEM instructions testcases for GFX10. Add SMEM_NOSDATA handling (s_dcache_discard_*) for SMEM instructions.
Formatting in GCNDisasmDecode.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

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

    r4801 r4803  
    10401040        // parse SDST (SGPR's (1-16 registers))
    10411041        gcnAsm->setCurrentRVU(0);
    1042         if ((mode1 & GCN_SMEM_SDATA_IMM)==0)
    1043             good &= parseSRegRange(asmr, linePtr, dataReg, arch, dregsNum,
    1044                     GCNFIELD_SMRD_SDST, true, INSTROP_SYMREGRANGE|
    1045                     ((gcnInsn.mode & GCN_MLOAD) != 0 ? INSTROP_WRITE : INSTROP_READ));
    1046         else
    1047             good &= parseImm(asmr, linePtr, dataReg.start, &simm7Expr, 7);
    1048         if (!skipRequiredComma(asmr, linePtr))
    1049             return false;
     1042        if ((mode1 & GCN_SMEM_NOSDATA) == 0)
     1043        {
     1044            if ((mode1 & GCN_SMEM_SDATA_IMM)==0)
     1045                good &= parseSRegRange(asmr, linePtr, dataReg, arch, dregsNum,
     1046                        GCNFIELD_SMRD_SDST, true, INSTROP_SYMREGRANGE|
     1047                        ((gcnInsn.mode & GCN_MLOAD) != 0 ? INSTROP_WRITE : INSTROP_READ));
     1048            else
     1049                good &= parseImm(asmr, linePtr, dataReg.start, &simm7Expr, 7);
     1050            if (!skipRequiredComma(asmr, linePtr))
     1051                return false;
     1052        }
    10501053       
    10511054        // parse SBASE (2 or 4 SGPR's)
     
    10651068            good &= parseSRegRange(asmr, linePtr, soffsetReg, arch, 1,
    10661069                       GCNFIELD_SMRD_SOFFSET, false, INSTROP_SYMREGRANGE|INSTROP_READ);
    1067             if (good && !isGCN14 && (gcnInsn.mode & GCN_MLOAD) == 0 && soffsetReg &&
    1068                     !soffsetReg.isVal(124))
     1070            if (good && (!isGCN14 && !isGCN15) && (gcnInsn.mode & GCN_MLOAD) == 0 &&
     1071                    soffsetReg && !soffsetReg.isVal(124))
    10691072                // if no M0 register
    10701073                ASM_NOTGOOD_BY_ERROR(soffsetPlace,
  • CLRadeonExtender/trunk/amdasm/GCNDisasmDecode.cpp

    r4793 r4803  
    854854        const cxuint dregsNum = 1<<((gcnInsn.mode & GCN_DSIZE_MASK)>>GCN_SHIFT2);
    855855        addSpaces(bufPtr, spacesToAdd);
    856         if (!(mode1 & GCN_SMEM_NOSDATA)) {
     856        if ((mode1 & GCN_SMEM_NOSDATA) == 0)
     857        {
    857858            if (mode1 & GCN_SMEM_SDATA_IMM)
    858859                // print immediate value
  • CLRadeonExtender/trunk/tests/amdasm/GCNAsmOpc15.cpp

    r4802 r4803  
    561561    { "s_load_dword    s3, s[18:19], ft*by; ft=42; by=21\n",
    562562                0xf40000c9U, 0xfa000372U, true, true, "" },
     563    { "s7=0x3cda; s_load_dword    s3, s[18:19], @s7\n",
     564                0xf40000c9U, 0xfa003cdaU, true, true, "" },
     565    { "x7=0x1f3cda; s_load_dword    s3, s[18:19], x7\n", 0xf40000c9U, 0xfa0f3cdaU,
     566            true, true, "test.s:1:44: Warning: Value 0x1f3cda truncated to 0xf3cda\n" },
     567    { "s_load_dword    s3, s[18:19], x7; x7=0x1f3cda\n", 0xf40000c9U, 0xfa0f3cdaU,
     568            true, true, "test.s:1:31: Warning: Value 0x1f3cda truncated to 0xf3cda\n" },
     569    /* SMEM errors */
     570    { "    s_load_dword  s[50:53], s[58:59], 0x1345b", 0, 0, false, false,
     571        "test.s:1:19: Error: Required 1 scalar register\n" },
     572    { "    s_load_dword  s50, s[58:58], 0x1345b", 0, 0, false, false,
     573        "test.s:1:24: Error: Required 2 scalar registers\n" },
     574    { "    s_load_dword    s50, -1, 0x5b", 0, 0, false, false,
     575        "test.s:1:26: Error: Some garbages at register name place\n" },
     576    { "    s_load_dword    s50, execz, 0x5b", 0, 0, false, false,
     577        "test.s:1:26: Error: Expected 2 scalar registers\n" },
     578    /* SMEM instructions */
     579    { "    s_load_dwordx2  s[6:7], s[18:19], s4\n",
     580                0xf4040189U, 0x08000000U, true, true, "" },
     581    { "    s_load_dwordx4  s[12:15], s[18:19], s4\n",
     582                0xf4080309U, 0x08000000U, true, true, "" },
     583    { "    s_load_dwordx8  s[12:19], s[18:19], s4\n",
     584                0xf40c0309U, 0x08000000U, true, true, "" },
     585    { "    s_load_dwordx16 s[12:27], s[18:19], s4\n",
     586                0xf4100309U, 0x08000000U, true, true, "" },
     587    { "    s_scratch_load_dword s3, s[18:19], s4\n",
     588                0xf41400c9U, 0x08000000U, true, true, "" },
     589    { "    s_scratch_load_dwordx2 s[6:7], s[18:19], s4\n",
     590                0xf4180189U, 0x08000000U, true, true, "" },
     591    { "    s_scratch_load_dwordx4 s[12:15], s[18:19], s4\n",
     592                0xf41c0309U, 0x08000000U, true, true, "" },
     593    { "    s_buffer_load_dword s3, s[20:23], s4\n",
     594                0xf42000caU, 0x08000000U, true, true, "" },
     595    { "    s_buffer_load_dwordx2 s[6:7], s[20:23], s4\n",
     596                0xf424018aU, 0x08000000U, true, true, "" },
     597    { "    s_buffer_load_dwordx4 s[12:15], s[20:23], s4\n",
     598                0xf428030aU, 0x08000000U, true, true, "" },
     599    { "    s_buffer_load_dwordx8 s[12:19], s[20:23], s4\n",
     600                0xf42c030aU, 0x08000000U, true, true, "" },
     601    { "    s_buffer_load_dwordx16 s[12:27], s[20:23], s4\n",
     602                0xf430030aU, 0x08000000U, true, true, "" },
     603    { "    s_store_dword   s3, s[20:21], s4\n", 0xf44000caU, 0x08000000U, true, true, "" },
     604    { "    s_store_dwordx2 s[6:7], s[20:21], s4\n",
     605                0xf444018aU, 0x08000000U, true, true, "" },
     606    { "    s_store_dwordx4 s[12:15], s[20:21], s4\n",
     607                0xf448030aU, 0x08000000U, true, true, "" },
     608    { "    s_scratch_store_dword s3, s[18:19], s4\n",
     609                0xf45400c9U, 0x08000000U, true, true, "" },
     610    { "    s_scratch_store_dwordx2 s[6:7], s[18:19], s4\n",
     611                0xf4580189U, 0x08000000U, true, true, "" },
     612    { "    s_scratch_store_dwordx4 s[12:15], s[18:19], s4\n",
     613                0xf45c0309U, 0x08000000U, true, true, "" },
     614    { "    s_buffer_store_dword s3, s[20:23], s4\n",
     615                0xf46000caU, 0x08000000U, true, true, "" },
     616    { "    s_buffer_store_dwordx2 s[6:7], s[20:23], s4\n",
     617                0xf464018aU, 0x08000000U, true, true, "" },
     618    { "    s_buffer_store_dwordx4 s[12:15], s[20:23], s4\n",
     619                0xf468030aU, 0x08000000U, true, true, "" },
     620    { "    s_gl1_inv\n", 0xf47c0000U, 0x00000000U, true, true, "" },
     621    { "    s_dcache_inv\n", 0xf4800000U, 0x00000000U, true, true, "" },
     622    { "    s_dcache_wb\n", 0xf4840000U, 0x00000000U, true, true, "" },
     623    { "    s_memtime       s[6:7]\n", 0xf4900180U, 0x00000000U, true, true, "" },
     624    { "    s_memrealtime   s[6:7]\n", 0xf4940180U, 0x00000000U, true, true, "" },
     625    { "    s_atc_probe     0x3, s[20:21], s4\n",
     626                0xf49800caU, 0x08000000U, true, true, "" },
     627    { "    s_atc_probe_buffer 0x3, s[20:23], s4\n",
     628                0xf49c00caU, 0x08000000U, true, true, "" },
     629    { "    s_dcache_discard s[20:21], s4\n", 0xf4a0000aU, 0x08000000U, true, true, "" },
     630    { "    s_dcache_discard_x2 s[20:21], s4\n", 0xf4a4000aU, 0x08000000U, true, true, "" },
     631    { "    s_get_waveid_in_workgroup s7\n", 0xf4a801c0U, 0x00000000U, true, true, "" },
    563632    { nullptr, 0, 0, false, false, 0 }
    564633};
Note: See TracChangeset for help on using the changeset viewer.