Changeset 4796 in CLRX


Ignore:
Timestamp:
Jul 17, 2019, 2:42:37 PM (5 months ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Add SOP1 instructions testcases for GFX10. Fixed syntax parsing for S_VERSION instruction.

Location:
CLRadeonExtender/trunk
Files:
2 edited

Legend:

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

    r4795 r4796  
    291291    bool doWrite = (gcnInsn.mode&GCN_MASK1) != GCN_DST_SRC &&
    292292            ((gcnInsn.mode&GCN_MASK1) != GCN_IMM_REL);
    293     if ((gcnInsn.mode & GCN_IMM_DST) == 0)
     293    if ((gcnInsn.mode & GCN_IMM_DST) == 0 && (gcnInsn.mode&GCN_MASK1) != GCN_DST_NONE)
    294294    {
    295295        // parse SDST (SGPR)
     
    409409    uint32_t imm32 = 0;
    410410    std::unique_ptr<AsmExpression> imm32Expr;
    411     if (gcnInsn.mode & GCN_IMM_DST)
     411    if ((gcnInsn.mode & GCN_IMM_DST) != 0 && (gcnInsn.mode&GCN_MASK1) != GCN_DST_NONE)
    412412    {
    413413        // parse SDST as immediate or next source
  • CLRadeonExtender/trunk/tests/amdasm/GCNAsmOpc15.cpp

    r4795 r4796  
    183183    { "        s_mul_hi_u32    s21, s4, s61\n", 0x9a953d04U, 0, false, true, "" },
    184184    { "        s_mul_hi_i32    s21, s4, s61\n", 0x9b153d04U, 0, false, true, "" },
     185    /* SOP1 */
     186    { "    s_mov_b32  s86, s20", 0xbed60314U, 0, false, true, "" },
     187    { "    s_mov_b32_e64  s86, -4", 0xbed603ffU, 0xfffffffcU, true, true, "" },
     188    { "    s_mov_b32  s86, 0xadbc", 0xbed603ff, 0xadbc, true, true, "" },
     189    { "    s_mov_b32  s86, xx; xx=0xadbc", 0xbed603ff, 0xadbc, true, true, "" },
     190    { "    s_mov_b64  s[86:87], s[20:21]", 0xbed60414U, 0, false, true, "" },
     191    { "    s_cmov_b32  s86, s20", 0xbed60514U, 0, false, true, "" },
     192    { "    s_cmov_b64  s[86:87], s[20:21]", 0xbed60614U, 0, false, true, "" },
     193    { "    s_not_b32  s86, s20", 0xbed60714U, 0, false, true, "" },
     194    { "    s_not_b64  s[86:87], s[20:21]", 0xbed60814U, 0, false, true, "" },
     195    { "    s_wqm_b32  s86, s20", 0xbed60914U, 0, false, true, "" },
     196    { "    s_wqm_b64  s[86:87], s[20:21]", 0xbed60a14U, 0, false, true, "" },
     197    { "    s_brev_b32  s86, s20", 0xbed60b14U, 0, false, true, "" },
     198    { "    s_brev_b64  s[86:87], s[20:21]", 0xbed60c14U, 0, false, true, "" },
     199    { "    s_bcnt0_i32_b32  s86, s20", 0xbed60d14U, 0, false, true, "" },
     200    { "    s_bcnt0_i32_b64  s86, s[20:21]", 0xbed60e14U, 0, false, true, "" },
     201    { "    s_bcnt1_i32_b32  s86, s20", 0xbed60f14U, 0, false, true, "" },
     202    { "    s_bcnt1_i32_b64  s86, s[20:21]", 0xbed61014U, 0, false, true, "" },
     203    { "    s_ff0_i32_b32  s86, s20", 0xbed61114U, 0, false, true, "" },
     204    { "    s_ff0_i32_b64  s86, s[20:21]", 0xbed61214U, 0, false, true, "" },
     205    { "    s_ff1_i32_b32  s86, s20", 0xbed61314U, 0, false, true, "" },
     206    { "    s_ff1_i32_b64  s86, s[20:21]", 0xbed61414U, 0, false, true, "" },
     207    { "    s_flbit_i32_b32  s86, s20", 0xbed61514U, 0, false, true, "" },
     208    { "    s_flbit_i32_b64  s86, s[20:21]", 0xbed61614U, 0, false, true, "" },
     209    { "    s_flbit_i32  s86, s20", 0xbed61714U, 0, false, true, "" },
     210    { "    s_flbit_i32_i64  s86, s[20:21]", 0xbed61814U, 0, false, true, "" },
     211    { "    s_sext_i32_i8  s86, s20", 0xbed61914U, 0, false, true, "" },
     212    { "    s_sext_i32_i16  s86, s20", 0xbed61a14U, 0, false, true, "" },
     213    { "    s_bitset0_b32  s86, s20", 0xbed61b14U, 0, false, true, "" },
     214    { "    s_bitset0_b64  s[86:87], s20", 0xbed61c14U, 0, false, true, "" },
     215    { "    s_bitset1_b32  s86, s20", 0xbed61d14U, 0, false, true, "" },
     216    { "    s_bitset1_b64  s[86:87], s20", 0xbed61e14U, 0, false, true, "" },
     217    { "    s_getpc_b64  s[86:87]", 0xbed61f00U, 0, false, true, "" },
     218    { "    s_setpc_b64  s[20:21]", 0xbe802014U, 0, false, true, "" },
     219    { "    s_swappc_b64  s[86:87], s[20:21]", 0xbed62114U, 0, false, true, "" },
     220    { "    s_rfe_b64  s[20:21]", 0xbe802214U, 0, false, true, "" },
     221    { "    s_and_saveexec_b64 s[86:87], s[20:21]", 0xbed62414U, 0, false, true, "" },
     222    { "    s_or_saveexec_b64 s[86:87], s[20:21]", 0xbed62514U, 0, false, true, "" },
     223    { "    s_xor_saveexec_b64 s[86:87], s[20:21]", 0xbed62614U, 0, false, true, "" },
     224    { "    s_andn2_saveexec_b64 s[86:87], s[20:21]", 0xbed62714U, 0, false, true, "" },
     225    { "    s_orn2_saveexec_b64 s[86:87], s[20:21]", 0xbed62814U, 0, false, true, "" },
     226    { "    s_nand_saveexec_b64 s[86:87], s[20:21]", 0xbed62914U, 0, false, true, "" },
     227    { "    s_nor_saveexec_b64 s[86:87], s[20:21]", 0xbed62a14U, 0, false, true, "" },
     228    { "    s_xnor_saveexec_b64 s[86:87], s[20:21]", 0xbed62b14U, 0, false, true, "" },
     229    { "    s_quadmask_b32  s86, s20",  0xbed62c14U, 0, false, true, "" },
     230    { "    s_quadmask_b64  s[86:87], s[20:21]",  0xbed62d14U, 0, false, true, "" },
     231    { "    s_movrels_b32  s86, s20",  0xbed62e14U, 0, false, true, "" },
     232    { "    s_movrels_b64  s[86:87], s[20:21]",  0xbed62f14U, 0, false, true, "" },
     233    { "    s_movreld_b32  s86, s20",  0xbed63014U, 0, false, true, "" },
     234    { "    s_movreld_b64  s[86:87], s[20:21]",  0xbed63114U, 0, false, true, "" },
     235    { "    s_cbranch_join  s20", 0xbe803214U, 0, false, false,
     236        "test.s:1:5: Error: Unknown instruction\n" },
     237    { "    s_mov_regrd_b32 s86, s20", 0xbed63314U, 0, false, false,
     238        "test.s:1:5: Error: Unknown instruction\n" },
     239    { "    s_abs_i32  s86, s20", 0xbed63414U, 0, false, true, "" },
     240    { "    s_mov_fed_b32  s86, s20", 0xbed63514U, 0, false, true, "" },
     241    { "    s_andn1_saveexec_b64 s[86:87], s[20:21]", 0xbed63714U, 0, false, true, "" },
     242    { "    s_orn1_saveexec_b64 s[86:87], s[20:21]", 0xbed63814U, 0, false, true, "" },
     243    { "    s_andn1_wrexec_b64 s[86:87], s[20:21]", 0xbed63914U, 0, false, true, "" },
     244    { "    s_andn2_wrexec_b64 s[86:87], s[20:21]", 0xbed63a14U, 0, false, true, "" },
     245    { "s_bitreplicate_b64_b32 s[86:87], s20\n", 0xbed63b14U, 0, false, true, "" },
     246    { "    s_and_saveexec_b32 s86, s20", 0xbed63c14U, 0, false, true, "" },
     247    { "    s_or_saveexec_b32 s86, s20", 0xbed63d14U, 0, false, true, "" },
     248    { "    s_xor_saveexec_b32 s86, s20", 0xbed63e14U, 0, false, true, "" },
     249    { "    s_andn2_saveexec_b32 s86, s20", 0xbed63f14U, 0, false, true, "" },
     250    { "    s_orn2_saveexec_b32 s86, s20", 0xbed64014U, 0, false, true, "" },
     251    { "    s_nand_saveexec_b32 s86, s20", 0xbed64114U, 0, false, true, "" },
     252    { "    s_nor_saveexec_b32 s86, s20", 0xbed64214U, 0, false, true, "" },
     253    { "    s_xnor_saveexec_b32 s86, s20", 0xbed64314U, 0, false, true, "" },
     254    { "    s_andn1_saveexec_b32 s86, s20", 0xbed64414U, 0, false, true, "" },
     255    { "    s_orn1_saveexec_b32 s86, s20", 0xbed64514U, 0, false, true, "" },
     256    { "    s_andn1_wrexec_b32 s86, s20", 0xbed64614U, 0, false, true, "" },
     257    { "    s_andn2_wrexec_b32 s86, s20", 0xbed64714U, 0, false, true, "" },
     258    { "    s_movrelsd_2_b32 s86, s20", 0xbed64914U, 0, false, true, "" },
     259    /* SOPC */
     260    { "    s_cmp_eq_i32  s29, s69", 0xbf00451dU, 0, false, true, "" },
     261    { "    s_cmp_eq_i32_e64  s29, 51", 0xbf00ff1dU, 51, true, true, "" },
     262    { "    s_cmp_eq_i32_e64  51, s69", 0xbf0045ffU, 51, true, true, "" },
     263    { "    s_cmp_eq_i32  12222, s69", 0xbf0045ffU, 12222, true, true, "" },
     264    { "    s_cmp_eq_i32  xx, s69; xx=12222", 0xbf0045ffU, 12222, true, true, "" },
     265    { "    s_cmp_eq_i32  s29, 32545", 0xbf00ff1dU, 32545, true, true, "" },
     266    { "    s_cmp_eq_i32  s29, xx; xx=32545", 0xbf00ff1dU, 32545, true, true, "" },
     267    { "    s_cmp_lg_i32  s29, s69", 0xbf01451dU, 0, false, true, "" },
     268    { "    s_cmp_gt_i32  s29, s69", 0xbf02451dU, 0, false, true, "" },
     269    { "    s_cmp_ge_i32  s29, s69", 0xbf03451dU, 0, false, true, "" },
     270    { "    s_cmp_lt_i32  s29, s69", 0xbf04451dU, 0, false, true, "" },
     271    { "    s_cmp_le_i32  s29, s69", 0xbf05451dU, 0, false, true, "" },
     272    { "    s_cmp_eq_u32  s29, s69", 0xbf06451dU, 0, false, true, "" },
     273    { "    s_cmp_lg_u32  s29, s69", 0xbf07451dU, 0, false, true, "" },
     274    { "    s_cmp_gt_u32  s29, s69", 0xbf08451dU, 0, false, true, "" },
     275    { "    s_cmp_ge_u32  s29, s69", 0xbf09451dU, 0, false, true, "" },
     276    { "    s_cmp_lt_u32  s29, s69", 0xbf0a451dU, 0, false, true, "" },
     277    { "    s_cmp_le_u32  s29, s69", 0xbf0b451dU, 0, false, true, "" },
     278    { "    s_bitcmp0_b32  s29, s69", 0xbf0c451dU, 0, false, true, "" },
     279    { "    s_bitcmp1_b32  s29, s69", 0xbf0d451dU, 0, false, true, "" },
     280    { "    s_bitcmp0_b64  s[28:29], s69", 0xbf0e451cU, 0, false, true, "" },
     281    { "    s_bitcmp1_b64  s[28:29], s69", 0xbf0f451cU, 0, false, true, "" },
     282    { "    s_setvskip  s29, s69", 0xbf10451dU, 0, false, false,
     283        "test.s:1:5: Error: Unknown instruction\n" },
     284    { "    s_cmp_eq_u64  s[28:29], s[68:69]", 0xbf12441cU, 0, false, true, "" },
     285    { "    s_cmp_lg_u64  s[28:29], s[68:69]", 0xbf13441cU, 0, false, true, "" },
     286    { "    s_cmp_ne_u64  s[28:29], s[68:69]", 0xbf13441cU, 0, false, true, "" },
     287    /* SOPK */
     288    { "    s_movk_i32  s43, 0xd3b9", 0xb02bd3b9U, 0, false, true, "" },
     289    { "    s_version 4331", 0xb08010ebU, 0, false, true, "" },
    185290    { nullptr, 0, 0, false, false, 0 }
    186291};
Note: See TracChangeset for help on using the changeset viewer.