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