Home | History | Annotate | Download | only in AMDGPU
      1 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
      2 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
      3 // RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s
      4 
      5 //===----------------------------------------------------------------------===//
      6 // Edge Cases
      7 //===----------------------------------------------------------------------===//
      8 
      9 s_nop 0
     10 // GCN: s_nop 0 ; encoding: [0x00,0x00,0x80,0xbf]
     11 
     12 s_nop 0xffff
     13 // GCN: s_nop 0xffff ; encoding: [0xff,0xff,0x80,0xbf]
     14 
     15 //===----------------------------------------------------------------------===//
     16 // Instructions
     17 //===----------------------------------------------------------------------===//
     18 
     19 s_nop 1
     20 // GCN: s_nop 1 ; encoding: [0x01,0x00,0x80,0xbf]
     21 
     22 s_endpgm
     23 // GCN: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
     24 
     25 s_branch 2
     26 // GCN: s_branch 2 ; encoding: [0x02,0x00,0x82,0xbf]
     27 
     28 s_cbranch_scc0 3
     29 // GCN: s_cbranch_scc0 3 ; encoding: [0x03,0x00,0x84,0xbf]
     30 
     31 s_cbranch_scc1 4
     32 // GCN: s_cbranch_scc1 4 ; encoding: [0x04,0x00,0x85,0xbf]
     33 
     34 s_cbranch_vccz 5
     35 // GCN: s_cbranch_vccz 5 ; encoding: [0x05,0x00,0x86,0xbf]
     36 
     37 s_cbranch_vccnz 6
     38 // GCN: s_cbranch_vccnz 6 ; encoding: [0x06,0x00,0x87,0xbf]
     39 
     40 s_cbranch_execz 7
     41 // GCN: s_cbranch_execz 7 ; encoding: [0x07,0x00,0x88,0xbf]
     42 
     43 s_cbranch_execnz 8
     44 // GCN: s_cbranch_execnz 8 ; encoding: [0x08,0x00,0x89,0xbf]
     45 
     46 s_barrier
     47 // GCN: s_barrier ; encoding: [0x00,0x00,0x8a,0xbf]
     48 
     49 //===----------------------------------------------------------------------===//
     50 // s_waitcnt
     51 //===----------------------------------------------------------------------===//
     52 
     53 s_waitcnt 0
     54 // GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
     55 
     56 s_waitcnt vmcnt(0) & expcnt(0) & lgkmcnt(0)
     57 // GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
     58 
     59 s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
     60 // GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
     61 
     62 s_waitcnt vmcnt(0), expcnt(0), lgkmcnt(0)
     63 // GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
     64 
     65 s_waitcnt vmcnt(1)
     66 // GCN: s_waitcnt vmcnt(1) ; encoding: [0x71,0x0f,0x8c,0xbf]
     67 
     68 s_waitcnt vmcnt(9)
     69 // GCN: s_waitcnt vmcnt(9) ; encoding: [0x79,0x0f,0x8c,0xbf]
     70 
     71 s_waitcnt expcnt(2)
     72 // GCN: s_waitcnt expcnt(2) ; encoding: [0x2f,0x0f,0x8c,0xbf]
     73 
     74 s_waitcnt lgkmcnt(3)
     75 // GCN: s_waitcnt lgkmcnt(3) ; encoding: [0x7f,0x03,0x8c,0xbf]
     76 
     77 s_waitcnt lgkmcnt(9)
     78 // GCN: s_waitcnt lgkmcnt(9) ; encoding: [0x7f,0x09,0x8c,0xbf]
     79 
     80 s_waitcnt vmcnt(0), expcnt(0)
     81 // GCN: s_waitcnt vmcnt(0) expcnt(0) ; encoding: [0x00,0x0f,0x8c,0xbf]
     82 
     83 
     84 s_sethalt 9
     85 // GCN: s_sethalt 9 ; encoding: [0x09,0x00,0x8d,0xbf]
     86 
     87 s_sleep 10
     88 // GCN: s_sleep 10 ; encoding: [0x0a,0x00,0x8e,0xbf]
     89 
     90 s_setprio 1
     91 // GCN: s_setprio 1 ; encoding: [0x01,0x00,0x8f,0xbf]
     92 
     93 s_sendmsg 2
     94 // GCN: s_sendmsg 2 ; encoding: [0x02,0x00,0x90,0xbf]
     95 
     96 s_sendmsg 0x1
     97 // GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf]
     98 
     99 s_sendmsg sendmsg(1)
    100 // GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf]
    101 
    102 s_sendmsg sendmsg(MSG_INTERRUPT)
    103 // GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf]
    104 
    105 s_sendmsg 0x12
    106 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf]
    107 
    108 s_sendmsg sendmsg(2, 1)
    109 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf]
    110 
    111 s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0)
    112 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf]
    113 
    114 s_sendmsg 0x122
    115 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x90,0xbf]
    116 
    117 s_sendmsg sendmsg(2, 2, 1)
    118 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x90,0xbf]
    119 
    120 s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1)
    121 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x90,0xbf]
    122 
    123 s_sendmsg 0x232
    124 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2) ; encoding: [0x32,0x02,0x90,0xbf]
    125 
    126 s_sendmsg sendmsg(2, 3, 2)
    127 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2) ; encoding: [0x32,0x02,0x90,0xbf]
    128 
    129 s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2)
    130 // GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2) ; encoding: [0x32,0x02,0x90,0xbf]
    131 
    132 s_sendmsg 0x3
    133 // GCN: s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x90,0xbf]
    134 
    135 s_sendmsg sendmsg(3, 0)
    136 // GCN: s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x90,0xbf]
    137 
    138 s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP)
    139 // GCN: s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x90,0xbf]
    140 
    141 s_sendmsg 0x4
    142 // GCN: s_sendmsg 4 ; encoding: [0x04,0x00,0x90,0xbf]
    143 
    144 s_sendmsg 11
    145 // GCN: s_sendmsg 11 ; encoding: [0x0b,0x00,0x90,0xbf]
    146 
    147 s_sendmsg 0x1f
    148 // GCN: s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT) ; encoding: [0x1f,0x00,0x90,0xbf]
    149 
    150 s_sendmsg sendmsg(15, 1)
    151 // GCN: s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT) ; encoding: [0x1f,0x00,0x90,0xbf]
    152 
    153 s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT)
    154 // GCN: s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT) ; encoding: [0x1f,0x00,0x90,0xbf]
    155 
    156 s_sendmsg 0x6f
    157 // GCN: s_sendmsg 111 ; encoding: [0x6f,0x00,0x90,0xbf]
    158 
    159 s_sendmsghalt 3
    160 // GCN: s_sendmsghalt sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x91,0xbf]
    161 
    162 s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT, 1)
    163 // GCN: s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x91,0xbf]
    164 
    165 s_trap 4
    166 // GCN: s_trap 4 ; encoding: [0x04,0x00,0x92,0xbf]
    167 
    168 s_icache_inv
    169 // GCN: s_icache_inv ; encoding: [0x00,0x00,0x93,0xbf]
    170 
    171 s_incperflevel 5
    172 // GCN: s_incperflevel 5 ; encoding: [0x05,0x00,0x94,0xbf]
    173 
    174 s_decperflevel 6
    175 // GCN: s_decperflevel 6 ; encoding: [0x06,0x00,0x95,0xbf]
    176 
    177 s_ttracedata
    178 // GCN: s_ttracedata ; encoding: [0x00,0x00,0x96,0xbf]
    179