Changeset 4849 in CLRX


Ignore:
Timestamp:
Jul 26, 2019, 3:04:23 PM (3 weeks ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Some preparings in MUBUF encoding for GFX10. GCNDisasm: Fix SLC decoding in MUBUF/MTBUF for GFX10.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

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

    r4789 r4849  
    146146    GCNOperand soffsetOp{};
    147147    RegRange srsrcReg(0, 0);
    148     const bool isGCN12 = (arch & ARCH_GCN_1_2_4)!=0;
    149     const bool isGCN14 = (arch & ARCH_GCN_1_4)!=0;
     148    const bool isGCN12 = (arch & ARCH_GCN_1_2_4_5)!=0;
     149    const bool isGCN14 = (arch & ARCH_GCN_1_4_5)!=0;
     150    const bool isGCN15 = ((arch&ARCH_GCN_1_5)!=0);
    150151    GCNAssembler* gcnAsm = static_cast<GCNAssembler*>(asmr.isaAssembler);
    151152   
     
    430431                (haveIdxen ? 0x2000U : 0U) | (haveGlc ? 0x4000U : 0U) |
    431432                ((haveAddr64 && !isGCN12) ? 0x8000U : 0U) | (haveLds ? 0x10000U : 0U) |
    432                 ((haveSlc && isGCN12) ? 0x20000U : 0) | (uint32_t(gcnInsn.code1)<<18));
     433                ((haveSlc && (isGCN12 && !isGCN15)) ? 0x20000U : 0) |
     434                (uint32_t(gcnInsn.code1)<<18));
    433435    else
    434436    {
     
    444446    SLEV(words[1], (vaddrReg.bstart()&0xff) | (uint32_t(vdataReg.bstart()&0xff)<<8) |
    445447            (uint32_t(srsrcReg.bstart()>>2)<<16) |
    446             ((haveSlc && (!isGCN12 || gcnInsn.encoding==GCNENC_MTBUF)) ? (1U<<22) : 0) |
     448            ((haveSlc && (!isGCN12 || isGCN15 ||
     449                        gcnInsn.encoding==GCNENC_MTBUF)) ? (1U<<22) : 0) |
    447450            (haveTfe ? (1U<<23) : 0) | (uint32_t(soffsetOp.range.bstart())<<24));
    448451   
  • CLRadeonExtender/trunk/amdasm/GCNDisasmDecode.cpp

    r4847 r4849  
    22252225   
    22262226    // print SLC if supplied
    2227     if (((!isGCN12 || isGCN15 ||
    2228             gcnInsn.encoding==GCNENC_MTBUF) && (insnCode2 & 0x400000U)!=0) ||
    2229         ((isGCN12 && gcnInsn.encoding!=GCNENC_MTBUF) && (insnCode & 0x20000)!=0))
     2227    if (!isGCN15)
     2228    {
     2229        if (((!isGCN12 || gcnInsn.encoding==GCNENC_MTBUF) && (insnCode2 & 0x400000U)!=0) ||
     2230            ((isGCN12 && gcnInsn.encoding!=GCNENC_MTBUF) && (insnCode & 0x20000)!=0))
     2231            putChars(bufPtr, " slc", 4);
     2232    }
     2233    else if ((insnCode2 & 0x400000U)!=0)
    22302234        putChars(bufPtr, " slc", 4);
    22312235   
  • CLRadeonExtender/trunk/tests/amdasm/GCNDisasmOpc15.cpp

    r4842 r4849  
    29022902        "v[61:62], v[18:19], s[80:83], s35 offen idxen glc slc dlc lds tfe\n" },
    29032903    /* vaddr sizing */
    2904     { 0xe003725bU, 0x23b43d12U, true, "        buffer_load_format_x "
    2905         "v[61:62], v[18:19], s[80:83], s35 offen idxen offset:603 glc slc lds tfe\n" },
    2906     { 0xe003425bU, 0x23b43d12U, true, "        buffer_load_format_x "
    2907         "v[61:62], v18, s[80:83], s35 offset:603 glc slc lds tfe\n" },
    2908     { 0xe003625bU, 0x23b43d12U, true, "        buffer_load_format_x "
    2909         "v[61:62], v18, s[80:83], s35 idxen offset:603 glc slc lds tfe\n" },
    2910     { 0xe003525bU, 0x23b43d12U, true, "        buffer_load_format_x "
    2911         "v[61:62], v18, s[80:83], s35 offen offset:603 glc slc lds tfe\n" },
     2904    { 0xe001725bU, 0x23b43d12U, true, "        buffer_load_format_x "
     2905        "v[61:62], v[18:19], s[80:83], s35 offen idxen offset:603 glc lds tfe\n" },
     2906    { 0xe001425bU, 0x23b43d12U, true, "        buffer_load_format_x "
     2907        "v[61:62], v18, s[80:83], s35 offset:603 glc lds tfe\n" },
     2908    { 0xe001625bU, 0x23b43d12U, true, "        buffer_load_format_x "
     2909        "v[61:62], v18, s[80:83], s35 idxen offset:603 glc lds tfe\n" },
     2910    { 0xe001525bU, 0x23b43d12U, true, "        buffer_load_format_x "
     2911        "v[61:62], v18, s[80:83], s35 offen offset:603 glc lds tfe\n" },
    29122912    /* flags */
    29132913    { 0xe003c25bU, 0xf0b43d12U, true, "        buffer_load_format_x "
     2914        "v[61:62], v18, s[80:83], 0.5 offset:603 glc dlc lds tfe\n" },
     2915    { 0xe001c25bU, 0xf0b43d12U, true, "        buffer_load_format_x "
     2916        "v[61:62], v18, s[80:83], 0.5 offset:603 glc dlc lds tfe\n" },
     2917    { 0xe001c25bU, 0xf0f43d12U, true, "        buffer_load_format_x "
    29142918        "v[61:62], v18, s[80:83], 0.5 offset:603 glc slc dlc lds tfe\n" },
    29152919    { 0xe001c25bU, 0xf0b43d12U, true, "        buffer_load_format_x "
    29162920        "v[61:62], v18, s[80:83], 0.5 offset:603 glc dlc lds tfe\n" },
    2917     { 0xe003c25bU, 0x23bd3d12U, true, "        buffer_load_format_x "
    2918         "v[61:62], v18, ttmp[8:11], s35 offset:603 glc slc dlc lds tfe\n" },
    2919     { 0xe003c25bU, 0x23a93d12U, true, "        buffer_load_format_x "
    2920         "v[61:62], v18, s[36:39], s35 offset:603 glc slc dlc lds tfe\n" },
    2921     { 0xe003f000U, 0x23b43d12U, true, "        buffer_load_format_x "
    2922         "v[61:62], v[18:19], s[80:83], s35 offen idxen glc slc dlc lds tfe\n" },
     2921    { 0xe001c25bU, 0x23bd3d12U, true, "        buffer_load_format_x "
     2922        "v[61:62], v18, ttmp[8:11], s35 offset:603 glc dlc lds tfe\n" },
     2923    { 0xe001c25bU, 0x23a93d12U, true, "        buffer_load_format_x "
     2924        "v[61:62], v18, s[36:39], s35 offset:603 glc dlc lds tfe\n" },
     2925    { 0xe001f000U, 0x23b43d12U, true, "        buffer_load_format_x "
     2926        "v[61:62], v[18:19], s[80:83], s35 offen idxen glc dlc lds tfe\n" },
    29232927    /* MUBUF instructions */
    29242928    { 0xe000325bU, 0x23343d12U, true, "        buffer_load_format_x "
     
    29732977                "v61, v[18:19], s[80:83], s35 offen idxen offset:603\n" },
    29742978    { 0xe067725bU, 0x23343d12U, true, "        buffer_store_byte_d16_hi "
    2975         "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc slc lds\n" },
     2979        "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc lds\n" },
    29762980    { 0xe068325bU, 0x23343d12U, true, "        buffer_store_short "
    29772981                "v61, v[18:19], s[80:83], s35 offen idxen offset:603\n" },
    29782982    { 0xe06f725bU, 0x23343d12U, true, "        buffer_store_short_d16_hi "
    2979         "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc slc lds\n" },
     2983        "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc lds\n" },
    29802984    { 0xe070325bU, 0x23343d12U, true, "        buffer_store_dword "
    29812985                "v61, v[18:19], s[80:83], s35 offen idxen offset:603\n" },
     
    29872991                "v[61:63], v[18:19], s[80:83], s35 offen idxen offset:603\n" },
    29882992    { 0xe083725bU, 0x23343d12U, true, "        buffer_load_ubyte_d16 "
    2989         "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc slc lds\n" },
     2993        "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc lds\n" },
    29902994    { 0xe087725bU, 0x23343d12U, true, "        buffer_load_ubyte_d16_hi "
    2991         "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc slc lds\n" },
     2995        "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc lds\n" },
    29922996    { 0xe08b725bU, 0x23343d12U, true, "        buffer_load_sbyte_d16 "
    2993         "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc slc lds\n" },
     2997        "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc lds\n" },
    29942998    { 0xe08f725bU, 0x23343d12U, true, "        buffer_load_sbyte_d16_hi "
    2995         "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc slc lds\n" },
     2999        "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc lds\n" },
    29963000    { 0xe093725bU, 0x23343d12U, true, "        buffer_load_short_d16 "
    2997         "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc slc lds\n" },
     3001        "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc lds\n" },
    29983002    { 0xe097725bU, 0x23343d12U, true, "        buffer_load_short_d16_hi "
    2999         "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc slc lds\n" },
     3003        "v61, v[18:19], s[80:83], s35 offen idxen offset:603 glc lds\n" },
    30003004    { 0xe098325bU, 0x23343d12U, true, "        MUBUF_ill_38    "
    30013005                "v61, v[18:19], s[80:83], s35 offen idxen offset:603\n" },
Note: See TracChangeset for help on using the changeset viewer.