Changeset 4805 in CLRX


Ignore:
Timestamp:
Jul 19, 2019, 7:22:33 AM (4 weeks ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Add VOP2 encoding testcases for GFX10. Fix encodeVOP3Words.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r4803 r4805  
    12841284}
    12851285
    1286 static void encodeVOP3Words(bool isGCN12, const GCNAsmInstruction& gcnInsn,
     1286static void encodeVOP3Words(GPUArchMask arch, const GCNAsmInstruction& gcnInsn,
    12871287        cxbyte modifiers, VOPOpModifiers opMods, bool haveDstCC,
    12881288        const RegRange& dstReg, const RegRange& dstCCReg, const RegRange& srcCCReg,
     
    12901290        cxuint& wordsNum, uint32_t* words)
    12911291{
     1292    const bool isGCN12 = (arch & ARCH_GCN_1_2_4_5)!=0;
    12921293    // VOP3 encoding
    12931294    uint32_t code = (isGCN12) ?
     
    15591560    else
    15601561        // VOP3 encoding
    1561         encodeVOP3Words(isGCN12, gcnInsn, modifiers, opMods, haveDstCC,
     1562        encodeVOP3Words(arch, gcnInsn, modifiers, opMods, haveDstCC,
    15621563                dstReg, dstCCReg, srcCCReg, src0Op, src1Op, wordsNum, words);
    15631564   
     
    17151716    else
    17161717        // VOP3 encoding
    1717         encodeVOP3Words(isGCN12, gcnInsn, modifiers, opMods, false,
     1718        encodeVOP3Words(arch, gcnInsn, modifiers, opMods, false,
    17181719                dstReg, RegRange{}, RegRange{}, src0Op, GCNOperand{}, wordsNum, words);
    17191720   
     
    18981899    else
    18991900        // VOP3 encoding
    1900         encodeVOP3Words(isGCN12, gcnInsn, modifiers, opMods, false,
     1901        encodeVOP3Words(arch, gcnInsn, modifiers, opMods, false,
    19011902                dstReg, RegRange{}, RegRange{}, src0Op, src1Op, wordsNum, words);
    19021903   
  • CLRadeonExtender/trunk/tests/amdasm/GCNAsmOpc15.cpp

    r4804 r4805  
    722722    { "    s_atomic_dec_x2 s[10:11], s[20:21], s4\n",
    723723                0xf6b0028aU, 0x08000000U, true, true, "" },
     724    /* VOP2/(VOP2 in VOP3) encoding */
     725    { "    v_cndmask_b32   v154, v21, v107, vcc", 0x0334d715U, 0, false, true, "" },
     726    { "    v_cndmask_b32   v154, v21, v107, vcc     ", 0x0334d715U, 0, false, true, "" },
     727    { "    v_cndmask_b32   v[154:154], v[21:21], v[107], vcc",
     728        0x0334d715U, 0, false, true, "" },
     729    { "    v_cndmask_b32   v[  154 : 154], v[ 21:21 ], v[ 107  ], vcc",
     730        0x0334d715U, 0, false, true, "" },
     731    { "    v_cndmask_b32   v154  , v21 , v107  , vcc", 0x0334d715U, 0, false, true, "" },
     732    { "    v_cndmask_b32   v154, lds, v107, vcc", 0x0334d6feU, 0, false, true, "" },
     733    { "    v_cndmask_b32   v154, lds_direct, v107, vcc", 0x0334d6feU, 0, false, true, "" },
     734    { "    v_cndmask_b32   v154, src_lds_direct, v107, vcc",
     735        0x0334d6feU, 0, false, true, "" },
     736    { "    v_add_f32   v154, s21, v107", 0x0734d615U, 0, false, true, "" },
     737    { "    v_cndmask_b32   v154, 2, v107, vcc", 0x0334d682U, 0, false, true, "" },
     738    { "    v_cndmask_b32   v154, -9, v107, vcc", 0x0334d6c9U, 0, false, true, "" },
     739    { "    v_cndmask_b32   v154, 20e-1, v107, vcc", 0x0334d6f4U, 0, false, true, "" },
     740    { "    v_cndmask_b32   v154, 1323, v107, vcc", 0x0334d6ffU, 1323, true, true, "" },
     741    { "xx=1323;v_cndmask_b32   v154, xx, v107, vcc", 0x0334d6ffU, 1323, true, true, "" },
     742    { "v_cndmask_b32   v154, xx, v107, vcc; xx=1323", 0x0334d6ffU, 1323, true, true, "" },
     743    { "v_cndmask_b32   v154, xx, v107, vcc; xx=2", 0x0334d6ffU, 2, true, true, "" },
     744    { "v0=1323;v_cndmask_b32   v154, @v0, v107, vcc", 0x0334d6ffU, 1323, true, true, "" },
     745    { "v_cndmask_b32   v154, @v0, v107, vcc; v0=1323", 0x0334d6ffU, 1323, true, true, "" },
     746    { "s0=1323;v_cndmask_b32   v154, @s0, v107, vcc", 0x0334d6ffU, 1323, true, true, "" },
     747    { "v_cndmask_b32   v154, @s0, v107, vcc; s0=1323", 0x0334d6ffU, 1323, true, true, "" },
     748    { "    v_add_f32  v154, v21, v107", 0x0734d715U, 0, false, true, "" },
     749    { "tx=%s21; v_add_f32  v154, tx, v107", 0x0734d615U, 0, false, true, "" },
     750    { "    v_add_f32  v154, s21, v107", 0x0734d615U, 0, false, true, "" },
     751    { " fla=%v154;   v_add_f32  fla, s21, v107", 0x0734d615U, 0, false, true, "" },
     752    /* VOP2 errors */
     753    { "    v_cndmask_b32   v[154:155], v21, v107, vcc", 0, 0, false, false,
     754        "test.s:1:21: Error: Required 1 vector register\n" },
     755    { "    v_cndmask_b32   v154, v[21:22], v107, vcc", 0, 0, false, false,
     756        "test.s:1:27: Error: Required 1 vector register\n" },
     757    { "    v_cndmask_b32   v154, v21, v[107:108], vcc", 0, 0, false, false,
     758        "test.s:1:32: Error: Required 1 vector register\n" },
     759    { "    v_cndmask_b32   v[154:, v21, v107, vcc", 0, 0, false, false,
     760        "test.s:1:27: Error: Expected expression\n" },
     761    { "    v_cndmask_b32   v[14, v21, v107, vcc", 0, 0, false, false,
     762        "test.s:1:21: Error: Unterminated vector register range\n" },
     763    { "    v_cndmask_b32   v[14:15, v21, v107, vcc", 0, 0, false, false,
     764        "test.s:1:21: Error: Unterminated vector register range\n" },
     765    { "    v_cndmask_b32   v256, v21, v107, vcc", 0, 0, false, false,
     766        "test.s:1:24: Error: Number is too big\n"
     767        "test.s:1:24: Error: Expected ',' before argument\n" },
     768    { "    v_cndmask_b32   v[255:256], v21, v107, vcc", 0, 0, false, false,
     769        "test.s:1:21: Error: Some vector register number out of range\n" },
     770    { "    v_add_f32  v154, v21, v107 mul,", 0, 0, false, false,
     771        "test.s:1:35: Error: Expected ':' before multiplier number\n"
     772        "test.s:1:35: Error: Some garbages at VOP modifier place\n" },
     773    { "    v_add_f32  v154, v21, v107 div,", 0, 0, false, false,
     774        "test.s:1:35: Error: Expected ':' before divider number\n"
     775        "test.s:1:35: Error: Some garbages at VOP modifier place\n" },
    724776    { nullptr, 0, 0, false, false, 0 }
    725777};
Note: See TracChangeset for help on using the changeset viewer.