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 80x41 0xc0 0xe0 0x1e 90x41 0xc0 0x20 0x1e 100x41 0xc0 0x60 0x1e 11 12# FP16: fabs h1, h2 13# CHECK: fabs s1, s2 14# CHECK: fabs d1, d2 15 160x41 0x28 0xe3 0x1e 170x41 0x28 0x23 0x1e 180x41 0x28 0x63 0x1e 19 20# FP16: fadd h1, h2, h3 21# CHECK: fadd s1, s2, s3 22# CHECK: fadd d1, d2, d3 23 240x41 0x18 0xe3 0x1e 250x41 0x18 0x23 0x1e 260x41 0x18 0x63 0x1e 27 28# FP16: fdiv h1, h2, h3 29# CHECK: fdiv s1, s2, s3 30# CHECK: fdiv d1, d2, d3 31 320x41 0x10 0xc3 0x1f 330x41 0x10 0x03 0x1f 340x41 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 400x41 0x48 0xe3 0x1e 410x41 0x48 0x23 0x1e 420x41 0x48 0x63 0x1e 430x41 0x68 0xe3 0x1e 440x41 0x68 0x23 0x1e 450x41 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 540x41 0x58 0xe3 0x1e 550x41 0x58 0x23 0x1e 560x41 0x58 0x63 0x1e 570x41 0x78 0xe3 0x1e 580x41 0x78 0x23 0x1e 590x41 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 680x41 0x90 0xc3 0x1f 690x41 0x90 0x03 0x1f 700x41 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 760x41 0x08 0xe3 0x1e 770x41 0x08 0x23 0x1e 780x41 0x08 0x63 0x1e 79 80# FP16: fmul h1, h2, h3 81# CHECK: fmul s1, s2, s3 82# CHECK: fmul d1, d2, d3 83 840x41 0x40 0xe1 0x1e 850x41 0x40 0x21 0x1e 860x41 0x40 0x61 0x1e 87 88# FP16: fneg h1, h2 89# CHECK: fneg s1, s2 90# CHECK: fneg d1, d2 91 920x41 0x10 0xe3 0x1f 930x41 0x10 0x23 0x1f 940x41 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 1000x41 0x90 0xe3 0x1f 1010x41 0x90 0x23 0x1f 1020x41 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 1080x41 0x88 0xe3 0x1e 1090x41 0x88 0x23 0x1e 1100x41 0x88 0x63 0x1e 111 112# FP16: fnmul h1, h2, h3 113# CHECK: fnmul s1, s2, s3 114# CHECK: fnmul d1, d2, d3 115 1160x41 0xc0 0xe1 0x1e 1170x41 0xc0 0x21 0x1e 1180x41 0xc0 0x61 0x1e 119 120# FP16: fsqrt h1, h2 121# CHECK: fsqrt s1, s2 122# CHECK: fsqrt d1, d2 123 1240x41 0x38 0xe3 0x1e 1250x41 0x38 0x23 0x1e 1260x41 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 1360x20 0x04 0xe2 0x1e 1370x20 0x04 0x22 0x1e 1380x20 0x04 0x62 0x1e 1390x30 0x04 0xe2 0x1e 1400x30 0x04 0x22 0x1e 1410x30 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 1500x20 0x20 0xe2 0x1e 1510x20 0x20 0x22 0x1e 1520x20 0x20 0x62 0x1e 1530x28 0x20 0xe0 0x1e 1540x28 0x20 0x20 0x1e 1550x28 0x20 0x60 0x1e 1560x30 0x20 0xe2 0x1e 1570x30 0x20 0x22 0x1e 1580x30 0x20 0x62 0x1e 1590x38 0x20 0xe0 0x1e 1600x38 0x20 0x20 0x1e 1610x38 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 1800x41 0x0c 0xe3 0x1e 1810x41 0x0c 0x23 0x1e 1820x41 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 1920x41 0xc0 0x63 0x1e 1930x41 0x40 0x62 0x1e 1940x41 0xc0 0xe2 0x1e 1950x41 0x40 0xe2 0x1e 1960x41 0xc0 0x22 0x1e 1970x41 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 2060x41 0x00 0x44 0x1e 2070x41 0x04 0x44 0x1e 2080x41 0x00 0x44 0x9e 2090x41 0x04 0x44 0x9e 2100x41 0x00 0x04 0x1e 2110x41 0x04 0x04 0x1e 2120x41 0x00 0x04 0x9e 2130x41 0x04 0x04 0x9e 214 215#----------------------------------------------------------------------------- 216# Floating-point move 217#----------------------------------------------------------------------------- 218 2190x41 0x00 0xe7 0x1e 2200x41 0x00 0xe6 0x1e 2210x41 0x00 0x27 0x1e 2220x41 0x00 0x26 0x1e 2230x41 0x00 0x67 0x9e 2240x41 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 2330x01 0x10 0xe8 0x1e 2340x01 0x10 0x28 0x1e 2350x01 0x10 0x68 0x1e 2360x01 0xf0 0x7b 0x1e 2370x01 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 2450x41 0x40 0xe0 0x1e 2460x41 0x40 0x20 0x1e 2470x41 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 2570x41 0x40 0xe6 0x1e 2580x41 0x40 0x26 0x1e 2590x41 0x40 0x66 0x1e 260 261# FP16: frinta h1, h2 262# CHECK: frinta s1, s2 263# CHECK: frinta d1, d2 264 2650x41 0xc0 0xe7 0x1e 2660x41 0xc0 0x27 0x1e 2670x41 0xc0 0x67 0x1e 268 269# FP16: frinti h1, h2 270# CHECK: frinti s1, s2 271# CHECK: frinti d1, d2 272 2730x41 0x40 0xe5 0x1e 2740x41 0x40 0x25 0x1e 2750x41 0x40 0x65 0x1e 276 277# FP16: frintm h1, h2 278# CHECK: frintm s1, s2 279# CHECK: frintm d1, d2 280 2810x41 0x40 0xe4 0x1e 2820x41 0x40 0x24 0x1e 2830x41 0x40 0x64 0x1e 284 285# FP16: frintn h1, h2 286# CHECK: frintn s1, s2 287# CHECK: frintn d1, d2 288 2890x41 0xc0 0xe4 0x1e 2900x41 0xc0 0x24 0x1e 2910x41 0xc0 0x64 0x1e 292 293# FP16: frintp h1, h2 294# CHECK: frintp s1, s2 295# CHECK: frintp d1, d2 296 2970x41 0x40 0xe7 0x1e 2980x41 0x40 0x27 0x1e 2990x41 0x40 0x67 0x1e 300 301# FP16: frintx h1, h2 302# CHECK: frintx s1, s2 303# CHECK: frintx d1, d2 304 3050x41 0xc0 0xe5 0x1e 3060x41 0xc0 0x25 0x1e 3070x41 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 3190x00 0x00 0xaf 0x9e 3200x00 0x00 0xae 0x9e 321 322# CHECK: fmov.d v0[1], x0 323# CHECK: fmov.d x0, v0[1] 324 325