Home | History | Annotate | Download | only in AArch64
      1 # RUN: llvm-mc -triple arm64-apple-darwin -mattr=neon --disassemble -output-asm-variant=1 < %s | FileCheck %s
      2 # RUN: llvm-mc -triple arm64-apple-darwin -mattr=neon,v8.2a,fullfp16 --disassemble -output-asm-variant=1 < %s | FileCheck %s --check-prefix=CHECK --check-prefix=FP16
      3 
      4 #-----------------------------------------------------------------------------
      5 # Floating-point arithmetic
      6 #-----------------------------------------------------------------------------
      7 
      8 0x41 0xc0 0xe0 0x1e
      9 0x41 0xc0 0x20 0x1e
     10 0x41 0xc0 0x60 0x1e
     11 
     12 # FP16: fabs h1, h2
     13 # CHECK: fabs s1, s2
     14 # CHECK: fabs d1, d2
     15 
     16 0x41 0x28 0xe3 0x1e
     17 0x41 0x28 0x23 0x1e
     18 0x41 0x28 0x63 0x1e
     19 
     20 # FP16:  fadd h1, h2, h3
     21 # CHECK: fadd s1, s2, s3
     22 # CHECK: fadd d1, d2, d3
     23 
     24 0x41 0x18 0xe3 0x1e
     25 0x41 0x18 0x23 0x1e
     26 0x41 0x18 0x63 0x1e
     27 
     28 # FP16:  fdiv h1, h2, h3
     29 # CHECK: fdiv s1, s2, s3
     30 # CHECK: fdiv d1, d2, d3
     31 
     32 0x41 0x10 0xc3 0x1f
     33 0x41 0x10 0x03 0x1f
     34 0x41 0x10 0x43 0x1f
     35 
     36 # FP16:  fmadd h1, h2, h3, h4
     37 # CHECK: fmadd s1, s2, s3, s4
     38 # CHECK: fmadd d1, d2, d3, d4
     39 
     40 0x41 0x48 0xe3 0x1e
     41 0x41 0x48 0x23 0x1e
     42 0x41 0x48 0x63 0x1e
     43 0x41 0x68 0xe3 0x1e
     44 0x41 0x68 0x23 0x1e
     45 0x41 0x68 0x63 0x1e
     46 
     47 # FP16:  fmax   h1, h2, h3
     48 # CHECK: fmax   s1, s2, s3
     49 # CHECK: fmax   d1, d2, d3
     50 # FP16:  fmaxnm h1, h2, h3
     51 # CHECK: fmaxnm s1, s2, s3
     52 # CHECK: fmaxnm d1, d2, d3
     53 
     54 0x41 0x58 0xe3 0x1e
     55 0x41 0x58 0x23 0x1e
     56 0x41 0x58 0x63 0x1e
     57 0x41 0x78 0xe3 0x1e
     58 0x41 0x78 0x23 0x1e
     59 0x41 0x78 0x63 0x1e
     60 
     61 # FP16:  fmin   h1, h2, h3
     62 # CHECK: fmin   s1, s2, s3
     63 # CHECK: fmin   d1, d2, d3
     64 # FP16:  fminnm h1, h2, h3
     65 # CHECK: fminnm s1, s2, s3
     66 # CHECK: fminnm d1, d2, d3
     67 
     68 0x41 0x90 0xc3 0x1f
     69 0x41 0x90 0x03 0x1f
     70 0x41 0x90 0x43 0x1f
     71 
     72 # FP16:  fmsub h1, h2, h3, h4
     73 # CHECK: fmsub s1, s2, s3, s4
     74 # CHECK: fmsub d1, d2, d3, d4
     75 
     76 0x41 0x08 0xe3 0x1e
     77 0x41 0x08 0x23 0x1e
     78 0x41 0x08 0x63 0x1e
     79 
     80 # FP16:  fmul h1, h2, h3
     81 # CHECK: fmul s1, s2, s3
     82 # CHECK: fmul d1, d2, d3
     83 
     84 0x41 0x40 0xe1 0x1e
     85 0x41 0x40 0x21 0x1e
     86 0x41 0x40 0x61 0x1e
     87 
     88 # FP16:  fneg h1, h2
     89 # CHECK: fneg s1, s2
     90 # CHECK: fneg d1, d2
     91 
     92 0x41 0x10 0xe3 0x1f
     93 0x41 0x10 0x23 0x1f
     94 0x41 0x10 0x63 0x1f
     95 
     96 # FP16:  fnmadd h1, h2, h3, h4
     97 # CHECK: fnmadd s1, s2, s3, s4
     98 # CHECK: fnmadd d1, d2, d3, d4
     99 
    100 0x41 0x90 0xe3 0x1f
    101 0x41 0x90 0x23 0x1f
    102 0x41 0x90 0x63 0x1f
    103 
    104 # FP16:  fnmsub h1, h2, h3, h4
    105 # CHECK: fnmsub s1, s2, s3, s4
    106 # CHECK: fnmsub d1, d2, d3, d4
    107 
    108 0x41 0x88 0xe3 0x1e
    109 0x41 0x88 0x23 0x1e
    110 0x41 0x88 0x63 0x1e
    111 
    112 # FP16:  fnmul h1, h2, h3
    113 # CHECK: fnmul s1, s2, s3
    114 # CHECK: fnmul d1, d2, d3
    115 
    116 0x41 0xc0 0xe1 0x1e
    117 0x41 0xc0 0x21 0x1e
    118 0x41 0xc0 0x61 0x1e
    119 
    120 # FP16:  fsqrt h1, h2
    121 # CHECK: fsqrt s1, s2
    122 # CHECK: fsqrt d1, d2
    123 
    124 0x41 0x38 0xe3 0x1e
    125 0x41 0x38 0x23 0x1e
    126 0x41 0x38 0x63 0x1e
    127 
    128 # FP16:  fsub h1, h2, h3
    129 # CHECK: fsub s1, s2, s3
    130 # CHECK: fsub d1, d2, d3
    131 
    132 #-----------------------------------------------------------------------------
    133 # Floating-point comparison
    134 #-----------------------------------------------------------------------------
    135 
    136 0x20 0x04 0xe2 0x1e
    137 0x20 0x04 0x22 0x1e
    138 0x20 0x04 0x62 0x1e
    139 0x30 0x04 0xe2 0x1e
    140 0x30 0x04 0x22 0x1e
    141 0x30 0x04 0x62 0x1e
    142 
    143 # FP16:  fccmp  h1, h2, #0, eq
    144 # CHECK: fccmp  s1, s2, #0, eq
    145 # CHECK: fccmp  d1, d2, #0, eq
    146 # FP16:  fccmpe h1, h2, #0, eq
    147 # CHECK: fccmpe s1, s2, #0, eq
    148 # CHECK: fccmpe d1, d2, #0, eq
    149 
    150 0x20 0x20 0xe2 0x1e
    151 0x20 0x20 0x22 0x1e
    152 0x20 0x20 0x62 0x1e
    153 0x28 0x20 0xe0 0x1e
    154 0x28 0x20 0x20 0x1e
    155 0x28 0x20 0x60 0x1e
    156 0x30 0x20 0xe2 0x1e
    157 0x30 0x20 0x22 0x1e
    158 0x30 0x20 0x62 0x1e
    159 0x38 0x20 0xe0 0x1e
    160 0x38 0x20 0x20 0x1e
    161 0x38 0x20 0x60 0x1e
    162 
    163 # FP16:  fcmp  h1, h2
    164 # CHECK: fcmp  s1, s2
    165 # CHECK: fcmp  d1, d2
    166 # FP16:  fcmp  h1, #0.0
    167 # CHECK: fcmp  s1, #0.0
    168 # CHECK: fcmp  d1, #0.0
    169 # FP16:  fcmpe h1, h2
    170 # CHECK: fcmpe s1, s2
    171 # CHECK: fcmpe d1, d2
    172 # FP16:  fcmpe h1, #0.0
    173 # CHECK: fcmpe s1, #0.0
    174 # CHECK: fcmpe d1, #0.0
    175 
    176 #-----------------------------------------------------------------------------
    177 # Floating-point conditional select
    178 #-----------------------------------------------------------------------------
    179 
    180 0x41 0x0c 0xe3 0x1e
    181 0x41 0x0c 0x23 0x1e
    182 0x41 0x0c 0x63 0x1e
    183 
    184 # FP16:  fcsel h1, h2, h3, eq
    185 # CHECK: fcsel s1, s2, s3, eq
    186 # CHECK: fcsel d1, d2, d3, eq
    187 
    188 #-----------------------------------------------------------------------------
    189 # Floating-point convert
    190 #-----------------------------------------------------------------------------
    191 
    192 0x41 0xc0 0x63 0x1e
    193 0x41 0x40 0x62 0x1e
    194 0x41 0xc0 0xe2 0x1e
    195 0x41 0x40 0xe2 0x1e
    196 0x41 0xc0 0x22 0x1e
    197 0x41 0xc0 0x23 0x1e
    198 
    199 # CHECK: fcvt h1, d2
    200 # CHECK: fcvt s1, d2
    201 # CHECK: fcvt d1, h2
    202 # CHECK: fcvt s1, h2
    203 # CHECK: fcvt d1, s2
    204 # CHECK: fcvt h1, s2
    205 
    206 0x41 0x00 0x44 0x1e
    207 0x41 0x04 0x44 0x1e
    208 0x41 0x00 0x44 0x9e
    209 0x41 0x04 0x44 0x9e
    210 0x41 0x00 0x04 0x1e
    211 0x41 0x04 0x04 0x1e
    212 0x41 0x00 0x04 0x9e
    213 0x41 0x04 0x04 0x9e
    214 
    215 #-----------------------------------------------------------------------------
    216 # Floating-point move
    217 #-----------------------------------------------------------------------------
    218 
    219 0x41 0x00 0xe7 0x1e
    220 0x41 0x00 0xe6 0x1e
    221 0x41 0x00 0x27 0x1e
    222 0x41 0x00 0x26 0x1e
    223 0x41 0x00 0x67 0x9e
    224 0x41 0x00 0x66 0x9e
    225 
    226 # FP16:  fmov h1, w2
    227 # FP16:  fmov w1, h2
    228 # CHECK: fmov s1, w2
    229 # CHECK: fmov w1, s2
    230 # CHECK: fmov d1, x2
    231 # CHECK: fmov x1, d2
    232 
    233 0x01 0x10 0xe8 0x1e
    234 0x01 0x10 0x28 0x1e
    235 0x01 0x10 0x68 0x1e
    236 0x01 0xf0 0x7b 0x1e
    237 0x01 0xf0 0x6b 0x1e
    238 
    239 # FP16:  fmov h1, #0.12500000
    240 # CHECK: fmov s1, #0.12500000
    241 # CHECK: fmov d1, #0.12500000
    242 # CHECK: fmov d1, #-0.48437500
    243 # CHECK: fmov d1, #0.48437500
    244 
    245 0x41 0x40 0xe0 0x1e
    246 0x41 0x40 0x20 0x1e
    247 0x41 0x40 0x60 0x1e
    248 
    249 # FP16:  fmov h1, h2
    250 # CHECK: fmov s1, s2
    251 # CHECK: fmov d1, d2
    252 
    253 #-----------------------------------------------------------------------------
    254 # Floating-point round to integral
    255 #-----------------------------------------------------------------------------
    256 
    257 0x41 0x40 0xe6 0x1e
    258 0x41 0x40 0x26 0x1e
    259 0x41 0x40 0x66 0x1e
    260 
    261 # FP16:  frinta h1, h2
    262 # CHECK: frinta s1, s2
    263 # CHECK: frinta d1, d2
    264 
    265 0x41 0xc0 0xe7 0x1e
    266 0x41 0xc0 0x27 0x1e
    267 0x41 0xc0 0x67 0x1e
    268 
    269 # FP16:  frinti h1, h2
    270 # CHECK: frinti s1, s2
    271 # CHECK: frinti d1, d2
    272 
    273 0x41 0x40 0xe5 0x1e
    274 0x41 0x40 0x25 0x1e
    275 0x41 0x40 0x65 0x1e
    276 
    277 # FP16:  frintm h1, h2
    278 # CHECK: frintm s1, s2
    279 # CHECK: frintm d1, d2
    280 
    281 0x41 0x40 0xe4 0x1e
    282 0x41 0x40 0x24 0x1e
    283 0x41 0x40 0x64 0x1e
    284 
    285 # FP16:  frintn h1, h2
    286 # CHECK: frintn s1, s2
    287 # CHECK: frintn d1, d2
    288 
    289 0x41 0xc0 0xe4 0x1e
    290 0x41 0xc0 0x24 0x1e
    291 0x41 0xc0 0x64 0x1e
    292 
    293 # FP16:  frintp h1, h2
    294 # CHECK: frintp s1, s2
    295 # CHECK: frintp d1, d2
    296 
    297 0x41 0x40 0xe7 0x1e
    298 0x41 0x40 0x27 0x1e
    299 0x41 0x40 0x67 0x1e
    300 
    301 # FP16:  frintx h1, h2
    302 # CHECK: frintx s1, s2
    303 # CHECK: frintx d1, d2
    304 
    305 0x41 0xc0 0xe5 0x1e
    306 0x41 0xc0 0x25 0x1e
    307 0x41 0xc0 0x65 0x1e
    308 
    309 # FP16:  frintz h1, h2
    310 # CHECK: frintz s1, s2
    311 # CHECK: frintz d1, d2
    312 
    313   0x00 0x3c 0xe0 0x7e
    314   0x00 0x8c 0xe0 0x5e
    315 
    316 # CHECK: cmhs d0, d0, d0
    317 # CHECK: cmtst d0, d0, d0
    318 
    319 0x00 0x00 0xaf 0x9e
    320 0x00 0x00 0xae 0x9e
    321 
    322 # CHECK: fmov.d v0[1], x0
    323 # CHECK: fmov.d x0, v0[1]
    324 
    325