Home | History | Annotate | Download | only in AMDGPU
      1 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
      2 // RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
      3 
      4 s_mov_b32 s1, s2
      5 // CHECK: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
      6 
      7 s_mov_b32 s1, 1
      8 // CHECK: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe]
      9 
     10 s_mov_b32 s1, 100
     11 // CHECK: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00]
     12 
     13 // Literal constant sign bit
     14 s_mov_b32 s1, 0x80000000
     15 // CHECK: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80]
     16 
     17 // Negative 32-bit constant
     18 s_mov_b32 s0, 0xfe5163ab
     19 // CHECK: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe]
     20 
     21 s_mov_b64 s[2:3], s[4:5]
     22 // CHECK: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
     23 
     24 s_mov_b64 s[2:3], 0xffffffffffffffff
     25 // CHECK: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe]
     26 
     27 s_mov_b64 s[2:3], 0xffffffff
     28 // CHECK: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff]
     29 
     30 s_mov_b64 s[0:1], 0x80000000
     31 // CHECK: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80]
     32 
     33 s_mov_b64 s[102:103], -1
     34 // CHECK: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe]
     35 
     36 s_cmov_b32 s1, 200
     37 // CHECK: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00]
     38 
     39 s_cmov_b32 s1, 1.0
     40 // CHECK: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe]
     41 
     42 //s_cmov_b64 s[2:3], 1.0
     43 //CHECK-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3]
     44 
     45 //===----------------------------------------------------------------------===//
     46 // Instructions
     47 //===----------------------------------------------------------------------===//
     48 
     49 s_mov_b32 s1, s2
     50 // CHECK: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
     51 
     52 s_mov_b64 s[2:3], s[4:5]
     53 // CHECK: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
     54 
     55 s_cmov_b32 s1, s2
     56 // CHECK: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe]
     57 
     58 s_cmov_b64 s[2:3], s[4:5]
     59 // CHECK: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe]
     60 
     61 s_not_b32 s1, s2
     62 // CHECK: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe]
     63 
     64 s_not_b64 s[2:3], s[4:5]
     65 // CHECK: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe]
     66 
     67 s_wqm_b32 s1, s2
     68 // CHECK: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe]
     69 
     70 s_wqm_b64 s[2:3], s[4:5]
     71 // CHECK: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe]
     72 
     73 s_brev_b32 s1, s2
     74 // CHECK: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe]
     75 
     76 s_brev_b64 s[2:3], s[4:5]
     77 // CHECK: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe]
     78 
     79 s_bcnt0_i32_b32 s1, s2
     80 // CHECK: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe]
     81 
     82 s_bcnt0_i32_b64 s1, s[2:3]
     83 // CHECK: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe]
     84 
     85 s_bcnt1_i32_b32 s1, s2
     86 // CHECK: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe]
     87 
     88 s_bcnt1_i32_b64 s1, s[2:3]
     89 // CHECK: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe]
     90 
     91 s_ff0_i32_b32 s1, s2
     92 // CHECK: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe]
     93 
     94 s_ff0_i32_b64 s1, s[2:3]
     95 // CHECK: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe]
     96 
     97 s_ff1_i32_b32 s1, s2
     98 // CHECK: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe]
     99 
    100 s_ff1_i32_b64 s1, s[2:3]
    101 // CHECK: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe]
    102 
    103 s_flbit_i32_b32 s1, s2
    104 // CHECK: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe]
    105 
    106 s_flbit_i32_b64 s1, s[2:3]
    107 // CHECK: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe]
    108 
    109 s_flbit_i32 s1, s2
    110 // CHECK: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
    111 
    112 s_flbit_i32_i64 s1, s[2:3]
    113 // CHECK: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe]
    114 
    115 s_sext_i32_i8 s1, s2
    116 // CHECK: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe]
    117 
    118 s_sext_i32_i16 s1, s2
    119 // CHECK: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
    120 
    121 s_bitset0_b32 s1, s2
    122 // CHECK: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe]
    123 
    124 s_bitset0_b64 s[2:3], s[4:5]
    125 // CHECK: s_bitset0_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1c,0x82,0xbe]
    126 
    127 s_bitset1_b32 s1, s2
    128 // CHECK: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe]
    129 
    130 s_bitset1_b64 s[2:3], s[4:5]
    131 // CHECK: s_bitset1_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1e,0x82,0xbe]
    132 
    133 s_getpc_b64 s[2:3]
    134 // CHECK: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe]
    135 
    136 s_setpc_b64 s[2:3], s[4:5]
    137 // CHECK: s_setpc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x20,0x82,0xbe]
    138 
    139 s_swappc_b64 s[2:3], s[4:5]
    140 // CHECK: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
    141 
    142 s_rfe_b64 s[2:3], s[4:5]
    143 // CHECK: s_rfe_b64 s[2:3], s[4:5] ; encoding: [0x04,0x22,0x82,0xbe]
    144 
    145 s_and_saveexec_b64 s[2:3], s[4:5]
    146 // CHECK: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
    147 
    148 s_or_saveexec_b64 s[2:3], s[4:5]
    149 // CHECK: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
    150 
    151 s_xor_saveexec_b64 s[2:3], s[4:5]
    152 // CHECK: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
    153 
    154 s_andn2_saveexec_b64 s[2:3], s[4:5]
    155 // CHECK: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
    156 
    157 s_orn2_saveexec_b64 s[2:3], s[4:5]
    158 // CHECK: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe]
    159 
    160 s_nand_saveexec_b64 s[2:3], s[4:5]
    161 // CHECK: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
    162 
    163 s_nor_saveexec_b64 s[2:3], s[4:5]
    164 // CHECK: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe]
    165 
    166 s_xnor_saveexec_b64 s[2:3], s[4:5]
    167 // CHECK: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
    168 
    169 s_quadmask_b32 s1, s2
    170 // CHECK: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
    171 
    172 s_quadmask_b64 s[2:3], s[4:5]
    173 // CHECK: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
    174 
    175 s_movrels_b32 s1, s2
    176 // CHECK: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe]
    177 
    178 s_movrels_b64 s[2:3], s[4:5]
    179 // CHECK: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe]
    180 
    181 s_movreld_b32 s1, s2
    182 // CHECK: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
    183 
    184 s_movreld_b64 s[2:3], s[4:5]
    185 // CHECK: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe]
    186 
    187 s_cbranch_join s[4:5]
    188 // CHECK: s_cbranch_join s[4:5] ; encoding: [0x04,0x32,0x80,0xbe]
    189 
    190 s_abs_i32 s1, s2
    191 // CHECK: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe]
    192 
    193 s_mov_fed_b32 s1, s2
    194 // CHECK: s_mov_fed_b32 s1, s2 ; encoding: [0x02,0x35,0x81,0xbe]
    195