Changeset 4854 in CLRX


Ignore:
Timestamp:
Jul 26, 2019, 10:35:47 PM (3 weeks ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Add MTBUF encoding testcases for GFX10. Fixed FORMAT modifier parsing for MTBUF for GFX10

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r4850 r4854  
    255255        else if (gcnInsn.encoding==GCNENC_MTBUF && ::strcmp(name, "format")==0)
    256256        {
     257           
     258            if (!isGCN15)
     259            { // pre NAVI
    257260            // parse format
    258261            bool modGood = true;
     
    264267            }
    265268            skipCharAndSpacesToEnd(linePtr, end);
    266            
    267             if (!isGCN15)
    268             { // pre NAVI
    269269            // parse [DATA_FORMAT:NUMBER_FORMAT]
    270270            if (linePtr==end || *linePtr!='[')
     
    459459        uint32_t code = (isGCN12 && !isGCN15) ? (uint32_t(gcnInsn.code1)<<15) :
    460460                (uint32_t(gcnInsn.code1&7)<<16);
     461        uint32_t formatVal = isGCN15 ? (uint32_t(format)<<19) :
     462                    ((uint32_t(dfmt)<<19) | (uint32_t(nfmt)<<23));
    461463        SLEV(words[0], 0xe8000000U | offset | (haveOffen ? 0x1000U : 0U) |
    462464                (haveIdxen ? 0x2000U : 0U) | (haveGlc ? 0x4000U : 0U) |
    463465                ((haveAddr64 && !isGCN12) ? 0x8000U : 0U) | code |
    464                 ((haveDlc && isGCN15) ? 0x8000U : 0) |
    465                 (uint32_t(dfmt)<<19) | (uint32_t(nfmt)<<23));
     466                ((haveDlc && isGCN15) ? 0x8000U : 0) | formatVal);
    466467    }
    467468    // second word
  • CLRadeonExtender/trunk/tests/amdasm/GCNAsmOpc15.cpp

    r4853 r4854  
    30843084    { "        buffer_wbinvl1\n", 0xe1c40000U, 0x00000000U, true, true, "" },
    30853085    { "        buffer_gl1_inv\n", 0xe1c80000U, 0x00000000U, true, true, "" },
     3086    /* MTBUF encoding */
     3087    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3088        "glc slc tfe format:59", 0xe9d867d4U, 0x23d43d12U, true, true, "" },
     3089    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3090        "glc slc tfe format  :  59", 0xe9d867d4U, 0x23d43d12U, true, true, "" },
     3091    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3092        "glc slc tfe", 0xe80067d4U, 0x23d43d12U, true, true, "" },
     3093    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3094        "glc slc tfe format:0", 0xe80067d4U, 0x23d43d12U, true, true, "" },
     3095    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3096        "glc slc tfe format:1", 0xe80867d4U, 0x23d43d12U, true, true, "" },
     3097    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3098        "glc slc tfe format:2", 0xe81067d4U, 0x23d43d12U, true, true, "" },
     3099    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3100        "glc slc tfe format:111", 0xeb7867d4U, 0x23d43d12U, true, true, "" },
     3101    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3102        "glc slc tfe format:38", 0xe93067d4U, 0x23d43d12U, true, true, "" },
     3103    /* MTBUF format warnings */
     3104    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3105        "glc slc tfe format:12 format:38", 0xe93067d4U, 0x23d43d12U, true, true,
     3106        "test.s:1:96: Warning: Format is already defined\n" },
     3107    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3108        "glc slc tfe format:166", 0xe93067d4U, 0x23d43d12U, true, true,
     3109        "test.s:1:93: Warning: Value 0xa6 truncated to 0x26\n" },
     3110    ////
     3111    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3112        "glc tfe format:38", 0xe93067d4U, 0x23943d12U, true, true, "" },
     3113    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3114        "tfe format:38", 0xe93027d4U, 0x23943d12U, true, true, "" },
     3115    { "    tbuffer_load_format_x v61, v18, s[80:83], s35 idxen offset:2004 "
     3116        "format:38", 0xe93027d4U, 0x23143d12U, true, true, "" },
     3117    { "    tbuffer_load_format_x v61, v18, s[80:83], s35 idxen offset:2004 "
     3118        "dlc format:38", 0xe930a7d4U, 0x23143d12U, true, true, "" },
     3119    /* vaddr sizing */
     3120    { "    tbuffer_load_format_x v61, v18, s[80:83], s35 offset:2004 "
     3121        "dlc format:38", 0xe93087d4U, 0x23143d12U, true, true, "" },
     3122    { "    tbuffer_load_format_x v61, v[18:19], s[80:83], s35 idxen offen offset:2004 "
     3123        "dlc format:38", 0xe930b7d4U, 0x23143d12U, true, true, "" },
     3124    { "    tbuffer_load_format_x v61, v18, s[80:83], s35 offen offset:2004 "
     3125        "dlc format:38", 0xe93097d4U, 0x23143d12U, true, true, "" },
     3126    /* MTBUF instructions */
     3127    { "    tbuffer_load_format_xy v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3128        "format:38", 0xe93127d4U, 0x23143d12U, true, true, "" },
     3129    { "    tbuffer_load_format_xyz v[61:63], v18, s[80:83], s35 idxen offset:2004 "
     3130        "format:38", 0xe93227d4U, 0x23143d12U, true, true, "" },
     3131    { "    tbuffer_load_format_xyzw v[61:64], v18, s[80:83], s35 idxen offset:2004 "
     3132        "format:38", 0xe93327d4U, 0x23143d12U, true, true, "" },
     3133    { "    tbuffer_store_format_x v61, v18, s[80:83], s35 idxen offset:2004 "
     3134        "format:38", 0xe93427d4U, 0x23143d12U, true, true, "" },
     3135    { "    tbuffer_store_format_xy v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3136        "format:38", 0xe93527d4U, 0x23143d12U, true, true, "" },
     3137    { "    tbuffer_store_format_xyz v[61:63], v18, s[80:83], s35 idxen offset:2004 "
     3138        "format:38", 0xe93627d4U, 0x23143d12U, true, true, "" },
     3139    { "    tbuffer_store_format_xyzw v[61:64], v18, s[80:83], s35 idxen offset:2004 "
     3140        "format:38", 0xe93727d4U, 0x23143d12U, true, true, "" },
     3141    { "    tbuffer_load_format_d16_x v61, v18, s[80:83], s35 idxen offset:2004 "
     3142        "format:38", 0xe93027d4U, 0x23343d12U, true, true, "" },
     3143    { "    tbuffer_load_format_d16_xy v61, v18, s[80:83], s35 idxen offset:2004 "
     3144        "format:38", 0xe93127d4U, 0x23343d12U, true, true, "" },
     3145    { "    tbuffer_load_format_d16_xyz v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3146        "format:38", 0xe93227d4U, 0x23343d12U, true, true, "" },
     3147    { "    tbuffer_load_format_d16_xyzw v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3148        "format:38", 0xe93327d4U, 0x23343d12U, true, true, "" },
     3149    { "    tbuffer_store_format_d16_x v61, v18, s[80:83], s35 idxen offset:2004 "
     3150        "format:38", 0xe93427d4U, 0x23343d12U, true, true, "" },
     3151    { "    tbuffer_store_format_d16_xy v61, v18, s[80:83], s35 idxen offset:2004 "
     3152        "format:38", 0xe93527d4U, 0x23343d12U, true, true, "" },
     3153    { "    tbuffer_store_format_d16_xyz v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3154        "format:38", 0xe93627d4U, 0x23343d12U, true, true, "" },
     3155    { "    tbuffer_store_format_d16_xyzw v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     3156        "format:38", 0xe93727d4U, 0x23343d12U, true, true, "" },
    30863157    { nullptr, 0, 0, false, false, 0 }
    30873158};
Note: See TracChangeset for help on using the changeset viewer.