Changeset 3107 in CLRX


Ignore:
Timestamp:
May 30, 2017, 7:31:59 PM (21 months ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Add new instructions and new modifiers to DS, MIMG, MUBUF (AMD VEGA arch).

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r3106 r3107  
    30893089        return false;
    30903090    }
     3091    const bool isGCN14 = (arch & ARCH_RXVEGA)!=0;
    30913092    bool good = true;
    30923093    RegRange vaddrReg(0, 0);
     
    31403141    bool haveTfe = false, haveSlc = false, haveGlc = false;
    31413142    bool haveDa = false, haveR128 = false, haveLwe = false, haveUnorm = false;
    3142     bool haveDMask = false, haveD16 = false;
     3143    bool haveDMask = false, haveD16 = false, haveA16 = false;
    31433144    cxbyte dmask = 0x1;
    31443145    /* modifiers and modifiers */
     
    32083209            else if (::strcmp(name, "lwe")==0)
    32093210                good &= parseModEnable(asmr, linePtr, haveLwe, "lwe modifier");
    3210             else if (::strcmp(name, "r128")==0)
     3211            else if (!isGCN14 && ::strcmp(name, "r128")==0)
    32113212                good &= parseModEnable(asmr, linePtr, haveR128, "r128 modifier");
     3213            else if (isGCN14 && ::strcmp(name, "a16")==0)
     3214                good &= parseModEnable(asmr, linePtr, haveA16, "a16 modifier");
    32123215            else
    32133216            {
     
    33063309    uint32_t words[2];
    33073310    SLEV(words[0], 0xf0000000U | (uint32_t(dmask&0xf)<<8) | (haveUnorm ? 0x1000U : 0) |
    3308         (haveGlc ? 0x2000U : 0) | (haveDa ? 0x4000U : 0) | (haveR128 ? 0x8000U : 0) |
     3311        (haveGlc ? 0x2000U : 0) | (haveDa ? 0x4000U : 0) |
     3312        (haveR128|haveA16 ? 0x8000U : 0) |
    33093313        (haveTfe ? 0x10000U : 0) | (haveLwe ? 0x20000U : 0) |
    33103314        (uint32_t(gcnInsn.code1)<<18) | (haveSlc ? (1U<<25) : 0));
  • CLRadeonExtender/trunk/tests/amdasm/GCNAsmOpc14.cpp

    r3105 r3107  
    586586    { "   v_interp_mov_f32 v93, p20, attr26.w", 0xd5766b01U, 0, false, true, "" },
    587587    { "   v_interp_mov_f32 v93, p0, attr26.w", 0xd5766b02U, 0, false, true, "" },
     588    /* DS instructions */
     589    { "ds_write_addtid_b32 v71 offset:52583\n", 0xd83acd67U, 0x00000047U, true, true, "" },
     590    { "ds_write_b8_d16_hi v71, v169 offset:52583\n",
     591        0xd8a8cd67U, 0x0000a947U, true, true, "" },
     592    { "ds_write_b16_d16_hi v71, v169 offset:52583\n",
     593        0xd8aacd67U, 0x0000a947U, true, true, "" },
     594    { "ds_read_u8_d16  v139, v71 offset:52583\n",
     595        0xd8accd67U, 0x8b000047U, true, true, "" },
     596    { "ds_read_u8_d16_hi v139, v71 offset:52583\n",
     597        0xd8aecd67U, 0x8b000047U, true, true, "" },
     598    { "ds_read_i8_d16  v139, v71 offset:52583\n",
     599        0xd8b0cd67U, 0x8b000047U, true, true, "" },
     600    { "ds_read_i8_d16_hi v139, v71 offset:52583\n",
     601        0xd8b2cd67U, 0x8b000047U, true, true, "" },
     602    { "ds_read_u16_d16 v139, v71 offset:52583\n",
     603        0xd8b4cd67U, 0x8b000047U, true, true, "" },
     604    { "ds_read_addtid_b32 v139 offset:52583\n", 0xd96ccd67U, 0x8b000000U, true, true, "" },
     605    /* MUBUF instructions */
     606    { "buffer_store_byte_d16_hi v61, v[18:19], s[80:83], s35 offen idxen "
     607        "offset:603 glc slc lds\n", 0xe067725bU, 0x23143d12U, true, true, "" },
     608    { "buffer_store_short_d16_hi v61, v[18:19], s[80:83], s35 offen idxen "
     609        "offset:603 glc slc lds\n", 0xe06f725bU, 0x23143d12U, true, true, "" },
     610    { "buffer_load_ubyte_d16 v61, v[18:19], s[80:83], s35 offen idxen "
     611        "offset:603 glc slc lds\n", 0xe083725bU, 0x23143d12U, true, true, "" },
     612    { "buffer_load_ubyte_d16_hi v61, v[18:19], s[80:83], s35 offen idxen "
     613        "offset:603 glc slc lds\n", 0xe087725bU, 0x23143d12U, true, true, "" },
     614    { "buffer_load_sbyte_d16 v61, v[18:19], s[80:83], s35 offen idxen "
     615        "offset:603 glc slc lds\n", 0xe08b725bU, 0x23143d12U, true, true, "" },
     616    { "buffer_load_sbyte_d16_hi v61, v[18:19], s[80:83], s35 offen idxen "
     617        "offset:603 glc slc lds\n", 0xe08f725bU, 0x23143d12U, true, true, "" },
     618    { "buffer_load_short_d16 v61, v[18:19], s[80:83], s35 offen idxen "
     619        "offset:603 glc slc lds\n", 0xe093725bU, 0x23143d12U, true, true, "" },
     620    { "buffer_load_short_d16_hi v61, v[18:19], s[80:83], s35 offen idxen "
     621        "offset:603 glc slc lds\n", 0xe097725bU, 0x23143d12U, true, true, "" },
     622    { "buffer_load_format_d16_hi_x v61, v[18:19], s[80:83], s35 offen idxen "
     623        "offset:603 glc slc lds\n", 0xe09b725bU, 0x23143d12U, true, true, "" },
     624    { "buffer_store_format_d16_hi_x v61, v[18:19], s[80:83], s35 offen idxen "
     625        "offset:603 glc slc lds\n", 0xe09f725bU, 0x23143d12U, true, true, "" },
     626    /* MIMG instructions */
     627    { "image_gather4h  v[157:160], v[121:124], s[84:91], s[0:3] dmask:11 "
     628        "unorm glc a16 da\n", 0xf108fb00U, 0x00159d79U, true, true, "" },
     629    { "image_gather4h  v[157:160], v[121:124], s[84:91], s[0:3] dmask:11 "
     630        "unorm glc da\n", 0xf1087b00U, 0x00159d79U, true, true, "" },
     631    { "image_gather4h_pck v[157:160], v[121:124], s[84:91], s[0:3] dmask:11 "
     632        "unorm glc a16 da\n", 0xf128fb00U, 0x00159d79U, true, true, "" },
     633    { "image_gather8h_pck v[157:160], v[121:124], s[84:91], s[0:3] dmask:11 "
     634        "unorm glc a16 da\n", 0xf12cfb00U, 0x00159d79U, true, true, "" },
    588635    { nullptr, 0, 0, false, false, 0 }
    589636};
Note: See TracChangeset for help on using the changeset viewer.