Home | History | Annotate | Download | only in instructions
      1 # RUN: llvm-mc -triple hexagon -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s
      2 # Hexagon Programmer's Reference Manual 11.4 J
      3 
      4 # Call subroutine
      5 # CHECK: 00 c0 00 5a
      6 call 0
      7 # CHECK: 00 c3 00 5d
      8 if (p3) call 0
      9 # CHECK: 00 c3 20 5d
     10 if (!p3) call 0
     11 
     12 # Compare and jump
     13 # CHECK: 00 c0 89 11
     14 { p0 = cmp.eq(r17,#-1); if (p0.new) jump:nt 0 }
     15 # CHECK: 00 c1 89 11
     16 { p0 = cmp.gt(r17,#-1); if (p0.new) jump:nt 0 }
     17 # CHECK: 00 c3 89 11
     18 { p0 = tstbit(r17, #0); if (p0.new) jump:nt 0 }
     19 # CHECK: 00 e0 89 11
     20 { p0 = cmp.eq(r17,#-1); if (p0.new) jump:t 0 }
     21 # CHECK: 00 e1 89 11
     22 { p0 = cmp.gt(r17,#-1); if (p0.new) jump:t 0 }
     23 # CHECK: 00 e3 89 11
     24 { p0 = tstbit(r17, #0); if (p0.new) jump:t 0 }
     25 # CHECK: 00 c0 c9 11
     26 { p0 = cmp.eq(r17,#-1); if (!p0.new) jump:nt 0 }
     27 # CHECK: 00 c1 c9 11
     28 { p0 = cmp.gt(r17,#-1); if (!p0.new) jump:nt 0 }
     29 # CHECK: 00 c3 c9 11
     30 { p0 = tstbit(r17, #0); if (!p0.new) jump:nt 0 }
     31 # CHECK: 00 e0 c9 11
     32 { p0 = cmp.eq(r17,#-1); if (!p0.new) jump:t 0 }
     33 # CHECK: 00 e1 c9 11
     34 { p0 = cmp.gt(r17,#-1); if (!p0.new) jump:t 0 }
     35 # CHECK: 00 e3 c9 11
     36 { p0 = tstbit(r17, #0); if (!p0.new) jump:t 0 }
     37 # CHECK: 00 d5 09 10
     38 { p0 = cmp.eq(r17, #21); if (p0.new) jump:nt 0 }
     39 # CHECK: 00 f5 09 10
     40 { p0 = cmp.eq(r17, #21); if (p0.new) jump:t 0 }
     41 # CHECK: 00 d5 49 10
     42 { p0 = cmp.eq(r17, #21); if (!p0.new) jump:nt 0 }
     43 # CHECK: 00 f5 49 10
     44 { p0 = cmp.eq(r17, #21); if (!p0.new) jump:t 0 }
     45 # CHECK: 00 d5 89 10
     46 { p0 = cmp.gt(r17, #21); if (p0.new) jump:nt 0 }
     47 # CHECK: 00 f5 89 10
     48 { p0 = cmp.gt(r17, #21); if (p0.new) jump:t 0 }
     49 # CHECK: 00 d5 c9 10
     50 { p0 = cmp.gt(r17, #21); if (!p0.new) jump:nt 0 }
     51 # CHECK: 00 f5 c9 10
     52 { p0 = cmp.gt(r17, #21); if (!p0.new) jump:t 0 }
     53 # CHECK: 00 d5 09 11
     54 { p0 = cmp.gtu(r17, #21); if (p0.new) jump:nt 0 }
     55 # CHECK: 00 f5 09 11
     56 { p0 = cmp.gtu(r17, #21); if (p0.new) jump:t 0 }
     57 # CHECK: 00 d5 49 11
     58 { p0 = cmp.gtu(r17, #21); if (!p0.new) jump:nt 0 }
     59 # CHECK: 00 f5 49 11
     60 { p0 = cmp.gtu(r17, #21); if (!p0.new) jump:t 0 }
     61 # CHECK: 00 c0 89 13
     62 { p1 = cmp.eq(r17,#-1); if (p1.new) jump:nt 0 }
     63 # CHECK: 00 c1 89 13
     64 { p1 = cmp.gt(r17,#-1); if (p1.new) jump:nt 0 }
     65 # CHECK: 00 c3 89 13
     66 { p1 = tstbit(r17, #0); if (p1.new) jump:nt 0 }
     67 # CHECK: 00 e0 89 13
     68 { p1 = cmp.eq(r17,#-1); if (p1.new) jump:t 0 }
     69 # CHECK: 00 e1 89 13
     70 { p1 = cmp.gt(r17,#-1); if (p1.new) jump:t 0 }
     71 # CHECK: 00 e3 89 13
     72 { p1 = tstbit(r17, #0); if (p1.new) jump:t 0 }
     73 # CHECK: 00 c0 c9 13
     74 { p1 = cmp.eq(r17,#-1); if (!p1.new) jump:nt 0 }
     75 # CHECK: 00 c1 c9 13
     76 { p1 = cmp.gt(r17,#-1); if (!p1.new) jump:nt 0 }
     77 # CHECK: 00 c3 c9 13
     78 { p1 = tstbit(r17, #0); if (!p1.new) jump:nt 0 }
     79 # CHECK: 00 e0 c9 13
     80 { p1 = cmp.eq(r17,#-1); if (!p1.new) jump:t 0 }
     81 # CHECK: 00 e1 c9 13
     82 { p1 = cmp.gt(r17,#-1); if (!p1.new) jump:t 0 }
     83 # CHECK: 00 e3 c9 13
     84 { p1 = tstbit(r17, #0); if (!p1.new) jump:t 0 }
     85 # CHECK: 00 d5 09 12
     86 { p1 = cmp.eq(r17, #21); if (p1.new) jump:nt 0 }
     87 # CHECK: 00 f5 09 12
     88 { p1 = cmp.eq(r17, #21); if (p1.new) jump:t 0 }
     89 # CHECK: 00 d5 49 12
     90 { p1 = cmp.eq(r17, #21); if (!p1.new) jump:nt 0 }
     91 # CHECK: 00 f5 49 12
     92 { p1 = cmp.eq(r17, #21); if (!p1.new) jump:t 0 }
     93 # CHECK: 00 d5 89 12
     94 { p1 = cmp.gt(r17, #21); if (p1.new) jump:nt 0 }
     95 # CHECK: 00 f5 89 12
     96 { p1 = cmp.gt(r17, #21); if (p1.new) jump:t 0 }
     97 # CHECK: 00 d5 c9 12
     98 { p1 = cmp.gt(r17, #21); if (!p1.new) jump:nt 0 }
     99 # CHECK: 00 f5 c9 12
    100 { p1 = cmp.gt(r17, #21); if (!p1.new) jump:t 0 }
    101 # CHECK: 00 d5 09 13
    102 { p1 = cmp.gtu(r17, #21); if (p1.new) jump:nt 0 }
    103 # CHECK: 00 f5 09 13
    104 { p1 = cmp.gtu(r17, #21); if (p1.new) jump:t 0 }
    105 # CHECK: 00 d5 49 13
    106 { p1 = cmp.gtu(r17, #21); if (!p1.new) jump:nt 0 }
    107 # CHECK: 00 f5 49 13
    108 { p1 = cmp.gtu(r17, #21); if (!p1.new) jump:t 0 }
    109 # CHECK: 00 cd 09 14
    110 { p0 = cmp.eq(r17, r21); if (p0.new) jump:nt 0 }
    111 # CHECK: 00 dd 09 14
    112 { p1 = cmp.eq(r17, r21); if (p1.new) jump:nt 0 }
    113 # CHECK: 00 ed 09 14
    114 { p0 = cmp.eq(r17, r21); if (p0.new) jump:t 0 }
    115 # CHECK: 00 fd 09 14
    116 { p1 = cmp.eq(r17, r21); if (p1.new) jump:t 0 }
    117 # CHECK: 00 cd 49 14
    118 { p0 = cmp.eq(r17, r21); if (!p0.new) jump:nt 0 }
    119 # CHECK: 00 dd 49 14
    120 { p1 = cmp.eq(r17, r21); if (!p1.new) jump:nt 0 }
    121 # CHECK: 00 ed 49 14
    122 { p0 = cmp.eq(r17, r21); if (!p0.new) jump:t 0 }
    123 # CHECK: 00 fd 49 14
    124 { p1 = cmp.eq(r17, r21); if (!p1.new) jump:t 0 }
    125 # CHECK: 00 cd 89 14
    126 { p0 = cmp.gt(r17, r21); if (p0.new) jump:nt 0 }
    127 # CHECK: 00 dd 89 14
    128 { p1 = cmp.gt(r17, r21); if (p1.new) jump:nt 0 }
    129 # CHECK: 00 ed 89 14
    130 { p0 = cmp.gt(r17, r21); if (p0.new) jump:t 0 }
    131 # CHECK: 00 fd 89 14
    132 { p1 = cmp.gt(r17, r21); if (p1.new) jump:t 0 }
    133 # CHECK: 00 cd c9 14
    134 { p0 = cmp.gt(r17, r21); if (!p0.new) jump:nt 0 }
    135 # CHECK: 00 dd c9 14
    136 { p1 = cmp.gt(r17, r21); if (!p1.new) jump:nt 0 }
    137 # CHECK: 00 ed c9 14
    138 { p0 = cmp.gt(r17, r21); if (!p0.new) jump:t 0 }
    139 # CHECK: 00 fd c9 14
    140 { p1 = cmp.gt(r17, r21); if (!p1.new) jump:t 0 }
    141 # CHECK: 00 cd 09 15
    142 { p0 = cmp.gtu(r17, r21); if (p0.new) jump:nt 0 }
    143 # CHECK: 00 dd 09 15
    144 { p1 = cmp.gtu(r17, r21); if (p1.new) jump:nt 0 }
    145 # CHECK: 00 ed 09 15
    146 { p0 = cmp.gtu(r17, r21); if (p0.new) jump:t 0 }
    147 # CHECK: 00 fd 09 15
    148 { p1 = cmp.gtu(r17, r21); if (p1.new) jump:t 0 }
    149 # CHECK: 00 cd 49 15
    150 { p0 = cmp.gtu(r17, r21); if (!p0.new) jump:nt 0 }
    151 # CHECK: 00 dd 49 15
    152 { p1 = cmp.gtu(r17, r21); if (!p1.new) jump:nt 0 }
    153 # CHECK: 00 ed 49 15
    154 { p0 = cmp.gtu(r17, r21); if (!p0.new) jump:t 0 }
    155 # CHECK: 00 fd 49 15
    156 { p1 = cmp.gtu(r17, r21); if (!p1.new) jump:t 0 }
    157 
    158 # Jump to address
    159 # CHECK: 00 c0 00 58
    160 jump 0
    161 # CHECK: 00 c3 00 5c
    162 if (p3) jump 0
    163 # CHECK: 00 c3 20 5c
    164 if (!p3) jump 0
    165 
    166 # Jump to address conditioned on new predicate
    167 # CHECK: 03 40 45 85
    168 # CHECK-NEXT: 00 cb 00 5c
    169 { p3 = r5
    170   if (p3.new) jump:nt 0 }
    171 # CHECK: 03 40 45 85
    172 # CHECK-NEXT: 00 db 00 5c
    173 { p3 = r5
    174   if (p3.new) jump:t 0 }
    175 # CHECK: 03 40 45 85
    176 # CHECK-NEXT: 00 cb 20 5c
    177 { p3 = r5
    178   if (!p3.new) jump:nt 0 }
    179 # CHECK: 03 40 45 85
    180 # CHECK-NEXT: 00 db 20 5c
    181 { p3 = r5
    182   if (!p3.new) jump:t 0 }
    183 
    184 # Jump to address conditioned on register value
    185 # CHECK: 00 c0 11 61
    186 if (r17!=#0) jump:nt 0
    187 # CHECK: 00 d0 11 61
    188 if (r17!=#0) jump:t 0
    189 # CHECK: 00 c0 51 61
    190 if (r17>=#0) jump:nt 0
    191 # CHECK: 00 d0 51 61
    192 if (r17>=#0) jump:t 0
    193 # CHECK: 00 c0 91 61
    194 if (r17==#0) jump:nt 0
    195 # CHECK: 00 d0 91 61
    196 if (r17==#0) jump:t 0
    197 # CHECK: 00 c0 d1 61
    198 if (r17<=#0) jump:nt 0
    199 # CHECK: 00 d0 d1 61
    200 if (r17<=#0) jump:t 0
    201 
    202 # Transfer and jump
    203 # CHECK: 00 d5 09 16
    204 { r17 = #21 ; jump 0}
    205 # CHECK: 00 c9 0d 17
    206 { r17 = r21 ; jump 0 }
    207