github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/compile/internal/ssa/rewriteARM.go (about) 1 // Code generated from gen/ARM.rules; DO NOT EDIT. 2 // generated with: cd gen; go run *.go 3 4 package ssa 5 6 import "github.com/gagliardetto/golang-go/cmd/internal/objabi" 7 import "github.com/gagliardetto/golang-go/cmd/compile/internal/types" 8 9 func rewriteValueARM(v *Value) bool { 10 switch v.Op { 11 case OpARMADC: 12 return rewriteValueARM_OpARMADC_0(v) || rewriteValueARM_OpARMADC_10(v) || rewriteValueARM_OpARMADC_20(v) 13 case OpARMADCconst: 14 return rewriteValueARM_OpARMADCconst_0(v) 15 case OpARMADCshiftLL: 16 return rewriteValueARM_OpARMADCshiftLL_0(v) 17 case OpARMADCshiftLLreg: 18 return rewriteValueARM_OpARMADCshiftLLreg_0(v) 19 case OpARMADCshiftRA: 20 return rewriteValueARM_OpARMADCshiftRA_0(v) 21 case OpARMADCshiftRAreg: 22 return rewriteValueARM_OpARMADCshiftRAreg_0(v) 23 case OpARMADCshiftRL: 24 return rewriteValueARM_OpARMADCshiftRL_0(v) 25 case OpARMADCshiftRLreg: 26 return rewriteValueARM_OpARMADCshiftRLreg_0(v) 27 case OpARMADD: 28 return rewriteValueARM_OpARMADD_0(v) || rewriteValueARM_OpARMADD_10(v) 29 case OpARMADDD: 30 return rewriteValueARM_OpARMADDD_0(v) 31 case OpARMADDF: 32 return rewriteValueARM_OpARMADDF_0(v) 33 case OpARMADDS: 34 return rewriteValueARM_OpARMADDS_0(v) || rewriteValueARM_OpARMADDS_10(v) 35 case OpARMADDSshiftLL: 36 return rewriteValueARM_OpARMADDSshiftLL_0(v) 37 case OpARMADDSshiftLLreg: 38 return rewriteValueARM_OpARMADDSshiftLLreg_0(v) 39 case OpARMADDSshiftRA: 40 return rewriteValueARM_OpARMADDSshiftRA_0(v) 41 case OpARMADDSshiftRAreg: 42 return rewriteValueARM_OpARMADDSshiftRAreg_0(v) 43 case OpARMADDSshiftRL: 44 return rewriteValueARM_OpARMADDSshiftRL_0(v) 45 case OpARMADDSshiftRLreg: 46 return rewriteValueARM_OpARMADDSshiftRLreg_0(v) 47 case OpARMADDconst: 48 return rewriteValueARM_OpARMADDconst_0(v) 49 case OpARMADDshiftLL: 50 return rewriteValueARM_OpARMADDshiftLL_0(v) 51 case OpARMADDshiftLLreg: 52 return rewriteValueARM_OpARMADDshiftLLreg_0(v) 53 case OpARMADDshiftRA: 54 return rewriteValueARM_OpARMADDshiftRA_0(v) 55 case OpARMADDshiftRAreg: 56 return rewriteValueARM_OpARMADDshiftRAreg_0(v) 57 case OpARMADDshiftRL: 58 return rewriteValueARM_OpARMADDshiftRL_0(v) 59 case OpARMADDshiftRLreg: 60 return rewriteValueARM_OpARMADDshiftRLreg_0(v) 61 case OpARMAND: 62 return rewriteValueARM_OpARMAND_0(v) || rewriteValueARM_OpARMAND_10(v) || rewriteValueARM_OpARMAND_20(v) 63 case OpARMANDconst: 64 return rewriteValueARM_OpARMANDconst_0(v) 65 case OpARMANDshiftLL: 66 return rewriteValueARM_OpARMANDshiftLL_0(v) 67 case OpARMANDshiftLLreg: 68 return rewriteValueARM_OpARMANDshiftLLreg_0(v) 69 case OpARMANDshiftRA: 70 return rewriteValueARM_OpARMANDshiftRA_0(v) 71 case OpARMANDshiftRAreg: 72 return rewriteValueARM_OpARMANDshiftRAreg_0(v) 73 case OpARMANDshiftRL: 74 return rewriteValueARM_OpARMANDshiftRL_0(v) 75 case OpARMANDshiftRLreg: 76 return rewriteValueARM_OpARMANDshiftRLreg_0(v) 77 case OpARMBFX: 78 return rewriteValueARM_OpARMBFX_0(v) 79 case OpARMBFXU: 80 return rewriteValueARM_OpARMBFXU_0(v) 81 case OpARMBIC: 82 return rewriteValueARM_OpARMBIC_0(v) 83 case OpARMBICconst: 84 return rewriteValueARM_OpARMBICconst_0(v) 85 case OpARMBICshiftLL: 86 return rewriteValueARM_OpARMBICshiftLL_0(v) 87 case OpARMBICshiftLLreg: 88 return rewriteValueARM_OpARMBICshiftLLreg_0(v) 89 case OpARMBICshiftRA: 90 return rewriteValueARM_OpARMBICshiftRA_0(v) 91 case OpARMBICshiftRAreg: 92 return rewriteValueARM_OpARMBICshiftRAreg_0(v) 93 case OpARMBICshiftRL: 94 return rewriteValueARM_OpARMBICshiftRL_0(v) 95 case OpARMBICshiftRLreg: 96 return rewriteValueARM_OpARMBICshiftRLreg_0(v) 97 case OpARMCMN: 98 return rewriteValueARM_OpARMCMN_0(v) || rewriteValueARM_OpARMCMN_10(v) 99 case OpARMCMNconst: 100 return rewriteValueARM_OpARMCMNconst_0(v) 101 case OpARMCMNshiftLL: 102 return rewriteValueARM_OpARMCMNshiftLL_0(v) 103 case OpARMCMNshiftLLreg: 104 return rewriteValueARM_OpARMCMNshiftLLreg_0(v) 105 case OpARMCMNshiftRA: 106 return rewriteValueARM_OpARMCMNshiftRA_0(v) 107 case OpARMCMNshiftRAreg: 108 return rewriteValueARM_OpARMCMNshiftRAreg_0(v) 109 case OpARMCMNshiftRL: 110 return rewriteValueARM_OpARMCMNshiftRL_0(v) 111 case OpARMCMNshiftRLreg: 112 return rewriteValueARM_OpARMCMNshiftRLreg_0(v) 113 case OpARMCMOVWHSconst: 114 return rewriteValueARM_OpARMCMOVWHSconst_0(v) 115 case OpARMCMOVWLSconst: 116 return rewriteValueARM_OpARMCMOVWLSconst_0(v) 117 case OpARMCMP: 118 return rewriteValueARM_OpARMCMP_0(v) || rewriteValueARM_OpARMCMP_10(v) 119 case OpARMCMPD: 120 return rewriteValueARM_OpARMCMPD_0(v) 121 case OpARMCMPF: 122 return rewriteValueARM_OpARMCMPF_0(v) 123 case OpARMCMPconst: 124 return rewriteValueARM_OpARMCMPconst_0(v) 125 case OpARMCMPshiftLL: 126 return rewriteValueARM_OpARMCMPshiftLL_0(v) 127 case OpARMCMPshiftLLreg: 128 return rewriteValueARM_OpARMCMPshiftLLreg_0(v) 129 case OpARMCMPshiftRA: 130 return rewriteValueARM_OpARMCMPshiftRA_0(v) 131 case OpARMCMPshiftRAreg: 132 return rewriteValueARM_OpARMCMPshiftRAreg_0(v) 133 case OpARMCMPshiftRL: 134 return rewriteValueARM_OpARMCMPshiftRL_0(v) 135 case OpARMCMPshiftRLreg: 136 return rewriteValueARM_OpARMCMPshiftRLreg_0(v) 137 case OpARMEqual: 138 return rewriteValueARM_OpARMEqual_0(v) 139 case OpARMGreaterEqual: 140 return rewriteValueARM_OpARMGreaterEqual_0(v) 141 case OpARMGreaterEqualU: 142 return rewriteValueARM_OpARMGreaterEqualU_0(v) 143 case OpARMGreaterThan: 144 return rewriteValueARM_OpARMGreaterThan_0(v) 145 case OpARMGreaterThanU: 146 return rewriteValueARM_OpARMGreaterThanU_0(v) 147 case OpARMLessEqual: 148 return rewriteValueARM_OpARMLessEqual_0(v) 149 case OpARMLessEqualU: 150 return rewriteValueARM_OpARMLessEqualU_0(v) 151 case OpARMLessThan: 152 return rewriteValueARM_OpARMLessThan_0(v) 153 case OpARMLessThanU: 154 return rewriteValueARM_OpARMLessThanU_0(v) 155 case OpARMMOVBUload: 156 return rewriteValueARM_OpARMMOVBUload_0(v) 157 case OpARMMOVBUloadidx: 158 return rewriteValueARM_OpARMMOVBUloadidx_0(v) 159 case OpARMMOVBUreg: 160 return rewriteValueARM_OpARMMOVBUreg_0(v) 161 case OpARMMOVBload: 162 return rewriteValueARM_OpARMMOVBload_0(v) 163 case OpARMMOVBloadidx: 164 return rewriteValueARM_OpARMMOVBloadidx_0(v) 165 case OpARMMOVBreg: 166 return rewriteValueARM_OpARMMOVBreg_0(v) 167 case OpARMMOVBstore: 168 return rewriteValueARM_OpARMMOVBstore_0(v) 169 case OpARMMOVBstoreidx: 170 return rewriteValueARM_OpARMMOVBstoreidx_0(v) 171 case OpARMMOVDload: 172 return rewriteValueARM_OpARMMOVDload_0(v) 173 case OpARMMOVDstore: 174 return rewriteValueARM_OpARMMOVDstore_0(v) 175 case OpARMMOVFload: 176 return rewriteValueARM_OpARMMOVFload_0(v) 177 case OpARMMOVFstore: 178 return rewriteValueARM_OpARMMOVFstore_0(v) 179 case OpARMMOVHUload: 180 return rewriteValueARM_OpARMMOVHUload_0(v) 181 case OpARMMOVHUloadidx: 182 return rewriteValueARM_OpARMMOVHUloadidx_0(v) 183 case OpARMMOVHUreg: 184 return rewriteValueARM_OpARMMOVHUreg_0(v) 185 case OpARMMOVHload: 186 return rewriteValueARM_OpARMMOVHload_0(v) 187 case OpARMMOVHloadidx: 188 return rewriteValueARM_OpARMMOVHloadidx_0(v) 189 case OpARMMOVHreg: 190 return rewriteValueARM_OpARMMOVHreg_0(v) 191 case OpARMMOVHstore: 192 return rewriteValueARM_OpARMMOVHstore_0(v) 193 case OpARMMOVHstoreidx: 194 return rewriteValueARM_OpARMMOVHstoreidx_0(v) 195 case OpARMMOVWload: 196 return rewriteValueARM_OpARMMOVWload_0(v) 197 case OpARMMOVWloadidx: 198 return rewriteValueARM_OpARMMOVWloadidx_0(v) 199 case OpARMMOVWloadshiftLL: 200 return rewriteValueARM_OpARMMOVWloadshiftLL_0(v) 201 case OpARMMOVWloadshiftRA: 202 return rewriteValueARM_OpARMMOVWloadshiftRA_0(v) 203 case OpARMMOVWloadshiftRL: 204 return rewriteValueARM_OpARMMOVWloadshiftRL_0(v) 205 case OpARMMOVWreg: 206 return rewriteValueARM_OpARMMOVWreg_0(v) 207 case OpARMMOVWstore: 208 return rewriteValueARM_OpARMMOVWstore_0(v) 209 case OpARMMOVWstoreidx: 210 return rewriteValueARM_OpARMMOVWstoreidx_0(v) 211 case OpARMMOVWstoreshiftLL: 212 return rewriteValueARM_OpARMMOVWstoreshiftLL_0(v) 213 case OpARMMOVWstoreshiftRA: 214 return rewriteValueARM_OpARMMOVWstoreshiftRA_0(v) 215 case OpARMMOVWstoreshiftRL: 216 return rewriteValueARM_OpARMMOVWstoreshiftRL_0(v) 217 case OpARMMUL: 218 return rewriteValueARM_OpARMMUL_0(v) || rewriteValueARM_OpARMMUL_10(v) || rewriteValueARM_OpARMMUL_20(v) 219 case OpARMMULA: 220 return rewriteValueARM_OpARMMULA_0(v) || rewriteValueARM_OpARMMULA_10(v) || rewriteValueARM_OpARMMULA_20(v) 221 case OpARMMULD: 222 return rewriteValueARM_OpARMMULD_0(v) 223 case OpARMMULF: 224 return rewriteValueARM_OpARMMULF_0(v) 225 case OpARMMULS: 226 return rewriteValueARM_OpARMMULS_0(v) || rewriteValueARM_OpARMMULS_10(v) || rewriteValueARM_OpARMMULS_20(v) 227 case OpARMMVN: 228 return rewriteValueARM_OpARMMVN_0(v) 229 case OpARMMVNshiftLL: 230 return rewriteValueARM_OpARMMVNshiftLL_0(v) 231 case OpARMMVNshiftLLreg: 232 return rewriteValueARM_OpARMMVNshiftLLreg_0(v) 233 case OpARMMVNshiftRA: 234 return rewriteValueARM_OpARMMVNshiftRA_0(v) 235 case OpARMMVNshiftRAreg: 236 return rewriteValueARM_OpARMMVNshiftRAreg_0(v) 237 case OpARMMVNshiftRL: 238 return rewriteValueARM_OpARMMVNshiftRL_0(v) 239 case OpARMMVNshiftRLreg: 240 return rewriteValueARM_OpARMMVNshiftRLreg_0(v) 241 case OpARMNEGD: 242 return rewriteValueARM_OpARMNEGD_0(v) 243 case OpARMNEGF: 244 return rewriteValueARM_OpARMNEGF_0(v) 245 case OpARMNMULD: 246 return rewriteValueARM_OpARMNMULD_0(v) 247 case OpARMNMULF: 248 return rewriteValueARM_OpARMNMULF_0(v) 249 case OpARMNotEqual: 250 return rewriteValueARM_OpARMNotEqual_0(v) 251 case OpARMOR: 252 return rewriteValueARM_OpARMOR_0(v) || rewriteValueARM_OpARMOR_10(v) 253 case OpARMORconst: 254 return rewriteValueARM_OpARMORconst_0(v) 255 case OpARMORshiftLL: 256 return rewriteValueARM_OpARMORshiftLL_0(v) 257 case OpARMORshiftLLreg: 258 return rewriteValueARM_OpARMORshiftLLreg_0(v) 259 case OpARMORshiftRA: 260 return rewriteValueARM_OpARMORshiftRA_0(v) 261 case OpARMORshiftRAreg: 262 return rewriteValueARM_OpARMORshiftRAreg_0(v) 263 case OpARMORshiftRL: 264 return rewriteValueARM_OpARMORshiftRL_0(v) 265 case OpARMORshiftRLreg: 266 return rewriteValueARM_OpARMORshiftRLreg_0(v) 267 case OpARMRSB: 268 return rewriteValueARM_OpARMRSB_0(v) || rewriteValueARM_OpARMRSB_10(v) 269 case OpARMRSBSshiftLL: 270 return rewriteValueARM_OpARMRSBSshiftLL_0(v) 271 case OpARMRSBSshiftLLreg: 272 return rewriteValueARM_OpARMRSBSshiftLLreg_0(v) 273 case OpARMRSBSshiftRA: 274 return rewriteValueARM_OpARMRSBSshiftRA_0(v) 275 case OpARMRSBSshiftRAreg: 276 return rewriteValueARM_OpARMRSBSshiftRAreg_0(v) 277 case OpARMRSBSshiftRL: 278 return rewriteValueARM_OpARMRSBSshiftRL_0(v) 279 case OpARMRSBSshiftRLreg: 280 return rewriteValueARM_OpARMRSBSshiftRLreg_0(v) 281 case OpARMRSBconst: 282 return rewriteValueARM_OpARMRSBconst_0(v) 283 case OpARMRSBshiftLL: 284 return rewriteValueARM_OpARMRSBshiftLL_0(v) 285 case OpARMRSBshiftLLreg: 286 return rewriteValueARM_OpARMRSBshiftLLreg_0(v) 287 case OpARMRSBshiftRA: 288 return rewriteValueARM_OpARMRSBshiftRA_0(v) 289 case OpARMRSBshiftRAreg: 290 return rewriteValueARM_OpARMRSBshiftRAreg_0(v) 291 case OpARMRSBshiftRL: 292 return rewriteValueARM_OpARMRSBshiftRL_0(v) 293 case OpARMRSBshiftRLreg: 294 return rewriteValueARM_OpARMRSBshiftRLreg_0(v) 295 case OpARMRSCconst: 296 return rewriteValueARM_OpARMRSCconst_0(v) 297 case OpARMRSCshiftLL: 298 return rewriteValueARM_OpARMRSCshiftLL_0(v) 299 case OpARMRSCshiftLLreg: 300 return rewriteValueARM_OpARMRSCshiftLLreg_0(v) 301 case OpARMRSCshiftRA: 302 return rewriteValueARM_OpARMRSCshiftRA_0(v) 303 case OpARMRSCshiftRAreg: 304 return rewriteValueARM_OpARMRSCshiftRAreg_0(v) 305 case OpARMRSCshiftRL: 306 return rewriteValueARM_OpARMRSCshiftRL_0(v) 307 case OpARMRSCshiftRLreg: 308 return rewriteValueARM_OpARMRSCshiftRLreg_0(v) 309 case OpARMSBC: 310 return rewriteValueARM_OpARMSBC_0(v) || rewriteValueARM_OpARMSBC_10(v) 311 case OpARMSBCconst: 312 return rewriteValueARM_OpARMSBCconst_0(v) 313 case OpARMSBCshiftLL: 314 return rewriteValueARM_OpARMSBCshiftLL_0(v) 315 case OpARMSBCshiftLLreg: 316 return rewriteValueARM_OpARMSBCshiftLLreg_0(v) 317 case OpARMSBCshiftRA: 318 return rewriteValueARM_OpARMSBCshiftRA_0(v) 319 case OpARMSBCshiftRAreg: 320 return rewriteValueARM_OpARMSBCshiftRAreg_0(v) 321 case OpARMSBCshiftRL: 322 return rewriteValueARM_OpARMSBCshiftRL_0(v) 323 case OpARMSBCshiftRLreg: 324 return rewriteValueARM_OpARMSBCshiftRLreg_0(v) 325 case OpARMSLL: 326 return rewriteValueARM_OpARMSLL_0(v) 327 case OpARMSLLconst: 328 return rewriteValueARM_OpARMSLLconst_0(v) 329 case OpARMSRA: 330 return rewriteValueARM_OpARMSRA_0(v) 331 case OpARMSRAcond: 332 return rewriteValueARM_OpARMSRAcond_0(v) 333 case OpARMSRAconst: 334 return rewriteValueARM_OpARMSRAconst_0(v) 335 case OpARMSRL: 336 return rewriteValueARM_OpARMSRL_0(v) 337 case OpARMSRLconst: 338 return rewriteValueARM_OpARMSRLconst_0(v) 339 case OpARMSUB: 340 return rewriteValueARM_OpARMSUB_0(v) || rewriteValueARM_OpARMSUB_10(v) 341 case OpARMSUBD: 342 return rewriteValueARM_OpARMSUBD_0(v) 343 case OpARMSUBF: 344 return rewriteValueARM_OpARMSUBF_0(v) 345 case OpARMSUBS: 346 return rewriteValueARM_OpARMSUBS_0(v) || rewriteValueARM_OpARMSUBS_10(v) 347 case OpARMSUBSshiftLL: 348 return rewriteValueARM_OpARMSUBSshiftLL_0(v) 349 case OpARMSUBSshiftLLreg: 350 return rewriteValueARM_OpARMSUBSshiftLLreg_0(v) 351 case OpARMSUBSshiftRA: 352 return rewriteValueARM_OpARMSUBSshiftRA_0(v) 353 case OpARMSUBSshiftRAreg: 354 return rewriteValueARM_OpARMSUBSshiftRAreg_0(v) 355 case OpARMSUBSshiftRL: 356 return rewriteValueARM_OpARMSUBSshiftRL_0(v) 357 case OpARMSUBSshiftRLreg: 358 return rewriteValueARM_OpARMSUBSshiftRLreg_0(v) 359 case OpARMSUBconst: 360 return rewriteValueARM_OpARMSUBconst_0(v) 361 case OpARMSUBshiftLL: 362 return rewriteValueARM_OpARMSUBshiftLL_0(v) 363 case OpARMSUBshiftLLreg: 364 return rewriteValueARM_OpARMSUBshiftLLreg_0(v) 365 case OpARMSUBshiftRA: 366 return rewriteValueARM_OpARMSUBshiftRA_0(v) 367 case OpARMSUBshiftRAreg: 368 return rewriteValueARM_OpARMSUBshiftRAreg_0(v) 369 case OpARMSUBshiftRL: 370 return rewriteValueARM_OpARMSUBshiftRL_0(v) 371 case OpARMSUBshiftRLreg: 372 return rewriteValueARM_OpARMSUBshiftRLreg_0(v) 373 case OpARMTEQ: 374 return rewriteValueARM_OpARMTEQ_0(v) || rewriteValueARM_OpARMTEQ_10(v) 375 case OpARMTEQconst: 376 return rewriteValueARM_OpARMTEQconst_0(v) 377 case OpARMTEQshiftLL: 378 return rewriteValueARM_OpARMTEQshiftLL_0(v) 379 case OpARMTEQshiftLLreg: 380 return rewriteValueARM_OpARMTEQshiftLLreg_0(v) 381 case OpARMTEQshiftRA: 382 return rewriteValueARM_OpARMTEQshiftRA_0(v) 383 case OpARMTEQshiftRAreg: 384 return rewriteValueARM_OpARMTEQshiftRAreg_0(v) 385 case OpARMTEQshiftRL: 386 return rewriteValueARM_OpARMTEQshiftRL_0(v) 387 case OpARMTEQshiftRLreg: 388 return rewriteValueARM_OpARMTEQshiftRLreg_0(v) 389 case OpARMTST: 390 return rewriteValueARM_OpARMTST_0(v) || rewriteValueARM_OpARMTST_10(v) 391 case OpARMTSTconst: 392 return rewriteValueARM_OpARMTSTconst_0(v) 393 case OpARMTSTshiftLL: 394 return rewriteValueARM_OpARMTSTshiftLL_0(v) 395 case OpARMTSTshiftLLreg: 396 return rewriteValueARM_OpARMTSTshiftLLreg_0(v) 397 case OpARMTSTshiftRA: 398 return rewriteValueARM_OpARMTSTshiftRA_0(v) 399 case OpARMTSTshiftRAreg: 400 return rewriteValueARM_OpARMTSTshiftRAreg_0(v) 401 case OpARMTSTshiftRL: 402 return rewriteValueARM_OpARMTSTshiftRL_0(v) 403 case OpARMTSTshiftRLreg: 404 return rewriteValueARM_OpARMTSTshiftRLreg_0(v) 405 case OpARMXOR: 406 return rewriteValueARM_OpARMXOR_0(v) || rewriteValueARM_OpARMXOR_10(v) 407 case OpARMXORconst: 408 return rewriteValueARM_OpARMXORconst_0(v) 409 case OpARMXORshiftLL: 410 return rewriteValueARM_OpARMXORshiftLL_0(v) 411 case OpARMXORshiftLLreg: 412 return rewriteValueARM_OpARMXORshiftLLreg_0(v) 413 case OpARMXORshiftRA: 414 return rewriteValueARM_OpARMXORshiftRA_0(v) 415 case OpARMXORshiftRAreg: 416 return rewriteValueARM_OpARMXORshiftRAreg_0(v) 417 case OpARMXORshiftRL: 418 return rewriteValueARM_OpARMXORshiftRL_0(v) 419 case OpARMXORshiftRLreg: 420 return rewriteValueARM_OpARMXORshiftRLreg_0(v) 421 case OpARMXORshiftRR: 422 return rewriteValueARM_OpARMXORshiftRR_0(v) 423 case OpAbs: 424 return rewriteValueARM_OpAbs_0(v) 425 case OpAdd16: 426 return rewriteValueARM_OpAdd16_0(v) 427 case OpAdd32: 428 return rewriteValueARM_OpAdd32_0(v) 429 case OpAdd32F: 430 return rewriteValueARM_OpAdd32F_0(v) 431 case OpAdd32carry: 432 return rewriteValueARM_OpAdd32carry_0(v) 433 case OpAdd32withcarry: 434 return rewriteValueARM_OpAdd32withcarry_0(v) 435 case OpAdd64F: 436 return rewriteValueARM_OpAdd64F_0(v) 437 case OpAdd8: 438 return rewriteValueARM_OpAdd8_0(v) 439 case OpAddPtr: 440 return rewriteValueARM_OpAddPtr_0(v) 441 case OpAddr: 442 return rewriteValueARM_OpAddr_0(v) 443 case OpAnd16: 444 return rewriteValueARM_OpAnd16_0(v) 445 case OpAnd32: 446 return rewriteValueARM_OpAnd32_0(v) 447 case OpAnd8: 448 return rewriteValueARM_OpAnd8_0(v) 449 case OpAndB: 450 return rewriteValueARM_OpAndB_0(v) 451 case OpAvg32u: 452 return rewriteValueARM_OpAvg32u_0(v) 453 case OpBitLen32: 454 return rewriteValueARM_OpBitLen32_0(v) 455 case OpBswap32: 456 return rewriteValueARM_OpBswap32_0(v) 457 case OpClosureCall: 458 return rewriteValueARM_OpClosureCall_0(v) 459 case OpCom16: 460 return rewriteValueARM_OpCom16_0(v) 461 case OpCom32: 462 return rewriteValueARM_OpCom32_0(v) 463 case OpCom8: 464 return rewriteValueARM_OpCom8_0(v) 465 case OpConst16: 466 return rewriteValueARM_OpConst16_0(v) 467 case OpConst32: 468 return rewriteValueARM_OpConst32_0(v) 469 case OpConst32F: 470 return rewriteValueARM_OpConst32F_0(v) 471 case OpConst64F: 472 return rewriteValueARM_OpConst64F_0(v) 473 case OpConst8: 474 return rewriteValueARM_OpConst8_0(v) 475 case OpConstBool: 476 return rewriteValueARM_OpConstBool_0(v) 477 case OpConstNil: 478 return rewriteValueARM_OpConstNil_0(v) 479 case OpCtz16: 480 return rewriteValueARM_OpCtz16_0(v) 481 case OpCtz16NonZero: 482 return rewriteValueARM_OpCtz16NonZero_0(v) 483 case OpCtz32: 484 return rewriteValueARM_OpCtz32_0(v) 485 case OpCtz32NonZero: 486 return rewriteValueARM_OpCtz32NonZero_0(v) 487 case OpCtz8: 488 return rewriteValueARM_OpCtz8_0(v) 489 case OpCtz8NonZero: 490 return rewriteValueARM_OpCtz8NonZero_0(v) 491 case OpCvt32Fto32: 492 return rewriteValueARM_OpCvt32Fto32_0(v) 493 case OpCvt32Fto32U: 494 return rewriteValueARM_OpCvt32Fto32U_0(v) 495 case OpCvt32Fto64F: 496 return rewriteValueARM_OpCvt32Fto64F_0(v) 497 case OpCvt32Uto32F: 498 return rewriteValueARM_OpCvt32Uto32F_0(v) 499 case OpCvt32Uto64F: 500 return rewriteValueARM_OpCvt32Uto64F_0(v) 501 case OpCvt32to32F: 502 return rewriteValueARM_OpCvt32to32F_0(v) 503 case OpCvt32to64F: 504 return rewriteValueARM_OpCvt32to64F_0(v) 505 case OpCvt64Fto32: 506 return rewriteValueARM_OpCvt64Fto32_0(v) 507 case OpCvt64Fto32F: 508 return rewriteValueARM_OpCvt64Fto32F_0(v) 509 case OpCvt64Fto32U: 510 return rewriteValueARM_OpCvt64Fto32U_0(v) 511 case OpDiv16: 512 return rewriteValueARM_OpDiv16_0(v) 513 case OpDiv16u: 514 return rewriteValueARM_OpDiv16u_0(v) 515 case OpDiv32: 516 return rewriteValueARM_OpDiv32_0(v) 517 case OpDiv32F: 518 return rewriteValueARM_OpDiv32F_0(v) 519 case OpDiv32u: 520 return rewriteValueARM_OpDiv32u_0(v) 521 case OpDiv64F: 522 return rewriteValueARM_OpDiv64F_0(v) 523 case OpDiv8: 524 return rewriteValueARM_OpDiv8_0(v) 525 case OpDiv8u: 526 return rewriteValueARM_OpDiv8u_0(v) 527 case OpEq16: 528 return rewriteValueARM_OpEq16_0(v) 529 case OpEq32: 530 return rewriteValueARM_OpEq32_0(v) 531 case OpEq32F: 532 return rewriteValueARM_OpEq32F_0(v) 533 case OpEq64F: 534 return rewriteValueARM_OpEq64F_0(v) 535 case OpEq8: 536 return rewriteValueARM_OpEq8_0(v) 537 case OpEqB: 538 return rewriteValueARM_OpEqB_0(v) 539 case OpEqPtr: 540 return rewriteValueARM_OpEqPtr_0(v) 541 case OpFMA: 542 return rewriteValueARM_OpFMA_0(v) 543 case OpGeq16: 544 return rewriteValueARM_OpGeq16_0(v) 545 case OpGeq16U: 546 return rewriteValueARM_OpGeq16U_0(v) 547 case OpGeq32: 548 return rewriteValueARM_OpGeq32_0(v) 549 case OpGeq32F: 550 return rewriteValueARM_OpGeq32F_0(v) 551 case OpGeq32U: 552 return rewriteValueARM_OpGeq32U_0(v) 553 case OpGeq64F: 554 return rewriteValueARM_OpGeq64F_0(v) 555 case OpGeq8: 556 return rewriteValueARM_OpGeq8_0(v) 557 case OpGeq8U: 558 return rewriteValueARM_OpGeq8U_0(v) 559 case OpGetCallerPC: 560 return rewriteValueARM_OpGetCallerPC_0(v) 561 case OpGetCallerSP: 562 return rewriteValueARM_OpGetCallerSP_0(v) 563 case OpGetClosurePtr: 564 return rewriteValueARM_OpGetClosurePtr_0(v) 565 case OpGreater16: 566 return rewriteValueARM_OpGreater16_0(v) 567 case OpGreater16U: 568 return rewriteValueARM_OpGreater16U_0(v) 569 case OpGreater32: 570 return rewriteValueARM_OpGreater32_0(v) 571 case OpGreater32F: 572 return rewriteValueARM_OpGreater32F_0(v) 573 case OpGreater32U: 574 return rewriteValueARM_OpGreater32U_0(v) 575 case OpGreater64F: 576 return rewriteValueARM_OpGreater64F_0(v) 577 case OpGreater8: 578 return rewriteValueARM_OpGreater8_0(v) 579 case OpGreater8U: 580 return rewriteValueARM_OpGreater8U_0(v) 581 case OpHmul32: 582 return rewriteValueARM_OpHmul32_0(v) 583 case OpHmul32u: 584 return rewriteValueARM_OpHmul32u_0(v) 585 case OpInterCall: 586 return rewriteValueARM_OpInterCall_0(v) 587 case OpIsInBounds: 588 return rewriteValueARM_OpIsInBounds_0(v) 589 case OpIsNonNil: 590 return rewriteValueARM_OpIsNonNil_0(v) 591 case OpIsSliceInBounds: 592 return rewriteValueARM_OpIsSliceInBounds_0(v) 593 case OpLeq16: 594 return rewriteValueARM_OpLeq16_0(v) 595 case OpLeq16U: 596 return rewriteValueARM_OpLeq16U_0(v) 597 case OpLeq32: 598 return rewriteValueARM_OpLeq32_0(v) 599 case OpLeq32F: 600 return rewriteValueARM_OpLeq32F_0(v) 601 case OpLeq32U: 602 return rewriteValueARM_OpLeq32U_0(v) 603 case OpLeq64F: 604 return rewriteValueARM_OpLeq64F_0(v) 605 case OpLeq8: 606 return rewriteValueARM_OpLeq8_0(v) 607 case OpLeq8U: 608 return rewriteValueARM_OpLeq8U_0(v) 609 case OpLess16: 610 return rewriteValueARM_OpLess16_0(v) 611 case OpLess16U: 612 return rewriteValueARM_OpLess16U_0(v) 613 case OpLess32: 614 return rewriteValueARM_OpLess32_0(v) 615 case OpLess32F: 616 return rewriteValueARM_OpLess32F_0(v) 617 case OpLess32U: 618 return rewriteValueARM_OpLess32U_0(v) 619 case OpLess64F: 620 return rewriteValueARM_OpLess64F_0(v) 621 case OpLess8: 622 return rewriteValueARM_OpLess8_0(v) 623 case OpLess8U: 624 return rewriteValueARM_OpLess8U_0(v) 625 case OpLoad: 626 return rewriteValueARM_OpLoad_0(v) 627 case OpLocalAddr: 628 return rewriteValueARM_OpLocalAddr_0(v) 629 case OpLsh16x16: 630 return rewriteValueARM_OpLsh16x16_0(v) 631 case OpLsh16x32: 632 return rewriteValueARM_OpLsh16x32_0(v) 633 case OpLsh16x64: 634 return rewriteValueARM_OpLsh16x64_0(v) 635 case OpLsh16x8: 636 return rewriteValueARM_OpLsh16x8_0(v) 637 case OpLsh32x16: 638 return rewriteValueARM_OpLsh32x16_0(v) 639 case OpLsh32x32: 640 return rewriteValueARM_OpLsh32x32_0(v) 641 case OpLsh32x64: 642 return rewriteValueARM_OpLsh32x64_0(v) 643 case OpLsh32x8: 644 return rewriteValueARM_OpLsh32x8_0(v) 645 case OpLsh8x16: 646 return rewriteValueARM_OpLsh8x16_0(v) 647 case OpLsh8x32: 648 return rewriteValueARM_OpLsh8x32_0(v) 649 case OpLsh8x64: 650 return rewriteValueARM_OpLsh8x64_0(v) 651 case OpLsh8x8: 652 return rewriteValueARM_OpLsh8x8_0(v) 653 case OpMod16: 654 return rewriteValueARM_OpMod16_0(v) 655 case OpMod16u: 656 return rewriteValueARM_OpMod16u_0(v) 657 case OpMod32: 658 return rewriteValueARM_OpMod32_0(v) 659 case OpMod32u: 660 return rewriteValueARM_OpMod32u_0(v) 661 case OpMod8: 662 return rewriteValueARM_OpMod8_0(v) 663 case OpMod8u: 664 return rewriteValueARM_OpMod8u_0(v) 665 case OpMove: 666 return rewriteValueARM_OpMove_0(v) 667 case OpMul16: 668 return rewriteValueARM_OpMul16_0(v) 669 case OpMul32: 670 return rewriteValueARM_OpMul32_0(v) 671 case OpMul32F: 672 return rewriteValueARM_OpMul32F_0(v) 673 case OpMul32uhilo: 674 return rewriteValueARM_OpMul32uhilo_0(v) 675 case OpMul64F: 676 return rewriteValueARM_OpMul64F_0(v) 677 case OpMul8: 678 return rewriteValueARM_OpMul8_0(v) 679 case OpNeg16: 680 return rewriteValueARM_OpNeg16_0(v) 681 case OpNeg32: 682 return rewriteValueARM_OpNeg32_0(v) 683 case OpNeg32F: 684 return rewriteValueARM_OpNeg32F_0(v) 685 case OpNeg64F: 686 return rewriteValueARM_OpNeg64F_0(v) 687 case OpNeg8: 688 return rewriteValueARM_OpNeg8_0(v) 689 case OpNeq16: 690 return rewriteValueARM_OpNeq16_0(v) 691 case OpNeq32: 692 return rewriteValueARM_OpNeq32_0(v) 693 case OpNeq32F: 694 return rewriteValueARM_OpNeq32F_0(v) 695 case OpNeq64F: 696 return rewriteValueARM_OpNeq64F_0(v) 697 case OpNeq8: 698 return rewriteValueARM_OpNeq8_0(v) 699 case OpNeqB: 700 return rewriteValueARM_OpNeqB_0(v) 701 case OpNeqPtr: 702 return rewriteValueARM_OpNeqPtr_0(v) 703 case OpNilCheck: 704 return rewriteValueARM_OpNilCheck_0(v) 705 case OpNot: 706 return rewriteValueARM_OpNot_0(v) 707 case OpOffPtr: 708 return rewriteValueARM_OpOffPtr_0(v) 709 case OpOr16: 710 return rewriteValueARM_OpOr16_0(v) 711 case OpOr32: 712 return rewriteValueARM_OpOr32_0(v) 713 case OpOr8: 714 return rewriteValueARM_OpOr8_0(v) 715 case OpOrB: 716 return rewriteValueARM_OpOrB_0(v) 717 case OpPanicBounds: 718 return rewriteValueARM_OpPanicBounds_0(v) 719 case OpPanicExtend: 720 return rewriteValueARM_OpPanicExtend_0(v) 721 case OpRotateLeft16: 722 return rewriteValueARM_OpRotateLeft16_0(v) 723 case OpRotateLeft32: 724 return rewriteValueARM_OpRotateLeft32_0(v) 725 case OpRotateLeft8: 726 return rewriteValueARM_OpRotateLeft8_0(v) 727 case OpRound32F: 728 return rewriteValueARM_OpRound32F_0(v) 729 case OpRound64F: 730 return rewriteValueARM_OpRound64F_0(v) 731 case OpRsh16Ux16: 732 return rewriteValueARM_OpRsh16Ux16_0(v) 733 case OpRsh16Ux32: 734 return rewriteValueARM_OpRsh16Ux32_0(v) 735 case OpRsh16Ux64: 736 return rewriteValueARM_OpRsh16Ux64_0(v) 737 case OpRsh16Ux8: 738 return rewriteValueARM_OpRsh16Ux8_0(v) 739 case OpRsh16x16: 740 return rewriteValueARM_OpRsh16x16_0(v) 741 case OpRsh16x32: 742 return rewriteValueARM_OpRsh16x32_0(v) 743 case OpRsh16x64: 744 return rewriteValueARM_OpRsh16x64_0(v) 745 case OpRsh16x8: 746 return rewriteValueARM_OpRsh16x8_0(v) 747 case OpRsh32Ux16: 748 return rewriteValueARM_OpRsh32Ux16_0(v) 749 case OpRsh32Ux32: 750 return rewriteValueARM_OpRsh32Ux32_0(v) 751 case OpRsh32Ux64: 752 return rewriteValueARM_OpRsh32Ux64_0(v) 753 case OpRsh32Ux8: 754 return rewriteValueARM_OpRsh32Ux8_0(v) 755 case OpRsh32x16: 756 return rewriteValueARM_OpRsh32x16_0(v) 757 case OpRsh32x32: 758 return rewriteValueARM_OpRsh32x32_0(v) 759 case OpRsh32x64: 760 return rewriteValueARM_OpRsh32x64_0(v) 761 case OpRsh32x8: 762 return rewriteValueARM_OpRsh32x8_0(v) 763 case OpRsh8Ux16: 764 return rewriteValueARM_OpRsh8Ux16_0(v) 765 case OpRsh8Ux32: 766 return rewriteValueARM_OpRsh8Ux32_0(v) 767 case OpRsh8Ux64: 768 return rewriteValueARM_OpRsh8Ux64_0(v) 769 case OpRsh8Ux8: 770 return rewriteValueARM_OpRsh8Ux8_0(v) 771 case OpRsh8x16: 772 return rewriteValueARM_OpRsh8x16_0(v) 773 case OpRsh8x32: 774 return rewriteValueARM_OpRsh8x32_0(v) 775 case OpRsh8x64: 776 return rewriteValueARM_OpRsh8x64_0(v) 777 case OpRsh8x8: 778 return rewriteValueARM_OpRsh8x8_0(v) 779 case OpSelect0: 780 return rewriteValueARM_OpSelect0_0(v) 781 case OpSelect1: 782 return rewriteValueARM_OpSelect1_0(v) 783 case OpSignExt16to32: 784 return rewriteValueARM_OpSignExt16to32_0(v) 785 case OpSignExt8to16: 786 return rewriteValueARM_OpSignExt8to16_0(v) 787 case OpSignExt8to32: 788 return rewriteValueARM_OpSignExt8to32_0(v) 789 case OpSignmask: 790 return rewriteValueARM_OpSignmask_0(v) 791 case OpSlicemask: 792 return rewriteValueARM_OpSlicemask_0(v) 793 case OpSqrt: 794 return rewriteValueARM_OpSqrt_0(v) 795 case OpStaticCall: 796 return rewriteValueARM_OpStaticCall_0(v) 797 case OpStore: 798 return rewriteValueARM_OpStore_0(v) 799 case OpSub16: 800 return rewriteValueARM_OpSub16_0(v) 801 case OpSub32: 802 return rewriteValueARM_OpSub32_0(v) 803 case OpSub32F: 804 return rewriteValueARM_OpSub32F_0(v) 805 case OpSub32carry: 806 return rewriteValueARM_OpSub32carry_0(v) 807 case OpSub32withcarry: 808 return rewriteValueARM_OpSub32withcarry_0(v) 809 case OpSub64F: 810 return rewriteValueARM_OpSub64F_0(v) 811 case OpSub8: 812 return rewriteValueARM_OpSub8_0(v) 813 case OpSubPtr: 814 return rewriteValueARM_OpSubPtr_0(v) 815 case OpTrunc16to8: 816 return rewriteValueARM_OpTrunc16to8_0(v) 817 case OpTrunc32to16: 818 return rewriteValueARM_OpTrunc32to16_0(v) 819 case OpTrunc32to8: 820 return rewriteValueARM_OpTrunc32to8_0(v) 821 case OpWB: 822 return rewriteValueARM_OpWB_0(v) 823 case OpXor16: 824 return rewriteValueARM_OpXor16_0(v) 825 case OpXor32: 826 return rewriteValueARM_OpXor32_0(v) 827 case OpXor8: 828 return rewriteValueARM_OpXor8_0(v) 829 case OpZero: 830 return rewriteValueARM_OpZero_0(v) 831 case OpZeroExt16to32: 832 return rewriteValueARM_OpZeroExt16to32_0(v) 833 case OpZeroExt8to16: 834 return rewriteValueARM_OpZeroExt8to16_0(v) 835 case OpZeroExt8to32: 836 return rewriteValueARM_OpZeroExt8to32_0(v) 837 case OpZeromask: 838 return rewriteValueARM_OpZeromask_0(v) 839 } 840 return false 841 } 842 func rewriteValueARM_OpARMADC_0(v *Value) bool { 843 // match: (ADC (MOVWconst [c]) x flags) 844 // result: (ADCconst [c] x flags) 845 for { 846 flags := v.Args[2] 847 v_0 := v.Args[0] 848 if v_0.Op != OpARMMOVWconst { 849 break 850 } 851 c := v_0.AuxInt 852 x := v.Args[1] 853 v.reset(OpARMADCconst) 854 v.AuxInt = c 855 v.AddArg(x) 856 v.AddArg(flags) 857 return true 858 } 859 // match: (ADC x (MOVWconst [c]) flags) 860 // result: (ADCconst [c] x flags) 861 for { 862 flags := v.Args[2] 863 x := v.Args[0] 864 v_1 := v.Args[1] 865 if v_1.Op != OpARMMOVWconst { 866 break 867 } 868 c := v_1.AuxInt 869 v.reset(OpARMADCconst) 870 v.AuxInt = c 871 v.AddArg(x) 872 v.AddArg(flags) 873 return true 874 } 875 // match: (ADC x (MOVWconst [c]) flags) 876 // result: (ADCconst [c] x flags) 877 for { 878 flags := v.Args[2] 879 x := v.Args[0] 880 v_1 := v.Args[1] 881 if v_1.Op != OpARMMOVWconst { 882 break 883 } 884 c := v_1.AuxInt 885 v.reset(OpARMADCconst) 886 v.AuxInt = c 887 v.AddArg(x) 888 v.AddArg(flags) 889 return true 890 } 891 // match: (ADC (MOVWconst [c]) x flags) 892 // result: (ADCconst [c] x flags) 893 for { 894 flags := v.Args[2] 895 v_0 := v.Args[0] 896 if v_0.Op != OpARMMOVWconst { 897 break 898 } 899 c := v_0.AuxInt 900 x := v.Args[1] 901 v.reset(OpARMADCconst) 902 v.AuxInt = c 903 v.AddArg(x) 904 v.AddArg(flags) 905 return true 906 } 907 // match: (ADC x (SLLconst [c] y) flags) 908 // result: (ADCshiftLL x y [c] flags) 909 for { 910 flags := v.Args[2] 911 x := v.Args[0] 912 v_1 := v.Args[1] 913 if v_1.Op != OpARMSLLconst { 914 break 915 } 916 c := v_1.AuxInt 917 y := v_1.Args[0] 918 v.reset(OpARMADCshiftLL) 919 v.AuxInt = c 920 v.AddArg(x) 921 v.AddArg(y) 922 v.AddArg(flags) 923 return true 924 } 925 // match: (ADC (SLLconst [c] y) x flags) 926 // result: (ADCshiftLL x y [c] flags) 927 for { 928 flags := v.Args[2] 929 v_0 := v.Args[0] 930 if v_0.Op != OpARMSLLconst { 931 break 932 } 933 c := v_0.AuxInt 934 y := v_0.Args[0] 935 x := v.Args[1] 936 v.reset(OpARMADCshiftLL) 937 v.AuxInt = c 938 v.AddArg(x) 939 v.AddArg(y) 940 v.AddArg(flags) 941 return true 942 } 943 // match: (ADC (SLLconst [c] y) x flags) 944 // result: (ADCshiftLL x y [c] flags) 945 for { 946 flags := v.Args[2] 947 v_0 := v.Args[0] 948 if v_0.Op != OpARMSLLconst { 949 break 950 } 951 c := v_0.AuxInt 952 y := v_0.Args[0] 953 x := v.Args[1] 954 v.reset(OpARMADCshiftLL) 955 v.AuxInt = c 956 v.AddArg(x) 957 v.AddArg(y) 958 v.AddArg(flags) 959 return true 960 } 961 // match: (ADC x (SLLconst [c] y) flags) 962 // result: (ADCshiftLL x y [c] flags) 963 for { 964 flags := v.Args[2] 965 x := v.Args[0] 966 v_1 := v.Args[1] 967 if v_1.Op != OpARMSLLconst { 968 break 969 } 970 c := v_1.AuxInt 971 y := v_1.Args[0] 972 v.reset(OpARMADCshiftLL) 973 v.AuxInt = c 974 v.AddArg(x) 975 v.AddArg(y) 976 v.AddArg(flags) 977 return true 978 } 979 // match: (ADC x (SRLconst [c] y) flags) 980 // result: (ADCshiftRL x y [c] flags) 981 for { 982 flags := v.Args[2] 983 x := v.Args[0] 984 v_1 := v.Args[1] 985 if v_1.Op != OpARMSRLconst { 986 break 987 } 988 c := v_1.AuxInt 989 y := v_1.Args[0] 990 v.reset(OpARMADCshiftRL) 991 v.AuxInt = c 992 v.AddArg(x) 993 v.AddArg(y) 994 v.AddArg(flags) 995 return true 996 } 997 // match: (ADC (SRLconst [c] y) x flags) 998 // result: (ADCshiftRL x y [c] flags) 999 for { 1000 flags := v.Args[2] 1001 v_0 := v.Args[0] 1002 if v_0.Op != OpARMSRLconst { 1003 break 1004 } 1005 c := v_0.AuxInt 1006 y := v_0.Args[0] 1007 x := v.Args[1] 1008 v.reset(OpARMADCshiftRL) 1009 v.AuxInt = c 1010 v.AddArg(x) 1011 v.AddArg(y) 1012 v.AddArg(flags) 1013 return true 1014 } 1015 return false 1016 } 1017 func rewriteValueARM_OpARMADC_10(v *Value) bool { 1018 // match: (ADC (SRLconst [c] y) x flags) 1019 // result: (ADCshiftRL x y [c] flags) 1020 for { 1021 flags := v.Args[2] 1022 v_0 := v.Args[0] 1023 if v_0.Op != OpARMSRLconst { 1024 break 1025 } 1026 c := v_0.AuxInt 1027 y := v_0.Args[0] 1028 x := v.Args[1] 1029 v.reset(OpARMADCshiftRL) 1030 v.AuxInt = c 1031 v.AddArg(x) 1032 v.AddArg(y) 1033 v.AddArg(flags) 1034 return true 1035 } 1036 // match: (ADC x (SRLconst [c] y) flags) 1037 // result: (ADCshiftRL x y [c] flags) 1038 for { 1039 flags := v.Args[2] 1040 x := v.Args[0] 1041 v_1 := v.Args[1] 1042 if v_1.Op != OpARMSRLconst { 1043 break 1044 } 1045 c := v_1.AuxInt 1046 y := v_1.Args[0] 1047 v.reset(OpARMADCshiftRL) 1048 v.AuxInt = c 1049 v.AddArg(x) 1050 v.AddArg(y) 1051 v.AddArg(flags) 1052 return true 1053 } 1054 // match: (ADC x (SRAconst [c] y) flags) 1055 // result: (ADCshiftRA x y [c] flags) 1056 for { 1057 flags := v.Args[2] 1058 x := v.Args[0] 1059 v_1 := v.Args[1] 1060 if v_1.Op != OpARMSRAconst { 1061 break 1062 } 1063 c := v_1.AuxInt 1064 y := v_1.Args[0] 1065 v.reset(OpARMADCshiftRA) 1066 v.AuxInt = c 1067 v.AddArg(x) 1068 v.AddArg(y) 1069 v.AddArg(flags) 1070 return true 1071 } 1072 // match: (ADC (SRAconst [c] y) x flags) 1073 // result: (ADCshiftRA x y [c] flags) 1074 for { 1075 flags := v.Args[2] 1076 v_0 := v.Args[0] 1077 if v_0.Op != OpARMSRAconst { 1078 break 1079 } 1080 c := v_0.AuxInt 1081 y := v_0.Args[0] 1082 x := v.Args[1] 1083 v.reset(OpARMADCshiftRA) 1084 v.AuxInt = c 1085 v.AddArg(x) 1086 v.AddArg(y) 1087 v.AddArg(flags) 1088 return true 1089 } 1090 // match: (ADC (SRAconst [c] y) x flags) 1091 // result: (ADCshiftRA x y [c] flags) 1092 for { 1093 flags := v.Args[2] 1094 v_0 := v.Args[0] 1095 if v_0.Op != OpARMSRAconst { 1096 break 1097 } 1098 c := v_0.AuxInt 1099 y := v_0.Args[0] 1100 x := v.Args[1] 1101 v.reset(OpARMADCshiftRA) 1102 v.AuxInt = c 1103 v.AddArg(x) 1104 v.AddArg(y) 1105 v.AddArg(flags) 1106 return true 1107 } 1108 // match: (ADC x (SRAconst [c] y) flags) 1109 // result: (ADCshiftRA x y [c] flags) 1110 for { 1111 flags := v.Args[2] 1112 x := v.Args[0] 1113 v_1 := v.Args[1] 1114 if v_1.Op != OpARMSRAconst { 1115 break 1116 } 1117 c := v_1.AuxInt 1118 y := v_1.Args[0] 1119 v.reset(OpARMADCshiftRA) 1120 v.AuxInt = c 1121 v.AddArg(x) 1122 v.AddArg(y) 1123 v.AddArg(flags) 1124 return true 1125 } 1126 // match: (ADC x (SLL y z) flags) 1127 // result: (ADCshiftLLreg x y z flags) 1128 for { 1129 flags := v.Args[2] 1130 x := v.Args[0] 1131 v_1 := v.Args[1] 1132 if v_1.Op != OpARMSLL { 1133 break 1134 } 1135 z := v_1.Args[1] 1136 y := v_1.Args[0] 1137 v.reset(OpARMADCshiftLLreg) 1138 v.AddArg(x) 1139 v.AddArg(y) 1140 v.AddArg(z) 1141 v.AddArg(flags) 1142 return true 1143 } 1144 // match: (ADC (SLL y z) x flags) 1145 // result: (ADCshiftLLreg x y z flags) 1146 for { 1147 flags := v.Args[2] 1148 v_0 := v.Args[0] 1149 if v_0.Op != OpARMSLL { 1150 break 1151 } 1152 z := v_0.Args[1] 1153 y := v_0.Args[0] 1154 x := v.Args[1] 1155 v.reset(OpARMADCshiftLLreg) 1156 v.AddArg(x) 1157 v.AddArg(y) 1158 v.AddArg(z) 1159 v.AddArg(flags) 1160 return true 1161 } 1162 // match: (ADC (SLL y z) x flags) 1163 // result: (ADCshiftLLreg x y z flags) 1164 for { 1165 flags := v.Args[2] 1166 v_0 := v.Args[0] 1167 if v_0.Op != OpARMSLL { 1168 break 1169 } 1170 z := v_0.Args[1] 1171 y := v_0.Args[0] 1172 x := v.Args[1] 1173 v.reset(OpARMADCshiftLLreg) 1174 v.AddArg(x) 1175 v.AddArg(y) 1176 v.AddArg(z) 1177 v.AddArg(flags) 1178 return true 1179 } 1180 // match: (ADC x (SLL y z) flags) 1181 // result: (ADCshiftLLreg x y z flags) 1182 for { 1183 flags := v.Args[2] 1184 x := v.Args[0] 1185 v_1 := v.Args[1] 1186 if v_1.Op != OpARMSLL { 1187 break 1188 } 1189 z := v_1.Args[1] 1190 y := v_1.Args[0] 1191 v.reset(OpARMADCshiftLLreg) 1192 v.AddArg(x) 1193 v.AddArg(y) 1194 v.AddArg(z) 1195 v.AddArg(flags) 1196 return true 1197 } 1198 return false 1199 } 1200 func rewriteValueARM_OpARMADC_20(v *Value) bool { 1201 // match: (ADC x (SRL y z) flags) 1202 // result: (ADCshiftRLreg x y z flags) 1203 for { 1204 flags := v.Args[2] 1205 x := v.Args[0] 1206 v_1 := v.Args[1] 1207 if v_1.Op != OpARMSRL { 1208 break 1209 } 1210 z := v_1.Args[1] 1211 y := v_1.Args[0] 1212 v.reset(OpARMADCshiftRLreg) 1213 v.AddArg(x) 1214 v.AddArg(y) 1215 v.AddArg(z) 1216 v.AddArg(flags) 1217 return true 1218 } 1219 // match: (ADC (SRL y z) x flags) 1220 // result: (ADCshiftRLreg x y z flags) 1221 for { 1222 flags := v.Args[2] 1223 v_0 := v.Args[0] 1224 if v_0.Op != OpARMSRL { 1225 break 1226 } 1227 z := v_0.Args[1] 1228 y := v_0.Args[0] 1229 x := v.Args[1] 1230 v.reset(OpARMADCshiftRLreg) 1231 v.AddArg(x) 1232 v.AddArg(y) 1233 v.AddArg(z) 1234 v.AddArg(flags) 1235 return true 1236 } 1237 // match: (ADC (SRL y z) x flags) 1238 // result: (ADCshiftRLreg x y z flags) 1239 for { 1240 flags := v.Args[2] 1241 v_0 := v.Args[0] 1242 if v_0.Op != OpARMSRL { 1243 break 1244 } 1245 z := v_0.Args[1] 1246 y := v_0.Args[0] 1247 x := v.Args[1] 1248 v.reset(OpARMADCshiftRLreg) 1249 v.AddArg(x) 1250 v.AddArg(y) 1251 v.AddArg(z) 1252 v.AddArg(flags) 1253 return true 1254 } 1255 // match: (ADC x (SRL y z) flags) 1256 // result: (ADCshiftRLreg x y z flags) 1257 for { 1258 flags := v.Args[2] 1259 x := v.Args[0] 1260 v_1 := v.Args[1] 1261 if v_1.Op != OpARMSRL { 1262 break 1263 } 1264 z := v_1.Args[1] 1265 y := v_1.Args[0] 1266 v.reset(OpARMADCshiftRLreg) 1267 v.AddArg(x) 1268 v.AddArg(y) 1269 v.AddArg(z) 1270 v.AddArg(flags) 1271 return true 1272 } 1273 // match: (ADC x (SRA y z) flags) 1274 // result: (ADCshiftRAreg x y z flags) 1275 for { 1276 flags := v.Args[2] 1277 x := v.Args[0] 1278 v_1 := v.Args[1] 1279 if v_1.Op != OpARMSRA { 1280 break 1281 } 1282 z := v_1.Args[1] 1283 y := v_1.Args[0] 1284 v.reset(OpARMADCshiftRAreg) 1285 v.AddArg(x) 1286 v.AddArg(y) 1287 v.AddArg(z) 1288 v.AddArg(flags) 1289 return true 1290 } 1291 // match: (ADC (SRA y z) x flags) 1292 // result: (ADCshiftRAreg x y z flags) 1293 for { 1294 flags := v.Args[2] 1295 v_0 := v.Args[0] 1296 if v_0.Op != OpARMSRA { 1297 break 1298 } 1299 z := v_0.Args[1] 1300 y := v_0.Args[0] 1301 x := v.Args[1] 1302 v.reset(OpARMADCshiftRAreg) 1303 v.AddArg(x) 1304 v.AddArg(y) 1305 v.AddArg(z) 1306 v.AddArg(flags) 1307 return true 1308 } 1309 // match: (ADC (SRA y z) x flags) 1310 // result: (ADCshiftRAreg x y z flags) 1311 for { 1312 flags := v.Args[2] 1313 v_0 := v.Args[0] 1314 if v_0.Op != OpARMSRA { 1315 break 1316 } 1317 z := v_0.Args[1] 1318 y := v_0.Args[0] 1319 x := v.Args[1] 1320 v.reset(OpARMADCshiftRAreg) 1321 v.AddArg(x) 1322 v.AddArg(y) 1323 v.AddArg(z) 1324 v.AddArg(flags) 1325 return true 1326 } 1327 // match: (ADC x (SRA y z) flags) 1328 // result: (ADCshiftRAreg x y z flags) 1329 for { 1330 flags := v.Args[2] 1331 x := v.Args[0] 1332 v_1 := v.Args[1] 1333 if v_1.Op != OpARMSRA { 1334 break 1335 } 1336 z := v_1.Args[1] 1337 y := v_1.Args[0] 1338 v.reset(OpARMADCshiftRAreg) 1339 v.AddArg(x) 1340 v.AddArg(y) 1341 v.AddArg(z) 1342 v.AddArg(flags) 1343 return true 1344 } 1345 return false 1346 } 1347 func rewriteValueARM_OpARMADCconst_0(v *Value) bool { 1348 // match: (ADCconst [c] (ADDconst [d] x) flags) 1349 // result: (ADCconst [int64(int32(c+d))] x flags) 1350 for { 1351 c := v.AuxInt 1352 flags := v.Args[1] 1353 v_0 := v.Args[0] 1354 if v_0.Op != OpARMADDconst { 1355 break 1356 } 1357 d := v_0.AuxInt 1358 x := v_0.Args[0] 1359 v.reset(OpARMADCconst) 1360 v.AuxInt = int64(int32(c + d)) 1361 v.AddArg(x) 1362 v.AddArg(flags) 1363 return true 1364 } 1365 // match: (ADCconst [c] (SUBconst [d] x) flags) 1366 // result: (ADCconst [int64(int32(c-d))] x flags) 1367 for { 1368 c := v.AuxInt 1369 flags := v.Args[1] 1370 v_0 := v.Args[0] 1371 if v_0.Op != OpARMSUBconst { 1372 break 1373 } 1374 d := v_0.AuxInt 1375 x := v_0.Args[0] 1376 v.reset(OpARMADCconst) 1377 v.AuxInt = int64(int32(c - d)) 1378 v.AddArg(x) 1379 v.AddArg(flags) 1380 return true 1381 } 1382 return false 1383 } 1384 func rewriteValueARM_OpARMADCshiftLL_0(v *Value) bool { 1385 b := v.Block 1386 // match: (ADCshiftLL (MOVWconst [c]) x [d] flags) 1387 // result: (ADCconst [c] (SLLconst <x.Type> x [d]) flags) 1388 for { 1389 d := v.AuxInt 1390 flags := v.Args[2] 1391 v_0 := v.Args[0] 1392 if v_0.Op != OpARMMOVWconst { 1393 break 1394 } 1395 c := v_0.AuxInt 1396 x := v.Args[1] 1397 v.reset(OpARMADCconst) 1398 v.AuxInt = c 1399 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 1400 v0.AuxInt = d 1401 v0.AddArg(x) 1402 v.AddArg(v0) 1403 v.AddArg(flags) 1404 return true 1405 } 1406 // match: (ADCshiftLL x (MOVWconst [c]) [d] flags) 1407 // result: (ADCconst x [int64(int32(uint32(c)<<uint64(d)))] flags) 1408 for { 1409 d := v.AuxInt 1410 flags := v.Args[2] 1411 x := v.Args[0] 1412 v_1 := v.Args[1] 1413 if v_1.Op != OpARMMOVWconst { 1414 break 1415 } 1416 c := v_1.AuxInt 1417 v.reset(OpARMADCconst) 1418 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 1419 v.AddArg(x) 1420 v.AddArg(flags) 1421 return true 1422 } 1423 return false 1424 } 1425 func rewriteValueARM_OpARMADCshiftLLreg_0(v *Value) bool { 1426 b := v.Block 1427 // match: (ADCshiftLLreg (MOVWconst [c]) x y flags) 1428 // result: (ADCconst [c] (SLL <x.Type> x y) flags) 1429 for { 1430 flags := v.Args[3] 1431 v_0 := v.Args[0] 1432 if v_0.Op != OpARMMOVWconst { 1433 break 1434 } 1435 c := v_0.AuxInt 1436 x := v.Args[1] 1437 y := v.Args[2] 1438 v.reset(OpARMADCconst) 1439 v.AuxInt = c 1440 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 1441 v0.AddArg(x) 1442 v0.AddArg(y) 1443 v.AddArg(v0) 1444 v.AddArg(flags) 1445 return true 1446 } 1447 // match: (ADCshiftLLreg x y (MOVWconst [c]) flags) 1448 // result: (ADCshiftLL x y [c] flags) 1449 for { 1450 flags := v.Args[3] 1451 x := v.Args[0] 1452 y := v.Args[1] 1453 v_2 := v.Args[2] 1454 if v_2.Op != OpARMMOVWconst { 1455 break 1456 } 1457 c := v_2.AuxInt 1458 v.reset(OpARMADCshiftLL) 1459 v.AuxInt = c 1460 v.AddArg(x) 1461 v.AddArg(y) 1462 v.AddArg(flags) 1463 return true 1464 } 1465 return false 1466 } 1467 func rewriteValueARM_OpARMADCshiftRA_0(v *Value) bool { 1468 b := v.Block 1469 // match: (ADCshiftRA (MOVWconst [c]) x [d] flags) 1470 // result: (ADCconst [c] (SRAconst <x.Type> x [d]) flags) 1471 for { 1472 d := v.AuxInt 1473 flags := v.Args[2] 1474 v_0 := v.Args[0] 1475 if v_0.Op != OpARMMOVWconst { 1476 break 1477 } 1478 c := v_0.AuxInt 1479 x := v.Args[1] 1480 v.reset(OpARMADCconst) 1481 v.AuxInt = c 1482 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 1483 v0.AuxInt = d 1484 v0.AddArg(x) 1485 v.AddArg(v0) 1486 v.AddArg(flags) 1487 return true 1488 } 1489 // match: (ADCshiftRA x (MOVWconst [c]) [d] flags) 1490 // result: (ADCconst x [int64(int32(c)>>uint64(d))] flags) 1491 for { 1492 d := v.AuxInt 1493 flags := v.Args[2] 1494 x := v.Args[0] 1495 v_1 := v.Args[1] 1496 if v_1.Op != OpARMMOVWconst { 1497 break 1498 } 1499 c := v_1.AuxInt 1500 v.reset(OpARMADCconst) 1501 v.AuxInt = int64(int32(c) >> uint64(d)) 1502 v.AddArg(x) 1503 v.AddArg(flags) 1504 return true 1505 } 1506 return false 1507 } 1508 func rewriteValueARM_OpARMADCshiftRAreg_0(v *Value) bool { 1509 b := v.Block 1510 // match: (ADCshiftRAreg (MOVWconst [c]) x y flags) 1511 // result: (ADCconst [c] (SRA <x.Type> x y) flags) 1512 for { 1513 flags := v.Args[3] 1514 v_0 := v.Args[0] 1515 if v_0.Op != OpARMMOVWconst { 1516 break 1517 } 1518 c := v_0.AuxInt 1519 x := v.Args[1] 1520 y := v.Args[2] 1521 v.reset(OpARMADCconst) 1522 v.AuxInt = c 1523 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 1524 v0.AddArg(x) 1525 v0.AddArg(y) 1526 v.AddArg(v0) 1527 v.AddArg(flags) 1528 return true 1529 } 1530 // match: (ADCshiftRAreg x y (MOVWconst [c]) flags) 1531 // result: (ADCshiftRA x y [c] flags) 1532 for { 1533 flags := v.Args[3] 1534 x := v.Args[0] 1535 y := v.Args[1] 1536 v_2 := v.Args[2] 1537 if v_2.Op != OpARMMOVWconst { 1538 break 1539 } 1540 c := v_2.AuxInt 1541 v.reset(OpARMADCshiftRA) 1542 v.AuxInt = c 1543 v.AddArg(x) 1544 v.AddArg(y) 1545 v.AddArg(flags) 1546 return true 1547 } 1548 return false 1549 } 1550 func rewriteValueARM_OpARMADCshiftRL_0(v *Value) bool { 1551 b := v.Block 1552 // match: (ADCshiftRL (MOVWconst [c]) x [d] flags) 1553 // result: (ADCconst [c] (SRLconst <x.Type> x [d]) flags) 1554 for { 1555 d := v.AuxInt 1556 flags := v.Args[2] 1557 v_0 := v.Args[0] 1558 if v_0.Op != OpARMMOVWconst { 1559 break 1560 } 1561 c := v_0.AuxInt 1562 x := v.Args[1] 1563 v.reset(OpARMADCconst) 1564 v.AuxInt = c 1565 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 1566 v0.AuxInt = d 1567 v0.AddArg(x) 1568 v.AddArg(v0) 1569 v.AddArg(flags) 1570 return true 1571 } 1572 // match: (ADCshiftRL x (MOVWconst [c]) [d] flags) 1573 // result: (ADCconst x [int64(int32(uint32(c)>>uint64(d)))] flags) 1574 for { 1575 d := v.AuxInt 1576 flags := v.Args[2] 1577 x := v.Args[0] 1578 v_1 := v.Args[1] 1579 if v_1.Op != OpARMMOVWconst { 1580 break 1581 } 1582 c := v_1.AuxInt 1583 v.reset(OpARMADCconst) 1584 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 1585 v.AddArg(x) 1586 v.AddArg(flags) 1587 return true 1588 } 1589 return false 1590 } 1591 func rewriteValueARM_OpARMADCshiftRLreg_0(v *Value) bool { 1592 b := v.Block 1593 // match: (ADCshiftRLreg (MOVWconst [c]) x y flags) 1594 // result: (ADCconst [c] (SRL <x.Type> x y) flags) 1595 for { 1596 flags := v.Args[3] 1597 v_0 := v.Args[0] 1598 if v_0.Op != OpARMMOVWconst { 1599 break 1600 } 1601 c := v_0.AuxInt 1602 x := v.Args[1] 1603 y := v.Args[2] 1604 v.reset(OpARMADCconst) 1605 v.AuxInt = c 1606 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 1607 v0.AddArg(x) 1608 v0.AddArg(y) 1609 v.AddArg(v0) 1610 v.AddArg(flags) 1611 return true 1612 } 1613 // match: (ADCshiftRLreg x y (MOVWconst [c]) flags) 1614 // result: (ADCshiftRL x y [c] flags) 1615 for { 1616 flags := v.Args[3] 1617 x := v.Args[0] 1618 y := v.Args[1] 1619 v_2 := v.Args[2] 1620 if v_2.Op != OpARMMOVWconst { 1621 break 1622 } 1623 c := v_2.AuxInt 1624 v.reset(OpARMADCshiftRL) 1625 v.AuxInt = c 1626 v.AddArg(x) 1627 v.AddArg(y) 1628 v.AddArg(flags) 1629 return true 1630 } 1631 return false 1632 } 1633 func rewriteValueARM_OpARMADD_0(v *Value) bool { 1634 // match: (ADD x (MOVWconst [c])) 1635 // result: (ADDconst [c] x) 1636 for { 1637 _ = v.Args[1] 1638 x := v.Args[0] 1639 v_1 := v.Args[1] 1640 if v_1.Op != OpARMMOVWconst { 1641 break 1642 } 1643 c := v_1.AuxInt 1644 v.reset(OpARMADDconst) 1645 v.AuxInt = c 1646 v.AddArg(x) 1647 return true 1648 } 1649 // match: (ADD (MOVWconst [c]) x) 1650 // result: (ADDconst [c] x) 1651 for { 1652 x := v.Args[1] 1653 v_0 := v.Args[0] 1654 if v_0.Op != OpARMMOVWconst { 1655 break 1656 } 1657 c := v_0.AuxInt 1658 v.reset(OpARMADDconst) 1659 v.AuxInt = c 1660 v.AddArg(x) 1661 return true 1662 } 1663 // match: (ADD x (SLLconst [c] y)) 1664 // result: (ADDshiftLL x y [c]) 1665 for { 1666 _ = v.Args[1] 1667 x := v.Args[0] 1668 v_1 := v.Args[1] 1669 if v_1.Op != OpARMSLLconst { 1670 break 1671 } 1672 c := v_1.AuxInt 1673 y := v_1.Args[0] 1674 v.reset(OpARMADDshiftLL) 1675 v.AuxInt = c 1676 v.AddArg(x) 1677 v.AddArg(y) 1678 return true 1679 } 1680 // match: (ADD (SLLconst [c] y) x) 1681 // result: (ADDshiftLL x y [c]) 1682 for { 1683 x := v.Args[1] 1684 v_0 := v.Args[0] 1685 if v_0.Op != OpARMSLLconst { 1686 break 1687 } 1688 c := v_0.AuxInt 1689 y := v_0.Args[0] 1690 v.reset(OpARMADDshiftLL) 1691 v.AuxInt = c 1692 v.AddArg(x) 1693 v.AddArg(y) 1694 return true 1695 } 1696 // match: (ADD x (SRLconst [c] y)) 1697 // result: (ADDshiftRL x y [c]) 1698 for { 1699 _ = v.Args[1] 1700 x := v.Args[0] 1701 v_1 := v.Args[1] 1702 if v_1.Op != OpARMSRLconst { 1703 break 1704 } 1705 c := v_1.AuxInt 1706 y := v_1.Args[0] 1707 v.reset(OpARMADDshiftRL) 1708 v.AuxInt = c 1709 v.AddArg(x) 1710 v.AddArg(y) 1711 return true 1712 } 1713 // match: (ADD (SRLconst [c] y) x) 1714 // result: (ADDshiftRL x y [c]) 1715 for { 1716 x := v.Args[1] 1717 v_0 := v.Args[0] 1718 if v_0.Op != OpARMSRLconst { 1719 break 1720 } 1721 c := v_0.AuxInt 1722 y := v_0.Args[0] 1723 v.reset(OpARMADDshiftRL) 1724 v.AuxInt = c 1725 v.AddArg(x) 1726 v.AddArg(y) 1727 return true 1728 } 1729 // match: (ADD x (SRAconst [c] y)) 1730 // result: (ADDshiftRA x y [c]) 1731 for { 1732 _ = v.Args[1] 1733 x := v.Args[0] 1734 v_1 := v.Args[1] 1735 if v_1.Op != OpARMSRAconst { 1736 break 1737 } 1738 c := v_1.AuxInt 1739 y := v_1.Args[0] 1740 v.reset(OpARMADDshiftRA) 1741 v.AuxInt = c 1742 v.AddArg(x) 1743 v.AddArg(y) 1744 return true 1745 } 1746 // match: (ADD (SRAconst [c] y) x) 1747 // result: (ADDshiftRA x y [c]) 1748 for { 1749 x := v.Args[1] 1750 v_0 := v.Args[0] 1751 if v_0.Op != OpARMSRAconst { 1752 break 1753 } 1754 c := v_0.AuxInt 1755 y := v_0.Args[0] 1756 v.reset(OpARMADDshiftRA) 1757 v.AuxInt = c 1758 v.AddArg(x) 1759 v.AddArg(y) 1760 return true 1761 } 1762 // match: (ADD x (SLL y z)) 1763 // result: (ADDshiftLLreg x y z) 1764 for { 1765 _ = v.Args[1] 1766 x := v.Args[0] 1767 v_1 := v.Args[1] 1768 if v_1.Op != OpARMSLL { 1769 break 1770 } 1771 z := v_1.Args[1] 1772 y := v_1.Args[0] 1773 v.reset(OpARMADDshiftLLreg) 1774 v.AddArg(x) 1775 v.AddArg(y) 1776 v.AddArg(z) 1777 return true 1778 } 1779 // match: (ADD (SLL y z) x) 1780 // result: (ADDshiftLLreg x y z) 1781 for { 1782 x := v.Args[1] 1783 v_0 := v.Args[0] 1784 if v_0.Op != OpARMSLL { 1785 break 1786 } 1787 z := v_0.Args[1] 1788 y := v_0.Args[0] 1789 v.reset(OpARMADDshiftLLreg) 1790 v.AddArg(x) 1791 v.AddArg(y) 1792 v.AddArg(z) 1793 return true 1794 } 1795 return false 1796 } 1797 func rewriteValueARM_OpARMADD_10(v *Value) bool { 1798 b := v.Block 1799 // match: (ADD x (SRL y z)) 1800 // result: (ADDshiftRLreg x y z) 1801 for { 1802 _ = v.Args[1] 1803 x := v.Args[0] 1804 v_1 := v.Args[1] 1805 if v_1.Op != OpARMSRL { 1806 break 1807 } 1808 z := v_1.Args[1] 1809 y := v_1.Args[0] 1810 v.reset(OpARMADDshiftRLreg) 1811 v.AddArg(x) 1812 v.AddArg(y) 1813 v.AddArg(z) 1814 return true 1815 } 1816 // match: (ADD (SRL y z) x) 1817 // result: (ADDshiftRLreg x y z) 1818 for { 1819 x := v.Args[1] 1820 v_0 := v.Args[0] 1821 if v_0.Op != OpARMSRL { 1822 break 1823 } 1824 z := v_0.Args[1] 1825 y := v_0.Args[0] 1826 v.reset(OpARMADDshiftRLreg) 1827 v.AddArg(x) 1828 v.AddArg(y) 1829 v.AddArg(z) 1830 return true 1831 } 1832 // match: (ADD x (SRA y z)) 1833 // result: (ADDshiftRAreg x y z) 1834 for { 1835 _ = v.Args[1] 1836 x := v.Args[0] 1837 v_1 := v.Args[1] 1838 if v_1.Op != OpARMSRA { 1839 break 1840 } 1841 z := v_1.Args[1] 1842 y := v_1.Args[0] 1843 v.reset(OpARMADDshiftRAreg) 1844 v.AddArg(x) 1845 v.AddArg(y) 1846 v.AddArg(z) 1847 return true 1848 } 1849 // match: (ADD (SRA y z) x) 1850 // result: (ADDshiftRAreg x y z) 1851 for { 1852 x := v.Args[1] 1853 v_0 := v.Args[0] 1854 if v_0.Op != OpARMSRA { 1855 break 1856 } 1857 z := v_0.Args[1] 1858 y := v_0.Args[0] 1859 v.reset(OpARMADDshiftRAreg) 1860 v.AddArg(x) 1861 v.AddArg(y) 1862 v.AddArg(z) 1863 return true 1864 } 1865 // match: (ADD x (RSBconst [0] y)) 1866 // result: (SUB x y) 1867 for { 1868 _ = v.Args[1] 1869 x := v.Args[0] 1870 v_1 := v.Args[1] 1871 if v_1.Op != OpARMRSBconst || v_1.AuxInt != 0 { 1872 break 1873 } 1874 y := v_1.Args[0] 1875 v.reset(OpARMSUB) 1876 v.AddArg(x) 1877 v.AddArg(y) 1878 return true 1879 } 1880 // match: (ADD (RSBconst [0] y) x) 1881 // result: (SUB x y) 1882 for { 1883 x := v.Args[1] 1884 v_0 := v.Args[0] 1885 if v_0.Op != OpARMRSBconst || v_0.AuxInt != 0 { 1886 break 1887 } 1888 y := v_0.Args[0] 1889 v.reset(OpARMSUB) 1890 v.AddArg(x) 1891 v.AddArg(y) 1892 return true 1893 } 1894 // match: (ADD <t> (RSBconst [c] x) (RSBconst [d] y)) 1895 // result: (RSBconst [c+d] (ADD <t> x y)) 1896 for { 1897 t := v.Type 1898 _ = v.Args[1] 1899 v_0 := v.Args[0] 1900 if v_0.Op != OpARMRSBconst { 1901 break 1902 } 1903 c := v_0.AuxInt 1904 x := v_0.Args[0] 1905 v_1 := v.Args[1] 1906 if v_1.Op != OpARMRSBconst { 1907 break 1908 } 1909 d := v_1.AuxInt 1910 y := v_1.Args[0] 1911 v.reset(OpARMRSBconst) 1912 v.AuxInt = c + d 1913 v0 := b.NewValue0(v.Pos, OpARMADD, t) 1914 v0.AddArg(x) 1915 v0.AddArg(y) 1916 v.AddArg(v0) 1917 return true 1918 } 1919 // match: (ADD <t> (RSBconst [d] y) (RSBconst [c] x)) 1920 // result: (RSBconst [c+d] (ADD <t> x y)) 1921 for { 1922 t := v.Type 1923 _ = v.Args[1] 1924 v_0 := v.Args[0] 1925 if v_0.Op != OpARMRSBconst { 1926 break 1927 } 1928 d := v_0.AuxInt 1929 y := v_0.Args[0] 1930 v_1 := v.Args[1] 1931 if v_1.Op != OpARMRSBconst { 1932 break 1933 } 1934 c := v_1.AuxInt 1935 x := v_1.Args[0] 1936 v.reset(OpARMRSBconst) 1937 v.AuxInt = c + d 1938 v0 := b.NewValue0(v.Pos, OpARMADD, t) 1939 v0.AddArg(x) 1940 v0.AddArg(y) 1941 v.AddArg(v0) 1942 return true 1943 } 1944 // match: (ADD (MUL x y) a) 1945 // result: (MULA x y a) 1946 for { 1947 a := v.Args[1] 1948 v_0 := v.Args[0] 1949 if v_0.Op != OpARMMUL { 1950 break 1951 } 1952 y := v_0.Args[1] 1953 x := v_0.Args[0] 1954 v.reset(OpARMMULA) 1955 v.AddArg(x) 1956 v.AddArg(y) 1957 v.AddArg(a) 1958 return true 1959 } 1960 // match: (ADD a (MUL x y)) 1961 // result: (MULA x y a) 1962 for { 1963 _ = v.Args[1] 1964 a := v.Args[0] 1965 v_1 := v.Args[1] 1966 if v_1.Op != OpARMMUL { 1967 break 1968 } 1969 y := v_1.Args[1] 1970 x := v_1.Args[0] 1971 v.reset(OpARMMULA) 1972 v.AddArg(x) 1973 v.AddArg(y) 1974 v.AddArg(a) 1975 return true 1976 } 1977 return false 1978 } 1979 func rewriteValueARM_OpARMADDD_0(v *Value) bool { 1980 // match: (ADDD a (MULD x y)) 1981 // cond: a.Uses == 1 && objabi.GOARM >= 6 1982 // result: (MULAD a x y) 1983 for { 1984 _ = v.Args[1] 1985 a := v.Args[0] 1986 v_1 := v.Args[1] 1987 if v_1.Op != OpARMMULD { 1988 break 1989 } 1990 y := v_1.Args[1] 1991 x := v_1.Args[0] 1992 if !(a.Uses == 1 && objabi.GOARM >= 6) { 1993 break 1994 } 1995 v.reset(OpARMMULAD) 1996 v.AddArg(a) 1997 v.AddArg(x) 1998 v.AddArg(y) 1999 return true 2000 } 2001 // match: (ADDD (MULD x y) a) 2002 // cond: a.Uses == 1 && objabi.GOARM >= 6 2003 // result: (MULAD a x y) 2004 for { 2005 a := v.Args[1] 2006 v_0 := v.Args[0] 2007 if v_0.Op != OpARMMULD { 2008 break 2009 } 2010 y := v_0.Args[1] 2011 x := v_0.Args[0] 2012 if !(a.Uses == 1 && objabi.GOARM >= 6) { 2013 break 2014 } 2015 v.reset(OpARMMULAD) 2016 v.AddArg(a) 2017 v.AddArg(x) 2018 v.AddArg(y) 2019 return true 2020 } 2021 // match: (ADDD a (NMULD x y)) 2022 // cond: a.Uses == 1 && objabi.GOARM >= 6 2023 // result: (MULSD a x y) 2024 for { 2025 _ = v.Args[1] 2026 a := v.Args[0] 2027 v_1 := v.Args[1] 2028 if v_1.Op != OpARMNMULD { 2029 break 2030 } 2031 y := v_1.Args[1] 2032 x := v_1.Args[0] 2033 if !(a.Uses == 1 && objabi.GOARM >= 6) { 2034 break 2035 } 2036 v.reset(OpARMMULSD) 2037 v.AddArg(a) 2038 v.AddArg(x) 2039 v.AddArg(y) 2040 return true 2041 } 2042 // match: (ADDD (NMULD x y) a) 2043 // cond: a.Uses == 1 && objabi.GOARM >= 6 2044 // result: (MULSD a x y) 2045 for { 2046 a := v.Args[1] 2047 v_0 := v.Args[0] 2048 if v_0.Op != OpARMNMULD { 2049 break 2050 } 2051 y := v_0.Args[1] 2052 x := v_0.Args[0] 2053 if !(a.Uses == 1 && objabi.GOARM >= 6) { 2054 break 2055 } 2056 v.reset(OpARMMULSD) 2057 v.AddArg(a) 2058 v.AddArg(x) 2059 v.AddArg(y) 2060 return true 2061 } 2062 return false 2063 } 2064 func rewriteValueARM_OpARMADDF_0(v *Value) bool { 2065 // match: (ADDF a (MULF x y)) 2066 // cond: a.Uses == 1 && objabi.GOARM >= 6 2067 // result: (MULAF a x y) 2068 for { 2069 _ = v.Args[1] 2070 a := v.Args[0] 2071 v_1 := v.Args[1] 2072 if v_1.Op != OpARMMULF { 2073 break 2074 } 2075 y := v_1.Args[1] 2076 x := v_1.Args[0] 2077 if !(a.Uses == 1 && objabi.GOARM >= 6) { 2078 break 2079 } 2080 v.reset(OpARMMULAF) 2081 v.AddArg(a) 2082 v.AddArg(x) 2083 v.AddArg(y) 2084 return true 2085 } 2086 // match: (ADDF (MULF x y) a) 2087 // cond: a.Uses == 1 && objabi.GOARM >= 6 2088 // result: (MULAF a x y) 2089 for { 2090 a := v.Args[1] 2091 v_0 := v.Args[0] 2092 if v_0.Op != OpARMMULF { 2093 break 2094 } 2095 y := v_0.Args[1] 2096 x := v_0.Args[0] 2097 if !(a.Uses == 1 && objabi.GOARM >= 6) { 2098 break 2099 } 2100 v.reset(OpARMMULAF) 2101 v.AddArg(a) 2102 v.AddArg(x) 2103 v.AddArg(y) 2104 return true 2105 } 2106 // match: (ADDF a (NMULF x y)) 2107 // cond: a.Uses == 1 && objabi.GOARM >= 6 2108 // result: (MULSF a x y) 2109 for { 2110 _ = v.Args[1] 2111 a := v.Args[0] 2112 v_1 := v.Args[1] 2113 if v_1.Op != OpARMNMULF { 2114 break 2115 } 2116 y := v_1.Args[1] 2117 x := v_1.Args[0] 2118 if !(a.Uses == 1 && objabi.GOARM >= 6) { 2119 break 2120 } 2121 v.reset(OpARMMULSF) 2122 v.AddArg(a) 2123 v.AddArg(x) 2124 v.AddArg(y) 2125 return true 2126 } 2127 // match: (ADDF (NMULF x y) a) 2128 // cond: a.Uses == 1 && objabi.GOARM >= 6 2129 // result: (MULSF a x y) 2130 for { 2131 a := v.Args[1] 2132 v_0 := v.Args[0] 2133 if v_0.Op != OpARMNMULF { 2134 break 2135 } 2136 y := v_0.Args[1] 2137 x := v_0.Args[0] 2138 if !(a.Uses == 1 && objabi.GOARM >= 6) { 2139 break 2140 } 2141 v.reset(OpARMMULSF) 2142 v.AddArg(a) 2143 v.AddArg(x) 2144 v.AddArg(y) 2145 return true 2146 } 2147 return false 2148 } 2149 func rewriteValueARM_OpARMADDS_0(v *Value) bool { 2150 // match: (ADDS x (MOVWconst [c])) 2151 // result: (ADDSconst [c] x) 2152 for { 2153 _ = v.Args[1] 2154 x := v.Args[0] 2155 v_1 := v.Args[1] 2156 if v_1.Op != OpARMMOVWconst { 2157 break 2158 } 2159 c := v_1.AuxInt 2160 v.reset(OpARMADDSconst) 2161 v.AuxInt = c 2162 v.AddArg(x) 2163 return true 2164 } 2165 // match: (ADDS (MOVWconst [c]) x) 2166 // result: (ADDSconst [c] x) 2167 for { 2168 x := v.Args[1] 2169 v_0 := v.Args[0] 2170 if v_0.Op != OpARMMOVWconst { 2171 break 2172 } 2173 c := v_0.AuxInt 2174 v.reset(OpARMADDSconst) 2175 v.AuxInt = c 2176 v.AddArg(x) 2177 return true 2178 } 2179 // match: (ADDS x (SLLconst [c] y)) 2180 // result: (ADDSshiftLL x y [c]) 2181 for { 2182 _ = v.Args[1] 2183 x := v.Args[0] 2184 v_1 := v.Args[1] 2185 if v_1.Op != OpARMSLLconst { 2186 break 2187 } 2188 c := v_1.AuxInt 2189 y := v_1.Args[0] 2190 v.reset(OpARMADDSshiftLL) 2191 v.AuxInt = c 2192 v.AddArg(x) 2193 v.AddArg(y) 2194 return true 2195 } 2196 // match: (ADDS (SLLconst [c] y) x) 2197 // result: (ADDSshiftLL x y [c]) 2198 for { 2199 x := v.Args[1] 2200 v_0 := v.Args[0] 2201 if v_0.Op != OpARMSLLconst { 2202 break 2203 } 2204 c := v_0.AuxInt 2205 y := v_0.Args[0] 2206 v.reset(OpARMADDSshiftLL) 2207 v.AuxInt = c 2208 v.AddArg(x) 2209 v.AddArg(y) 2210 return true 2211 } 2212 // match: (ADDS x (SRLconst [c] y)) 2213 // result: (ADDSshiftRL x y [c]) 2214 for { 2215 _ = v.Args[1] 2216 x := v.Args[0] 2217 v_1 := v.Args[1] 2218 if v_1.Op != OpARMSRLconst { 2219 break 2220 } 2221 c := v_1.AuxInt 2222 y := v_1.Args[0] 2223 v.reset(OpARMADDSshiftRL) 2224 v.AuxInt = c 2225 v.AddArg(x) 2226 v.AddArg(y) 2227 return true 2228 } 2229 // match: (ADDS (SRLconst [c] y) x) 2230 // result: (ADDSshiftRL x y [c]) 2231 for { 2232 x := v.Args[1] 2233 v_0 := v.Args[0] 2234 if v_0.Op != OpARMSRLconst { 2235 break 2236 } 2237 c := v_0.AuxInt 2238 y := v_0.Args[0] 2239 v.reset(OpARMADDSshiftRL) 2240 v.AuxInt = c 2241 v.AddArg(x) 2242 v.AddArg(y) 2243 return true 2244 } 2245 // match: (ADDS x (SRAconst [c] y)) 2246 // result: (ADDSshiftRA x y [c]) 2247 for { 2248 _ = v.Args[1] 2249 x := v.Args[0] 2250 v_1 := v.Args[1] 2251 if v_1.Op != OpARMSRAconst { 2252 break 2253 } 2254 c := v_1.AuxInt 2255 y := v_1.Args[0] 2256 v.reset(OpARMADDSshiftRA) 2257 v.AuxInt = c 2258 v.AddArg(x) 2259 v.AddArg(y) 2260 return true 2261 } 2262 // match: (ADDS (SRAconst [c] y) x) 2263 // result: (ADDSshiftRA x y [c]) 2264 for { 2265 x := v.Args[1] 2266 v_0 := v.Args[0] 2267 if v_0.Op != OpARMSRAconst { 2268 break 2269 } 2270 c := v_0.AuxInt 2271 y := v_0.Args[0] 2272 v.reset(OpARMADDSshiftRA) 2273 v.AuxInt = c 2274 v.AddArg(x) 2275 v.AddArg(y) 2276 return true 2277 } 2278 // match: (ADDS x (SLL y z)) 2279 // result: (ADDSshiftLLreg x y z) 2280 for { 2281 _ = v.Args[1] 2282 x := v.Args[0] 2283 v_1 := v.Args[1] 2284 if v_1.Op != OpARMSLL { 2285 break 2286 } 2287 z := v_1.Args[1] 2288 y := v_1.Args[0] 2289 v.reset(OpARMADDSshiftLLreg) 2290 v.AddArg(x) 2291 v.AddArg(y) 2292 v.AddArg(z) 2293 return true 2294 } 2295 // match: (ADDS (SLL y z) x) 2296 // result: (ADDSshiftLLreg x y z) 2297 for { 2298 x := v.Args[1] 2299 v_0 := v.Args[0] 2300 if v_0.Op != OpARMSLL { 2301 break 2302 } 2303 z := v_0.Args[1] 2304 y := v_0.Args[0] 2305 v.reset(OpARMADDSshiftLLreg) 2306 v.AddArg(x) 2307 v.AddArg(y) 2308 v.AddArg(z) 2309 return true 2310 } 2311 return false 2312 } 2313 func rewriteValueARM_OpARMADDS_10(v *Value) bool { 2314 // match: (ADDS x (SRL y z)) 2315 // result: (ADDSshiftRLreg x y z) 2316 for { 2317 _ = v.Args[1] 2318 x := v.Args[0] 2319 v_1 := v.Args[1] 2320 if v_1.Op != OpARMSRL { 2321 break 2322 } 2323 z := v_1.Args[1] 2324 y := v_1.Args[0] 2325 v.reset(OpARMADDSshiftRLreg) 2326 v.AddArg(x) 2327 v.AddArg(y) 2328 v.AddArg(z) 2329 return true 2330 } 2331 // match: (ADDS (SRL y z) x) 2332 // result: (ADDSshiftRLreg x y z) 2333 for { 2334 x := v.Args[1] 2335 v_0 := v.Args[0] 2336 if v_0.Op != OpARMSRL { 2337 break 2338 } 2339 z := v_0.Args[1] 2340 y := v_0.Args[0] 2341 v.reset(OpARMADDSshiftRLreg) 2342 v.AddArg(x) 2343 v.AddArg(y) 2344 v.AddArg(z) 2345 return true 2346 } 2347 // match: (ADDS x (SRA y z)) 2348 // result: (ADDSshiftRAreg x y z) 2349 for { 2350 _ = v.Args[1] 2351 x := v.Args[0] 2352 v_1 := v.Args[1] 2353 if v_1.Op != OpARMSRA { 2354 break 2355 } 2356 z := v_1.Args[1] 2357 y := v_1.Args[0] 2358 v.reset(OpARMADDSshiftRAreg) 2359 v.AddArg(x) 2360 v.AddArg(y) 2361 v.AddArg(z) 2362 return true 2363 } 2364 // match: (ADDS (SRA y z) x) 2365 // result: (ADDSshiftRAreg x y z) 2366 for { 2367 x := v.Args[1] 2368 v_0 := v.Args[0] 2369 if v_0.Op != OpARMSRA { 2370 break 2371 } 2372 z := v_0.Args[1] 2373 y := v_0.Args[0] 2374 v.reset(OpARMADDSshiftRAreg) 2375 v.AddArg(x) 2376 v.AddArg(y) 2377 v.AddArg(z) 2378 return true 2379 } 2380 return false 2381 } 2382 func rewriteValueARM_OpARMADDSshiftLL_0(v *Value) bool { 2383 b := v.Block 2384 // match: (ADDSshiftLL (MOVWconst [c]) x [d]) 2385 // result: (ADDSconst [c] (SLLconst <x.Type> x [d])) 2386 for { 2387 d := v.AuxInt 2388 x := v.Args[1] 2389 v_0 := v.Args[0] 2390 if v_0.Op != OpARMMOVWconst { 2391 break 2392 } 2393 c := v_0.AuxInt 2394 v.reset(OpARMADDSconst) 2395 v.AuxInt = c 2396 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 2397 v0.AuxInt = d 2398 v0.AddArg(x) 2399 v.AddArg(v0) 2400 return true 2401 } 2402 // match: (ADDSshiftLL x (MOVWconst [c]) [d]) 2403 // result: (ADDSconst x [int64(int32(uint32(c)<<uint64(d)))]) 2404 for { 2405 d := v.AuxInt 2406 _ = v.Args[1] 2407 x := v.Args[0] 2408 v_1 := v.Args[1] 2409 if v_1.Op != OpARMMOVWconst { 2410 break 2411 } 2412 c := v_1.AuxInt 2413 v.reset(OpARMADDSconst) 2414 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 2415 v.AddArg(x) 2416 return true 2417 } 2418 return false 2419 } 2420 func rewriteValueARM_OpARMADDSshiftLLreg_0(v *Value) bool { 2421 b := v.Block 2422 // match: (ADDSshiftLLreg (MOVWconst [c]) x y) 2423 // result: (ADDSconst [c] (SLL <x.Type> x y)) 2424 for { 2425 y := v.Args[2] 2426 v_0 := v.Args[0] 2427 if v_0.Op != OpARMMOVWconst { 2428 break 2429 } 2430 c := v_0.AuxInt 2431 x := v.Args[1] 2432 v.reset(OpARMADDSconst) 2433 v.AuxInt = c 2434 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 2435 v0.AddArg(x) 2436 v0.AddArg(y) 2437 v.AddArg(v0) 2438 return true 2439 } 2440 // match: (ADDSshiftLLreg x y (MOVWconst [c])) 2441 // result: (ADDSshiftLL x y [c]) 2442 for { 2443 _ = v.Args[2] 2444 x := v.Args[0] 2445 y := v.Args[1] 2446 v_2 := v.Args[2] 2447 if v_2.Op != OpARMMOVWconst { 2448 break 2449 } 2450 c := v_2.AuxInt 2451 v.reset(OpARMADDSshiftLL) 2452 v.AuxInt = c 2453 v.AddArg(x) 2454 v.AddArg(y) 2455 return true 2456 } 2457 return false 2458 } 2459 func rewriteValueARM_OpARMADDSshiftRA_0(v *Value) bool { 2460 b := v.Block 2461 // match: (ADDSshiftRA (MOVWconst [c]) x [d]) 2462 // result: (ADDSconst [c] (SRAconst <x.Type> x [d])) 2463 for { 2464 d := v.AuxInt 2465 x := v.Args[1] 2466 v_0 := v.Args[0] 2467 if v_0.Op != OpARMMOVWconst { 2468 break 2469 } 2470 c := v_0.AuxInt 2471 v.reset(OpARMADDSconst) 2472 v.AuxInt = c 2473 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 2474 v0.AuxInt = d 2475 v0.AddArg(x) 2476 v.AddArg(v0) 2477 return true 2478 } 2479 // match: (ADDSshiftRA x (MOVWconst [c]) [d]) 2480 // result: (ADDSconst x [int64(int32(c)>>uint64(d))]) 2481 for { 2482 d := v.AuxInt 2483 _ = v.Args[1] 2484 x := v.Args[0] 2485 v_1 := v.Args[1] 2486 if v_1.Op != OpARMMOVWconst { 2487 break 2488 } 2489 c := v_1.AuxInt 2490 v.reset(OpARMADDSconst) 2491 v.AuxInt = int64(int32(c) >> uint64(d)) 2492 v.AddArg(x) 2493 return true 2494 } 2495 return false 2496 } 2497 func rewriteValueARM_OpARMADDSshiftRAreg_0(v *Value) bool { 2498 b := v.Block 2499 // match: (ADDSshiftRAreg (MOVWconst [c]) x y) 2500 // result: (ADDSconst [c] (SRA <x.Type> x y)) 2501 for { 2502 y := v.Args[2] 2503 v_0 := v.Args[0] 2504 if v_0.Op != OpARMMOVWconst { 2505 break 2506 } 2507 c := v_0.AuxInt 2508 x := v.Args[1] 2509 v.reset(OpARMADDSconst) 2510 v.AuxInt = c 2511 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 2512 v0.AddArg(x) 2513 v0.AddArg(y) 2514 v.AddArg(v0) 2515 return true 2516 } 2517 // match: (ADDSshiftRAreg x y (MOVWconst [c])) 2518 // result: (ADDSshiftRA x y [c]) 2519 for { 2520 _ = v.Args[2] 2521 x := v.Args[0] 2522 y := v.Args[1] 2523 v_2 := v.Args[2] 2524 if v_2.Op != OpARMMOVWconst { 2525 break 2526 } 2527 c := v_2.AuxInt 2528 v.reset(OpARMADDSshiftRA) 2529 v.AuxInt = c 2530 v.AddArg(x) 2531 v.AddArg(y) 2532 return true 2533 } 2534 return false 2535 } 2536 func rewriteValueARM_OpARMADDSshiftRL_0(v *Value) bool { 2537 b := v.Block 2538 // match: (ADDSshiftRL (MOVWconst [c]) x [d]) 2539 // result: (ADDSconst [c] (SRLconst <x.Type> x [d])) 2540 for { 2541 d := v.AuxInt 2542 x := v.Args[1] 2543 v_0 := v.Args[0] 2544 if v_0.Op != OpARMMOVWconst { 2545 break 2546 } 2547 c := v_0.AuxInt 2548 v.reset(OpARMADDSconst) 2549 v.AuxInt = c 2550 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 2551 v0.AuxInt = d 2552 v0.AddArg(x) 2553 v.AddArg(v0) 2554 return true 2555 } 2556 // match: (ADDSshiftRL x (MOVWconst [c]) [d]) 2557 // result: (ADDSconst x [int64(int32(uint32(c)>>uint64(d)))]) 2558 for { 2559 d := v.AuxInt 2560 _ = v.Args[1] 2561 x := v.Args[0] 2562 v_1 := v.Args[1] 2563 if v_1.Op != OpARMMOVWconst { 2564 break 2565 } 2566 c := v_1.AuxInt 2567 v.reset(OpARMADDSconst) 2568 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 2569 v.AddArg(x) 2570 return true 2571 } 2572 return false 2573 } 2574 func rewriteValueARM_OpARMADDSshiftRLreg_0(v *Value) bool { 2575 b := v.Block 2576 // match: (ADDSshiftRLreg (MOVWconst [c]) x y) 2577 // result: (ADDSconst [c] (SRL <x.Type> x y)) 2578 for { 2579 y := v.Args[2] 2580 v_0 := v.Args[0] 2581 if v_0.Op != OpARMMOVWconst { 2582 break 2583 } 2584 c := v_0.AuxInt 2585 x := v.Args[1] 2586 v.reset(OpARMADDSconst) 2587 v.AuxInt = c 2588 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 2589 v0.AddArg(x) 2590 v0.AddArg(y) 2591 v.AddArg(v0) 2592 return true 2593 } 2594 // match: (ADDSshiftRLreg x y (MOVWconst [c])) 2595 // result: (ADDSshiftRL x y [c]) 2596 for { 2597 _ = v.Args[2] 2598 x := v.Args[0] 2599 y := v.Args[1] 2600 v_2 := v.Args[2] 2601 if v_2.Op != OpARMMOVWconst { 2602 break 2603 } 2604 c := v_2.AuxInt 2605 v.reset(OpARMADDSshiftRL) 2606 v.AuxInt = c 2607 v.AddArg(x) 2608 v.AddArg(y) 2609 return true 2610 } 2611 return false 2612 } 2613 func rewriteValueARM_OpARMADDconst_0(v *Value) bool { 2614 // match: (ADDconst [off1] (MOVWaddr [off2] {sym} ptr)) 2615 // result: (MOVWaddr [off1+off2] {sym} ptr) 2616 for { 2617 off1 := v.AuxInt 2618 v_0 := v.Args[0] 2619 if v_0.Op != OpARMMOVWaddr { 2620 break 2621 } 2622 off2 := v_0.AuxInt 2623 sym := v_0.Aux 2624 ptr := v_0.Args[0] 2625 v.reset(OpARMMOVWaddr) 2626 v.AuxInt = off1 + off2 2627 v.Aux = sym 2628 v.AddArg(ptr) 2629 return true 2630 } 2631 // match: (ADDconst [0] x) 2632 // result: x 2633 for { 2634 if v.AuxInt != 0 { 2635 break 2636 } 2637 x := v.Args[0] 2638 v.reset(OpCopy) 2639 v.Type = x.Type 2640 v.AddArg(x) 2641 return true 2642 } 2643 // match: (ADDconst [c] x) 2644 // cond: !isARMImmRot(uint32(c)) && isARMImmRot(uint32(-c)) 2645 // result: (SUBconst [int64(int32(-c))] x) 2646 for { 2647 c := v.AuxInt 2648 x := v.Args[0] 2649 if !(!isARMImmRot(uint32(c)) && isARMImmRot(uint32(-c))) { 2650 break 2651 } 2652 v.reset(OpARMSUBconst) 2653 v.AuxInt = int64(int32(-c)) 2654 v.AddArg(x) 2655 return true 2656 } 2657 // match: (ADDconst [c] x) 2658 // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff 2659 // result: (SUBconst [int64(int32(-c))] x) 2660 for { 2661 c := v.AuxInt 2662 x := v.Args[0] 2663 if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && uint32(-c) <= 0xffff) { 2664 break 2665 } 2666 v.reset(OpARMSUBconst) 2667 v.AuxInt = int64(int32(-c)) 2668 v.AddArg(x) 2669 return true 2670 } 2671 // match: (ADDconst [c] (MOVWconst [d])) 2672 // result: (MOVWconst [int64(int32(c+d))]) 2673 for { 2674 c := v.AuxInt 2675 v_0 := v.Args[0] 2676 if v_0.Op != OpARMMOVWconst { 2677 break 2678 } 2679 d := v_0.AuxInt 2680 v.reset(OpARMMOVWconst) 2681 v.AuxInt = int64(int32(c + d)) 2682 return true 2683 } 2684 // match: (ADDconst [c] (ADDconst [d] x)) 2685 // result: (ADDconst [int64(int32(c+d))] x) 2686 for { 2687 c := v.AuxInt 2688 v_0 := v.Args[0] 2689 if v_0.Op != OpARMADDconst { 2690 break 2691 } 2692 d := v_0.AuxInt 2693 x := v_0.Args[0] 2694 v.reset(OpARMADDconst) 2695 v.AuxInt = int64(int32(c + d)) 2696 v.AddArg(x) 2697 return true 2698 } 2699 // match: (ADDconst [c] (SUBconst [d] x)) 2700 // result: (ADDconst [int64(int32(c-d))] x) 2701 for { 2702 c := v.AuxInt 2703 v_0 := v.Args[0] 2704 if v_0.Op != OpARMSUBconst { 2705 break 2706 } 2707 d := v_0.AuxInt 2708 x := v_0.Args[0] 2709 v.reset(OpARMADDconst) 2710 v.AuxInt = int64(int32(c - d)) 2711 v.AddArg(x) 2712 return true 2713 } 2714 // match: (ADDconst [c] (RSBconst [d] x)) 2715 // result: (RSBconst [int64(int32(c+d))] x) 2716 for { 2717 c := v.AuxInt 2718 v_0 := v.Args[0] 2719 if v_0.Op != OpARMRSBconst { 2720 break 2721 } 2722 d := v_0.AuxInt 2723 x := v_0.Args[0] 2724 v.reset(OpARMRSBconst) 2725 v.AuxInt = int64(int32(c + d)) 2726 v.AddArg(x) 2727 return true 2728 } 2729 return false 2730 } 2731 func rewriteValueARM_OpARMADDshiftLL_0(v *Value) bool { 2732 b := v.Block 2733 typ := &b.Func.Config.Types 2734 // match: (ADDshiftLL (MOVWconst [c]) x [d]) 2735 // result: (ADDconst [c] (SLLconst <x.Type> x [d])) 2736 for { 2737 d := v.AuxInt 2738 x := v.Args[1] 2739 v_0 := v.Args[0] 2740 if v_0.Op != OpARMMOVWconst { 2741 break 2742 } 2743 c := v_0.AuxInt 2744 v.reset(OpARMADDconst) 2745 v.AuxInt = c 2746 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 2747 v0.AuxInt = d 2748 v0.AddArg(x) 2749 v.AddArg(v0) 2750 return true 2751 } 2752 // match: (ADDshiftLL x (MOVWconst [c]) [d]) 2753 // result: (ADDconst x [int64(int32(uint32(c)<<uint64(d)))]) 2754 for { 2755 d := v.AuxInt 2756 _ = v.Args[1] 2757 x := v.Args[0] 2758 v_1 := v.Args[1] 2759 if v_1.Op != OpARMMOVWconst { 2760 break 2761 } 2762 c := v_1.AuxInt 2763 v.reset(OpARMADDconst) 2764 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 2765 v.AddArg(x) 2766 return true 2767 } 2768 // match: (ADDshiftLL [c] (SRLconst x [32-c]) x) 2769 // result: (SRRconst [32-c] x) 2770 for { 2771 c := v.AuxInt 2772 x := v.Args[1] 2773 v_0 := v.Args[0] 2774 if v_0.Op != OpARMSRLconst || v_0.AuxInt != 32-c || x != v_0.Args[0] { 2775 break 2776 } 2777 v.reset(OpARMSRRconst) 2778 v.AuxInt = 32 - c 2779 v.AddArg(x) 2780 return true 2781 } 2782 // match: (ADDshiftLL <typ.UInt16> [8] (BFXU <typ.UInt16> [armBFAuxInt(8, 8)] x) x) 2783 // result: (REV16 x) 2784 for { 2785 if v.Type != typ.UInt16 || v.AuxInt != 8 { 2786 break 2787 } 2788 x := v.Args[1] 2789 v_0 := v.Args[0] 2790 if v_0.Op != OpARMBFXU || v_0.Type != typ.UInt16 || v_0.AuxInt != armBFAuxInt(8, 8) || x != v_0.Args[0] { 2791 break 2792 } 2793 v.reset(OpARMREV16) 2794 v.AddArg(x) 2795 return true 2796 } 2797 // match: (ADDshiftLL <typ.UInt16> [8] (SRLconst <typ.UInt16> [24] (SLLconst [16] x)) x) 2798 // cond: objabi.GOARM>=6 2799 // result: (REV16 x) 2800 for { 2801 if v.Type != typ.UInt16 || v.AuxInt != 8 { 2802 break 2803 } 2804 x := v.Args[1] 2805 v_0 := v.Args[0] 2806 if v_0.Op != OpARMSRLconst || v_0.Type != typ.UInt16 || v_0.AuxInt != 24 { 2807 break 2808 } 2809 v_0_0 := v_0.Args[0] 2810 if v_0_0.Op != OpARMSLLconst || v_0_0.AuxInt != 16 || x != v_0_0.Args[0] || !(objabi.GOARM >= 6) { 2811 break 2812 } 2813 v.reset(OpARMREV16) 2814 v.AddArg(x) 2815 return true 2816 } 2817 return false 2818 } 2819 func rewriteValueARM_OpARMADDshiftLLreg_0(v *Value) bool { 2820 b := v.Block 2821 // match: (ADDshiftLLreg (MOVWconst [c]) x y) 2822 // result: (ADDconst [c] (SLL <x.Type> x y)) 2823 for { 2824 y := v.Args[2] 2825 v_0 := v.Args[0] 2826 if v_0.Op != OpARMMOVWconst { 2827 break 2828 } 2829 c := v_0.AuxInt 2830 x := v.Args[1] 2831 v.reset(OpARMADDconst) 2832 v.AuxInt = c 2833 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 2834 v0.AddArg(x) 2835 v0.AddArg(y) 2836 v.AddArg(v0) 2837 return true 2838 } 2839 // match: (ADDshiftLLreg x y (MOVWconst [c])) 2840 // result: (ADDshiftLL x y [c]) 2841 for { 2842 _ = v.Args[2] 2843 x := v.Args[0] 2844 y := v.Args[1] 2845 v_2 := v.Args[2] 2846 if v_2.Op != OpARMMOVWconst { 2847 break 2848 } 2849 c := v_2.AuxInt 2850 v.reset(OpARMADDshiftLL) 2851 v.AuxInt = c 2852 v.AddArg(x) 2853 v.AddArg(y) 2854 return true 2855 } 2856 return false 2857 } 2858 func rewriteValueARM_OpARMADDshiftRA_0(v *Value) bool { 2859 b := v.Block 2860 // match: (ADDshiftRA (MOVWconst [c]) x [d]) 2861 // result: (ADDconst [c] (SRAconst <x.Type> x [d])) 2862 for { 2863 d := v.AuxInt 2864 x := v.Args[1] 2865 v_0 := v.Args[0] 2866 if v_0.Op != OpARMMOVWconst { 2867 break 2868 } 2869 c := v_0.AuxInt 2870 v.reset(OpARMADDconst) 2871 v.AuxInt = c 2872 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 2873 v0.AuxInt = d 2874 v0.AddArg(x) 2875 v.AddArg(v0) 2876 return true 2877 } 2878 // match: (ADDshiftRA x (MOVWconst [c]) [d]) 2879 // result: (ADDconst x [int64(int32(c)>>uint64(d))]) 2880 for { 2881 d := v.AuxInt 2882 _ = v.Args[1] 2883 x := v.Args[0] 2884 v_1 := v.Args[1] 2885 if v_1.Op != OpARMMOVWconst { 2886 break 2887 } 2888 c := v_1.AuxInt 2889 v.reset(OpARMADDconst) 2890 v.AuxInt = int64(int32(c) >> uint64(d)) 2891 v.AddArg(x) 2892 return true 2893 } 2894 return false 2895 } 2896 func rewriteValueARM_OpARMADDshiftRAreg_0(v *Value) bool { 2897 b := v.Block 2898 // match: (ADDshiftRAreg (MOVWconst [c]) x y) 2899 // result: (ADDconst [c] (SRA <x.Type> x y)) 2900 for { 2901 y := v.Args[2] 2902 v_0 := v.Args[0] 2903 if v_0.Op != OpARMMOVWconst { 2904 break 2905 } 2906 c := v_0.AuxInt 2907 x := v.Args[1] 2908 v.reset(OpARMADDconst) 2909 v.AuxInt = c 2910 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 2911 v0.AddArg(x) 2912 v0.AddArg(y) 2913 v.AddArg(v0) 2914 return true 2915 } 2916 // match: (ADDshiftRAreg x y (MOVWconst [c])) 2917 // result: (ADDshiftRA x y [c]) 2918 for { 2919 _ = v.Args[2] 2920 x := v.Args[0] 2921 y := v.Args[1] 2922 v_2 := v.Args[2] 2923 if v_2.Op != OpARMMOVWconst { 2924 break 2925 } 2926 c := v_2.AuxInt 2927 v.reset(OpARMADDshiftRA) 2928 v.AuxInt = c 2929 v.AddArg(x) 2930 v.AddArg(y) 2931 return true 2932 } 2933 return false 2934 } 2935 func rewriteValueARM_OpARMADDshiftRL_0(v *Value) bool { 2936 b := v.Block 2937 // match: (ADDshiftRL (MOVWconst [c]) x [d]) 2938 // result: (ADDconst [c] (SRLconst <x.Type> x [d])) 2939 for { 2940 d := v.AuxInt 2941 x := v.Args[1] 2942 v_0 := v.Args[0] 2943 if v_0.Op != OpARMMOVWconst { 2944 break 2945 } 2946 c := v_0.AuxInt 2947 v.reset(OpARMADDconst) 2948 v.AuxInt = c 2949 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 2950 v0.AuxInt = d 2951 v0.AddArg(x) 2952 v.AddArg(v0) 2953 return true 2954 } 2955 // match: (ADDshiftRL x (MOVWconst [c]) [d]) 2956 // result: (ADDconst x [int64(int32(uint32(c)>>uint64(d)))]) 2957 for { 2958 d := v.AuxInt 2959 _ = v.Args[1] 2960 x := v.Args[0] 2961 v_1 := v.Args[1] 2962 if v_1.Op != OpARMMOVWconst { 2963 break 2964 } 2965 c := v_1.AuxInt 2966 v.reset(OpARMADDconst) 2967 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 2968 v.AddArg(x) 2969 return true 2970 } 2971 // match: (ADDshiftRL [c] (SLLconst x [32-c]) x) 2972 // result: (SRRconst [ c] x) 2973 for { 2974 c := v.AuxInt 2975 x := v.Args[1] 2976 v_0 := v.Args[0] 2977 if v_0.Op != OpARMSLLconst || v_0.AuxInt != 32-c || x != v_0.Args[0] { 2978 break 2979 } 2980 v.reset(OpARMSRRconst) 2981 v.AuxInt = c 2982 v.AddArg(x) 2983 return true 2984 } 2985 return false 2986 } 2987 func rewriteValueARM_OpARMADDshiftRLreg_0(v *Value) bool { 2988 b := v.Block 2989 // match: (ADDshiftRLreg (MOVWconst [c]) x y) 2990 // result: (ADDconst [c] (SRL <x.Type> x y)) 2991 for { 2992 y := v.Args[2] 2993 v_0 := v.Args[0] 2994 if v_0.Op != OpARMMOVWconst { 2995 break 2996 } 2997 c := v_0.AuxInt 2998 x := v.Args[1] 2999 v.reset(OpARMADDconst) 3000 v.AuxInt = c 3001 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 3002 v0.AddArg(x) 3003 v0.AddArg(y) 3004 v.AddArg(v0) 3005 return true 3006 } 3007 // match: (ADDshiftRLreg x y (MOVWconst [c])) 3008 // result: (ADDshiftRL x y [c]) 3009 for { 3010 _ = v.Args[2] 3011 x := v.Args[0] 3012 y := v.Args[1] 3013 v_2 := v.Args[2] 3014 if v_2.Op != OpARMMOVWconst { 3015 break 3016 } 3017 c := v_2.AuxInt 3018 v.reset(OpARMADDshiftRL) 3019 v.AuxInt = c 3020 v.AddArg(x) 3021 v.AddArg(y) 3022 return true 3023 } 3024 return false 3025 } 3026 func rewriteValueARM_OpARMAND_0(v *Value) bool { 3027 // match: (AND x (MOVWconst [c])) 3028 // result: (ANDconst [c] x) 3029 for { 3030 _ = v.Args[1] 3031 x := v.Args[0] 3032 v_1 := v.Args[1] 3033 if v_1.Op != OpARMMOVWconst { 3034 break 3035 } 3036 c := v_1.AuxInt 3037 v.reset(OpARMANDconst) 3038 v.AuxInt = c 3039 v.AddArg(x) 3040 return true 3041 } 3042 // match: (AND (MOVWconst [c]) x) 3043 // result: (ANDconst [c] x) 3044 for { 3045 x := v.Args[1] 3046 v_0 := v.Args[0] 3047 if v_0.Op != OpARMMOVWconst { 3048 break 3049 } 3050 c := v_0.AuxInt 3051 v.reset(OpARMANDconst) 3052 v.AuxInt = c 3053 v.AddArg(x) 3054 return true 3055 } 3056 // match: (AND x (SLLconst [c] y)) 3057 // result: (ANDshiftLL x y [c]) 3058 for { 3059 _ = v.Args[1] 3060 x := v.Args[0] 3061 v_1 := v.Args[1] 3062 if v_1.Op != OpARMSLLconst { 3063 break 3064 } 3065 c := v_1.AuxInt 3066 y := v_1.Args[0] 3067 v.reset(OpARMANDshiftLL) 3068 v.AuxInt = c 3069 v.AddArg(x) 3070 v.AddArg(y) 3071 return true 3072 } 3073 // match: (AND (SLLconst [c] y) x) 3074 // result: (ANDshiftLL x y [c]) 3075 for { 3076 x := v.Args[1] 3077 v_0 := v.Args[0] 3078 if v_0.Op != OpARMSLLconst { 3079 break 3080 } 3081 c := v_0.AuxInt 3082 y := v_0.Args[0] 3083 v.reset(OpARMANDshiftLL) 3084 v.AuxInt = c 3085 v.AddArg(x) 3086 v.AddArg(y) 3087 return true 3088 } 3089 // match: (AND x (SRLconst [c] y)) 3090 // result: (ANDshiftRL x y [c]) 3091 for { 3092 _ = v.Args[1] 3093 x := v.Args[0] 3094 v_1 := v.Args[1] 3095 if v_1.Op != OpARMSRLconst { 3096 break 3097 } 3098 c := v_1.AuxInt 3099 y := v_1.Args[0] 3100 v.reset(OpARMANDshiftRL) 3101 v.AuxInt = c 3102 v.AddArg(x) 3103 v.AddArg(y) 3104 return true 3105 } 3106 // match: (AND (SRLconst [c] y) x) 3107 // result: (ANDshiftRL x y [c]) 3108 for { 3109 x := v.Args[1] 3110 v_0 := v.Args[0] 3111 if v_0.Op != OpARMSRLconst { 3112 break 3113 } 3114 c := v_0.AuxInt 3115 y := v_0.Args[0] 3116 v.reset(OpARMANDshiftRL) 3117 v.AuxInt = c 3118 v.AddArg(x) 3119 v.AddArg(y) 3120 return true 3121 } 3122 // match: (AND x (SRAconst [c] y)) 3123 // result: (ANDshiftRA x y [c]) 3124 for { 3125 _ = v.Args[1] 3126 x := v.Args[0] 3127 v_1 := v.Args[1] 3128 if v_1.Op != OpARMSRAconst { 3129 break 3130 } 3131 c := v_1.AuxInt 3132 y := v_1.Args[0] 3133 v.reset(OpARMANDshiftRA) 3134 v.AuxInt = c 3135 v.AddArg(x) 3136 v.AddArg(y) 3137 return true 3138 } 3139 // match: (AND (SRAconst [c] y) x) 3140 // result: (ANDshiftRA x y [c]) 3141 for { 3142 x := v.Args[1] 3143 v_0 := v.Args[0] 3144 if v_0.Op != OpARMSRAconst { 3145 break 3146 } 3147 c := v_0.AuxInt 3148 y := v_0.Args[0] 3149 v.reset(OpARMANDshiftRA) 3150 v.AuxInt = c 3151 v.AddArg(x) 3152 v.AddArg(y) 3153 return true 3154 } 3155 // match: (AND x (SLL y z)) 3156 // result: (ANDshiftLLreg x y z) 3157 for { 3158 _ = v.Args[1] 3159 x := v.Args[0] 3160 v_1 := v.Args[1] 3161 if v_1.Op != OpARMSLL { 3162 break 3163 } 3164 z := v_1.Args[1] 3165 y := v_1.Args[0] 3166 v.reset(OpARMANDshiftLLreg) 3167 v.AddArg(x) 3168 v.AddArg(y) 3169 v.AddArg(z) 3170 return true 3171 } 3172 // match: (AND (SLL y z) x) 3173 // result: (ANDshiftLLreg x y z) 3174 for { 3175 x := v.Args[1] 3176 v_0 := v.Args[0] 3177 if v_0.Op != OpARMSLL { 3178 break 3179 } 3180 z := v_0.Args[1] 3181 y := v_0.Args[0] 3182 v.reset(OpARMANDshiftLLreg) 3183 v.AddArg(x) 3184 v.AddArg(y) 3185 v.AddArg(z) 3186 return true 3187 } 3188 return false 3189 } 3190 func rewriteValueARM_OpARMAND_10(v *Value) bool { 3191 // match: (AND x (SRL y z)) 3192 // result: (ANDshiftRLreg x y z) 3193 for { 3194 _ = v.Args[1] 3195 x := v.Args[0] 3196 v_1 := v.Args[1] 3197 if v_1.Op != OpARMSRL { 3198 break 3199 } 3200 z := v_1.Args[1] 3201 y := v_1.Args[0] 3202 v.reset(OpARMANDshiftRLreg) 3203 v.AddArg(x) 3204 v.AddArg(y) 3205 v.AddArg(z) 3206 return true 3207 } 3208 // match: (AND (SRL y z) x) 3209 // result: (ANDshiftRLreg x y z) 3210 for { 3211 x := v.Args[1] 3212 v_0 := v.Args[0] 3213 if v_0.Op != OpARMSRL { 3214 break 3215 } 3216 z := v_0.Args[1] 3217 y := v_0.Args[0] 3218 v.reset(OpARMANDshiftRLreg) 3219 v.AddArg(x) 3220 v.AddArg(y) 3221 v.AddArg(z) 3222 return true 3223 } 3224 // match: (AND x (SRA y z)) 3225 // result: (ANDshiftRAreg x y z) 3226 for { 3227 _ = v.Args[1] 3228 x := v.Args[0] 3229 v_1 := v.Args[1] 3230 if v_1.Op != OpARMSRA { 3231 break 3232 } 3233 z := v_1.Args[1] 3234 y := v_1.Args[0] 3235 v.reset(OpARMANDshiftRAreg) 3236 v.AddArg(x) 3237 v.AddArg(y) 3238 v.AddArg(z) 3239 return true 3240 } 3241 // match: (AND (SRA y z) x) 3242 // result: (ANDshiftRAreg x y z) 3243 for { 3244 x := v.Args[1] 3245 v_0 := v.Args[0] 3246 if v_0.Op != OpARMSRA { 3247 break 3248 } 3249 z := v_0.Args[1] 3250 y := v_0.Args[0] 3251 v.reset(OpARMANDshiftRAreg) 3252 v.AddArg(x) 3253 v.AddArg(y) 3254 v.AddArg(z) 3255 return true 3256 } 3257 // match: (AND x x) 3258 // result: x 3259 for { 3260 x := v.Args[1] 3261 if x != v.Args[0] { 3262 break 3263 } 3264 v.reset(OpCopy) 3265 v.Type = x.Type 3266 v.AddArg(x) 3267 return true 3268 } 3269 // match: (AND x (MVN y)) 3270 // result: (BIC x y) 3271 for { 3272 _ = v.Args[1] 3273 x := v.Args[0] 3274 v_1 := v.Args[1] 3275 if v_1.Op != OpARMMVN { 3276 break 3277 } 3278 y := v_1.Args[0] 3279 v.reset(OpARMBIC) 3280 v.AddArg(x) 3281 v.AddArg(y) 3282 return true 3283 } 3284 // match: (AND (MVN y) x) 3285 // result: (BIC x y) 3286 for { 3287 x := v.Args[1] 3288 v_0 := v.Args[0] 3289 if v_0.Op != OpARMMVN { 3290 break 3291 } 3292 y := v_0.Args[0] 3293 v.reset(OpARMBIC) 3294 v.AddArg(x) 3295 v.AddArg(y) 3296 return true 3297 } 3298 // match: (AND x (MVNshiftLL y [c])) 3299 // result: (BICshiftLL x y [c]) 3300 for { 3301 _ = v.Args[1] 3302 x := v.Args[0] 3303 v_1 := v.Args[1] 3304 if v_1.Op != OpARMMVNshiftLL { 3305 break 3306 } 3307 c := v_1.AuxInt 3308 y := v_1.Args[0] 3309 v.reset(OpARMBICshiftLL) 3310 v.AuxInt = c 3311 v.AddArg(x) 3312 v.AddArg(y) 3313 return true 3314 } 3315 // match: (AND (MVNshiftLL y [c]) x) 3316 // result: (BICshiftLL x y [c]) 3317 for { 3318 x := v.Args[1] 3319 v_0 := v.Args[0] 3320 if v_0.Op != OpARMMVNshiftLL { 3321 break 3322 } 3323 c := v_0.AuxInt 3324 y := v_0.Args[0] 3325 v.reset(OpARMBICshiftLL) 3326 v.AuxInt = c 3327 v.AddArg(x) 3328 v.AddArg(y) 3329 return true 3330 } 3331 // match: (AND x (MVNshiftRL y [c])) 3332 // result: (BICshiftRL x y [c]) 3333 for { 3334 _ = v.Args[1] 3335 x := v.Args[0] 3336 v_1 := v.Args[1] 3337 if v_1.Op != OpARMMVNshiftRL { 3338 break 3339 } 3340 c := v_1.AuxInt 3341 y := v_1.Args[0] 3342 v.reset(OpARMBICshiftRL) 3343 v.AuxInt = c 3344 v.AddArg(x) 3345 v.AddArg(y) 3346 return true 3347 } 3348 return false 3349 } 3350 func rewriteValueARM_OpARMAND_20(v *Value) bool { 3351 // match: (AND (MVNshiftRL y [c]) x) 3352 // result: (BICshiftRL x y [c]) 3353 for { 3354 x := v.Args[1] 3355 v_0 := v.Args[0] 3356 if v_0.Op != OpARMMVNshiftRL { 3357 break 3358 } 3359 c := v_0.AuxInt 3360 y := v_0.Args[0] 3361 v.reset(OpARMBICshiftRL) 3362 v.AuxInt = c 3363 v.AddArg(x) 3364 v.AddArg(y) 3365 return true 3366 } 3367 // match: (AND x (MVNshiftRA y [c])) 3368 // result: (BICshiftRA x y [c]) 3369 for { 3370 _ = v.Args[1] 3371 x := v.Args[0] 3372 v_1 := v.Args[1] 3373 if v_1.Op != OpARMMVNshiftRA { 3374 break 3375 } 3376 c := v_1.AuxInt 3377 y := v_1.Args[0] 3378 v.reset(OpARMBICshiftRA) 3379 v.AuxInt = c 3380 v.AddArg(x) 3381 v.AddArg(y) 3382 return true 3383 } 3384 // match: (AND (MVNshiftRA y [c]) x) 3385 // result: (BICshiftRA x y [c]) 3386 for { 3387 x := v.Args[1] 3388 v_0 := v.Args[0] 3389 if v_0.Op != OpARMMVNshiftRA { 3390 break 3391 } 3392 c := v_0.AuxInt 3393 y := v_0.Args[0] 3394 v.reset(OpARMBICshiftRA) 3395 v.AuxInt = c 3396 v.AddArg(x) 3397 v.AddArg(y) 3398 return true 3399 } 3400 return false 3401 } 3402 func rewriteValueARM_OpARMANDconst_0(v *Value) bool { 3403 // match: (ANDconst [0] _) 3404 // result: (MOVWconst [0]) 3405 for { 3406 if v.AuxInt != 0 { 3407 break 3408 } 3409 v.reset(OpARMMOVWconst) 3410 v.AuxInt = 0 3411 return true 3412 } 3413 // match: (ANDconst [c] x) 3414 // cond: int32(c)==-1 3415 // result: x 3416 for { 3417 c := v.AuxInt 3418 x := v.Args[0] 3419 if !(int32(c) == -1) { 3420 break 3421 } 3422 v.reset(OpCopy) 3423 v.Type = x.Type 3424 v.AddArg(x) 3425 return true 3426 } 3427 // match: (ANDconst [c] x) 3428 // cond: !isARMImmRot(uint32(c)) && isARMImmRot(^uint32(c)) 3429 // result: (BICconst [int64(int32(^uint32(c)))] x) 3430 for { 3431 c := v.AuxInt 3432 x := v.Args[0] 3433 if !(!isARMImmRot(uint32(c)) && isARMImmRot(^uint32(c))) { 3434 break 3435 } 3436 v.reset(OpARMBICconst) 3437 v.AuxInt = int64(int32(^uint32(c))) 3438 v.AddArg(x) 3439 return true 3440 } 3441 // match: (ANDconst [c] x) 3442 // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff 3443 // result: (BICconst [int64(int32(^uint32(c)))] x) 3444 for { 3445 c := v.AuxInt 3446 x := v.Args[0] 3447 if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && ^uint32(c) <= 0xffff) { 3448 break 3449 } 3450 v.reset(OpARMBICconst) 3451 v.AuxInt = int64(int32(^uint32(c))) 3452 v.AddArg(x) 3453 return true 3454 } 3455 // match: (ANDconst [c] (MOVWconst [d])) 3456 // result: (MOVWconst [c&d]) 3457 for { 3458 c := v.AuxInt 3459 v_0 := v.Args[0] 3460 if v_0.Op != OpARMMOVWconst { 3461 break 3462 } 3463 d := v_0.AuxInt 3464 v.reset(OpARMMOVWconst) 3465 v.AuxInt = c & d 3466 return true 3467 } 3468 // match: (ANDconst [c] (ANDconst [d] x)) 3469 // result: (ANDconst [c&d] x) 3470 for { 3471 c := v.AuxInt 3472 v_0 := v.Args[0] 3473 if v_0.Op != OpARMANDconst { 3474 break 3475 } 3476 d := v_0.AuxInt 3477 x := v_0.Args[0] 3478 v.reset(OpARMANDconst) 3479 v.AuxInt = c & d 3480 v.AddArg(x) 3481 return true 3482 } 3483 return false 3484 } 3485 func rewriteValueARM_OpARMANDshiftLL_0(v *Value) bool { 3486 b := v.Block 3487 // match: (ANDshiftLL (MOVWconst [c]) x [d]) 3488 // result: (ANDconst [c] (SLLconst <x.Type> x [d])) 3489 for { 3490 d := v.AuxInt 3491 x := v.Args[1] 3492 v_0 := v.Args[0] 3493 if v_0.Op != OpARMMOVWconst { 3494 break 3495 } 3496 c := v_0.AuxInt 3497 v.reset(OpARMANDconst) 3498 v.AuxInt = c 3499 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 3500 v0.AuxInt = d 3501 v0.AddArg(x) 3502 v.AddArg(v0) 3503 return true 3504 } 3505 // match: (ANDshiftLL x (MOVWconst [c]) [d]) 3506 // result: (ANDconst x [int64(int32(uint32(c)<<uint64(d)))]) 3507 for { 3508 d := v.AuxInt 3509 _ = v.Args[1] 3510 x := v.Args[0] 3511 v_1 := v.Args[1] 3512 if v_1.Op != OpARMMOVWconst { 3513 break 3514 } 3515 c := v_1.AuxInt 3516 v.reset(OpARMANDconst) 3517 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 3518 v.AddArg(x) 3519 return true 3520 } 3521 // match: (ANDshiftLL x y:(SLLconst x [c]) [d]) 3522 // cond: c==d 3523 // result: y 3524 for { 3525 d := v.AuxInt 3526 _ = v.Args[1] 3527 x := v.Args[0] 3528 y := v.Args[1] 3529 if y.Op != OpARMSLLconst { 3530 break 3531 } 3532 c := y.AuxInt 3533 if x != y.Args[0] || !(c == d) { 3534 break 3535 } 3536 v.reset(OpCopy) 3537 v.Type = y.Type 3538 v.AddArg(y) 3539 return true 3540 } 3541 return false 3542 } 3543 func rewriteValueARM_OpARMANDshiftLLreg_0(v *Value) bool { 3544 b := v.Block 3545 // match: (ANDshiftLLreg (MOVWconst [c]) x y) 3546 // result: (ANDconst [c] (SLL <x.Type> x y)) 3547 for { 3548 y := v.Args[2] 3549 v_0 := v.Args[0] 3550 if v_0.Op != OpARMMOVWconst { 3551 break 3552 } 3553 c := v_0.AuxInt 3554 x := v.Args[1] 3555 v.reset(OpARMANDconst) 3556 v.AuxInt = c 3557 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 3558 v0.AddArg(x) 3559 v0.AddArg(y) 3560 v.AddArg(v0) 3561 return true 3562 } 3563 // match: (ANDshiftLLreg x y (MOVWconst [c])) 3564 // result: (ANDshiftLL x y [c]) 3565 for { 3566 _ = v.Args[2] 3567 x := v.Args[0] 3568 y := v.Args[1] 3569 v_2 := v.Args[2] 3570 if v_2.Op != OpARMMOVWconst { 3571 break 3572 } 3573 c := v_2.AuxInt 3574 v.reset(OpARMANDshiftLL) 3575 v.AuxInt = c 3576 v.AddArg(x) 3577 v.AddArg(y) 3578 return true 3579 } 3580 return false 3581 } 3582 func rewriteValueARM_OpARMANDshiftRA_0(v *Value) bool { 3583 b := v.Block 3584 // match: (ANDshiftRA (MOVWconst [c]) x [d]) 3585 // result: (ANDconst [c] (SRAconst <x.Type> x [d])) 3586 for { 3587 d := v.AuxInt 3588 x := v.Args[1] 3589 v_0 := v.Args[0] 3590 if v_0.Op != OpARMMOVWconst { 3591 break 3592 } 3593 c := v_0.AuxInt 3594 v.reset(OpARMANDconst) 3595 v.AuxInt = c 3596 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 3597 v0.AuxInt = d 3598 v0.AddArg(x) 3599 v.AddArg(v0) 3600 return true 3601 } 3602 // match: (ANDshiftRA x (MOVWconst [c]) [d]) 3603 // result: (ANDconst x [int64(int32(c)>>uint64(d))]) 3604 for { 3605 d := v.AuxInt 3606 _ = v.Args[1] 3607 x := v.Args[0] 3608 v_1 := v.Args[1] 3609 if v_1.Op != OpARMMOVWconst { 3610 break 3611 } 3612 c := v_1.AuxInt 3613 v.reset(OpARMANDconst) 3614 v.AuxInt = int64(int32(c) >> uint64(d)) 3615 v.AddArg(x) 3616 return true 3617 } 3618 // match: (ANDshiftRA x y:(SRAconst x [c]) [d]) 3619 // cond: c==d 3620 // result: y 3621 for { 3622 d := v.AuxInt 3623 _ = v.Args[1] 3624 x := v.Args[0] 3625 y := v.Args[1] 3626 if y.Op != OpARMSRAconst { 3627 break 3628 } 3629 c := y.AuxInt 3630 if x != y.Args[0] || !(c == d) { 3631 break 3632 } 3633 v.reset(OpCopy) 3634 v.Type = y.Type 3635 v.AddArg(y) 3636 return true 3637 } 3638 return false 3639 } 3640 func rewriteValueARM_OpARMANDshiftRAreg_0(v *Value) bool { 3641 b := v.Block 3642 // match: (ANDshiftRAreg (MOVWconst [c]) x y) 3643 // result: (ANDconst [c] (SRA <x.Type> x y)) 3644 for { 3645 y := v.Args[2] 3646 v_0 := v.Args[0] 3647 if v_0.Op != OpARMMOVWconst { 3648 break 3649 } 3650 c := v_0.AuxInt 3651 x := v.Args[1] 3652 v.reset(OpARMANDconst) 3653 v.AuxInt = c 3654 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 3655 v0.AddArg(x) 3656 v0.AddArg(y) 3657 v.AddArg(v0) 3658 return true 3659 } 3660 // match: (ANDshiftRAreg x y (MOVWconst [c])) 3661 // result: (ANDshiftRA x y [c]) 3662 for { 3663 _ = v.Args[2] 3664 x := v.Args[0] 3665 y := v.Args[1] 3666 v_2 := v.Args[2] 3667 if v_2.Op != OpARMMOVWconst { 3668 break 3669 } 3670 c := v_2.AuxInt 3671 v.reset(OpARMANDshiftRA) 3672 v.AuxInt = c 3673 v.AddArg(x) 3674 v.AddArg(y) 3675 return true 3676 } 3677 return false 3678 } 3679 func rewriteValueARM_OpARMANDshiftRL_0(v *Value) bool { 3680 b := v.Block 3681 // match: (ANDshiftRL (MOVWconst [c]) x [d]) 3682 // result: (ANDconst [c] (SRLconst <x.Type> x [d])) 3683 for { 3684 d := v.AuxInt 3685 x := v.Args[1] 3686 v_0 := v.Args[0] 3687 if v_0.Op != OpARMMOVWconst { 3688 break 3689 } 3690 c := v_0.AuxInt 3691 v.reset(OpARMANDconst) 3692 v.AuxInt = c 3693 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 3694 v0.AuxInt = d 3695 v0.AddArg(x) 3696 v.AddArg(v0) 3697 return true 3698 } 3699 // match: (ANDshiftRL x (MOVWconst [c]) [d]) 3700 // result: (ANDconst x [int64(int32(uint32(c)>>uint64(d)))]) 3701 for { 3702 d := v.AuxInt 3703 _ = v.Args[1] 3704 x := v.Args[0] 3705 v_1 := v.Args[1] 3706 if v_1.Op != OpARMMOVWconst { 3707 break 3708 } 3709 c := v_1.AuxInt 3710 v.reset(OpARMANDconst) 3711 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 3712 v.AddArg(x) 3713 return true 3714 } 3715 // match: (ANDshiftRL x y:(SRLconst x [c]) [d]) 3716 // cond: c==d 3717 // result: y 3718 for { 3719 d := v.AuxInt 3720 _ = v.Args[1] 3721 x := v.Args[0] 3722 y := v.Args[1] 3723 if y.Op != OpARMSRLconst { 3724 break 3725 } 3726 c := y.AuxInt 3727 if x != y.Args[0] || !(c == d) { 3728 break 3729 } 3730 v.reset(OpCopy) 3731 v.Type = y.Type 3732 v.AddArg(y) 3733 return true 3734 } 3735 return false 3736 } 3737 func rewriteValueARM_OpARMANDshiftRLreg_0(v *Value) bool { 3738 b := v.Block 3739 // match: (ANDshiftRLreg (MOVWconst [c]) x y) 3740 // result: (ANDconst [c] (SRL <x.Type> x y)) 3741 for { 3742 y := v.Args[2] 3743 v_0 := v.Args[0] 3744 if v_0.Op != OpARMMOVWconst { 3745 break 3746 } 3747 c := v_0.AuxInt 3748 x := v.Args[1] 3749 v.reset(OpARMANDconst) 3750 v.AuxInt = c 3751 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 3752 v0.AddArg(x) 3753 v0.AddArg(y) 3754 v.AddArg(v0) 3755 return true 3756 } 3757 // match: (ANDshiftRLreg x y (MOVWconst [c])) 3758 // result: (ANDshiftRL x y [c]) 3759 for { 3760 _ = v.Args[2] 3761 x := v.Args[0] 3762 y := v.Args[1] 3763 v_2 := v.Args[2] 3764 if v_2.Op != OpARMMOVWconst { 3765 break 3766 } 3767 c := v_2.AuxInt 3768 v.reset(OpARMANDshiftRL) 3769 v.AuxInt = c 3770 v.AddArg(x) 3771 v.AddArg(y) 3772 return true 3773 } 3774 return false 3775 } 3776 func rewriteValueARM_OpARMBFX_0(v *Value) bool { 3777 // match: (BFX [c] (MOVWconst [d])) 3778 // result: (MOVWconst [int64(int32(d)<<(32-uint32(c&0xff)-uint32(c>>8))>>(32-uint32(c>>8)))]) 3779 for { 3780 c := v.AuxInt 3781 v_0 := v.Args[0] 3782 if v_0.Op != OpARMMOVWconst { 3783 break 3784 } 3785 d := v_0.AuxInt 3786 v.reset(OpARMMOVWconst) 3787 v.AuxInt = int64(int32(d) << (32 - uint32(c&0xff) - uint32(c>>8)) >> (32 - uint32(c>>8))) 3788 return true 3789 } 3790 return false 3791 } 3792 func rewriteValueARM_OpARMBFXU_0(v *Value) bool { 3793 // match: (BFXU [c] (MOVWconst [d])) 3794 // result: (MOVWconst [int64(int32(uint32(d)<<(32-uint32(c&0xff)-uint32(c>>8))>>(32-uint32(c>>8))))]) 3795 for { 3796 c := v.AuxInt 3797 v_0 := v.Args[0] 3798 if v_0.Op != OpARMMOVWconst { 3799 break 3800 } 3801 d := v_0.AuxInt 3802 v.reset(OpARMMOVWconst) 3803 v.AuxInt = int64(int32(uint32(d) << (32 - uint32(c&0xff) - uint32(c>>8)) >> (32 - uint32(c>>8)))) 3804 return true 3805 } 3806 return false 3807 } 3808 func rewriteValueARM_OpARMBIC_0(v *Value) bool { 3809 // match: (BIC x (MOVWconst [c])) 3810 // result: (BICconst [c] x) 3811 for { 3812 _ = v.Args[1] 3813 x := v.Args[0] 3814 v_1 := v.Args[1] 3815 if v_1.Op != OpARMMOVWconst { 3816 break 3817 } 3818 c := v_1.AuxInt 3819 v.reset(OpARMBICconst) 3820 v.AuxInt = c 3821 v.AddArg(x) 3822 return true 3823 } 3824 // match: (BIC x (SLLconst [c] y)) 3825 // result: (BICshiftLL x y [c]) 3826 for { 3827 _ = v.Args[1] 3828 x := v.Args[0] 3829 v_1 := v.Args[1] 3830 if v_1.Op != OpARMSLLconst { 3831 break 3832 } 3833 c := v_1.AuxInt 3834 y := v_1.Args[0] 3835 v.reset(OpARMBICshiftLL) 3836 v.AuxInt = c 3837 v.AddArg(x) 3838 v.AddArg(y) 3839 return true 3840 } 3841 // match: (BIC x (SRLconst [c] y)) 3842 // result: (BICshiftRL x y [c]) 3843 for { 3844 _ = v.Args[1] 3845 x := v.Args[0] 3846 v_1 := v.Args[1] 3847 if v_1.Op != OpARMSRLconst { 3848 break 3849 } 3850 c := v_1.AuxInt 3851 y := v_1.Args[0] 3852 v.reset(OpARMBICshiftRL) 3853 v.AuxInt = c 3854 v.AddArg(x) 3855 v.AddArg(y) 3856 return true 3857 } 3858 // match: (BIC x (SRAconst [c] y)) 3859 // result: (BICshiftRA x y [c]) 3860 for { 3861 _ = v.Args[1] 3862 x := v.Args[0] 3863 v_1 := v.Args[1] 3864 if v_1.Op != OpARMSRAconst { 3865 break 3866 } 3867 c := v_1.AuxInt 3868 y := v_1.Args[0] 3869 v.reset(OpARMBICshiftRA) 3870 v.AuxInt = c 3871 v.AddArg(x) 3872 v.AddArg(y) 3873 return true 3874 } 3875 // match: (BIC x (SLL y z)) 3876 // result: (BICshiftLLreg x y z) 3877 for { 3878 _ = v.Args[1] 3879 x := v.Args[0] 3880 v_1 := v.Args[1] 3881 if v_1.Op != OpARMSLL { 3882 break 3883 } 3884 z := v_1.Args[1] 3885 y := v_1.Args[0] 3886 v.reset(OpARMBICshiftLLreg) 3887 v.AddArg(x) 3888 v.AddArg(y) 3889 v.AddArg(z) 3890 return true 3891 } 3892 // match: (BIC x (SRL y z)) 3893 // result: (BICshiftRLreg x y z) 3894 for { 3895 _ = v.Args[1] 3896 x := v.Args[0] 3897 v_1 := v.Args[1] 3898 if v_1.Op != OpARMSRL { 3899 break 3900 } 3901 z := v_1.Args[1] 3902 y := v_1.Args[0] 3903 v.reset(OpARMBICshiftRLreg) 3904 v.AddArg(x) 3905 v.AddArg(y) 3906 v.AddArg(z) 3907 return true 3908 } 3909 // match: (BIC x (SRA y z)) 3910 // result: (BICshiftRAreg x y z) 3911 for { 3912 _ = v.Args[1] 3913 x := v.Args[0] 3914 v_1 := v.Args[1] 3915 if v_1.Op != OpARMSRA { 3916 break 3917 } 3918 z := v_1.Args[1] 3919 y := v_1.Args[0] 3920 v.reset(OpARMBICshiftRAreg) 3921 v.AddArg(x) 3922 v.AddArg(y) 3923 v.AddArg(z) 3924 return true 3925 } 3926 // match: (BIC x x) 3927 // result: (MOVWconst [0]) 3928 for { 3929 x := v.Args[1] 3930 if x != v.Args[0] { 3931 break 3932 } 3933 v.reset(OpARMMOVWconst) 3934 v.AuxInt = 0 3935 return true 3936 } 3937 return false 3938 } 3939 func rewriteValueARM_OpARMBICconst_0(v *Value) bool { 3940 // match: (BICconst [0] x) 3941 // result: x 3942 for { 3943 if v.AuxInt != 0 { 3944 break 3945 } 3946 x := v.Args[0] 3947 v.reset(OpCopy) 3948 v.Type = x.Type 3949 v.AddArg(x) 3950 return true 3951 } 3952 // match: (BICconst [c] _) 3953 // cond: int32(c)==-1 3954 // result: (MOVWconst [0]) 3955 for { 3956 c := v.AuxInt 3957 if !(int32(c) == -1) { 3958 break 3959 } 3960 v.reset(OpARMMOVWconst) 3961 v.AuxInt = 0 3962 return true 3963 } 3964 // match: (BICconst [c] x) 3965 // cond: !isARMImmRot(uint32(c)) && isARMImmRot(^uint32(c)) 3966 // result: (ANDconst [int64(int32(^uint32(c)))] x) 3967 for { 3968 c := v.AuxInt 3969 x := v.Args[0] 3970 if !(!isARMImmRot(uint32(c)) && isARMImmRot(^uint32(c))) { 3971 break 3972 } 3973 v.reset(OpARMANDconst) 3974 v.AuxInt = int64(int32(^uint32(c))) 3975 v.AddArg(x) 3976 return true 3977 } 3978 // match: (BICconst [c] x) 3979 // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff 3980 // result: (ANDconst [int64(int32(^uint32(c)))] x) 3981 for { 3982 c := v.AuxInt 3983 x := v.Args[0] 3984 if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && ^uint32(c) <= 0xffff) { 3985 break 3986 } 3987 v.reset(OpARMANDconst) 3988 v.AuxInt = int64(int32(^uint32(c))) 3989 v.AddArg(x) 3990 return true 3991 } 3992 // match: (BICconst [c] (MOVWconst [d])) 3993 // result: (MOVWconst [d&^c]) 3994 for { 3995 c := v.AuxInt 3996 v_0 := v.Args[0] 3997 if v_0.Op != OpARMMOVWconst { 3998 break 3999 } 4000 d := v_0.AuxInt 4001 v.reset(OpARMMOVWconst) 4002 v.AuxInt = d &^ c 4003 return true 4004 } 4005 // match: (BICconst [c] (BICconst [d] x)) 4006 // result: (BICconst [int64(int32(c|d))] x) 4007 for { 4008 c := v.AuxInt 4009 v_0 := v.Args[0] 4010 if v_0.Op != OpARMBICconst { 4011 break 4012 } 4013 d := v_0.AuxInt 4014 x := v_0.Args[0] 4015 v.reset(OpARMBICconst) 4016 v.AuxInt = int64(int32(c | d)) 4017 v.AddArg(x) 4018 return true 4019 } 4020 return false 4021 } 4022 func rewriteValueARM_OpARMBICshiftLL_0(v *Value) bool { 4023 // match: (BICshiftLL x (MOVWconst [c]) [d]) 4024 // result: (BICconst x [int64(int32(uint32(c)<<uint64(d)))]) 4025 for { 4026 d := v.AuxInt 4027 _ = v.Args[1] 4028 x := v.Args[0] 4029 v_1 := v.Args[1] 4030 if v_1.Op != OpARMMOVWconst { 4031 break 4032 } 4033 c := v_1.AuxInt 4034 v.reset(OpARMBICconst) 4035 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 4036 v.AddArg(x) 4037 return true 4038 } 4039 // match: (BICshiftLL x (SLLconst x [c]) [d]) 4040 // cond: c==d 4041 // result: (MOVWconst [0]) 4042 for { 4043 d := v.AuxInt 4044 _ = v.Args[1] 4045 x := v.Args[0] 4046 v_1 := v.Args[1] 4047 if v_1.Op != OpARMSLLconst { 4048 break 4049 } 4050 c := v_1.AuxInt 4051 if x != v_1.Args[0] || !(c == d) { 4052 break 4053 } 4054 v.reset(OpARMMOVWconst) 4055 v.AuxInt = 0 4056 return true 4057 } 4058 return false 4059 } 4060 func rewriteValueARM_OpARMBICshiftLLreg_0(v *Value) bool { 4061 // match: (BICshiftLLreg x y (MOVWconst [c])) 4062 // result: (BICshiftLL x y [c]) 4063 for { 4064 _ = v.Args[2] 4065 x := v.Args[0] 4066 y := v.Args[1] 4067 v_2 := v.Args[2] 4068 if v_2.Op != OpARMMOVWconst { 4069 break 4070 } 4071 c := v_2.AuxInt 4072 v.reset(OpARMBICshiftLL) 4073 v.AuxInt = c 4074 v.AddArg(x) 4075 v.AddArg(y) 4076 return true 4077 } 4078 return false 4079 } 4080 func rewriteValueARM_OpARMBICshiftRA_0(v *Value) bool { 4081 // match: (BICshiftRA x (MOVWconst [c]) [d]) 4082 // result: (BICconst x [int64(int32(c)>>uint64(d))]) 4083 for { 4084 d := v.AuxInt 4085 _ = v.Args[1] 4086 x := v.Args[0] 4087 v_1 := v.Args[1] 4088 if v_1.Op != OpARMMOVWconst { 4089 break 4090 } 4091 c := v_1.AuxInt 4092 v.reset(OpARMBICconst) 4093 v.AuxInt = int64(int32(c) >> uint64(d)) 4094 v.AddArg(x) 4095 return true 4096 } 4097 // match: (BICshiftRA x (SRAconst x [c]) [d]) 4098 // cond: c==d 4099 // result: (MOVWconst [0]) 4100 for { 4101 d := v.AuxInt 4102 _ = v.Args[1] 4103 x := v.Args[0] 4104 v_1 := v.Args[1] 4105 if v_1.Op != OpARMSRAconst { 4106 break 4107 } 4108 c := v_1.AuxInt 4109 if x != v_1.Args[0] || !(c == d) { 4110 break 4111 } 4112 v.reset(OpARMMOVWconst) 4113 v.AuxInt = 0 4114 return true 4115 } 4116 return false 4117 } 4118 func rewriteValueARM_OpARMBICshiftRAreg_0(v *Value) bool { 4119 // match: (BICshiftRAreg x y (MOVWconst [c])) 4120 // result: (BICshiftRA x y [c]) 4121 for { 4122 _ = v.Args[2] 4123 x := v.Args[0] 4124 y := v.Args[1] 4125 v_2 := v.Args[2] 4126 if v_2.Op != OpARMMOVWconst { 4127 break 4128 } 4129 c := v_2.AuxInt 4130 v.reset(OpARMBICshiftRA) 4131 v.AuxInt = c 4132 v.AddArg(x) 4133 v.AddArg(y) 4134 return true 4135 } 4136 return false 4137 } 4138 func rewriteValueARM_OpARMBICshiftRL_0(v *Value) bool { 4139 // match: (BICshiftRL x (MOVWconst [c]) [d]) 4140 // result: (BICconst x [int64(int32(uint32(c)>>uint64(d)))]) 4141 for { 4142 d := v.AuxInt 4143 _ = v.Args[1] 4144 x := v.Args[0] 4145 v_1 := v.Args[1] 4146 if v_1.Op != OpARMMOVWconst { 4147 break 4148 } 4149 c := v_1.AuxInt 4150 v.reset(OpARMBICconst) 4151 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 4152 v.AddArg(x) 4153 return true 4154 } 4155 // match: (BICshiftRL x (SRLconst x [c]) [d]) 4156 // cond: c==d 4157 // result: (MOVWconst [0]) 4158 for { 4159 d := v.AuxInt 4160 _ = v.Args[1] 4161 x := v.Args[0] 4162 v_1 := v.Args[1] 4163 if v_1.Op != OpARMSRLconst { 4164 break 4165 } 4166 c := v_1.AuxInt 4167 if x != v_1.Args[0] || !(c == d) { 4168 break 4169 } 4170 v.reset(OpARMMOVWconst) 4171 v.AuxInt = 0 4172 return true 4173 } 4174 return false 4175 } 4176 func rewriteValueARM_OpARMBICshiftRLreg_0(v *Value) bool { 4177 // match: (BICshiftRLreg x y (MOVWconst [c])) 4178 // result: (BICshiftRL x y [c]) 4179 for { 4180 _ = v.Args[2] 4181 x := v.Args[0] 4182 y := v.Args[1] 4183 v_2 := v.Args[2] 4184 if v_2.Op != OpARMMOVWconst { 4185 break 4186 } 4187 c := v_2.AuxInt 4188 v.reset(OpARMBICshiftRL) 4189 v.AuxInt = c 4190 v.AddArg(x) 4191 v.AddArg(y) 4192 return true 4193 } 4194 return false 4195 } 4196 func rewriteValueARM_OpARMCMN_0(v *Value) bool { 4197 // match: (CMN x (MOVWconst [c])) 4198 // result: (CMNconst [c] x) 4199 for { 4200 _ = v.Args[1] 4201 x := v.Args[0] 4202 v_1 := v.Args[1] 4203 if v_1.Op != OpARMMOVWconst { 4204 break 4205 } 4206 c := v_1.AuxInt 4207 v.reset(OpARMCMNconst) 4208 v.AuxInt = c 4209 v.AddArg(x) 4210 return true 4211 } 4212 // match: (CMN (MOVWconst [c]) x) 4213 // result: (CMNconst [c] x) 4214 for { 4215 x := v.Args[1] 4216 v_0 := v.Args[0] 4217 if v_0.Op != OpARMMOVWconst { 4218 break 4219 } 4220 c := v_0.AuxInt 4221 v.reset(OpARMCMNconst) 4222 v.AuxInt = c 4223 v.AddArg(x) 4224 return true 4225 } 4226 // match: (CMN x (SLLconst [c] y)) 4227 // result: (CMNshiftLL x y [c]) 4228 for { 4229 _ = v.Args[1] 4230 x := v.Args[0] 4231 v_1 := v.Args[1] 4232 if v_1.Op != OpARMSLLconst { 4233 break 4234 } 4235 c := v_1.AuxInt 4236 y := v_1.Args[0] 4237 v.reset(OpARMCMNshiftLL) 4238 v.AuxInt = c 4239 v.AddArg(x) 4240 v.AddArg(y) 4241 return true 4242 } 4243 // match: (CMN (SLLconst [c] y) x) 4244 // result: (CMNshiftLL x y [c]) 4245 for { 4246 x := v.Args[1] 4247 v_0 := v.Args[0] 4248 if v_0.Op != OpARMSLLconst { 4249 break 4250 } 4251 c := v_0.AuxInt 4252 y := v_0.Args[0] 4253 v.reset(OpARMCMNshiftLL) 4254 v.AuxInt = c 4255 v.AddArg(x) 4256 v.AddArg(y) 4257 return true 4258 } 4259 // match: (CMN x (SRLconst [c] y)) 4260 // result: (CMNshiftRL x y [c]) 4261 for { 4262 _ = v.Args[1] 4263 x := v.Args[0] 4264 v_1 := v.Args[1] 4265 if v_1.Op != OpARMSRLconst { 4266 break 4267 } 4268 c := v_1.AuxInt 4269 y := v_1.Args[0] 4270 v.reset(OpARMCMNshiftRL) 4271 v.AuxInt = c 4272 v.AddArg(x) 4273 v.AddArg(y) 4274 return true 4275 } 4276 // match: (CMN (SRLconst [c] y) x) 4277 // result: (CMNshiftRL x y [c]) 4278 for { 4279 x := v.Args[1] 4280 v_0 := v.Args[0] 4281 if v_0.Op != OpARMSRLconst { 4282 break 4283 } 4284 c := v_0.AuxInt 4285 y := v_0.Args[0] 4286 v.reset(OpARMCMNshiftRL) 4287 v.AuxInt = c 4288 v.AddArg(x) 4289 v.AddArg(y) 4290 return true 4291 } 4292 // match: (CMN x (SRAconst [c] y)) 4293 // result: (CMNshiftRA x y [c]) 4294 for { 4295 _ = v.Args[1] 4296 x := v.Args[0] 4297 v_1 := v.Args[1] 4298 if v_1.Op != OpARMSRAconst { 4299 break 4300 } 4301 c := v_1.AuxInt 4302 y := v_1.Args[0] 4303 v.reset(OpARMCMNshiftRA) 4304 v.AuxInt = c 4305 v.AddArg(x) 4306 v.AddArg(y) 4307 return true 4308 } 4309 // match: (CMN (SRAconst [c] y) x) 4310 // result: (CMNshiftRA x y [c]) 4311 for { 4312 x := v.Args[1] 4313 v_0 := v.Args[0] 4314 if v_0.Op != OpARMSRAconst { 4315 break 4316 } 4317 c := v_0.AuxInt 4318 y := v_0.Args[0] 4319 v.reset(OpARMCMNshiftRA) 4320 v.AuxInt = c 4321 v.AddArg(x) 4322 v.AddArg(y) 4323 return true 4324 } 4325 // match: (CMN x (SLL y z)) 4326 // result: (CMNshiftLLreg x y z) 4327 for { 4328 _ = v.Args[1] 4329 x := v.Args[0] 4330 v_1 := v.Args[1] 4331 if v_1.Op != OpARMSLL { 4332 break 4333 } 4334 z := v_1.Args[1] 4335 y := v_1.Args[0] 4336 v.reset(OpARMCMNshiftLLreg) 4337 v.AddArg(x) 4338 v.AddArg(y) 4339 v.AddArg(z) 4340 return true 4341 } 4342 // match: (CMN (SLL y z) x) 4343 // result: (CMNshiftLLreg x y z) 4344 for { 4345 x := v.Args[1] 4346 v_0 := v.Args[0] 4347 if v_0.Op != OpARMSLL { 4348 break 4349 } 4350 z := v_0.Args[1] 4351 y := v_0.Args[0] 4352 v.reset(OpARMCMNshiftLLreg) 4353 v.AddArg(x) 4354 v.AddArg(y) 4355 v.AddArg(z) 4356 return true 4357 } 4358 return false 4359 } 4360 func rewriteValueARM_OpARMCMN_10(v *Value) bool { 4361 // match: (CMN x (SRL y z)) 4362 // result: (CMNshiftRLreg x y z) 4363 for { 4364 _ = v.Args[1] 4365 x := v.Args[0] 4366 v_1 := v.Args[1] 4367 if v_1.Op != OpARMSRL { 4368 break 4369 } 4370 z := v_1.Args[1] 4371 y := v_1.Args[0] 4372 v.reset(OpARMCMNshiftRLreg) 4373 v.AddArg(x) 4374 v.AddArg(y) 4375 v.AddArg(z) 4376 return true 4377 } 4378 // match: (CMN (SRL y z) x) 4379 // result: (CMNshiftRLreg x y z) 4380 for { 4381 x := v.Args[1] 4382 v_0 := v.Args[0] 4383 if v_0.Op != OpARMSRL { 4384 break 4385 } 4386 z := v_0.Args[1] 4387 y := v_0.Args[0] 4388 v.reset(OpARMCMNshiftRLreg) 4389 v.AddArg(x) 4390 v.AddArg(y) 4391 v.AddArg(z) 4392 return true 4393 } 4394 // match: (CMN x (SRA y z)) 4395 // result: (CMNshiftRAreg x y z) 4396 for { 4397 _ = v.Args[1] 4398 x := v.Args[0] 4399 v_1 := v.Args[1] 4400 if v_1.Op != OpARMSRA { 4401 break 4402 } 4403 z := v_1.Args[1] 4404 y := v_1.Args[0] 4405 v.reset(OpARMCMNshiftRAreg) 4406 v.AddArg(x) 4407 v.AddArg(y) 4408 v.AddArg(z) 4409 return true 4410 } 4411 // match: (CMN (SRA y z) x) 4412 // result: (CMNshiftRAreg x y z) 4413 for { 4414 x := v.Args[1] 4415 v_0 := v.Args[0] 4416 if v_0.Op != OpARMSRA { 4417 break 4418 } 4419 z := v_0.Args[1] 4420 y := v_0.Args[0] 4421 v.reset(OpARMCMNshiftRAreg) 4422 v.AddArg(x) 4423 v.AddArg(y) 4424 v.AddArg(z) 4425 return true 4426 } 4427 // match: (CMN x (RSBconst [0] y)) 4428 // result: (CMP x y) 4429 for { 4430 _ = v.Args[1] 4431 x := v.Args[0] 4432 v_1 := v.Args[1] 4433 if v_1.Op != OpARMRSBconst || v_1.AuxInt != 0 { 4434 break 4435 } 4436 y := v_1.Args[0] 4437 v.reset(OpARMCMP) 4438 v.AddArg(x) 4439 v.AddArg(y) 4440 return true 4441 } 4442 // match: (CMN (RSBconst [0] y) x) 4443 // result: (CMP x y) 4444 for { 4445 x := v.Args[1] 4446 v_0 := v.Args[0] 4447 if v_0.Op != OpARMRSBconst || v_0.AuxInt != 0 { 4448 break 4449 } 4450 y := v_0.Args[0] 4451 v.reset(OpARMCMP) 4452 v.AddArg(x) 4453 v.AddArg(y) 4454 return true 4455 } 4456 return false 4457 } 4458 func rewriteValueARM_OpARMCMNconst_0(v *Value) bool { 4459 // match: (CMNconst (MOVWconst [x]) [y]) 4460 // cond: int32(x)==int32(-y) 4461 // result: (FlagEQ) 4462 for { 4463 y := v.AuxInt 4464 v_0 := v.Args[0] 4465 if v_0.Op != OpARMMOVWconst { 4466 break 4467 } 4468 x := v_0.AuxInt 4469 if !(int32(x) == int32(-y)) { 4470 break 4471 } 4472 v.reset(OpARMFlagEQ) 4473 return true 4474 } 4475 // match: (CMNconst (MOVWconst [x]) [y]) 4476 // cond: int32(x)<int32(-y) && uint32(x)<uint32(-y) 4477 // result: (FlagLT_ULT) 4478 for { 4479 y := v.AuxInt 4480 v_0 := v.Args[0] 4481 if v_0.Op != OpARMMOVWconst { 4482 break 4483 } 4484 x := v_0.AuxInt 4485 if !(int32(x) < int32(-y) && uint32(x) < uint32(-y)) { 4486 break 4487 } 4488 v.reset(OpARMFlagLT_ULT) 4489 return true 4490 } 4491 // match: (CMNconst (MOVWconst [x]) [y]) 4492 // cond: int32(x)<int32(-y) && uint32(x)>uint32(-y) 4493 // result: (FlagLT_UGT) 4494 for { 4495 y := v.AuxInt 4496 v_0 := v.Args[0] 4497 if v_0.Op != OpARMMOVWconst { 4498 break 4499 } 4500 x := v_0.AuxInt 4501 if !(int32(x) < int32(-y) && uint32(x) > uint32(-y)) { 4502 break 4503 } 4504 v.reset(OpARMFlagLT_UGT) 4505 return true 4506 } 4507 // match: (CMNconst (MOVWconst [x]) [y]) 4508 // cond: int32(x)>int32(-y) && uint32(x)<uint32(-y) 4509 // result: (FlagGT_ULT) 4510 for { 4511 y := v.AuxInt 4512 v_0 := v.Args[0] 4513 if v_0.Op != OpARMMOVWconst { 4514 break 4515 } 4516 x := v_0.AuxInt 4517 if !(int32(x) > int32(-y) && uint32(x) < uint32(-y)) { 4518 break 4519 } 4520 v.reset(OpARMFlagGT_ULT) 4521 return true 4522 } 4523 // match: (CMNconst (MOVWconst [x]) [y]) 4524 // cond: int32(x)>int32(-y) && uint32(x)>uint32(-y) 4525 // result: (FlagGT_UGT) 4526 for { 4527 y := v.AuxInt 4528 v_0 := v.Args[0] 4529 if v_0.Op != OpARMMOVWconst { 4530 break 4531 } 4532 x := v_0.AuxInt 4533 if !(int32(x) > int32(-y) && uint32(x) > uint32(-y)) { 4534 break 4535 } 4536 v.reset(OpARMFlagGT_UGT) 4537 return true 4538 } 4539 return false 4540 } 4541 func rewriteValueARM_OpARMCMNshiftLL_0(v *Value) bool { 4542 b := v.Block 4543 // match: (CMNshiftLL (MOVWconst [c]) x [d]) 4544 // result: (CMNconst [c] (SLLconst <x.Type> x [d])) 4545 for { 4546 d := v.AuxInt 4547 x := v.Args[1] 4548 v_0 := v.Args[0] 4549 if v_0.Op != OpARMMOVWconst { 4550 break 4551 } 4552 c := v_0.AuxInt 4553 v.reset(OpARMCMNconst) 4554 v.AuxInt = c 4555 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 4556 v0.AuxInt = d 4557 v0.AddArg(x) 4558 v.AddArg(v0) 4559 return true 4560 } 4561 // match: (CMNshiftLL x (MOVWconst [c]) [d]) 4562 // result: (CMNconst x [int64(int32(uint32(c)<<uint64(d)))]) 4563 for { 4564 d := v.AuxInt 4565 _ = v.Args[1] 4566 x := v.Args[0] 4567 v_1 := v.Args[1] 4568 if v_1.Op != OpARMMOVWconst { 4569 break 4570 } 4571 c := v_1.AuxInt 4572 v.reset(OpARMCMNconst) 4573 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 4574 v.AddArg(x) 4575 return true 4576 } 4577 return false 4578 } 4579 func rewriteValueARM_OpARMCMNshiftLLreg_0(v *Value) bool { 4580 b := v.Block 4581 // match: (CMNshiftLLreg (MOVWconst [c]) x y) 4582 // result: (CMNconst [c] (SLL <x.Type> x y)) 4583 for { 4584 y := v.Args[2] 4585 v_0 := v.Args[0] 4586 if v_0.Op != OpARMMOVWconst { 4587 break 4588 } 4589 c := v_0.AuxInt 4590 x := v.Args[1] 4591 v.reset(OpARMCMNconst) 4592 v.AuxInt = c 4593 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 4594 v0.AddArg(x) 4595 v0.AddArg(y) 4596 v.AddArg(v0) 4597 return true 4598 } 4599 // match: (CMNshiftLLreg x y (MOVWconst [c])) 4600 // result: (CMNshiftLL x y [c]) 4601 for { 4602 _ = v.Args[2] 4603 x := v.Args[0] 4604 y := v.Args[1] 4605 v_2 := v.Args[2] 4606 if v_2.Op != OpARMMOVWconst { 4607 break 4608 } 4609 c := v_2.AuxInt 4610 v.reset(OpARMCMNshiftLL) 4611 v.AuxInt = c 4612 v.AddArg(x) 4613 v.AddArg(y) 4614 return true 4615 } 4616 return false 4617 } 4618 func rewriteValueARM_OpARMCMNshiftRA_0(v *Value) bool { 4619 b := v.Block 4620 // match: (CMNshiftRA (MOVWconst [c]) x [d]) 4621 // result: (CMNconst [c] (SRAconst <x.Type> x [d])) 4622 for { 4623 d := v.AuxInt 4624 x := v.Args[1] 4625 v_0 := v.Args[0] 4626 if v_0.Op != OpARMMOVWconst { 4627 break 4628 } 4629 c := v_0.AuxInt 4630 v.reset(OpARMCMNconst) 4631 v.AuxInt = c 4632 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 4633 v0.AuxInt = d 4634 v0.AddArg(x) 4635 v.AddArg(v0) 4636 return true 4637 } 4638 // match: (CMNshiftRA x (MOVWconst [c]) [d]) 4639 // result: (CMNconst x [int64(int32(c)>>uint64(d))]) 4640 for { 4641 d := v.AuxInt 4642 _ = v.Args[1] 4643 x := v.Args[0] 4644 v_1 := v.Args[1] 4645 if v_1.Op != OpARMMOVWconst { 4646 break 4647 } 4648 c := v_1.AuxInt 4649 v.reset(OpARMCMNconst) 4650 v.AuxInt = int64(int32(c) >> uint64(d)) 4651 v.AddArg(x) 4652 return true 4653 } 4654 return false 4655 } 4656 func rewriteValueARM_OpARMCMNshiftRAreg_0(v *Value) bool { 4657 b := v.Block 4658 // match: (CMNshiftRAreg (MOVWconst [c]) x y) 4659 // result: (CMNconst [c] (SRA <x.Type> x y)) 4660 for { 4661 y := v.Args[2] 4662 v_0 := v.Args[0] 4663 if v_0.Op != OpARMMOVWconst { 4664 break 4665 } 4666 c := v_0.AuxInt 4667 x := v.Args[1] 4668 v.reset(OpARMCMNconst) 4669 v.AuxInt = c 4670 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 4671 v0.AddArg(x) 4672 v0.AddArg(y) 4673 v.AddArg(v0) 4674 return true 4675 } 4676 // match: (CMNshiftRAreg x y (MOVWconst [c])) 4677 // result: (CMNshiftRA x y [c]) 4678 for { 4679 _ = v.Args[2] 4680 x := v.Args[0] 4681 y := v.Args[1] 4682 v_2 := v.Args[2] 4683 if v_2.Op != OpARMMOVWconst { 4684 break 4685 } 4686 c := v_2.AuxInt 4687 v.reset(OpARMCMNshiftRA) 4688 v.AuxInt = c 4689 v.AddArg(x) 4690 v.AddArg(y) 4691 return true 4692 } 4693 return false 4694 } 4695 func rewriteValueARM_OpARMCMNshiftRL_0(v *Value) bool { 4696 b := v.Block 4697 // match: (CMNshiftRL (MOVWconst [c]) x [d]) 4698 // result: (CMNconst [c] (SRLconst <x.Type> x [d])) 4699 for { 4700 d := v.AuxInt 4701 x := v.Args[1] 4702 v_0 := v.Args[0] 4703 if v_0.Op != OpARMMOVWconst { 4704 break 4705 } 4706 c := v_0.AuxInt 4707 v.reset(OpARMCMNconst) 4708 v.AuxInt = c 4709 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 4710 v0.AuxInt = d 4711 v0.AddArg(x) 4712 v.AddArg(v0) 4713 return true 4714 } 4715 // match: (CMNshiftRL x (MOVWconst [c]) [d]) 4716 // result: (CMNconst x [int64(int32(uint32(c)>>uint64(d)))]) 4717 for { 4718 d := v.AuxInt 4719 _ = v.Args[1] 4720 x := v.Args[0] 4721 v_1 := v.Args[1] 4722 if v_1.Op != OpARMMOVWconst { 4723 break 4724 } 4725 c := v_1.AuxInt 4726 v.reset(OpARMCMNconst) 4727 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 4728 v.AddArg(x) 4729 return true 4730 } 4731 return false 4732 } 4733 func rewriteValueARM_OpARMCMNshiftRLreg_0(v *Value) bool { 4734 b := v.Block 4735 // match: (CMNshiftRLreg (MOVWconst [c]) x y) 4736 // result: (CMNconst [c] (SRL <x.Type> x y)) 4737 for { 4738 y := v.Args[2] 4739 v_0 := v.Args[0] 4740 if v_0.Op != OpARMMOVWconst { 4741 break 4742 } 4743 c := v_0.AuxInt 4744 x := v.Args[1] 4745 v.reset(OpARMCMNconst) 4746 v.AuxInt = c 4747 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 4748 v0.AddArg(x) 4749 v0.AddArg(y) 4750 v.AddArg(v0) 4751 return true 4752 } 4753 // match: (CMNshiftRLreg x y (MOVWconst [c])) 4754 // result: (CMNshiftRL x y [c]) 4755 for { 4756 _ = v.Args[2] 4757 x := v.Args[0] 4758 y := v.Args[1] 4759 v_2 := v.Args[2] 4760 if v_2.Op != OpARMMOVWconst { 4761 break 4762 } 4763 c := v_2.AuxInt 4764 v.reset(OpARMCMNshiftRL) 4765 v.AuxInt = c 4766 v.AddArg(x) 4767 v.AddArg(y) 4768 return true 4769 } 4770 return false 4771 } 4772 func rewriteValueARM_OpARMCMOVWHSconst_0(v *Value) bool { 4773 // match: (CMOVWHSconst _ (FlagEQ) [c]) 4774 // result: (MOVWconst [c]) 4775 for { 4776 c := v.AuxInt 4777 _ = v.Args[1] 4778 v_1 := v.Args[1] 4779 if v_1.Op != OpARMFlagEQ { 4780 break 4781 } 4782 v.reset(OpARMMOVWconst) 4783 v.AuxInt = c 4784 return true 4785 } 4786 // match: (CMOVWHSconst x (FlagLT_ULT)) 4787 // result: x 4788 for { 4789 _ = v.Args[1] 4790 x := v.Args[0] 4791 v_1 := v.Args[1] 4792 if v_1.Op != OpARMFlagLT_ULT { 4793 break 4794 } 4795 v.reset(OpCopy) 4796 v.Type = x.Type 4797 v.AddArg(x) 4798 return true 4799 } 4800 // match: (CMOVWHSconst _ (FlagLT_UGT) [c]) 4801 // result: (MOVWconst [c]) 4802 for { 4803 c := v.AuxInt 4804 _ = v.Args[1] 4805 v_1 := v.Args[1] 4806 if v_1.Op != OpARMFlagLT_UGT { 4807 break 4808 } 4809 v.reset(OpARMMOVWconst) 4810 v.AuxInt = c 4811 return true 4812 } 4813 // match: (CMOVWHSconst x (FlagGT_ULT)) 4814 // result: x 4815 for { 4816 _ = v.Args[1] 4817 x := v.Args[0] 4818 v_1 := v.Args[1] 4819 if v_1.Op != OpARMFlagGT_ULT { 4820 break 4821 } 4822 v.reset(OpCopy) 4823 v.Type = x.Type 4824 v.AddArg(x) 4825 return true 4826 } 4827 // match: (CMOVWHSconst _ (FlagGT_UGT) [c]) 4828 // result: (MOVWconst [c]) 4829 for { 4830 c := v.AuxInt 4831 _ = v.Args[1] 4832 v_1 := v.Args[1] 4833 if v_1.Op != OpARMFlagGT_UGT { 4834 break 4835 } 4836 v.reset(OpARMMOVWconst) 4837 v.AuxInt = c 4838 return true 4839 } 4840 // match: (CMOVWHSconst x (InvertFlags flags) [c]) 4841 // result: (CMOVWLSconst x flags [c]) 4842 for { 4843 c := v.AuxInt 4844 _ = v.Args[1] 4845 x := v.Args[0] 4846 v_1 := v.Args[1] 4847 if v_1.Op != OpARMInvertFlags { 4848 break 4849 } 4850 flags := v_1.Args[0] 4851 v.reset(OpARMCMOVWLSconst) 4852 v.AuxInt = c 4853 v.AddArg(x) 4854 v.AddArg(flags) 4855 return true 4856 } 4857 return false 4858 } 4859 func rewriteValueARM_OpARMCMOVWLSconst_0(v *Value) bool { 4860 // match: (CMOVWLSconst _ (FlagEQ) [c]) 4861 // result: (MOVWconst [c]) 4862 for { 4863 c := v.AuxInt 4864 _ = v.Args[1] 4865 v_1 := v.Args[1] 4866 if v_1.Op != OpARMFlagEQ { 4867 break 4868 } 4869 v.reset(OpARMMOVWconst) 4870 v.AuxInt = c 4871 return true 4872 } 4873 // match: (CMOVWLSconst _ (FlagLT_ULT) [c]) 4874 // result: (MOVWconst [c]) 4875 for { 4876 c := v.AuxInt 4877 _ = v.Args[1] 4878 v_1 := v.Args[1] 4879 if v_1.Op != OpARMFlagLT_ULT { 4880 break 4881 } 4882 v.reset(OpARMMOVWconst) 4883 v.AuxInt = c 4884 return true 4885 } 4886 // match: (CMOVWLSconst x (FlagLT_UGT)) 4887 // result: x 4888 for { 4889 _ = v.Args[1] 4890 x := v.Args[0] 4891 v_1 := v.Args[1] 4892 if v_1.Op != OpARMFlagLT_UGT { 4893 break 4894 } 4895 v.reset(OpCopy) 4896 v.Type = x.Type 4897 v.AddArg(x) 4898 return true 4899 } 4900 // match: (CMOVWLSconst _ (FlagGT_ULT) [c]) 4901 // result: (MOVWconst [c]) 4902 for { 4903 c := v.AuxInt 4904 _ = v.Args[1] 4905 v_1 := v.Args[1] 4906 if v_1.Op != OpARMFlagGT_ULT { 4907 break 4908 } 4909 v.reset(OpARMMOVWconst) 4910 v.AuxInt = c 4911 return true 4912 } 4913 // match: (CMOVWLSconst x (FlagGT_UGT)) 4914 // result: x 4915 for { 4916 _ = v.Args[1] 4917 x := v.Args[0] 4918 v_1 := v.Args[1] 4919 if v_1.Op != OpARMFlagGT_UGT { 4920 break 4921 } 4922 v.reset(OpCopy) 4923 v.Type = x.Type 4924 v.AddArg(x) 4925 return true 4926 } 4927 // match: (CMOVWLSconst x (InvertFlags flags) [c]) 4928 // result: (CMOVWHSconst x flags [c]) 4929 for { 4930 c := v.AuxInt 4931 _ = v.Args[1] 4932 x := v.Args[0] 4933 v_1 := v.Args[1] 4934 if v_1.Op != OpARMInvertFlags { 4935 break 4936 } 4937 flags := v_1.Args[0] 4938 v.reset(OpARMCMOVWHSconst) 4939 v.AuxInt = c 4940 v.AddArg(x) 4941 v.AddArg(flags) 4942 return true 4943 } 4944 return false 4945 } 4946 func rewriteValueARM_OpARMCMP_0(v *Value) bool { 4947 b := v.Block 4948 // match: (CMP x (MOVWconst [c])) 4949 // result: (CMPconst [c] x) 4950 for { 4951 _ = v.Args[1] 4952 x := v.Args[0] 4953 v_1 := v.Args[1] 4954 if v_1.Op != OpARMMOVWconst { 4955 break 4956 } 4957 c := v_1.AuxInt 4958 v.reset(OpARMCMPconst) 4959 v.AuxInt = c 4960 v.AddArg(x) 4961 return true 4962 } 4963 // match: (CMP (MOVWconst [c]) x) 4964 // result: (InvertFlags (CMPconst [c] x)) 4965 for { 4966 x := v.Args[1] 4967 v_0 := v.Args[0] 4968 if v_0.Op != OpARMMOVWconst { 4969 break 4970 } 4971 c := v_0.AuxInt 4972 v.reset(OpARMInvertFlags) 4973 v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 4974 v0.AuxInt = c 4975 v0.AddArg(x) 4976 v.AddArg(v0) 4977 return true 4978 } 4979 // match: (CMP x (SLLconst [c] y)) 4980 // result: (CMPshiftLL x y [c]) 4981 for { 4982 _ = v.Args[1] 4983 x := v.Args[0] 4984 v_1 := v.Args[1] 4985 if v_1.Op != OpARMSLLconst { 4986 break 4987 } 4988 c := v_1.AuxInt 4989 y := v_1.Args[0] 4990 v.reset(OpARMCMPshiftLL) 4991 v.AuxInt = c 4992 v.AddArg(x) 4993 v.AddArg(y) 4994 return true 4995 } 4996 // match: (CMP (SLLconst [c] y) x) 4997 // result: (InvertFlags (CMPshiftLL x y [c])) 4998 for { 4999 x := v.Args[1] 5000 v_0 := v.Args[0] 5001 if v_0.Op != OpARMSLLconst { 5002 break 5003 } 5004 c := v_0.AuxInt 5005 y := v_0.Args[0] 5006 v.reset(OpARMInvertFlags) 5007 v0 := b.NewValue0(v.Pos, OpARMCMPshiftLL, types.TypeFlags) 5008 v0.AuxInt = c 5009 v0.AddArg(x) 5010 v0.AddArg(y) 5011 v.AddArg(v0) 5012 return true 5013 } 5014 // match: (CMP x (SRLconst [c] y)) 5015 // result: (CMPshiftRL x y [c]) 5016 for { 5017 _ = v.Args[1] 5018 x := v.Args[0] 5019 v_1 := v.Args[1] 5020 if v_1.Op != OpARMSRLconst { 5021 break 5022 } 5023 c := v_1.AuxInt 5024 y := v_1.Args[0] 5025 v.reset(OpARMCMPshiftRL) 5026 v.AuxInt = c 5027 v.AddArg(x) 5028 v.AddArg(y) 5029 return true 5030 } 5031 // match: (CMP (SRLconst [c] y) x) 5032 // result: (InvertFlags (CMPshiftRL x y [c])) 5033 for { 5034 x := v.Args[1] 5035 v_0 := v.Args[0] 5036 if v_0.Op != OpARMSRLconst { 5037 break 5038 } 5039 c := v_0.AuxInt 5040 y := v_0.Args[0] 5041 v.reset(OpARMInvertFlags) 5042 v0 := b.NewValue0(v.Pos, OpARMCMPshiftRL, types.TypeFlags) 5043 v0.AuxInt = c 5044 v0.AddArg(x) 5045 v0.AddArg(y) 5046 v.AddArg(v0) 5047 return true 5048 } 5049 // match: (CMP x (SRAconst [c] y)) 5050 // result: (CMPshiftRA x y [c]) 5051 for { 5052 _ = v.Args[1] 5053 x := v.Args[0] 5054 v_1 := v.Args[1] 5055 if v_1.Op != OpARMSRAconst { 5056 break 5057 } 5058 c := v_1.AuxInt 5059 y := v_1.Args[0] 5060 v.reset(OpARMCMPshiftRA) 5061 v.AuxInt = c 5062 v.AddArg(x) 5063 v.AddArg(y) 5064 return true 5065 } 5066 // match: (CMP (SRAconst [c] y) x) 5067 // result: (InvertFlags (CMPshiftRA x y [c])) 5068 for { 5069 x := v.Args[1] 5070 v_0 := v.Args[0] 5071 if v_0.Op != OpARMSRAconst { 5072 break 5073 } 5074 c := v_0.AuxInt 5075 y := v_0.Args[0] 5076 v.reset(OpARMInvertFlags) 5077 v0 := b.NewValue0(v.Pos, OpARMCMPshiftRA, types.TypeFlags) 5078 v0.AuxInt = c 5079 v0.AddArg(x) 5080 v0.AddArg(y) 5081 v.AddArg(v0) 5082 return true 5083 } 5084 // match: (CMP x (SLL y z)) 5085 // result: (CMPshiftLLreg x y z) 5086 for { 5087 _ = v.Args[1] 5088 x := v.Args[0] 5089 v_1 := v.Args[1] 5090 if v_1.Op != OpARMSLL { 5091 break 5092 } 5093 z := v_1.Args[1] 5094 y := v_1.Args[0] 5095 v.reset(OpARMCMPshiftLLreg) 5096 v.AddArg(x) 5097 v.AddArg(y) 5098 v.AddArg(z) 5099 return true 5100 } 5101 // match: (CMP (SLL y z) x) 5102 // result: (InvertFlags (CMPshiftLLreg x y z)) 5103 for { 5104 x := v.Args[1] 5105 v_0 := v.Args[0] 5106 if v_0.Op != OpARMSLL { 5107 break 5108 } 5109 z := v_0.Args[1] 5110 y := v_0.Args[0] 5111 v.reset(OpARMInvertFlags) 5112 v0 := b.NewValue0(v.Pos, OpARMCMPshiftLLreg, types.TypeFlags) 5113 v0.AddArg(x) 5114 v0.AddArg(y) 5115 v0.AddArg(z) 5116 v.AddArg(v0) 5117 return true 5118 } 5119 return false 5120 } 5121 func rewriteValueARM_OpARMCMP_10(v *Value) bool { 5122 b := v.Block 5123 // match: (CMP x (SRL y z)) 5124 // result: (CMPshiftRLreg x y z) 5125 for { 5126 _ = v.Args[1] 5127 x := v.Args[0] 5128 v_1 := v.Args[1] 5129 if v_1.Op != OpARMSRL { 5130 break 5131 } 5132 z := v_1.Args[1] 5133 y := v_1.Args[0] 5134 v.reset(OpARMCMPshiftRLreg) 5135 v.AddArg(x) 5136 v.AddArg(y) 5137 v.AddArg(z) 5138 return true 5139 } 5140 // match: (CMP (SRL y z) x) 5141 // result: (InvertFlags (CMPshiftRLreg x y z)) 5142 for { 5143 x := v.Args[1] 5144 v_0 := v.Args[0] 5145 if v_0.Op != OpARMSRL { 5146 break 5147 } 5148 z := v_0.Args[1] 5149 y := v_0.Args[0] 5150 v.reset(OpARMInvertFlags) 5151 v0 := b.NewValue0(v.Pos, OpARMCMPshiftRLreg, types.TypeFlags) 5152 v0.AddArg(x) 5153 v0.AddArg(y) 5154 v0.AddArg(z) 5155 v.AddArg(v0) 5156 return true 5157 } 5158 // match: (CMP x (SRA y z)) 5159 // result: (CMPshiftRAreg x y z) 5160 for { 5161 _ = v.Args[1] 5162 x := v.Args[0] 5163 v_1 := v.Args[1] 5164 if v_1.Op != OpARMSRA { 5165 break 5166 } 5167 z := v_1.Args[1] 5168 y := v_1.Args[0] 5169 v.reset(OpARMCMPshiftRAreg) 5170 v.AddArg(x) 5171 v.AddArg(y) 5172 v.AddArg(z) 5173 return true 5174 } 5175 // match: (CMP (SRA y z) x) 5176 // result: (InvertFlags (CMPshiftRAreg x y z)) 5177 for { 5178 x := v.Args[1] 5179 v_0 := v.Args[0] 5180 if v_0.Op != OpARMSRA { 5181 break 5182 } 5183 z := v_0.Args[1] 5184 y := v_0.Args[0] 5185 v.reset(OpARMInvertFlags) 5186 v0 := b.NewValue0(v.Pos, OpARMCMPshiftRAreg, types.TypeFlags) 5187 v0.AddArg(x) 5188 v0.AddArg(y) 5189 v0.AddArg(z) 5190 v.AddArg(v0) 5191 return true 5192 } 5193 // match: (CMP x (RSBconst [0] y)) 5194 // result: (CMN x y) 5195 for { 5196 _ = v.Args[1] 5197 x := v.Args[0] 5198 v_1 := v.Args[1] 5199 if v_1.Op != OpARMRSBconst || v_1.AuxInt != 0 { 5200 break 5201 } 5202 y := v_1.Args[0] 5203 v.reset(OpARMCMN) 5204 v.AddArg(x) 5205 v.AddArg(y) 5206 return true 5207 } 5208 return false 5209 } 5210 func rewriteValueARM_OpARMCMPD_0(v *Value) bool { 5211 // match: (CMPD x (MOVDconst [0])) 5212 // result: (CMPD0 x) 5213 for { 5214 _ = v.Args[1] 5215 x := v.Args[0] 5216 v_1 := v.Args[1] 5217 if v_1.Op != OpARMMOVDconst || v_1.AuxInt != 0 { 5218 break 5219 } 5220 v.reset(OpARMCMPD0) 5221 v.AddArg(x) 5222 return true 5223 } 5224 return false 5225 } 5226 func rewriteValueARM_OpARMCMPF_0(v *Value) bool { 5227 // match: (CMPF x (MOVFconst [0])) 5228 // result: (CMPF0 x) 5229 for { 5230 _ = v.Args[1] 5231 x := v.Args[0] 5232 v_1 := v.Args[1] 5233 if v_1.Op != OpARMMOVFconst || v_1.AuxInt != 0 { 5234 break 5235 } 5236 v.reset(OpARMCMPF0) 5237 v.AddArg(x) 5238 return true 5239 } 5240 return false 5241 } 5242 func rewriteValueARM_OpARMCMPconst_0(v *Value) bool { 5243 // match: (CMPconst (MOVWconst [x]) [y]) 5244 // cond: int32(x)==int32(y) 5245 // result: (FlagEQ) 5246 for { 5247 y := v.AuxInt 5248 v_0 := v.Args[0] 5249 if v_0.Op != OpARMMOVWconst { 5250 break 5251 } 5252 x := v_0.AuxInt 5253 if !(int32(x) == int32(y)) { 5254 break 5255 } 5256 v.reset(OpARMFlagEQ) 5257 return true 5258 } 5259 // match: (CMPconst (MOVWconst [x]) [y]) 5260 // cond: int32(x)<int32(y) && uint32(x)<uint32(y) 5261 // result: (FlagLT_ULT) 5262 for { 5263 y := v.AuxInt 5264 v_0 := v.Args[0] 5265 if v_0.Op != OpARMMOVWconst { 5266 break 5267 } 5268 x := v_0.AuxInt 5269 if !(int32(x) < int32(y) && uint32(x) < uint32(y)) { 5270 break 5271 } 5272 v.reset(OpARMFlagLT_ULT) 5273 return true 5274 } 5275 // match: (CMPconst (MOVWconst [x]) [y]) 5276 // cond: int32(x)<int32(y) && uint32(x)>uint32(y) 5277 // result: (FlagLT_UGT) 5278 for { 5279 y := v.AuxInt 5280 v_0 := v.Args[0] 5281 if v_0.Op != OpARMMOVWconst { 5282 break 5283 } 5284 x := v_0.AuxInt 5285 if !(int32(x) < int32(y) && uint32(x) > uint32(y)) { 5286 break 5287 } 5288 v.reset(OpARMFlagLT_UGT) 5289 return true 5290 } 5291 // match: (CMPconst (MOVWconst [x]) [y]) 5292 // cond: int32(x)>int32(y) && uint32(x)<uint32(y) 5293 // result: (FlagGT_ULT) 5294 for { 5295 y := v.AuxInt 5296 v_0 := v.Args[0] 5297 if v_0.Op != OpARMMOVWconst { 5298 break 5299 } 5300 x := v_0.AuxInt 5301 if !(int32(x) > int32(y) && uint32(x) < uint32(y)) { 5302 break 5303 } 5304 v.reset(OpARMFlagGT_ULT) 5305 return true 5306 } 5307 // match: (CMPconst (MOVWconst [x]) [y]) 5308 // cond: int32(x)>int32(y) && uint32(x)>uint32(y) 5309 // result: (FlagGT_UGT) 5310 for { 5311 y := v.AuxInt 5312 v_0 := v.Args[0] 5313 if v_0.Op != OpARMMOVWconst { 5314 break 5315 } 5316 x := v_0.AuxInt 5317 if !(int32(x) > int32(y) && uint32(x) > uint32(y)) { 5318 break 5319 } 5320 v.reset(OpARMFlagGT_UGT) 5321 return true 5322 } 5323 // match: (CMPconst (MOVBUreg _) [c]) 5324 // cond: 0xff < c 5325 // result: (FlagLT_ULT) 5326 for { 5327 c := v.AuxInt 5328 v_0 := v.Args[0] 5329 if v_0.Op != OpARMMOVBUreg || !(0xff < c) { 5330 break 5331 } 5332 v.reset(OpARMFlagLT_ULT) 5333 return true 5334 } 5335 // match: (CMPconst (MOVHUreg _) [c]) 5336 // cond: 0xffff < c 5337 // result: (FlagLT_ULT) 5338 for { 5339 c := v.AuxInt 5340 v_0 := v.Args[0] 5341 if v_0.Op != OpARMMOVHUreg || !(0xffff < c) { 5342 break 5343 } 5344 v.reset(OpARMFlagLT_ULT) 5345 return true 5346 } 5347 // match: (CMPconst (ANDconst _ [m]) [n]) 5348 // cond: 0 <= int32(m) && int32(m) < int32(n) 5349 // result: (FlagLT_ULT) 5350 for { 5351 n := v.AuxInt 5352 v_0 := v.Args[0] 5353 if v_0.Op != OpARMANDconst { 5354 break 5355 } 5356 m := v_0.AuxInt 5357 if !(0 <= int32(m) && int32(m) < int32(n)) { 5358 break 5359 } 5360 v.reset(OpARMFlagLT_ULT) 5361 return true 5362 } 5363 // match: (CMPconst (SRLconst _ [c]) [n]) 5364 // cond: 0 <= n && 0 < c && c <= 32 && (1<<uint32(32-c)) <= uint32(n) 5365 // result: (FlagLT_ULT) 5366 for { 5367 n := v.AuxInt 5368 v_0 := v.Args[0] 5369 if v_0.Op != OpARMSRLconst { 5370 break 5371 } 5372 c := v_0.AuxInt 5373 if !(0 <= n && 0 < c && c <= 32 && (1<<uint32(32-c)) <= uint32(n)) { 5374 break 5375 } 5376 v.reset(OpARMFlagLT_ULT) 5377 return true 5378 } 5379 return false 5380 } 5381 func rewriteValueARM_OpARMCMPshiftLL_0(v *Value) bool { 5382 b := v.Block 5383 // match: (CMPshiftLL (MOVWconst [c]) x [d]) 5384 // result: (InvertFlags (CMPconst [c] (SLLconst <x.Type> x [d]))) 5385 for { 5386 d := v.AuxInt 5387 x := v.Args[1] 5388 v_0 := v.Args[0] 5389 if v_0.Op != OpARMMOVWconst { 5390 break 5391 } 5392 c := v_0.AuxInt 5393 v.reset(OpARMInvertFlags) 5394 v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 5395 v0.AuxInt = c 5396 v1 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 5397 v1.AuxInt = d 5398 v1.AddArg(x) 5399 v0.AddArg(v1) 5400 v.AddArg(v0) 5401 return true 5402 } 5403 // match: (CMPshiftLL x (MOVWconst [c]) [d]) 5404 // result: (CMPconst x [int64(int32(uint32(c)<<uint64(d)))]) 5405 for { 5406 d := v.AuxInt 5407 _ = v.Args[1] 5408 x := v.Args[0] 5409 v_1 := v.Args[1] 5410 if v_1.Op != OpARMMOVWconst { 5411 break 5412 } 5413 c := v_1.AuxInt 5414 v.reset(OpARMCMPconst) 5415 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 5416 v.AddArg(x) 5417 return true 5418 } 5419 return false 5420 } 5421 func rewriteValueARM_OpARMCMPshiftLLreg_0(v *Value) bool { 5422 b := v.Block 5423 // match: (CMPshiftLLreg (MOVWconst [c]) x y) 5424 // result: (InvertFlags (CMPconst [c] (SLL <x.Type> x y))) 5425 for { 5426 y := v.Args[2] 5427 v_0 := v.Args[0] 5428 if v_0.Op != OpARMMOVWconst { 5429 break 5430 } 5431 c := v_0.AuxInt 5432 x := v.Args[1] 5433 v.reset(OpARMInvertFlags) 5434 v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 5435 v0.AuxInt = c 5436 v1 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 5437 v1.AddArg(x) 5438 v1.AddArg(y) 5439 v0.AddArg(v1) 5440 v.AddArg(v0) 5441 return true 5442 } 5443 // match: (CMPshiftLLreg x y (MOVWconst [c])) 5444 // result: (CMPshiftLL x y [c]) 5445 for { 5446 _ = v.Args[2] 5447 x := v.Args[0] 5448 y := v.Args[1] 5449 v_2 := v.Args[2] 5450 if v_2.Op != OpARMMOVWconst { 5451 break 5452 } 5453 c := v_2.AuxInt 5454 v.reset(OpARMCMPshiftLL) 5455 v.AuxInt = c 5456 v.AddArg(x) 5457 v.AddArg(y) 5458 return true 5459 } 5460 return false 5461 } 5462 func rewriteValueARM_OpARMCMPshiftRA_0(v *Value) bool { 5463 b := v.Block 5464 // match: (CMPshiftRA (MOVWconst [c]) x [d]) 5465 // result: (InvertFlags (CMPconst [c] (SRAconst <x.Type> x [d]))) 5466 for { 5467 d := v.AuxInt 5468 x := v.Args[1] 5469 v_0 := v.Args[0] 5470 if v_0.Op != OpARMMOVWconst { 5471 break 5472 } 5473 c := v_0.AuxInt 5474 v.reset(OpARMInvertFlags) 5475 v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 5476 v0.AuxInt = c 5477 v1 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 5478 v1.AuxInt = d 5479 v1.AddArg(x) 5480 v0.AddArg(v1) 5481 v.AddArg(v0) 5482 return true 5483 } 5484 // match: (CMPshiftRA x (MOVWconst [c]) [d]) 5485 // result: (CMPconst x [int64(int32(c)>>uint64(d))]) 5486 for { 5487 d := v.AuxInt 5488 _ = v.Args[1] 5489 x := v.Args[0] 5490 v_1 := v.Args[1] 5491 if v_1.Op != OpARMMOVWconst { 5492 break 5493 } 5494 c := v_1.AuxInt 5495 v.reset(OpARMCMPconst) 5496 v.AuxInt = int64(int32(c) >> uint64(d)) 5497 v.AddArg(x) 5498 return true 5499 } 5500 return false 5501 } 5502 func rewriteValueARM_OpARMCMPshiftRAreg_0(v *Value) bool { 5503 b := v.Block 5504 // match: (CMPshiftRAreg (MOVWconst [c]) x y) 5505 // result: (InvertFlags (CMPconst [c] (SRA <x.Type> x y))) 5506 for { 5507 y := v.Args[2] 5508 v_0 := v.Args[0] 5509 if v_0.Op != OpARMMOVWconst { 5510 break 5511 } 5512 c := v_0.AuxInt 5513 x := v.Args[1] 5514 v.reset(OpARMInvertFlags) 5515 v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 5516 v0.AuxInt = c 5517 v1 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 5518 v1.AddArg(x) 5519 v1.AddArg(y) 5520 v0.AddArg(v1) 5521 v.AddArg(v0) 5522 return true 5523 } 5524 // match: (CMPshiftRAreg x y (MOVWconst [c])) 5525 // result: (CMPshiftRA x y [c]) 5526 for { 5527 _ = v.Args[2] 5528 x := v.Args[0] 5529 y := v.Args[1] 5530 v_2 := v.Args[2] 5531 if v_2.Op != OpARMMOVWconst { 5532 break 5533 } 5534 c := v_2.AuxInt 5535 v.reset(OpARMCMPshiftRA) 5536 v.AuxInt = c 5537 v.AddArg(x) 5538 v.AddArg(y) 5539 return true 5540 } 5541 return false 5542 } 5543 func rewriteValueARM_OpARMCMPshiftRL_0(v *Value) bool { 5544 b := v.Block 5545 // match: (CMPshiftRL (MOVWconst [c]) x [d]) 5546 // result: (InvertFlags (CMPconst [c] (SRLconst <x.Type> x [d]))) 5547 for { 5548 d := v.AuxInt 5549 x := v.Args[1] 5550 v_0 := v.Args[0] 5551 if v_0.Op != OpARMMOVWconst { 5552 break 5553 } 5554 c := v_0.AuxInt 5555 v.reset(OpARMInvertFlags) 5556 v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 5557 v0.AuxInt = c 5558 v1 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 5559 v1.AuxInt = d 5560 v1.AddArg(x) 5561 v0.AddArg(v1) 5562 v.AddArg(v0) 5563 return true 5564 } 5565 // match: (CMPshiftRL x (MOVWconst [c]) [d]) 5566 // result: (CMPconst x [int64(int32(uint32(c)>>uint64(d)))]) 5567 for { 5568 d := v.AuxInt 5569 _ = v.Args[1] 5570 x := v.Args[0] 5571 v_1 := v.Args[1] 5572 if v_1.Op != OpARMMOVWconst { 5573 break 5574 } 5575 c := v_1.AuxInt 5576 v.reset(OpARMCMPconst) 5577 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 5578 v.AddArg(x) 5579 return true 5580 } 5581 return false 5582 } 5583 func rewriteValueARM_OpARMCMPshiftRLreg_0(v *Value) bool { 5584 b := v.Block 5585 // match: (CMPshiftRLreg (MOVWconst [c]) x y) 5586 // result: (InvertFlags (CMPconst [c] (SRL <x.Type> x y))) 5587 for { 5588 y := v.Args[2] 5589 v_0 := v.Args[0] 5590 if v_0.Op != OpARMMOVWconst { 5591 break 5592 } 5593 c := v_0.AuxInt 5594 x := v.Args[1] 5595 v.reset(OpARMInvertFlags) 5596 v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 5597 v0.AuxInt = c 5598 v1 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 5599 v1.AddArg(x) 5600 v1.AddArg(y) 5601 v0.AddArg(v1) 5602 v.AddArg(v0) 5603 return true 5604 } 5605 // match: (CMPshiftRLreg x y (MOVWconst [c])) 5606 // result: (CMPshiftRL x y [c]) 5607 for { 5608 _ = v.Args[2] 5609 x := v.Args[0] 5610 y := v.Args[1] 5611 v_2 := v.Args[2] 5612 if v_2.Op != OpARMMOVWconst { 5613 break 5614 } 5615 c := v_2.AuxInt 5616 v.reset(OpARMCMPshiftRL) 5617 v.AuxInt = c 5618 v.AddArg(x) 5619 v.AddArg(y) 5620 return true 5621 } 5622 return false 5623 } 5624 func rewriteValueARM_OpARMEqual_0(v *Value) bool { 5625 // match: (Equal (FlagEQ)) 5626 // result: (MOVWconst [1]) 5627 for { 5628 v_0 := v.Args[0] 5629 if v_0.Op != OpARMFlagEQ { 5630 break 5631 } 5632 v.reset(OpARMMOVWconst) 5633 v.AuxInt = 1 5634 return true 5635 } 5636 // match: (Equal (FlagLT_ULT)) 5637 // result: (MOVWconst [0]) 5638 for { 5639 v_0 := v.Args[0] 5640 if v_0.Op != OpARMFlagLT_ULT { 5641 break 5642 } 5643 v.reset(OpARMMOVWconst) 5644 v.AuxInt = 0 5645 return true 5646 } 5647 // match: (Equal (FlagLT_UGT)) 5648 // result: (MOVWconst [0]) 5649 for { 5650 v_0 := v.Args[0] 5651 if v_0.Op != OpARMFlagLT_UGT { 5652 break 5653 } 5654 v.reset(OpARMMOVWconst) 5655 v.AuxInt = 0 5656 return true 5657 } 5658 // match: (Equal (FlagGT_ULT)) 5659 // result: (MOVWconst [0]) 5660 for { 5661 v_0 := v.Args[0] 5662 if v_0.Op != OpARMFlagGT_ULT { 5663 break 5664 } 5665 v.reset(OpARMMOVWconst) 5666 v.AuxInt = 0 5667 return true 5668 } 5669 // match: (Equal (FlagGT_UGT)) 5670 // result: (MOVWconst [0]) 5671 for { 5672 v_0 := v.Args[0] 5673 if v_0.Op != OpARMFlagGT_UGT { 5674 break 5675 } 5676 v.reset(OpARMMOVWconst) 5677 v.AuxInt = 0 5678 return true 5679 } 5680 // match: (Equal (InvertFlags x)) 5681 // result: (Equal x) 5682 for { 5683 v_0 := v.Args[0] 5684 if v_0.Op != OpARMInvertFlags { 5685 break 5686 } 5687 x := v_0.Args[0] 5688 v.reset(OpARMEqual) 5689 v.AddArg(x) 5690 return true 5691 } 5692 return false 5693 } 5694 func rewriteValueARM_OpARMGreaterEqual_0(v *Value) bool { 5695 // match: (GreaterEqual (FlagEQ)) 5696 // result: (MOVWconst [1]) 5697 for { 5698 v_0 := v.Args[0] 5699 if v_0.Op != OpARMFlagEQ { 5700 break 5701 } 5702 v.reset(OpARMMOVWconst) 5703 v.AuxInt = 1 5704 return true 5705 } 5706 // match: (GreaterEqual (FlagLT_ULT)) 5707 // result: (MOVWconst [0]) 5708 for { 5709 v_0 := v.Args[0] 5710 if v_0.Op != OpARMFlagLT_ULT { 5711 break 5712 } 5713 v.reset(OpARMMOVWconst) 5714 v.AuxInt = 0 5715 return true 5716 } 5717 // match: (GreaterEqual (FlagLT_UGT)) 5718 // result: (MOVWconst [0]) 5719 for { 5720 v_0 := v.Args[0] 5721 if v_0.Op != OpARMFlagLT_UGT { 5722 break 5723 } 5724 v.reset(OpARMMOVWconst) 5725 v.AuxInt = 0 5726 return true 5727 } 5728 // match: (GreaterEqual (FlagGT_ULT)) 5729 // result: (MOVWconst [1]) 5730 for { 5731 v_0 := v.Args[0] 5732 if v_0.Op != OpARMFlagGT_ULT { 5733 break 5734 } 5735 v.reset(OpARMMOVWconst) 5736 v.AuxInt = 1 5737 return true 5738 } 5739 // match: (GreaterEqual (FlagGT_UGT)) 5740 // result: (MOVWconst [1]) 5741 for { 5742 v_0 := v.Args[0] 5743 if v_0.Op != OpARMFlagGT_UGT { 5744 break 5745 } 5746 v.reset(OpARMMOVWconst) 5747 v.AuxInt = 1 5748 return true 5749 } 5750 // match: (GreaterEqual (InvertFlags x)) 5751 // result: (LessEqual x) 5752 for { 5753 v_0 := v.Args[0] 5754 if v_0.Op != OpARMInvertFlags { 5755 break 5756 } 5757 x := v_0.Args[0] 5758 v.reset(OpARMLessEqual) 5759 v.AddArg(x) 5760 return true 5761 } 5762 return false 5763 } 5764 func rewriteValueARM_OpARMGreaterEqualU_0(v *Value) bool { 5765 // match: (GreaterEqualU (FlagEQ)) 5766 // result: (MOVWconst [1]) 5767 for { 5768 v_0 := v.Args[0] 5769 if v_0.Op != OpARMFlagEQ { 5770 break 5771 } 5772 v.reset(OpARMMOVWconst) 5773 v.AuxInt = 1 5774 return true 5775 } 5776 // match: (GreaterEqualU (FlagLT_ULT)) 5777 // result: (MOVWconst [0]) 5778 for { 5779 v_0 := v.Args[0] 5780 if v_0.Op != OpARMFlagLT_ULT { 5781 break 5782 } 5783 v.reset(OpARMMOVWconst) 5784 v.AuxInt = 0 5785 return true 5786 } 5787 // match: (GreaterEqualU (FlagLT_UGT)) 5788 // result: (MOVWconst [1]) 5789 for { 5790 v_0 := v.Args[0] 5791 if v_0.Op != OpARMFlagLT_UGT { 5792 break 5793 } 5794 v.reset(OpARMMOVWconst) 5795 v.AuxInt = 1 5796 return true 5797 } 5798 // match: (GreaterEqualU (FlagGT_ULT)) 5799 // result: (MOVWconst [0]) 5800 for { 5801 v_0 := v.Args[0] 5802 if v_0.Op != OpARMFlagGT_ULT { 5803 break 5804 } 5805 v.reset(OpARMMOVWconst) 5806 v.AuxInt = 0 5807 return true 5808 } 5809 // match: (GreaterEqualU (FlagGT_UGT)) 5810 // result: (MOVWconst [1]) 5811 for { 5812 v_0 := v.Args[0] 5813 if v_0.Op != OpARMFlagGT_UGT { 5814 break 5815 } 5816 v.reset(OpARMMOVWconst) 5817 v.AuxInt = 1 5818 return true 5819 } 5820 // match: (GreaterEqualU (InvertFlags x)) 5821 // result: (LessEqualU x) 5822 for { 5823 v_0 := v.Args[0] 5824 if v_0.Op != OpARMInvertFlags { 5825 break 5826 } 5827 x := v_0.Args[0] 5828 v.reset(OpARMLessEqualU) 5829 v.AddArg(x) 5830 return true 5831 } 5832 return false 5833 } 5834 func rewriteValueARM_OpARMGreaterThan_0(v *Value) bool { 5835 // match: (GreaterThan (FlagEQ)) 5836 // result: (MOVWconst [0]) 5837 for { 5838 v_0 := v.Args[0] 5839 if v_0.Op != OpARMFlagEQ { 5840 break 5841 } 5842 v.reset(OpARMMOVWconst) 5843 v.AuxInt = 0 5844 return true 5845 } 5846 // match: (GreaterThan (FlagLT_ULT)) 5847 // result: (MOVWconst [0]) 5848 for { 5849 v_0 := v.Args[0] 5850 if v_0.Op != OpARMFlagLT_ULT { 5851 break 5852 } 5853 v.reset(OpARMMOVWconst) 5854 v.AuxInt = 0 5855 return true 5856 } 5857 // match: (GreaterThan (FlagLT_UGT)) 5858 // result: (MOVWconst [0]) 5859 for { 5860 v_0 := v.Args[0] 5861 if v_0.Op != OpARMFlagLT_UGT { 5862 break 5863 } 5864 v.reset(OpARMMOVWconst) 5865 v.AuxInt = 0 5866 return true 5867 } 5868 // match: (GreaterThan (FlagGT_ULT)) 5869 // result: (MOVWconst [1]) 5870 for { 5871 v_0 := v.Args[0] 5872 if v_0.Op != OpARMFlagGT_ULT { 5873 break 5874 } 5875 v.reset(OpARMMOVWconst) 5876 v.AuxInt = 1 5877 return true 5878 } 5879 // match: (GreaterThan (FlagGT_UGT)) 5880 // result: (MOVWconst [1]) 5881 for { 5882 v_0 := v.Args[0] 5883 if v_0.Op != OpARMFlagGT_UGT { 5884 break 5885 } 5886 v.reset(OpARMMOVWconst) 5887 v.AuxInt = 1 5888 return true 5889 } 5890 // match: (GreaterThan (InvertFlags x)) 5891 // result: (LessThan x) 5892 for { 5893 v_0 := v.Args[0] 5894 if v_0.Op != OpARMInvertFlags { 5895 break 5896 } 5897 x := v_0.Args[0] 5898 v.reset(OpARMLessThan) 5899 v.AddArg(x) 5900 return true 5901 } 5902 return false 5903 } 5904 func rewriteValueARM_OpARMGreaterThanU_0(v *Value) bool { 5905 // match: (GreaterThanU (FlagEQ)) 5906 // result: (MOVWconst [0]) 5907 for { 5908 v_0 := v.Args[0] 5909 if v_0.Op != OpARMFlagEQ { 5910 break 5911 } 5912 v.reset(OpARMMOVWconst) 5913 v.AuxInt = 0 5914 return true 5915 } 5916 // match: (GreaterThanU (FlagLT_ULT)) 5917 // result: (MOVWconst [0]) 5918 for { 5919 v_0 := v.Args[0] 5920 if v_0.Op != OpARMFlagLT_ULT { 5921 break 5922 } 5923 v.reset(OpARMMOVWconst) 5924 v.AuxInt = 0 5925 return true 5926 } 5927 // match: (GreaterThanU (FlagLT_UGT)) 5928 // result: (MOVWconst [1]) 5929 for { 5930 v_0 := v.Args[0] 5931 if v_0.Op != OpARMFlagLT_UGT { 5932 break 5933 } 5934 v.reset(OpARMMOVWconst) 5935 v.AuxInt = 1 5936 return true 5937 } 5938 // match: (GreaterThanU (FlagGT_ULT)) 5939 // result: (MOVWconst [0]) 5940 for { 5941 v_0 := v.Args[0] 5942 if v_0.Op != OpARMFlagGT_ULT { 5943 break 5944 } 5945 v.reset(OpARMMOVWconst) 5946 v.AuxInt = 0 5947 return true 5948 } 5949 // match: (GreaterThanU (FlagGT_UGT)) 5950 // result: (MOVWconst [1]) 5951 for { 5952 v_0 := v.Args[0] 5953 if v_0.Op != OpARMFlagGT_UGT { 5954 break 5955 } 5956 v.reset(OpARMMOVWconst) 5957 v.AuxInt = 1 5958 return true 5959 } 5960 // match: (GreaterThanU (InvertFlags x)) 5961 // result: (LessThanU x) 5962 for { 5963 v_0 := v.Args[0] 5964 if v_0.Op != OpARMInvertFlags { 5965 break 5966 } 5967 x := v_0.Args[0] 5968 v.reset(OpARMLessThanU) 5969 v.AddArg(x) 5970 return true 5971 } 5972 return false 5973 } 5974 func rewriteValueARM_OpARMLessEqual_0(v *Value) bool { 5975 // match: (LessEqual (FlagEQ)) 5976 // result: (MOVWconst [1]) 5977 for { 5978 v_0 := v.Args[0] 5979 if v_0.Op != OpARMFlagEQ { 5980 break 5981 } 5982 v.reset(OpARMMOVWconst) 5983 v.AuxInt = 1 5984 return true 5985 } 5986 // match: (LessEqual (FlagLT_ULT)) 5987 // result: (MOVWconst [1]) 5988 for { 5989 v_0 := v.Args[0] 5990 if v_0.Op != OpARMFlagLT_ULT { 5991 break 5992 } 5993 v.reset(OpARMMOVWconst) 5994 v.AuxInt = 1 5995 return true 5996 } 5997 // match: (LessEqual (FlagLT_UGT)) 5998 // result: (MOVWconst [1]) 5999 for { 6000 v_0 := v.Args[0] 6001 if v_0.Op != OpARMFlagLT_UGT { 6002 break 6003 } 6004 v.reset(OpARMMOVWconst) 6005 v.AuxInt = 1 6006 return true 6007 } 6008 // match: (LessEqual (FlagGT_ULT)) 6009 // result: (MOVWconst [0]) 6010 for { 6011 v_0 := v.Args[0] 6012 if v_0.Op != OpARMFlagGT_ULT { 6013 break 6014 } 6015 v.reset(OpARMMOVWconst) 6016 v.AuxInt = 0 6017 return true 6018 } 6019 // match: (LessEqual (FlagGT_UGT)) 6020 // result: (MOVWconst [0]) 6021 for { 6022 v_0 := v.Args[0] 6023 if v_0.Op != OpARMFlagGT_UGT { 6024 break 6025 } 6026 v.reset(OpARMMOVWconst) 6027 v.AuxInt = 0 6028 return true 6029 } 6030 // match: (LessEqual (InvertFlags x)) 6031 // result: (GreaterEqual x) 6032 for { 6033 v_0 := v.Args[0] 6034 if v_0.Op != OpARMInvertFlags { 6035 break 6036 } 6037 x := v_0.Args[0] 6038 v.reset(OpARMGreaterEqual) 6039 v.AddArg(x) 6040 return true 6041 } 6042 return false 6043 } 6044 func rewriteValueARM_OpARMLessEqualU_0(v *Value) bool { 6045 // match: (LessEqualU (FlagEQ)) 6046 // result: (MOVWconst [1]) 6047 for { 6048 v_0 := v.Args[0] 6049 if v_0.Op != OpARMFlagEQ { 6050 break 6051 } 6052 v.reset(OpARMMOVWconst) 6053 v.AuxInt = 1 6054 return true 6055 } 6056 // match: (LessEqualU (FlagLT_ULT)) 6057 // result: (MOVWconst [1]) 6058 for { 6059 v_0 := v.Args[0] 6060 if v_0.Op != OpARMFlagLT_ULT { 6061 break 6062 } 6063 v.reset(OpARMMOVWconst) 6064 v.AuxInt = 1 6065 return true 6066 } 6067 // match: (LessEqualU (FlagLT_UGT)) 6068 // result: (MOVWconst [0]) 6069 for { 6070 v_0 := v.Args[0] 6071 if v_0.Op != OpARMFlagLT_UGT { 6072 break 6073 } 6074 v.reset(OpARMMOVWconst) 6075 v.AuxInt = 0 6076 return true 6077 } 6078 // match: (LessEqualU (FlagGT_ULT)) 6079 // result: (MOVWconst [1]) 6080 for { 6081 v_0 := v.Args[0] 6082 if v_0.Op != OpARMFlagGT_ULT { 6083 break 6084 } 6085 v.reset(OpARMMOVWconst) 6086 v.AuxInt = 1 6087 return true 6088 } 6089 // match: (LessEqualU (FlagGT_UGT)) 6090 // result: (MOVWconst [0]) 6091 for { 6092 v_0 := v.Args[0] 6093 if v_0.Op != OpARMFlagGT_UGT { 6094 break 6095 } 6096 v.reset(OpARMMOVWconst) 6097 v.AuxInt = 0 6098 return true 6099 } 6100 // match: (LessEqualU (InvertFlags x)) 6101 // result: (GreaterEqualU x) 6102 for { 6103 v_0 := v.Args[0] 6104 if v_0.Op != OpARMInvertFlags { 6105 break 6106 } 6107 x := v_0.Args[0] 6108 v.reset(OpARMGreaterEqualU) 6109 v.AddArg(x) 6110 return true 6111 } 6112 return false 6113 } 6114 func rewriteValueARM_OpARMLessThan_0(v *Value) bool { 6115 // match: (LessThan (FlagEQ)) 6116 // result: (MOVWconst [0]) 6117 for { 6118 v_0 := v.Args[0] 6119 if v_0.Op != OpARMFlagEQ { 6120 break 6121 } 6122 v.reset(OpARMMOVWconst) 6123 v.AuxInt = 0 6124 return true 6125 } 6126 // match: (LessThan (FlagLT_ULT)) 6127 // result: (MOVWconst [1]) 6128 for { 6129 v_0 := v.Args[0] 6130 if v_0.Op != OpARMFlagLT_ULT { 6131 break 6132 } 6133 v.reset(OpARMMOVWconst) 6134 v.AuxInt = 1 6135 return true 6136 } 6137 // match: (LessThan (FlagLT_UGT)) 6138 // result: (MOVWconst [1]) 6139 for { 6140 v_0 := v.Args[0] 6141 if v_0.Op != OpARMFlagLT_UGT { 6142 break 6143 } 6144 v.reset(OpARMMOVWconst) 6145 v.AuxInt = 1 6146 return true 6147 } 6148 // match: (LessThan (FlagGT_ULT)) 6149 // result: (MOVWconst [0]) 6150 for { 6151 v_0 := v.Args[0] 6152 if v_0.Op != OpARMFlagGT_ULT { 6153 break 6154 } 6155 v.reset(OpARMMOVWconst) 6156 v.AuxInt = 0 6157 return true 6158 } 6159 // match: (LessThan (FlagGT_UGT)) 6160 // result: (MOVWconst [0]) 6161 for { 6162 v_0 := v.Args[0] 6163 if v_0.Op != OpARMFlagGT_UGT { 6164 break 6165 } 6166 v.reset(OpARMMOVWconst) 6167 v.AuxInt = 0 6168 return true 6169 } 6170 // match: (LessThan (InvertFlags x)) 6171 // result: (GreaterThan x) 6172 for { 6173 v_0 := v.Args[0] 6174 if v_0.Op != OpARMInvertFlags { 6175 break 6176 } 6177 x := v_0.Args[0] 6178 v.reset(OpARMGreaterThan) 6179 v.AddArg(x) 6180 return true 6181 } 6182 return false 6183 } 6184 func rewriteValueARM_OpARMLessThanU_0(v *Value) bool { 6185 // match: (LessThanU (FlagEQ)) 6186 // result: (MOVWconst [0]) 6187 for { 6188 v_0 := v.Args[0] 6189 if v_0.Op != OpARMFlagEQ { 6190 break 6191 } 6192 v.reset(OpARMMOVWconst) 6193 v.AuxInt = 0 6194 return true 6195 } 6196 // match: (LessThanU (FlagLT_ULT)) 6197 // result: (MOVWconst [1]) 6198 for { 6199 v_0 := v.Args[0] 6200 if v_0.Op != OpARMFlagLT_ULT { 6201 break 6202 } 6203 v.reset(OpARMMOVWconst) 6204 v.AuxInt = 1 6205 return true 6206 } 6207 // match: (LessThanU (FlagLT_UGT)) 6208 // result: (MOVWconst [0]) 6209 for { 6210 v_0 := v.Args[0] 6211 if v_0.Op != OpARMFlagLT_UGT { 6212 break 6213 } 6214 v.reset(OpARMMOVWconst) 6215 v.AuxInt = 0 6216 return true 6217 } 6218 // match: (LessThanU (FlagGT_ULT)) 6219 // result: (MOVWconst [1]) 6220 for { 6221 v_0 := v.Args[0] 6222 if v_0.Op != OpARMFlagGT_ULT { 6223 break 6224 } 6225 v.reset(OpARMMOVWconst) 6226 v.AuxInt = 1 6227 return true 6228 } 6229 // match: (LessThanU (FlagGT_UGT)) 6230 // result: (MOVWconst [0]) 6231 for { 6232 v_0 := v.Args[0] 6233 if v_0.Op != OpARMFlagGT_UGT { 6234 break 6235 } 6236 v.reset(OpARMMOVWconst) 6237 v.AuxInt = 0 6238 return true 6239 } 6240 // match: (LessThanU (InvertFlags x)) 6241 // result: (GreaterThanU x) 6242 for { 6243 v_0 := v.Args[0] 6244 if v_0.Op != OpARMInvertFlags { 6245 break 6246 } 6247 x := v_0.Args[0] 6248 v.reset(OpARMGreaterThanU) 6249 v.AddArg(x) 6250 return true 6251 } 6252 return false 6253 } 6254 func rewriteValueARM_OpARMMOVBUload_0(v *Value) bool { 6255 // match: (MOVBUload [off1] {sym} (ADDconst [off2] ptr) mem) 6256 // result: (MOVBUload [off1+off2] {sym} ptr mem) 6257 for { 6258 off1 := v.AuxInt 6259 sym := v.Aux 6260 mem := v.Args[1] 6261 v_0 := v.Args[0] 6262 if v_0.Op != OpARMADDconst { 6263 break 6264 } 6265 off2 := v_0.AuxInt 6266 ptr := v_0.Args[0] 6267 v.reset(OpARMMOVBUload) 6268 v.AuxInt = off1 + off2 6269 v.Aux = sym 6270 v.AddArg(ptr) 6271 v.AddArg(mem) 6272 return true 6273 } 6274 // match: (MOVBUload [off1] {sym} (SUBconst [off2] ptr) mem) 6275 // result: (MOVBUload [off1-off2] {sym} ptr mem) 6276 for { 6277 off1 := v.AuxInt 6278 sym := v.Aux 6279 mem := v.Args[1] 6280 v_0 := v.Args[0] 6281 if v_0.Op != OpARMSUBconst { 6282 break 6283 } 6284 off2 := v_0.AuxInt 6285 ptr := v_0.Args[0] 6286 v.reset(OpARMMOVBUload) 6287 v.AuxInt = off1 - off2 6288 v.Aux = sym 6289 v.AddArg(ptr) 6290 v.AddArg(mem) 6291 return true 6292 } 6293 // match: (MOVBUload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem) 6294 // cond: canMergeSym(sym1,sym2) 6295 // result: (MOVBUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 6296 for { 6297 off1 := v.AuxInt 6298 sym1 := v.Aux 6299 mem := v.Args[1] 6300 v_0 := v.Args[0] 6301 if v_0.Op != OpARMMOVWaddr { 6302 break 6303 } 6304 off2 := v_0.AuxInt 6305 sym2 := v_0.Aux 6306 ptr := v_0.Args[0] 6307 if !(canMergeSym(sym1, sym2)) { 6308 break 6309 } 6310 v.reset(OpARMMOVBUload) 6311 v.AuxInt = off1 + off2 6312 v.Aux = mergeSym(sym1, sym2) 6313 v.AddArg(ptr) 6314 v.AddArg(mem) 6315 return true 6316 } 6317 // match: (MOVBUload [off] {sym} ptr (MOVBstore [off2] {sym2} ptr2 x _)) 6318 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2) 6319 // result: (MOVBUreg x) 6320 for { 6321 off := v.AuxInt 6322 sym := v.Aux 6323 _ = v.Args[1] 6324 ptr := v.Args[0] 6325 v_1 := v.Args[1] 6326 if v_1.Op != OpARMMOVBstore { 6327 break 6328 } 6329 off2 := v_1.AuxInt 6330 sym2 := v_1.Aux 6331 _ = v_1.Args[2] 6332 ptr2 := v_1.Args[0] 6333 x := v_1.Args[1] 6334 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) { 6335 break 6336 } 6337 v.reset(OpARMMOVBUreg) 6338 v.AddArg(x) 6339 return true 6340 } 6341 // match: (MOVBUload [0] {sym} (ADD ptr idx) mem) 6342 // cond: sym == nil 6343 // result: (MOVBUloadidx ptr idx mem) 6344 for { 6345 if v.AuxInt != 0 { 6346 break 6347 } 6348 sym := v.Aux 6349 mem := v.Args[1] 6350 v_0 := v.Args[0] 6351 if v_0.Op != OpARMADD { 6352 break 6353 } 6354 idx := v_0.Args[1] 6355 ptr := v_0.Args[0] 6356 if !(sym == nil) { 6357 break 6358 } 6359 v.reset(OpARMMOVBUloadidx) 6360 v.AddArg(ptr) 6361 v.AddArg(idx) 6362 v.AddArg(mem) 6363 return true 6364 } 6365 // match: (MOVBUload [off] {sym} (SB) _) 6366 // cond: symIsRO(sym) 6367 // result: (MOVWconst [int64(read8(sym, off))]) 6368 for { 6369 off := v.AuxInt 6370 sym := v.Aux 6371 _ = v.Args[1] 6372 v_0 := v.Args[0] 6373 if v_0.Op != OpSB || !(symIsRO(sym)) { 6374 break 6375 } 6376 v.reset(OpARMMOVWconst) 6377 v.AuxInt = int64(read8(sym, off)) 6378 return true 6379 } 6380 return false 6381 } 6382 func rewriteValueARM_OpARMMOVBUloadidx_0(v *Value) bool { 6383 // match: (MOVBUloadidx ptr idx (MOVBstoreidx ptr2 idx x _)) 6384 // cond: isSamePtr(ptr, ptr2) 6385 // result: (MOVBUreg x) 6386 for { 6387 _ = v.Args[2] 6388 ptr := v.Args[0] 6389 idx := v.Args[1] 6390 v_2 := v.Args[2] 6391 if v_2.Op != OpARMMOVBstoreidx { 6392 break 6393 } 6394 _ = v_2.Args[3] 6395 ptr2 := v_2.Args[0] 6396 if idx != v_2.Args[1] { 6397 break 6398 } 6399 x := v_2.Args[2] 6400 if !(isSamePtr(ptr, ptr2)) { 6401 break 6402 } 6403 v.reset(OpARMMOVBUreg) 6404 v.AddArg(x) 6405 return true 6406 } 6407 // match: (MOVBUloadidx ptr (MOVWconst [c]) mem) 6408 // result: (MOVBUload [c] ptr mem) 6409 for { 6410 mem := v.Args[2] 6411 ptr := v.Args[0] 6412 v_1 := v.Args[1] 6413 if v_1.Op != OpARMMOVWconst { 6414 break 6415 } 6416 c := v_1.AuxInt 6417 v.reset(OpARMMOVBUload) 6418 v.AuxInt = c 6419 v.AddArg(ptr) 6420 v.AddArg(mem) 6421 return true 6422 } 6423 // match: (MOVBUloadidx (MOVWconst [c]) ptr mem) 6424 // result: (MOVBUload [c] ptr mem) 6425 for { 6426 mem := v.Args[2] 6427 v_0 := v.Args[0] 6428 if v_0.Op != OpARMMOVWconst { 6429 break 6430 } 6431 c := v_0.AuxInt 6432 ptr := v.Args[1] 6433 v.reset(OpARMMOVBUload) 6434 v.AuxInt = c 6435 v.AddArg(ptr) 6436 v.AddArg(mem) 6437 return true 6438 } 6439 return false 6440 } 6441 func rewriteValueARM_OpARMMOVBUreg_0(v *Value) bool { 6442 // match: (MOVBUreg x:(MOVBUload _ _)) 6443 // result: (MOVWreg x) 6444 for { 6445 x := v.Args[0] 6446 if x.Op != OpARMMOVBUload { 6447 break 6448 } 6449 _ = x.Args[1] 6450 v.reset(OpARMMOVWreg) 6451 v.AddArg(x) 6452 return true 6453 } 6454 // match: (MOVBUreg (ANDconst [c] x)) 6455 // result: (ANDconst [c&0xff] x) 6456 for { 6457 v_0 := v.Args[0] 6458 if v_0.Op != OpARMANDconst { 6459 break 6460 } 6461 c := v_0.AuxInt 6462 x := v_0.Args[0] 6463 v.reset(OpARMANDconst) 6464 v.AuxInt = c & 0xff 6465 v.AddArg(x) 6466 return true 6467 } 6468 // match: (MOVBUreg x:(MOVBUreg _)) 6469 // result: (MOVWreg x) 6470 for { 6471 x := v.Args[0] 6472 if x.Op != OpARMMOVBUreg { 6473 break 6474 } 6475 v.reset(OpARMMOVWreg) 6476 v.AddArg(x) 6477 return true 6478 } 6479 // match: (MOVBUreg (MOVWconst [c])) 6480 // result: (MOVWconst [int64(uint8(c))]) 6481 for { 6482 v_0 := v.Args[0] 6483 if v_0.Op != OpARMMOVWconst { 6484 break 6485 } 6486 c := v_0.AuxInt 6487 v.reset(OpARMMOVWconst) 6488 v.AuxInt = int64(uint8(c)) 6489 return true 6490 } 6491 return false 6492 } 6493 func rewriteValueARM_OpARMMOVBload_0(v *Value) bool { 6494 // match: (MOVBload [off1] {sym} (ADDconst [off2] ptr) mem) 6495 // result: (MOVBload [off1+off2] {sym} ptr mem) 6496 for { 6497 off1 := v.AuxInt 6498 sym := v.Aux 6499 mem := v.Args[1] 6500 v_0 := v.Args[0] 6501 if v_0.Op != OpARMADDconst { 6502 break 6503 } 6504 off2 := v_0.AuxInt 6505 ptr := v_0.Args[0] 6506 v.reset(OpARMMOVBload) 6507 v.AuxInt = off1 + off2 6508 v.Aux = sym 6509 v.AddArg(ptr) 6510 v.AddArg(mem) 6511 return true 6512 } 6513 // match: (MOVBload [off1] {sym} (SUBconst [off2] ptr) mem) 6514 // result: (MOVBload [off1-off2] {sym} ptr mem) 6515 for { 6516 off1 := v.AuxInt 6517 sym := v.Aux 6518 mem := v.Args[1] 6519 v_0 := v.Args[0] 6520 if v_0.Op != OpARMSUBconst { 6521 break 6522 } 6523 off2 := v_0.AuxInt 6524 ptr := v_0.Args[0] 6525 v.reset(OpARMMOVBload) 6526 v.AuxInt = off1 - off2 6527 v.Aux = sym 6528 v.AddArg(ptr) 6529 v.AddArg(mem) 6530 return true 6531 } 6532 // match: (MOVBload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem) 6533 // cond: canMergeSym(sym1,sym2) 6534 // result: (MOVBload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 6535 for { 6536 off1 := v.AuxInt 6537 sym1 := v.Aux 6538 mem := v.Args[1] 6539 v_0 := v.Args[0] 6540 if v_0.Op != OpARMMOVWaddr { 6541 break 6542 } 6543 off2 := v_0.AuxInt 6544 sym2 := v_0.Aux 6545 ptr := v_0.Args[0] 6546 if !(canMergeSym(sym1, sym2)) { 6547 break 6548 } 6549 v.reset(OpARMMOVBload) 6550 v.AuxInt = off1 + off2 6551 v.Aux = mergeSym(sym1, sym2) 6552 v.AddArg(ptr) 6553 v.AddArg(mem) 6554 return true 6555 } 6556 // match: (MOVBload [off] {sym} ptr (MOVBstore [off2] {sym2} ptr2 x _)) 6557 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2) 6558 // result: (MOVBreg x) 6559 for { 6560 off := v.AuxInt 6561 sym := v.Aux 6562 _ = v.Args[1] 6563 ptr := v.Args[0] 6564 v_1 := v.Args[1] 6565 if v_1.Op != OpARMMOVBstore { 6566 break 6567 } 6568 off2 := v_1.AuxInt 6569 sym2 := v_1.Aux 6570 _ = v_1.Args[2] 6571 ptr2 := v_1.Args[0] 6572 x := v_1.Args[1] 6573 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) { 6574 break 6575 } 6576 v.reset(OpARMMOVBreg) 6577 v.AddArg(x) 6578 return true 6579 } 6580 // match: (MOVBload [0] {sym} (ADD ptr idx) mem) 6581 // cond: sym == nil 6582 // result: (MOVBloadidx ptr idx mem) 6583 for { 6584 if v.AuxInt != 0 { 6585 break 6586 } 6587 sym := v.Aux 6588 mem := v.Args[1] 6589 v_0 := v.Args[0] 6590 if v_0.Op != OpARMADD { 6591 break 6592 } 6593 idx := v_0.Args[1] 6594 ptr := v_0.Args[0] 6595 if !(sym == nil) { 6596 break 6597 } 6598 v.reset(OpARMMOVBloadidx) 6599 v.AddArg(ptr) 6600 v.AddArg(idx) 6601 v.AddArg(mem) 6602 return true 6603 } 6604 return false 6605 } 6606 func rewriteValueARM_OpARMMOVBloadidx_0(v *Value) bool { 6607 // match: (MOVBloadidx ptr idx (MOVBstoreidx ptr2 idx x _)) 6608 // cond: isSamePtr(ptr, ptr2) 6609 // result: (MOVBreg x) 6610 for { 6611 _ = v.Args[2] 6612 ptr := v.Args[0] 6613 idx := v.Args[1] 6614 v_2 := v.Args[2] 6615 if v_2.Op != OpARMMOVBstoreidx { 6616 break 6617 } 6618 _ = v_2.Args[3] 6619 ptr2 := v_2.Args[0] 6620 if idx != v_2.Args[1] { 6621 break 6622 } 6623 x := v_2.Args[2] 6624 if !(isSamePtr(ptr, ptr2)) { 6625 break 6626 } 6627 v.reset(OpARMMOVBreg) 6628 v.AddArg(x) 6629 return true 6630 } 6631 // match: (MOVBloadidx ptr (MOVWconst [c]) mem) 6632 // result: (MOVBload [c] ptr mem) 6633 for { 6634 mem := v.Args[2] 6635 ptr := v.Args[0] 6636 v_1 := v.Args[1] 6637 if v_1.Op != OpARMMOVWconst { 6638 break 6639 } 6640 c := v_1.AuxInt 6641 v.reset(OpARMMOVBload) 6642 v.AuxInt = c 6643 v.AddArg(ptr) 6644 v.AddArg(mem) 6645 return true 6646 } 6647 // match: (MOVBloadidx (MOVWconst [c]) ptr mem) 6648 // result: (MOVBload [c] ptr mem) 6649 for { 6650 mem := v.Args[2] 6651 v_0 := v.Args[0] 6652 if v_0.Op != OpARMMOVWconst { 6653 break 6654 } 6655 c := v_0.AuxInt 6656 ptr := v.Args[1] 6657 v.reset(OpARMMOVBload) 6658 v.AuxInt = c 6659 v.AddArg(ptr) 6660 v.AddArg(mem) 6661 return true 6662 } 6663 return false 6664 } 6665 func rewriteValueARM_OpARMMOVBreg_0(v *Value) bool { 6666 // match: (MOVBreg x:(MOVBload _ _)) 6667 // result: (MOVWreg x) 6668 for { 6669 x := v.Args[0] 6670 if x.Op != OpARMMOVBload { 6671 break 6672 } 6673 _ = x.Args[1] 6674 v.reset(OpARMMOVWreg) 6675 v.AddArg(x) 6676 return true 6677 } 6678 // match: (MOVBreg (ANDconst [c] x)) 6679 // cond: c & 0x80 == 0 6680 // result: (ANDconst [c&0x7f] x) 6681 for { 6682 v_0 := v.Args[0] 6683 if v_0.Op != OpARMANDconst { 6684 break 6685 } 6686 c := v_0.AuxInt 6687 x := v_0.Args[0] 6688 if !(c&0x80 == 0) { 6689 break 6690 } 6691 v.reset(OpARMANDconst) 6692 v.AuxInt = c & 0x7f 6693 v.AddArg(x) 6694 return true 6695 } 6696 // match: (MOVBreg x:(MOVBreg _)) 6697 // result: (MOVWreg x) 6698 for { 6699 x := v.Args[0] 6700 if x.Op != OpARMMOVBreg { 6701 break 6702 } 6703 v.reset(OpARMMOVWreg) 6704 v.AddArg(x) 6705 return true 6706 } 6707 // match: (MOVBreg (MOVWconst [c])) 6708 // result: (MOVWconst [int64(int8(c))]) 6709 for { 6710 v_0 := v.Args[0] 6711 if v_0.Op != OpARMMOVWconst { 6712 break 6713 } 6714 c := v_0.AuxInt 6715 v.reset(OpARMMOVWconst) 6716 v.AuxInt = int64(int8(c)) 6717 return true 6718 } 6719 return false 6720 } 6721 func rewriteValueARM_OpARMMOVBstore_0(v *Value) bool { 6722 // match: (MOVBstore [off1] {sym} (ADDconst [off2] ptr) val mem) 6723 // result: (MOVBstore [off1+off2] {sym} ptr val mem) 6724 for { 6725 off1 := v.AuxInt 6726 sym := v.Aux 6727 mem := v.Args[2] 6728 v_0 := v.Args[0] 6729 if v_0.Op != OpARMADDconst { 6730 break 6731 } 6732 off2 := v_0.AuxInt 6733 ptr := v_0.Args[0] 6734 val := v.Args[1] 6735 v.reset(OpARMMOVBstore) 6736 v.AuxInt = off1 + off2 6737 v.Aux = sym 6738 v.AddArg(ptr) 6739 v.AddArg(val) 6740 v.AddArg(mem) 6741 return true 6742 } 6743 // match: (MOVBstore [off1] {sym} (SUBconst [off2] ptr) val mem) 6744 // result: (MOVBstore [off1-off2] {sym} ptr val mem) 6745 for { 6746 off1 := v.AuxInt 6747 sym := v.Aux 6748 mem := v.Args[2] 6749 v_0 := v.Args[0] 6750 if v_0.Op != OpARMSUBconst { 6751 break 6752 } 6753 off2 := v_0.AuxInt 6754 ptr := v_0.Args[0] 6755 val := v.Args[1] 6756 v.reset(OpARMMOVBstore) 6757 v.AuxInt = off1 - off2 6758 v.Aux = sym 6759 v.AddArg(ptr) 6760 v.AddArg(val) 6761 v.AddArg(mem) 6762 return true 6763 } 6764 // match: (MOVBstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem) 6765 // cond: canMergeSym(sym1,sym2) 6766 // result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 6767 for { 6768 off1 := v.AuxInt 6769 sym1 := v.Aux 6770 mem := v.Args[2] 6771 v_0 := v.Args[0] 6772 if v_0.Op != OpARMMOVWaddr { 6773 break 6774 } 6775 off2 := v_0.AuxInt 6776 sym2 := v_0.Aux 6777 ptr := v_0.Args[0] 6778 val := v.Args[1] 6779 if !(canMergeSym(sym1, sym2)) { 6780 break 6781 } 6782 v.reset(OpARMMOVBstore) 6783 v.AuxInt = off1 + off2 6784 v.Aux = mergeSym(sym1, sym2) 6785 v.AddArg(ptr) 6786 v.AddArg(val) 6787 v.AddArg(mem) 6788 return true 6789 } 6790 // match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem) 6791 // result: (MOVBstore [off] {sym} ptr x mem) 6792 for { 6793 off := v.AuxInt 6794 sym := v.Aux 6795 mem := v.Args[2] 6796 ptr := v.Args[0] 6797 v_1 := v.Args[1] 6798 if v_1.Op != OpARMMOVBreg { 6799 break 6800 } 6801 x := v_1.Args[0] 6802 v.reset(OpARMMOVBstore) 6803 v.AuxInt = off 6804 v.Aux = sym 6805 v.AddArg(ptr) 6806 v.AddArg(x) 6807 v.AddArg(mem) 6808 return true 6809 } 6810 // match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem) 6811 // result: (MOVBstore [off] {sym} ptr x mem) 6812 for { 6813 off := v.AuxInt 6814 sym := v.Aux 6815 mem := v.Args[2] 6816 ptr := v.Args[0] 6817 v_1 := v.Args[1] 6818 if v_1.Op != OpARMMOVBUreg { 6819 break 6820 } 6821 x := v_1.Args[0] 6822 v.reset(OpARMMOVBstore) 6823 v.AuxInt = off 6824 v.Aux = sym 6825 v.AddArg(ptr) 6826 v.AddArg(x) 6827 v.AddArg(mem) 6828 return true 6829 } 6830 // match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem) 6831 // result: (MOVBstore [off] {sym} ptr x mem) 6832 for { 6833 off := v.AuxInt 6834 sym := v.Aux 6835 mem := v.Args[2] 6836 ptr := v.Args[0] 6837 v_1 := v.Args[1] 6838 if v_1.Op != OpARMMOVHreg { 6839 break 6840 } 6841 x := v_1.Args[0] 6842 v.reset(OpARMMOVBstore) 6843 v.AuxInt = off 6844 v.Aux = sym 6845 v.AddArg(ptr) 6846 v.AddArg(x) 6847 v.AddArg(mem) 6848 return true 6849 } 6850 // match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem) 6851 // result: (MOVBstore [off] {sym} ptr x mem) 6852 for { 6853 off := v.AuxInt 6854 sym := v.Aux 6855 mem := v.Args[2] 6856 ptr := v.Args[0] 6857 v_1 := v.Args[1] 6858 if v_1.Op != OpARMMOVHUreg { 6859 break 6860 } 6861 x := v_1.Args[0] 6862 v.reset(OpARMMOVBstore) 6863 v.AuxInt = off 6864 v.Aux = sym 6865 v.AddArg(ptr) 6866 v.AddArg(x) 6867 v.AddArg(mem) 6868 return true 6869 } 6870 // match: (MOVBstore [0] {sym} (ADD ptr idx) val mem) 6871 // cond: sym == nil 6872 // result: (MOVBstoreidx ptr idx val mem) 6873 for { 6874 if v.AuxInt != 0 { 6875 break 6876 } 6877 sym := v.Aux 6878 mem := v.Args[2] 6879 v_0 := v.Args[0] 6880 if v_0.Op != OpARMADD { 6881 break 6882 } 6883 idx := v_0.Args[1] 6884 ptr := v_0.Args[0] 6885 val := v.Args[1] 6886 if !(sym == nil) { 6887 break 6888 } 6889 v.reset(OpARMMOVBstoreidx) 6890 v.AddArg(ptr) 6891 v.AddArg(idx) 6892 v.AddArg(val) 6893 v.AddArg(mem) 6894 return true 6895 } 6896 return false 6897 } 6898 func rewriteValueARM_OpARMMOVBstoreidx_0(v *Value) bool { 6899 // match: (MOVBstoreidx ptr (MOVWconst [c]) val mem) 6900 // result: (MOVBstore [c] ptr val mem) 6901 for { 6902 mem := v.Args[3] 6903 ptr := v.Args[0] 6904 v_1 := v.Args[1] 6905 if v_1.Op != OpARMMOVWconst { 6906 break 6907 } 6908 c := v_1.AuxInt 6909 val := v.Args[2] 6910 v.reset(OpARMMOVBstore) 6911 v.AuxInt = c 6912 v.AddArg(ptr) 6913 v.AddArg(val) 6914 v.AddArg(mem) 6915 return true 6916 } 6917 // match: (MOVBstoreidx (MOVWconst [c]) ptr val mem) 6918 // result: (MOVBstore [c] ptr val mem) 6919 for { 6920 mem := v.Args[3] 6921 v_0 := v.Args[0] 6922 if v_0.Op != OpARMMOVWconst { 6923 break 6924 } 6925 c := v_0.AuxInt 6926 ptr := v.Args[1] 6927 val := v.Args[2] 6928 v.reset(OpARMMOVBstore) 6929 v.AuxInt = c 6930 v.AddArg(ptr) 6931 v.AddArg(val) 6932 v.AddArg(mem) 6933 return true 6934 } 6935 return false 6936 } 6937 func rewriteValueARM_OpARMMOVDload_0(v *Value) bool { 6938 // match: (MOVDload [off1] {sym} (ADDconst [off2] ptr) mem) 6939 // result: (MOVDload [off1+off2] {sym} ptr mem) 6940 for { 6941 off1 := v.AuxInt 6942 sym := v.Aux 6943 mem := v.Args[1] 6944 v_0 := v.Args[0] 6945 if v_0.Op != OpARMADDconst { 6946 break 6947 } 6948 off2 := v_0.AuxInt 6949 ptr := v_0.Args[0] 6950 v.reset(OpARMMOVDload) 6951 v.AuxInt = off1 + off2 6952 v.Aux = sym 6953 v.AddArg(ptr) 6954 v.AddArg(mem) 6955 return true 6956 } 6957 // match: (MOVDload [off1] {sym} (SUBconst [off2] ptr) mem) 6958 // result: (MOVDload [off1-off2] {sym} ptr mem) 6959 for { 6960 off1 := v.AuxInt 6961 sym := v.Aux 6962 mem := v.Args[1] 6963 v_0 := v.Args[0] 6964 if v_0.Op != OpARMSUBconst { 6965 break 6966 } 6967 off2 := v_0.AuxInt 6968 ptr := v_0.Args[0] 6969 v.reset(OpARMMOVDload) 6970 v.AuxInt = off1 - off2 6971 v.Aux = sym 6972 v.AddArg(ptr) 6973 v.AddArg(mem) 6974 return true 6975 } 6976 // match: (MOVDload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem) 6977 // cond: canMergeSym(sym1,sym2) 6978 // result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 6979 for { 6980 off1 := v.AuxInt 6981 sym1 := v.Aux 6982 mem := v.Args[1] 6983 v_0 := v.Args[0] 6984 if v_0.Op != OpARMMOVWaddr { 6985 break 6986 } 6987 off2 := v_0.AuxInt 6988 sym2 := v_0.Aux 6989 ptr := v_0.Args[0] 6990 if !(canMergeSym(sym1, sym2)) { 6991 break 6992 } 6993 v.reset(OpARMMOVDload) 6994 v.AuxInt = off1 + off2 6995 v.Aux = mergeSym(sym1, sym2) 6996 v.AddArg(ptr) 6997 v.AddArg(mem) 6998 return true 6999 } 7000 // match: (MOVDload [off] {sym} ptr (MOVDstore [off2] {sym2} ptr2 x _)) 7001 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2) 7002 // result: x 7003 for { 7004 off := v.AuxInt 7005 sym := v.Aux 7006 _ = v.Args[1] 7007 ptr := v.Args[0] 7008 v_1 := v.Args[1] 7009 if v_1.Op != OpARMMOVDstore { 7010 break 7011 } 7012 off2 := v_1.AuxInt 7013 sym2 := v_1.Aux 7014 _ = v_1.Args[2] 7015 ptr2 := v_1.Args[0] 7016 x := v_1.Args[1] 7017 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) { 7018 break 7019 } 7020 v.reset(OpCopy) 7021 v.Type = x.Type 7022 v.AddArg(x) 7023 return true 7024 } 7025 return false 7026 } 7027 func rewriteValueARM_OpARMMOVDstore_0(v *Value) bool { 7028 // match: (MOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem) 7029 // result: (MOVDstore [off1+off2] {sym} ptr val mem) 7030 for { 7031 off1 := v.AuxInt 7032 sym := v.Aux 7033 mem := v.Args[2] 7034 v_0 := v.Args[0] 7035 if v_0.Op != OpARMADDconst { 7036 break 7037 } 7038 off2 := v_0.AuxInt 7039 ptr := v_0.Args[0] 7040 val := v.Args[1] 7041 v.reset(OpARMMOVDstore) 7042 v.AuxInt = off1 + off2 7043 v.Aux = sym 7044 v.AddArg(ptr) 7045 v.AddArg(val) 7046 v.AddArg(mem) 7047 return true 7048 } 7049 // match: (MOVDstore [off1] {sym} (SUBconst [off2] ptr) val mem) 7050 // result: (MOVDstore [off1-off2] {sym} ptr val mem) 7051 for { 7052 off1 := v.AuxInt 7053 sym := v.Aux 7054 mem := v.Args[2] 7055 v_0 := v.Args[0] 7056 if v_0.Op != OpARMSUBconst { 7057 break 7058 } 7059 off2 := v_0.AuxInt 7060 ptr := v_0.Args[0] 7061 val := v.Args[1] 7062 v.reset(OpARMMOVDstore) 7063 v.AuxInt = off1 - off2 7064 v.Aux = sym 7065 v.AddArg(ptr) 7066 v.AddArg(val) 7067 v.AddArg(mem) 7068 return true 7069 } 7070 // match: (MOVDstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem) 7071 // cond: canMergeSym(sym1,sym2) 7072 // result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 7073 for { 7074 off1 := v.AuxInt 7075 sym1 := v.Aux 7076 mem := v.Args[2] 7077 v_0 := v.Args[0] 7078 if v_0.Op != OpARMMOVWaddr { 7079 break 7080 } 7081 off2 := v_0.AuxInt 7082 sym2 := v_0.Aux 7083 ptr := v_0.Args[0] 7084 val := v.Args[1] 7085 if !(canMergeSym(sym1, sym2)) { 7086 break 7087 } 7088 v.reset(OpARMMOVDstore) 7089 v.AuxInt = off1 + off2 7090 v.Aux = mergeSym(sym1, sym2) 7091 v.AddArg(ptr) 7092 v.AddArg(val) 7093 v.AddArg(mem) 7094 return true 7095 } 7096 return false 7097 } 7098 func rewriteValueARM_OpARMMOVFload_0(v *Value) bool { 7099 // match: (MOVFload [off1] {sym} (ADDconst [off2] ptr) mem) 7100 // result: (MOVFload [off1+off2] {sym} ptr mem) 7101 for { 7102 off1 := v.AuxInt 7103 sym := v.Aux 7104 mem := v.Args[1] 7105 v_0 := v.Args[0] 7106 if v_0.Op != OpARMADDconst { 7107 break 7108 } 7109 off2 := v_0.AuxInt 7110 ptr := v_0.Args[0] 7111 v.reset(OpARMMOVFload) 7112 v.AuxInt = off1 + off2 7113 v.Aux = sym 7114 v.AddArg(ptr) 7115 v.AddArg(mem) 7116 return true 7117 } 7118 // match: (MOVFload [off1] {sym} (SUBconst [off2] ptr) mem) 7119 // result: (MOVFload [off1-off2] {sym} ptr mem) 7120 for { 7121 off1 := v.AuxInt 7122 sym := v.Aux 7123 mem := v.Args[1] 7124 v_0 := v.Args[0] 7125 if v_0.Op != OpARMSUBconst { 7126 break 7127 } 7128 off2 := v_0.AuxInt 7129 ptr := v_0.Args[0] 7130 v.reset(OpARMMOVFload) 7131 v.AuxInt = off1 - off2 7132 v.Aux = sym 7133 v.AddArg(ptr) 7134 v.AddArg(mem) 7135 return true 7136 } 7137 // match: (MOVFload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem) 7138 // cond: canMergeSym(sym1,sym2) 7139 // result: (MOVFload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 7140 for { 7141 off1 := v.AuxInt 7142 sym1 := v.Aux 7143 mem := v.Args[1] 7144 v_0 := v.Args[0] 7145 if v_0.Op != OpARMMOVWaddr { 7146 break 7147 } 7148 off2 := v_0.AuxInt 7149 sym2 := v_0.Aux 7150 ptr := v_0.Args[0] 7151 if !(canMergeSym(sym1, sym2)) { 7152 break 7153 } 7154 v.reset(OpARMMOVFload) 7155 v.AuxInt = off1 + off2 7156 v.Aux = mergeSym(sym1, sym2) 7157 v.AddArg(ptr) 7158 v.AddArg(mem) 7159 return true 7160 } 7161 // match: (MOVFload [off] {sym} ptr (MOVFstore [off2] {sym2} ptr2 x _)) 7162 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2) 7163 // result: x 7164 for { 7165 off := v.AuxInt 7166 sym := v.Aux 7167 _ = v.Args[1] 7168 ptr := v.Args[0] 7169 v_1 := v.Args[1] 7170 if v_1.Op != OpARMMOVFstore { 7171 break 7172 } 7173 off2 := v_1.AuxInt 7174 sym2 := v_1.Aux 7175 _ = v_1.Args[2] 7176 ptr2 := v_1.Args[0] 7177 x := v_1.Args[1] 7178 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) { 7179 break 7180 } 7181 v.reset(OpCopy) 7182 v.Type = x.Type 7183 v.AddArg(x) 7184 return true 7185 } 7186 return false 7187 } 7188 func rewriteValueARM_OpARMMOVFstore_0(v *Value) bool { 7189 // match: (MOVFstore [off1] {sym} (ADDconst [off2] ptr) val mem) 7190 // result: (MOVFstore [off1+off2] {sym} ptr val mem) 7191 for { 7192 off1 := v.AuxInt 7193 sym := v.Aux 7194 mem := v.Args[2] 7195 v_0 := v.Args[0] 7196 if v_0.Op != OpARMADDconst { 7197 break 7198 } 7199 off2 := v_0.AuxInt 7200 ptr := v_0.Args[0] 7201 val := v.Args[1] 7202 v.reset(OpARMMOVFstore) 7203 v.AuxInt = off1 + off2 7204 v.Aux = sym 7205 v.AddArg(ptr) 7206 v.AddArg(val) 7207 v.AddArg(mem) 7208 return true 7209 } 7210 // match: (MOVFstore [off1] {sym} (SUBconst [off2] ptr) val mem) 7211 // result: (MOVFstore [off1-off2] {sym} ptr val mem) 7212 for { 7213 off1 := v.AuxInt 7214 sym := v.Aux 7215 mem := v.Args[2] 7216 v_0 := v.Args[0] 7217 if v_0.Op != OpARMSUBconst { 7218 break 7219 } 7220 off2 := v_0.AuxInt 7221 ptr := v_0.Args[0] 7222 val := v.Args[1] 7223 v.reset(OpARMMOVFstore) 7224 v.AuxInt = off1 - off2 7225 v.Aux = sym 7226 v.AddArg(ptr) 7227 v.AddArg(val) 7228 v.AddArg(mem) 7229 return true 7230 } 7231 // match: (MOVFstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem) 7232 // cond: canMergeSym(sym1,sym2) 7233 // result: (MOVFstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 7234 for { 7235 off1 := v.AuxInt 7236 sym1 := v.Aux 7237 mem := v.Args[2] 7238 v_0 := v.Args[0] 7239 if v_0.Op != OpARMMOVWaddr { 7240 break 7241 } 7242 off2 := v_0.AuxInt 7243 sym2 := v_0.Aux 7244 ptr := v_0.Args[0] 7245 val := v.Args[1] 7246 if !(canMergeSym(sym1, sym2)) { 7247 break 7248 } 7249 v.reset(OpARMMOVFstore) 7250 v.AuxInt = off1 + off2 7251 v.Aux = mergeSym(sym1, sym2) 7252 v.AddArg(ptr) 7253 v.AddArg(val) 7254 v.AddArg(mem) 7255 return true 7256 } 7257 return false 7258 } 7259 func rewriteValueARM_OpARMMOVHUload_0(v *Value) bool { 7260 b := v.Block 7261 config := b.Func.Config 7262 // match: (MOVHUload [off1] {sym} (ADDconst [off2] ptr) mem) 7263 // result: (MOVHUload [off1+off2] {sym} ptr mem) 7264 for { 7265 off1 := v.AuxInt 7266 sym := v.Aux 7267 mem := v.Args[1] 7268 v_0 := v.Args[0] 7269 if v_0.Op != OpARMADDconst { 7270 break 7271 } 7272 off2 := v_0.AuxInt 7273 ptr := v_0.Args[0] 7274 v.reset(OpARMMOVHUload) 7275 v.AuxInt = off1 + off2 7276 v.Aux = sym 7277 v.AddArg(ptr) 7278 v.AddArg(mem) 7279 return true 7280 } 7281 // match: (MOVHUload [off1] {sym} (SUBconst [off2] ptr) mem) 7282 // result: (MOVHUload [off1-off2] {sym} ptr mem) 7283 for { 7284 off1 := v.AuxInt 7285 sym := v.Aux 7286 mem := v.Args[1] 7287 v_0 := v.Args[0] 7288 if v_0.Op != OpARMSUBconst { 7289 break 7290 } 7291 off2 := v_0.AuxInt 7292 ptr := v_0.Args[0] 7293 v.reset(OpARMMOVHUload) 7294 v.AuxInt = off1 - off2 7295 v.Aux = sym 7296 v.AddArg(ptr) 7297 v.AddArg(mem) 7298 return true 7299 } 7300 // match: (MOVHUload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem) 7301 // cond: canMergeSym(sym1,sym2) 7302 // result: (MOVHUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 7303 for { 7304 off1 := v.AuxInt 7305 sym1 := v.Aux 7306 mem := v.Args[1] 7307 v_0 := v.Args[0] 7308 if v_0.Op != OpARMMOVWaddr { 7309 break 7310 } 7311 off2 := v_0.AuxInt 7312 sym2 := v_0.Aux 7313 ptr := v_0.Args[0] 7314 if !(canMergeSym(sym1, sym2)) { 7315 break 7316 } 7317 v.reset(OpARMMOVHUload) 7318 v.AuxInt = off1 + off2 7319 v.Aux = mergeSym(sym1, sym2) 7320 v.AddArg(ptr) 7321 v.AddArg(mem) 7322 return true 7323 } 7324 // match: (MOVHUload [off] {sym} ptr (MOVHstore [off2] {sym2} ptr2 x _)) 7325 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2) 7326 // result: (MOVHUreg x) 7327 for { 7328 off := v.AuxInt 7329 sym := v.Aux 7330 _ = v.Args[1] 7331 ptr := v.Args[0] 7332 v_1 := v.Args[1] 7333 if v_1.Op != OpARMMOVHstore { 7334 break 7335 } 7336 off2 := v_1.AuxInt 7337 sym2 := v_1.Aux 7338 _ = v_1.Args[2] 7339 ptr2 := v_1.Args[0] 7340 x := v_1.Args[1] 7341 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) { 7342 break 7343 } 7344 v.reset(OpARMMOVHUreg) 7345 v.AddArg(x) 7346 return true 7347 } 7348 // match: (MOVHUload [0] {sym} (ADD ptr idx) mem) 7349 // cond: sym == nil 7350 // result: (MOVHUloadidx ptr idx mem) 7351 for { 7352 if v.AuxInt != 0 { 7353 break 7354 } 7355 sym := v.Aux 7356 mem := v.Args[1] 7357 v_0 := v.Args[0] 7358 if v_0.Op != OpARMADD { 7359 break 7360 } 7361 idx := v_0.Args[1] 7362 ptr := v_0.Args[0] 7363 if !(sym == nil) { 7364 break 7365 } 7366 v.reset(OpARMMOVHUloadidx) 7367 v.AddArg(ptr) 7368 v.AddArg(idx) 7369 v.AddArg(mem) 7370 return true 7371 } 7372 // match: (MOVHUload [off] {sym} (SB) _) 7373 // cond: symIsRO(sym) 7374 // result: (MOVWconst [int64(read16(sym, off, config.BigEndian))]) 7375 for { 7376 off := v.AuxInt 7377 sym := v.Aux 7378 _ = v.Args[1] 7379 v_0 := v.Args[0] 7380 if v_0.Op != OpSB || !(symIsRO(sym)) { 7381 break 7382 } 7383 v.reset(OpARMMOVWconst) 7384 v.AuxInt = int64(read16(sym, off, config.BigEndian)) 7385 return true 7386 } 7387 return false 7388 } 7389 func rewriteValueARM_OpARMMOVHUloadidx_0(v *Value) bool { 7390 // match: (MOVHUloadidx ptr idx (MOVHstoreidx ptr2 idx x _)) 7391 // cond: isSamePtr(ptr, ptr2) 7392 // result: (MOVHUreg x) 7393 for { 7394 _ = v.Args[2] 7395 ptr := v.Args[0] 7396 idx := v.Args[1] 7397 v_2 := v.Args[2] 7398 if v_2.Op != OpARMMOVHstoreidx { 7399 break 7400 } 7401 _ = v_2.Args[3] 7402 ptr2 := v_2.Args[0] 7403 if idx != v_2.Args[1] { 7404 break 7405 } 7406 x := v_2.Args[2] 7407 if !(isSamePtr(ptr, ptr2)) { 7408 break 7409 } 7410 v.reset(OpARMMOVHUreg) 7411 v.AddArg(x) 7412 return true 7413 } 7414 // match: (MOVHUloadidx ptr (MOVWconst [c]) mem) 7415 // result: (MOVHUload [c] ptr mem) 7416 for { 7417 mem := v.Args[2] 7418 ptr := v.Args[0] 7419 v_1 := v.Args[1] 7420 if v_1.Op != OpARMMOVWconst { 7421 break 7422 } 7423 c := v_1.AuxInt 7424 v.reset(OpARMMOVHUload) 7425 v.AuxInt = c 7426 v.AddArg(ptr) 7427 v.AddArg(mem) 7428 return true 7429 } 7430 // match: (MOVHUloadidx (MOVWconst [c]) ptr mem) 7431 // result: (MOVHUload [c] ptr mem) 7432 for { 7433 mem := v.Args[2] 7434 v_0 := v.Args[0] 7435 if v_0.Op != OpARMMOVWconst { 7436 break 7437 } 7438 c := v_0.AuxInt 7439 ptr := v.Args[1] 7440 v.reset(OpARMMOVHUload) 7441 v.AuxInt = c 7442 v.AddArg(ptr) 7443 v.AddArg(mem) 7444 return true 7445 } 7446 return false 7447 } 7448 func rewriteValueARM_OpARMMOVHUreg_0(v *Value) bool { 7449 // match: (MOVHUreg x:(MOVBUload _ _)) 7450 // result: (MOVWreg x) 7451 for { 7452 x := v.Args[0] 7453 if x.Op != OpARMMOVBUload { 7454 break 7455 } 7456 _ = x.Args[1] 7457 v.reset(OpARMMOVWreg) 7458 v.AddArg(x) 7459 return true 7460 } 7461 // match: (MOVHUreg x:(MOVHUload _ _)) 7462 // result: (MOVWreg x) 7463 for { 7464 x := v.Args[0] 7465 if x.Op != OpARMMOVHUload { 7466 break 7467 } 7468 _ = x.Args[1] 7469 v.reset(OpARMMOVWreg) 7470 v.AddArg(x) 7471 return true 7472 } 7473 // match: (MOVHUreg (ANDconst [c] x)) 7474 // result: (ANDconst [c&0xffff] x) 7475 for { 7476 v_0 := v.Args[0] 7477 if v_0.Op != OpARMANDconst { 7478 break 7479 } 7480 c := v_0.AuxInt 7481 x := v_0.Args[0] 7482 v.reset(OpARMANDconst) 7483 v.AuxInt = c & 0xffff 7484 v.AddArg(x) 7485 return true 7486 } 7487 // match: (MOVHUreg x:(MOVBUreg _)) 7488 // result: (MOVWreg x) 7489 for { 7490 x := v.Args[0] 7491 if x.Op != OpARMMOVBUreg { 7492 break 7493 } 7494 v.reset(OpARMMOVWreg) 7495 v.AddArg(x) 7496 return true 7497 } 7498 // match: (MOVHUreg x:(MOVHUreg _)) 7499 // result: (MOVWreg x) 7500 for { 7501 x := v.Args[0] 7502 if x.Op != OpARMMOVHUreg { 7503 break 7504 } 7505 v.reset(OpARMMOVWreg) 7506 v.AddArg(x) 7507 return true 7508 } 7509 // match: (MOVHUreg (MOVWconst [c])) 7510 // result: (MOVWconst [int64(uint16(c))]) 7511 for { 7512 v_0 := v.Args[0] 7513 if v_0.Op != OpARMMOVWconst { 7514 break 7515 } 7516 c := v_0.AuxInt 7517 v.reset(OpARMMOVWconst) 7518 v.AuxInt = int64(uint16(c)) 7519 return true 7520 } 7521 return false 7522 } 7523 func rewriteValueARM_OpARMMOVHload_0(v *Value) bool { 7524 // match: (MOVHload [off1] {sym} (ADDconst [off2] ptr) mem) 7525 // result: (MOVHload [off1+off2] {sym} ptr mem) 7526 for { 7527 off1 := v.AuxInt 7528 sym := v.Aux 7529 mem := v.Args[1] 7530 v_0 := v.Args[0] 7531 if v_0.Op != OpARMADDconst { 7532 break 7533 } 7534 off2 := v_0.AuxInt 7535 ptr := v_0.Args[0] 7536 v.reset(OpARMMOVHload) 7537 v.AuxInt = off1 + off2 7538 v.Aux = sym 7539 v.AddArg(ptr) 7540 v.AddArg(mem) 7541 return true 7542 } 7543 // match: (MOVHload [off1] {sym} (SUBconst [off2] ptr) mem) 7544 // result: (MOVHload [off1-off2] {sym} ptr mem) 7545 for { 7546 off1 := v.AuxInt 7547 sym := v.Aux 7548 mem := v.Args[1] 7549 v_0 := v.Args[0] 7550 if v_0.Op != OpARMSUBconst { 7551 break 7552 } 7553 off2 := v_0.AuxInt 7554 ptr := v_0.Args[0] 7555 v.reset(OpARMMOVHload) 7556 v.AuxInt = off1 - off2 7557 v.Aux = sym 7558 v.AddArg(ptr) 7559 v.AddArg(mem) 7560 return true 7561 } 7562 // match: (MOVHload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem) 7563 // cond: canMergeSym(sym1,sym2) 7564 // result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 7565 for { 7566 off1 := v.AuxInt 7567 sym1 := v.Aux 7568 mem := v.Args[1] 7569 v_0 := v.Args[0] 7570 if v_0.Op != OpARMMOVWaddr { 7571 break 7572 } 7573 off2 := v_0.AuxInt 7574 sym2 := v_0.Aux 7575 ptr := v_0.Args[0] 7576 if !(canMergeSym(sym1, sym2)) { 7577 break 7578 } 7579 v.reset(OpARMMOVHload) 7580 v.AuxInt = off1 + off2 7581 v.Aux = mergeSym(sym1, sym2) 7582 v.AddArg(ptr) 7583 v.AddArg(mem) 7584 return true 7585 } 7586 // match: (MOVHload [off] {sym} ptr (MOVHstore [off2] {sym2} ptr2 x _)) 7587 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2) 7588 // result: (MOVHreg x) 7589 for { 7590 off := v.AuxInt 7591 sym := v.Aux 7592 _ = v.Args[1] 7593 ptr := v.Args[0] 7594 v_1 := v.Args[1] 7595 if v_1.Op != OpARMMOVHstore { 7596 break 7597 } 7598 off2 := v_1.AuxInt 7599 sym2 := v_1.Aux 7600 _ = v_1.Args[2] 7601 ptr2 := v_1.Args[0] 7602 x := v_1.Args[1] 7603 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) { 7604 break 7605 } 7606 v.reset(OpARMMOVHreg) 7607 v.AddArg(x) 7608 return true 7609 } 7610 // match: (MOVHload [0] {sym} (ADD ptr idx) mem) 7611 // cond: sym == nil 7612 // result: (MOVHloadidx ptr idx mem) 7613 for { 7614 if v.AuxInt != 0 { 7615 break 7616 } 7617 sym := v.Aux 7618 mem := v.Args[1] 7619 v_0 := v.Args[0] 7620 if v_0.Op != OpARMADD { 7621 break 7622 } 7623 idx := v_0.Args[1] 7624 ptr := v_0.Args[0] 7625 if !(sym == nil) { 7626 break 7627 } 7628 v.reset(OpARMMOVHloadidx) 7629 v.AddArg(ptr) 7630 v.AddArg(idx) 7631 v.AddArg(mem) 7632 return true 7633 } 7634 return false 7635 } 7636 func rewriteValueARM_OpARMMOVHloadidx_0(v *Value) bool { 7637 // match: (MOVHloadidx ptr idx (MOVHstoreidx ptr2 idx x _)) 7638 // cond: isSamePtr(ptr, ptr2) 7639 // result: (MOVHreg x) 7640 for { 7641 _ = v.Args[2] 7642 ptr := v.Args[0] 7643 idx := v.Args[1] 7644 v_2 := v.Args[2] 7645 if v_2.Op != OpARMMOVHstoreidx { 7646 break 7647 } 7648 _ = v_2.Args[3] 7649 ptr2 := v_2.Args[0] 7650 if idx != v_2.Args[1] { 7651 break 7652 } 7653 x := v_2.Args[2] 7654 if !(isSamePtr(ptr, ptr2)) { 7655 break 7656 } 7657 v.reset(OpARMMOVHreg) 7658 v.AddArg(x) 7659 return true 7660 } 7661 // match: (MOVHloadidx ptr (MOVWconst [c]) mem) 7662 // result: (MOVHload [c] ptr mem) 7663 for { 7664 mem := v.Args[2] 7665 ptr := v.Args[0] 7666 v_1 := v.Args[1] 7667 if v_1.Op != OpARMMOVWconst { 7668 break 7669 } 7670 c := v_1.AuxInt 7671 v.reset(OpARMMOVHload) 7672 v.AuxInt = c 7673 v.AddArg(ptr) 7674 v.AddArg(mem) 7675 return true 7676 } 7677 // match: (MOVHloadidx (MOVWconst [c]) ptr mem) 7678 // result: (MOVHload [c] ptr mem) 7679 for { 7680 mem := v.Args[2] 7681 v_0 := v.Args[0] 7682 if v_0.Op != OpARMMOVWconst { 7683 break 7684 } 7685 c := v_0.AuxInt 7686 ptr := v.Args[1] 7687 v.reset(OpARMMOVHload) 7688 v.AuxInt = c 7689 v.AddArg(ptr) 7690 v.AddArg(mem) 7691 return true 7692 } 7693 return false 7694 } 7695 func rewriteValueARM_OpARMMOVHreg_0(v *Value) bool { 7696 // match: (MOVHreg x:(MOVBload _ _)) 7697 // result: (MOVWreg x) 7698 for { 7699 x := v.Args[0] 7700 if x.Op != OpARMMOVBload { 7701 break 7702 } 7703 _ = x.Args[1] 7704 v.reset(OpARMMOVWreg) 7705 v.AddArg(x) 7706 return true 7707 } 7708 // match: (MOVHreg x:(MOVBUload _ _)) 7709 // result: (MOVWreg x) 7710 for { 7711 x := v.Args[0] 7712 if x.Op != OpARMMOVBUload { 7713 break 7714 } 7715 _ = x.Args[1] 7716 v.reset(OpARMMOVWreg) 7717 v.AddArg(x) 7718 return true 7719 } 7720 // match: (MOVHreg x:(MOVHload _ _)) 7721 // result: (MOVWreg x) 7722 for { 7723 x := v.Args[0] 7724 if x.Op != OpARMMOVHload { 7725 break 7726 } 7727 _ = x.Args[1] 7728 v.reset(OpARMMOVWreg) 7729 v.AddArg(x) 7730 return true 7731 } 7732 // match: (MOVHreg (ANDconst [c] x)) 7733 // cond: c & 0x8000 == 0 7734 // result: (ANDconst [c&0x7fff] x) 7735 for { 7736 v_0 := v.Args[0] 7737 if v_0.Op != OpARMANDconst { 7738 break 7739 } 7740 c := v_0.AuxInt 7741 x := v_0.Args[0] 7742 if !(c&0x8000 == 0) { 7743 break 7744 } 7745 v.reset(OpARMANDconst) 7746 v.AuxInt = c & 0x7fff 7747 v.AddArg(x) 7748 return true 7749 } 7750 // match: (MOVHreg x:(MOVBreg _)) 7751 // result: (MOVWreg x) 7752 for { 7753 x := v.Args[0] 7754 if x.Op != OpARMMOVBreg { 7755 break 7756 } 7757 v.reset(OpARMMOVWreg) 7758 v.AddArg(x) 7759 return true 7760 } 7761 // match: (MOVHreg x:(MOVBUreg _)) 7762 // result: (MOVWreg x) 7763 for { 7764 x := v.Args[0] 7765 if x.Op != OpARMMOVBUreg { 7766 break 7767 } 7768 v.reset(OpARMMOVWreg) 7769 v.AddArg(x) 7770 return true 7771 } 7772 // match: (MOVHreg x:(MOVHreg _)) 7773 // result: (MOVWreg x) 7774 for { 7775 x := v.Args[0] 7776 if x.Op != OpARMMOVHreg { 7777 break 7778 } 7779 v.reset(OpARMMOVWreg) 7780 v.AddArg(x) 7781 return true 7782 } 7783 // match: (MOVHreg (MOVWconst [c])) 7784 // result: (MOVWconst [int64(int16(c))]) 7785 for { 7786 v_0 := v.Args[0] 7787 if v_0.Op != OpARMMOVWconst { 7788 break 7789 } 7790 c := v_0.AuxInt 7791 v.reset(OpARMMOVWconst) 7792 v.AuxInt = int64(int16(c)) 7793 return true 7794 } 7795 return false 7796 } 7797 func rewriteValueARM_OpARMMOVHstore_0(v *Value) bool { 7798 // match: (MOVHstore [off1] {sym} (ADDconst [off2] ptr) val mem) 7799 // result: (MOVHstore [off1+off2] {sym} ptr val mem) 7800 for { 7801 off1 := v.AuxInt 7802 sym := v.Aux 7803 mem := v.Args[2] 7804 v_0 := v.Args[0] 7805 if v_0.Op != OpARMADDconst { 7806 break 7807 } 7808 off2 := v_0.AuxInt 7809 ptr := v_0.Args[0] 7810 val := v.Args[1] 7811 v.reset(OpARMMOVHstore) 7812 v.AuxInt = off1 + off2 7813 v.Aux = sym 7814 v.AddArg(ptr) 7815 v.AddArg(val) 7816 v.AddArg(mem) 7817 return true 7818 } 7819 // match: (MOVHstore [off1] {sym} (SUBconst [off2] ptr) val mem) 7820 // result: (MOVHstore [off1-off2] {sym} ptr val mem) 7821 for { 7822 off1 := v.AuxInt 7823 sym := v.Aux 7824 mem := v.Args[2] 7825 v_0 := v.Args[0] 7826 if v_0.Op != OpARMSUBconst { 7827 break 7828 } 7829 off2 := v_0.AuxInt 7830 ptr := v_0.Args[0] 7831 val := v.Args[1] 7832 v.reset(OpARMMOVHstore) 7833 v.AuxInt = off1 - off2 7834 v.Aux = sym 7835 v.AddArg(ptr) 7836 v.AddArg(val) 7837 v.AddArg(mem) 7838 return true 7839 } 7840 // match: (MOVHstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem) 7841 // cond: canMergeSym(sym1,sym2) 7842 // result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 7843 for { 7844 off1 := v.AuxInt 7845 sym1 := v.Aux 7846 mem := v.Args[2] 7847 v_0 := v.Args[0] 7848 if v_0.Op != OpARMMOVWaddr { 7849 break 7850 } 7851 off2 := v_0.AuxInt 7852 sym2 := v_0.Aux 7853 ptr := v_0.Args[0] 7854 val := v.Args[1] 7855 if !(canMergeSym(sym1, sym2)) { 7856 break 7857 } 7858 v.reset(OpARMMOVHstore) 7859 v.AuxInt = off1 + off2 7860 v.Aux = mergeSym(sym1, sym2) 7861 v.AddArg(ptr) 7862 v.AddArg(val) 7863 v.AddArg(mem) 7864 return true 7865 } 7866 // match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem) 7867 // result: (MOVHstore [off] {sym} ptr x mem) 7868 for { 7869 off := v.AuxInt 7870 sym := v.Aux 7871 mem := v.Args[2] 7872 ptr := v.Args[0] 7873 v_1 := v.Args[1] 7874 if v_1.Op != OpARMMOVHreg { 7875 break 7876 } 7877 x := v_1.Args[0] 7878 v.reset(OpARMMOVHstore) 7879 v.AuxInt = off 7880 v.Aux = sym 7881 v.AddArg(ptr) 7882 v.AddArg(x) 7883 v.AddArg(mem) 7884 return true 7885 } 7886 // match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem) 7887 // result: (MOVHstore [off] {sym} ptr x mem) 7888 for { 7889 off := v.AuxInt 7890 sym := v.Aux 7891 mem := v.Args[2] 7892 ptr := v.Args[0] 7893 v_1 := v.Args[1] 7894 if v_1.Op != OpARMMOVHUreg { 7895 break 7896 } 7897 x := v_1.Args[0] 7898 v.reset(OpARMMOVHstore) 7899 v.AuxInt = off 7900 v.Aux = sym 7901 v.AddArg(ptr) 7902 v.AddArg(x) 7903 v.AddArg(mem) 7904 return true 7905 } 7906 // match: (MOVHstore [0] {sym} (ADD ptr idx) val mem) 7907 // cond: sym == nil 7908 // result: (MOVHstoreidx ptr idx val mem) 7909 for { 7910 if v.AuxInt != 0 { 7911 break 7912 } 7913 sym := v.Aux 7914 mem := v.Args[2] 7915 v_0 := v.Args[0] 7916 if v_0.Op != OpARMADD { 7917 break 7918 } 7919 idx := v_0.Args[1] 7920 ptr := v_0.Args[0] 7921 val := v.Args[1] 7922 if !(sym == nil) { 7923 break 7924 } 7925 v.reset(OpARMMOVHstoreidx) 7926 v.AddArg(ptr) 7927 v.AddArg(idx) 7928 v.AddArg(val) 7929 v.AddArg(mem) 7930 return true 7931 } 7932 return false 7933 } 7934 func rewriteValueARM_OpARMMOVHstoreidx_0(v *Value) bool { 7935 // match: (MOVHstoreidx ptr (MOVWconst [c]) val mem) 7936 // result: (MOVHstore [c] ptr val mem) 7937 for { 7938 mem := v.Args[3] 7939 ptr := v.Args[0] 7940 v_1 := v.Args[1] 7941 if v_1.Op != OpARMMOVWconst { 7942 break 7943 } 7944 c := v_1.AuxInt 7945 val := v.Args[2] 7946 v.reset(OpARMMOVHstore) 7947 v.AuxInt = c 7948 v.AddArg(ptr) 7949 v.AddArg(val) 7950 v.AddArg(mem) 7951 return true 7952 } 7953 // match: (MOVHstoreidx (MOVWconst [c]) ptr val mem) 7954 // result: (MOVHstore [c] ptr val mem) 7955 for { 7956 mem := v.Args[3] 7957 v_0 := v.Args[0] 7958 if v_0.Op != OpARMMOVWconst { 7959 break 7960 } 7961 c := v_0.AuxInt 7962 ptr := v.Args[1] 7963 val := v.Args[2] 7964 v.reset(OpARMMOVHstore) 7965 v.AuxInt = c 7966 v.AddArg(ptr) 7967 v.AddArg(val) 7968 v.AddArg(mem) 7969 return true 7970 } 7971 return false 7972 } 7973 func rewriteValueARM_OpARMMOVWload_0(v *Value) bool { 7974 b := v.Block 7975 config := b.Func.Config 7976 // match: (MOVWload [off1] {sym} (ADDconst [off2] ptr) mem) 7977 // result: (MOVWload [off1+off2] {sym} ptr mem) 7978 for { 7979 off1 := v.AuxInt 7980 sym := v.Aux 7981 mem := v.Args[1] 7982 v_0 := v.Args[0] 7983 if v_0.Op != OpARMADDconst { 7984 break 7985 } 7986 off2 := v_0.AuxInt 7987 ptr := v_0.Args[0] 7988 v.reset(OpARMMOVWload) 7989 v.AuxInt = off1 + off2 7990 v.Aux = sym 7991 v.AddArg(ptr) 7992 v.AddArg(mem) 7993 return true 7994 } 7995 // match: (MOVWload [off1] {sym} (SUBconst [off2] ptr) mem) 7996 // result: (MOVWload [off1-off2] {sym} ptr mem) 7997 for { 7998 off1 := v.AuxInt 7999 sym := v.Aux 8000 mem := v.Args[1] 8001 v_0 := v.Args[0] 8002 if v_0.Op != OpARMSUBconst { 8003 break 8004 } 8005 off2 := v_0.AuxInt 8006 ptr := v_0.Args[0] 8007 v.reset(OpARMMOVWload) 8008 v.AuxInt = off1 - off2 8009 v.Aux = sym 8010 v.AddArg(ptr) 8011 v.AddArg(mem) 8012 return true 8013 } 8014 // match: (MOVWload [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) mem) 8015 // cond: canMergeSym(sym1,sym2) 8016 // result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem) 8017 for { 8018 off1 := v.AuxInt 8019 sym1 := v.Aux 8020 mem := v.Args[1] 8021 v_0 := v.Args[0] 8022 if v_0.Op != OpARMMOVWaddr { 8023 break 8024 } 8025 off2 := v_0.AuxInt 8026 sym2 := v_0.Aux 8027 ptr := v_0.Args[0] 8028 if !(canMergeSym(sym1, sym2)) { 8029 break 8030 } 8031 v.reset(OpARMMOVWload) 8032 v.AuxInt = off1 + off2 8033 v.Aux = mergeSym(sym1, sym2) 8034 v.AddArg(ptr) 8035 v.AddArg(mem) 8036 return true 8037 } 8038 // match: (MOVWload [off] {sym} ptr (MOVWstore [off2] {sym2} ptr2 x _)) 8039 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2) 8040 // result: x 8041 for { 8042 off := v.AuxInt 8043 sym := v.Aux 8044 _ = v.Args[1] 8045 ptr := v.Args[0] 8046 v_1 := v.Args[1] 8047 if v_1.Op != OpARMMOVWstore { 8048 break 8049 } 8050 off2 := v_1.AuxInt 8051 sym2 := v_1.Aux 8052 _ = v_1.Args[2] 8053 ptr2 := v_1.Args[0] 8054 x := v_1.Args[1] 8055 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) { 8056 break 8057 } 8058 v.reset(OpCopy) 8059 v.Type = x.Type 8060 v.AddArg(x) 8061 return true 8062 } 8063 // match: (MOVWload [0] {sym} (ADD ptr idx) mem) 8064 // cond: sym == nil 8065 // result: (MOVWloadidx ptr idx mem) 8066 for { 8067 if v.AuxInt != 0 { 8068 break 8069 } 8070 sym := v.Aux 8071 mem := v.Args[1] 8072 v_0 := v.Args[0] 8073 if v_0.Op != OpARMADD { 8074 break 8075 } 8076 idx := v_0.Args[1] 8077 ptr := v_0.Args[0] 8078 if !(sym == nil) { 8079 break 8080 } 8081 v.reset(OpARMMOVWloadidx) 8082 v.AddArg(ptr) 8083 v.AddArg(idx) 8084 v.AddArg(mem) 8085 return true 8086 } 8087 // match: (MOVWload [0] {sym} (ADDshiftLL ptr idx [c]) mem) 8088 // cond: sym == nil 8089 // result: (MOVWloadshiftLL ptr idx [c] mem) 8090 for { 8091 if v.AuxInt != 0 { 8092 break 8093 } 8094 sym := v.Aux 8095 mem := v.Args[1] 8096 v_0 := v.Args[0] 8097 if v_0.Op != OpARMADDshiftLL { 8098 break 8099 } 8100 c := v_0.AuxInt 8101 idx := v_0.Args[1] 8102 ptr := v_0.Args[0] 8103 if !(sym == nil) { 8104 break 8105 } 8106 v.reset(OpARMMOVWloadshiftLL) 8107 v.AuxInt = c 8108 v.AddArg(ptr) 8109 v.AddArg(idx) 8110 v.AddArg(mem) 8111 return true 8112 } 8113 // match: (MOVWload [0] {sym} (ADDshiftRL ptr idx [c]) mem) 8114 // cond: sym == nil 8115 // result: (MOVWloadshiftRL ptr idx [c] mem) 8116 for { 8117 if v.AuxInt != 0 { 8118 break 8119 } 8120 sym := v.Aux 8121 mem := v.Args[1] 8122 v_0 := v.Args[0] 8123 if v_0.Op != OpARMADDshiftRL { 8124 break 8125 } 8126 c := v_0.AuxInt 8127 idx := v_0.Args[1] 8128 ptr := v_0.Args[0] 8129 if !(sym == nil) { 8130 break 8131 } 8132 v.reset(OpARMMOVWloadshiftRL) 8133 v.AuxInt = c 8134 v.AddArg(ptr) 8135 v.AddArg(idx) 8136 v.AddArg(mem) 8137 return true 8138 } 8139 // match: (MOVWload [0] {sym} (ADDshiftRA ptr idx [c]) mem) 8140 // cond: sym == nil 8141 // result: (MOVWloadshiftRA ptr idx [c] mem) 8142 for { 8143 if v.AuxInt != 0 { 8144 break 8145 } 8146 sym := v.Aux 8147 mem := v.Args[1] 8148 v_0 := v.Args[0] 8149 if v_0.Op != OpARMADDshiftRA { 8150 break 8151 } 8152 c := v_0.AuxInt 8153 idx := v_0.Args[1] 8154 ptr := v_0.Args[0] 8155 if !(sym == nil) { 8156 break 8157 } 8158 v.reset(OpARMMOVWloadshiftRA) 8159 v.AuxInt = c 8160 v.AddArg(ptr) 8161 v.AddArg(idx) 8162 v.AddArg(mem) 8163 return true 8164 } 8165 // match: (MOVWload [off] {sym} (SB) _) 8166 // cond: symIsRO(sym) 8167 // result: (MOVWconst [int64(int32(read32(sym, off, config.BigEndian)))]) 8168 for { 8169 off := v.AuxInt 8170 sym := v.Aux 8171 _ = v.Args[1] 8172 v_0 := v.Args[0] 8173 if v_0.Op != OpSB || !(symIsRO(sym)) { 8174 break 8175 } 8176 v.reset(OpARMMOVWconst) 8177 v.AuxInt = int64(int32(read32(sym, off, config.BigEndian))) 8178 return true 8179 } 8180 return false 8181 } 8182 func rewriteValueARM_OpARMMOVWloadidx_0(v *Value) bool { 8183 // match: (MOVWloadidx ptr idx (MOVWstoreidx ptr2 idx x _)) 8184 // cond: isSamePtr(ptr, ptr2) 8185 // result: x 8186 for { 8187 _ = v.Args[2] 8188 ptr := v.Args[0] 8189 idx := v.Args[1] 8190 v_2 := v.Args[2] 8191 if v_2.Op != OpARMMOVWstoreidx { 8192 break 8193 } 8194 _ = v_2.Args[3] 8195 ptr2 := v_2.Args[0] 8196 if idx != v_2.Args[1] { 8197 break 8198 } 8199 x := v_2.Args[2] 8200 if !(isSamePtr(ptr, ptr2)) { 8201 break 8202 } 8203 v.reset(OpCopy) 8204 v.Type = x.Type 8205 v.AddArg(x) 8206 return true 8207 } 8208 // match: (MOVWloadidx ptr (MOVWconst [c]) mem) 8209 // result: (MOVWload [c] ptr mem) 8210 for { 8211 mem := v.Args[2] 8212 ptr := v.Args[0] 8213 v_1 := v.Args[1] 8214 if v_1.Op != OpARMMOVWconst { 8215 break 8216 } 8217 c := v_1.AuxInt 8218 v.reset(OpARMMOVWload) 8219 v.AuxInt = c 8220 v.AddArg(ptr) 8221 v.AddArg(mem) 8222 return true 8223 } 8224 // match: (MOVWloadidx (MOVWconst [c]) ptr mem) 8225 // result: (MOVWload [c] ptr mem) 8226 for { 8227 mem := v.Args[2] 8228 v_0 := v.Args[0] 8229 if v_0.Op != OpARMMOVWconst { 8230 break 8231 } 8232 c := v_0.AuxInt 8233 ptr := v.Args[1] 8234 v.reset(OpARMMOVWload) 8235 v.AuxInt = c 8236 v.AddArg(ptr) 8237 v.AddArg(mem) 8238 return true 8239 } 8240 // match: (MOVWloadidx ptr (SLLconst idx [c]) mem) 8241 // result: (MOVWloadshiftLL ptr idx [c] mem) 8242 for { 8243 mem := v.Args[2] 8244 ptr := v.Args[0] 8245 v_1 := v.Args[1] 8246 if v_1.Op != OpARMSLLconst { 8247 break 8248 } 8249 c := v_1.AuxInt 8250 idx := v_1.Args[0] 8251 v.reset(OpARMMOVWloadshiftLL) 8252 v.AuxInt = c 8253 v.AddArg(ptr) 8254 v.AddArg(idx) 8255 v.AddArg(mem) 8256 return true 8257 } 8258 // match: (MOVWloadidx (SLLconst idx [c]) ptr mem) 8259 // result: (MOVWloadshiftLL ptr idx [c] mem) 8260 for { 8261 mem := v.Args[2] 8262 v_0 := v.Args[0] 8263 if v_0.Op != OpARMSLLconst { 8264 break 8265 } 8266 c := v_0.AuxInt 8267 idx := v_0.Args[0] 8268 ptr := v.Args[1] 8269 v.reset(OpARMMOVWloadshiftLL) 8270 v.AuxInt = c 8271 v.AddArg(ptr) 8272 v.AddArg(idx) 8273 v.AddArg(mem) 8274 return true 8275 } 8276 // match: (MOVWloadidx ptr (SRLconst idx [c]) mem) 8277 // result: (MOVWloadshiftRL ptr idx [c] mem) 8278 for { 8279 mem := v.Args[2] 8280 ptr := v.Args[0] 8281 v_1 := v.Args[1] 8282 if v_1.Op != OpARMSRLconst { 8283 break 8284 } 8285 c := v_1.AuxInt 8286 idx := v_1.Args[0] 8287 v.reset(OpARMMOVWloadshiftRL) 8288 v.AuxInt = c 8289 v.AddArg(ptr) 8290 v.AddArg(idx) 8291 v.AddArg(mem) 8292 return true 8293 } 8294 // match: (MOVWloadidx (SRLconst idx [c]) ptr mem) 8295 // result: (MOVWloadshiftRL ptr idx [c] mem) 8296 for { 8297 mem := v.Args[2] 8298 v_0 := v.Args[0] 8299 if v_0.Op != OpARMSRLconst { 8300 break 8301 } 8302 c := v_0.AuxInt 8303 idx := v_0.Args[0] 8304 ptr := v.Args[1] 8305 v.reset(OpARMMOVWloadshiftRL) 8306 v.AuxInt = c 8307 v.AddArg(ptr) 8308 v.AddArg(idx) 8309 v.AddArg(mem) 8310 return true 8311 } 8312 // match: (MOVWloadidx ptr (SRAconst idx [c]) mem) 8313 // result: (MOVWloadshiftRA ptr idx [c] mem) 8314 for { 8315 mem := v.Args[2] 8316 ptr := v.Args[0] 8317 v_1 := v.Args[1] 8318 if v_1.Op != OpARMSRAconst { 8319 break 8320 } 8321 c := v_1.AuxInt 8322 idx := v_1.Args[0] 8323 v.reset(OpARMMOVWloadshiftRA) 8324 v.AuxInt = c 8325 v.AddArg(ptr) 8326 v.AddArg(idx) 8327 v.AddArg(mem) 8328 return true 8329 } 8330 // match: (MOVWloadidx (SRAconst idx [c]) ptr mem) 8331 // result: (MOVWloadshiftRA ptr idx [c] mem) 8332 for { 8333 mem := v.Args[2] 8334 v_0 := v.Args[0] 8335 if v_0.Op != OpARMSRAconst { 8336 break 8337 } 8338 c := v_0.AuxInt 8339 idx := v_0.Args[0] 8340 ptr := v.Args[1] 8341 v.reset(OpARMMOVWloadshiftRA) 8342 v.AuxInt = c 8343 v.AddArg(ptr) 8344 v.AddArg(idx) 8345 v.AddArg(mem) 8346 return true 8347 } 8348 return false 8349 } 8350 func rewriteValueARM_OpARMMOVWloadshiftLL_0(v *Value) bool { 8351 // match: (MOVWloadshiftLL ptr idx [c] (MOVWstoreshiftLL ptr2 idx [d] x _)) 8352 // cond: c==d && isSamePtr(ptr, ptr2) 8353 // result: x 8354 for { 8355 c := v.AuxInt 8356 _ = v.Args[2] 8357 ptr := v.Args[0] 8358 idx := v.Args[1] 8359 v_2 := v.Args[2] 8360 if v_2.Op != OpARMMOVWstoreshiftLL { 8361 break 8362 } 8363 d := v_2.AuxInt 8364 _ = v_2.Args[3] 8365 ptr2 := v_2.Args[0] 8366 if idx != v_2.Args[1] { 8367 break 8368 } 8369 x := v_2.Args[2] 8370 if !(c == d && isSamePtr(ptr, ptr2)) { 8371 break 8372 } 8373 v.reset(OpCopy) 8374 v.Type = x.Type 8375 v.AddArg(x) 8376 return true 8377 } 8378 // match: (MOVWloadshiftLL ptr (MOVWconst [c]) [d] mem) 8379 // result: (MOVWload [int64(uint32(c)<<uint64(d))] ptr mem) 8380 for { 8381 d := v.AuxInt 8382 mem := v.Args[2] 8383 ptr := v.Args[0] 8384 v_1 := v.Args[1] 8385 if v_1.Op != OpARMMOVWconst { 8386 break 8387 } 8388 c := v_1.AuxInt 8389 v.reset(OpARMMOVWload) 8390 v.AuxInt = int64(uint32(c) << uint64(d)) 8391 v.AddArg(ptr) 8392 v.AddArg(mem) 8393 return true 8394 } 8395 return false 8396 } 8397 func rewriteValueARM_OpARMMOVWloadshiftRA_0(v *Value) bool { 8398 // match: (MOVWloadshiftRA ptr idx [c] (MOVWstoreshiftRA ptr2 idx [d] x _)) 8399 // cond: c==d && isSamePtr(ptr, ptr2) 8400 // result: x 8401 for { 8402 c := v.AuxInt 8403 _ = v.Args[2] 8404 ptr := v.Args[0] 8405 idx := v.Args[1] 8406 v_2 := v.Args[2] 8407 if v_2.Op != OpARMMOVWstoreshiftRA { 8408 break 8409 } 8410 d := v_2.AuxInt 8411 _ = v_2.Args[3] 8412 ptr2 := v_2.Args[0] 8413 if idx != v_2.Args[1] { 8414 break 8415 } 8416 x := v_2.Args[2] 8417 if !(c == d && isSamePtr(ptr, ptr2)) { 8418 break 8419 } 8420 v.reset(OpCopy) 8421 v.Type = x.Type 8422 v.AddArg(x) 8423 return true 8424 } 8425 // match: (MOVWloadshiftRA ptr (MOVWconst [c]) [d] mem) 8426 // result: (MOVWload [int64(int32(c)>>uint64(d))] ptr mem) 8427 for { 8428 d := v.AuxInt 8429 mem := v.Args[2] 8430 ptr := v.Args[0] 8431 v_1 := v.Args[1] 8432 if v_1.Op != OpARMMOVWconst { 8433 break 8434 } 8435 c := v_1.AuxInt 8436 v.reset(OpARMMOVWload) 8437 v.AuxInt = int64(int32(c) >> uint64(d)) 8438 v.AddArg(ptr) 8439 v.AddArg(mem) 8440 return true 8441 } 8442 return false 8443 } 8444 func rewriteValueARM_OpARMMOVWloadshiftRL_0(v *Value) bool { 8445 // match: (MOVWloadshiftRL ptr idx [c] (MOVWstoreshiftRL ptr2 idx [d] x _)) 8446 // cond: c==d && isSamePtr(ptr, ptr2) 8447 // result: x 8448 for { 8449 c := v.AuxInt 8450 _ = v.Args[2] 8451 ptr := v.Args[0] 8452 idx := v.Args[1] 8453 v_2 := v.Args[2] 8454 if v_2.Op != OpARMMOVWstoreshiftRL { 8455 break 8456 } 8457 d := v_2.AuxInt 8458 _ = v_2.Args[3] 8459 ptr2 := v_2.Args[0] 8460 if idx != v_2.Args[1] { 8461 break 8462 } 8463 x := v_2.Args[2] 8464 if !(c == d && isSamePtr(ptr, ptr2)) { 8465 break 8466 } 8467 v.reset(OpCopy) 8468 v.Type = x.Type 8469 v.AddArg(x) 8470 return true 8471 } 8472 // match: (MOVWloadshiftRL ptr (MOVWconst [c]) [d] mem) 8473 // result: (MOVWload [int64(uint32(c)>>uint64(d))] ptr mem) 8474 for { 8475 d := v.AuxInt 8476 mem := v.Args[2] 8477 ptr := v.Args[0] 8478 v_1 := v.Args[1] 8479 if v_1.Op != OpARMMOVWconst { 8480 break 8481 } 8482 c := v_1.AuxInt 8483 v.reset(OpARMMOVWload) 8484 v.AuxInt = int64(uint32(c) >> uint64(d)) 8485 v.AddArg(ptr) 8486 v.AddArg(mem) 8487 return true 8488 } 8489 return false 8490 } 8491 func rewriteValueARM_OpARMMOVWreg_0(v *Value) bool { 8492 // match: (MOVWreg x) 8493 // cond: x.Uses == 1 8494 // result: (MOVWnop x) 8495 for { 8496 x := v.Args[0] 8497 if !(x.Uses == 1) { 8498 break 8499 } 8500 v.reset(OpARMMOVWnop) 8501 v.AddArg(x) 8502 return true 8503 } 8504 // match: (MOVWreg (MOVWconst [c])) 8505 // result: (MOVWconst [c]) 8506 for { 8507 v_0 := v.Args[0] 8508 if v_0.Op != OpARMMOVWconst { 8509 break 8510 } 8511 c := v_0.AuxInt 8512 v.reset(OpARMMOVWconst) 8513 v.AuxInt = c 8514 return true 8515 } 8516 return false 8517 } 8518 func rewriteValueARM_OpARMMOVWstore_0(v *Value) bool { 8519 // match: (MOVWstore [off1] {sym} (ADDconst [off2] ptr) val mem) 8520 // result: (MOVWstore [off1+off2] {sym} ptr val mem) 8521 for { 8522 off1 := v.AuxInt 8523 sym := v.Aux 8524 mem := v.Args[2] 8525 v_0 := v.Args[0] 8526 if v_0.Op != OpARMADDconst { 8527 break 8528 } 8529 off2 := v_0.AuxInt 8530 ptr := v_0.Args[0] 8531 val := v.Args[1] 8532 v.reset(OpARMMOVWstore) 8533 v.AuxInt = off1 + off2 8534 v.Aux = sym 8535 v.AddArg(ptr) 8536 v.AddArg(val) 8537 v.AddArg(mem) 8538 return true 8539 } 8540 // match: (MOVWstore [off1] {sym} (SUBconst [off2] ptr) val mem) 8541 // result: (MOVWstore [off1-off2] {sym} ptr val mem) 8542 for { 8543 off1 := v.AuxInt 8544 sym := v.Aux 8545 mem := v.Args[2] 8546 v_0 := v.Args[0] 8547 if v_0.Op != OpARMSUBconst { 8548 break 8549 } 8550 off2 := v_0.AuxInt 8551 ptr := v_0.Args[0] 8552 val := v.Args[1] 8553 v.reset(OpARMMOVWstore) 8554 v.AuxInt = off1 - off2 8555 v.Aux = sym 8556 v.AddArg(ptr) 8557 v.AddArg(val) 8558 v.AddArg(mem) 8559 return true 8560 } 8561 // match: (MOVWstore [off1] {sym1} (MOVWaddr [off2] {sym2} ptr) val mem) 8562 // cond: canMergeSym(sym1,sym2) 8563 // result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem) 8564 for { 8565 off1 := v.AuxInt 8566 sym1 := v.Aux 8567 mem := v.Args[2] 8568 v_0 := v.Args[0] 8569 if v_0.Op != OpARMMOVWaddr { 8570 break 8571 } 8572 off2 := v_0.AuxInt 8573 sym2 := v_0.Aux 8574 ptr := v_0.Args[0] 8575 val := v.Args[1] 8576 if !(canMergeSym(sym1, sym2)) { 8577 break 8578 } 8579 v.reset(OpARMMOVWstore) 8580 v.AuxInt = off1 + off2 8581 v.Aux = mergeSym(sym1, sym2) 8582 v.AddArg(ptr) 8583 v.AddArg(val) 8584 v.AddArg(mem) 8585 return true 8586 } 8587 // match: (MOVWstore [0] {sym} (ADD ptr idx) val mem) 8588 // cond: sym == nil 8589 // result: (MOVWstoreidx ptr idx val mem) 8590 for { 8591 if v.AuxInt != 0 { 8592 break 8593 } 8594 sym := v.Aux 8595 mem := v.Args[2] 8596 v_0 := v.Args[0] 8597 if v_0.Op != OpARMADD { 8598 break 8599 } 8600 idx := v_0.Args[1] 8601 ptr := v_0.Args[0] 8602 val := v.Args[1] 8603 if !(sym == nil) { 8604 break 8605 } 8606 v.reset(OpARMMOVWstoreidx) 8607 v.AddArg(ptr) 8608 v.AddArg(idx) 8609 v.AddArg(val) 8610 v.AddArg(mem) 8611 return true 8612 } 8613 // match: (MOVWstore [0] {sym} (ADDshiftLL ptr idx [c]) val mem) 8614 // cond: sym == nil 8615 // result: (MOVWstoreshiftLL ptr idx [c] val mem) 8616 for { 8617 if v.AuxInt != 0 { 8618 break 8619 } 8620 sym := v.Aux 8621 mem := v.Args[2] 8622 v_0 := v.Args[0] 8623 if v_0.Op != OpARMADDshiftLL { 8624 break 8625 } 8626 c := v_0.AuxInt 8627 idx := v_0.Args[1] 8628 ptr := v_0.Args[0] 8629 val := v.Args[1] 8630 if !(sym == nil) { 8631 break 8632 } 8633 v.reset(OpARMMOVWstoreshiftLL) 8634 v.AuxInt = c 8635 v.AddArg(ptr) 8636 v.AddArg(idx) 8637 v.AddArg(val) 8638 v.AddArg(mem) 8639 return true 8640 } 8641 // match: (MOVWstore [0] {sym} (ADDshiftRL ptr idx [c]) val mem) 8642 // cond: sym == nil 8643 // result: (MOVWstoreshiftRL ptr idx [c] val mem) 8644 for { 8645 if v.AuxInt != 0 { 8646 break 8647 } 8648 sym := v.Aux 8649 mem := v.Args[2] 8650 v_0 := v.Args[0] 8651 if v_0.Op != OpARMADDshiftRL { 8652 break 8653 } 8654 c := v_0.AuxInt 8655 idx := v_0.Args[1] 8656 ptr := v_0.Args[0] 8657 val := v.Args[1] 8658 if !(sym == nil) { 8659 break 8660 } 8661 v.reset(OpARMMOVWstoreshiftRL) 8662 v.AuxInt = c 8663 v.AddArg(ptr) 8664 v.AddArg(idx) 8665 v.AddArg(val) 8666 v.AddArg(mem) 8667 return true 8668 } 8669 // match: (MOVWstore [0] {sym} (ADDshiftRA ptr idx [c]) val mem) 8670 // cond: sym == nil 8671 // result: (MOVWstoreshiftRA ptr idx [c] val mem) 8672 for { 8673 if v.AuxInt != 0 { 8674 break 8675 } 8676 sym := v.Aux 8677 mem := v.Args[2] 8678 v_0 := v.Args[0] 8679 if v_0.Op != OpARMADDshiftRA { 8680 break 8681 } 8682 c := v_0.AuxInt 8683 idx := v_0.Args[1] 8684 ptr := v_0.Args[0] 8685 val := v.Args[1] 8686 if !(sym == nil) { 8687 break 8688 } 8689 v.reset(OpARMMOVWstoreshiftRA) 8690 v.AuxInt = c 8691 v.AddArg(ptr) 8692 v.AddArg(idx) 8693 v.AddArg(val) 8694 v.AddArg(mem) 8695 return true 8696 } 8697 return false 8698 } 8699 func rewriteValueARM_OpARMMOVWstoreidx_0(v *Value) bool { 8700 // match: (MOVWstoreidx ptr (MOVWconst [c]) val mem) 8701 // result: (MOVWstore [c] ptr val mem) 8702 for { 8703 mem := v.Args[3] 8704 ptr := v.Args[0] 8705 v_1 := v.Args[1] 8706 if v_1.Op != OpARMMOVWconst { 8707 break 8708 } 8709 c := v_1.AuxInt 8710 val := v.Args[2] 8711 v.reset(OpARMMOVWstore) 8712 v.AuxInt = c 8713 v.AddArg(ptr) 8714 v.AddArg(val) 8715 v.AddArg(mem) 8716 return true 8717 } 8718 // match: (MOVWstoreidx (MOVWconst [c]) ptr val mem) 8719 // result: (MOVWstore [c] ptr val mem) 8720 for { 8721 mem := v.Args[3] 8722 v_0 := v.Args[0] 8723 if v_0.Op != OpARMMOVWconst { 8724 break 8725 } 8726 c := v_0.AuxInt 8727 ptr := v.Args[1] 8728 val := v.Args[2] 8729 v.reset(OpARMMOVWstore) 8730 v.AuxInt = c 8731 v.AddArg(ptr) 8732 v.AddArg(val) 8733 v.AddArg(mem) 8734 return true 8735 } 8736 // match: (MOVWstoreidx ptr (SLLconst idx [c]) val mem) 8737 // result: (MOVWstoreshiftLL ptr idx [c] val mem) 8738 for { 8739 mem := v.Args[3] 8740 ptr := v.Args[0] 8741 v_1 := v.Args[1] 8742 if v_1.Op != OpARMSLLconst { 8743 break 8744 } 8745 c := v_1.AuxInt 8746 idx := v_1.Args[0] 8747 val := v.Args[2] 8748 v.reset(OpARMMOVWstoreshiftLL) 8749 v.AuxInt = c 8750 v.AddArg(ptr) 8751 v.AddArg(idx) 8752 v.AddArg(val) 8753 v.AddArg(mem) 8754 return true 8755 } 8756 // match: (MOVWstoreidx (SLLconst idx [c]) ptr val mem) 8757 // result: (MOVWstoreshiftLL ptr idx [c] val mem) 8758 for { 8759 mem := v.Args[3] 8760 v_0 := v.Args[0] 8761 if v_0.Op != OpARMSLLconst { 8762 break 8763 } 8764 c := v_0.AuxInt 8765 idx := v_0.Args[0] 8766 ptr := v.Args[1] 8767 val := v.Args[2] 8768 v.reset(OpARMMOVWstoreshiftLL) 8769 v.AuxInt = c 8770 v.AddArg(ptr) 8771 v.AddArg(idx) 8772 v.AddArg(val) 8773 v.AddArg(mem) 8774 return true 8775 } 8776 // match: (MOVWstoreidx ptr (SRLconst idx [c]) val mem) 8777 // result: (MOVWstoreshiftRL ptr idx [c] val mem) 8778 for { 8779 mem := v.Args[3] 8780 ptr := v.Args[0] 8781 v_1 := v.Args[1] 8782 if v_1.Op != OpARMSRLconst { 8783 break 8784 } 8785 c := v_1.AuxInt 8786 idx := v_1.Args[0] 8787 val := v.Args[2] 8788 v.reset(OpARMMOVWstoreshiftRL) 8789 v.AuxInt = c 8790 v.AddArg(ptr) 8791 v.AddArg(idx) 8792 v.AddArg(val) 8793 v.AddArg(mem) 8794 return true 8795 } 8796 // match: (MOVWstoreidx (SRLconst idx [c]) ptr val mem) 8797 // result: (MOVWstoreshiftRL ptr idx [c] val mem) 8798 for { 8799 mem := v.Args[3] 8800 v_0 := v.Args[0] 8801 if v_0.Op != OpARMSRLconst { 8802 break 8803 } 8804 c := v_0.AuxInt 8805 idx := v_0.Args[0] 8806 ptr := v.Args[1] 8807 val := v.Args[2] 8808 v.reset(OpARMMOVWstoreshiftRL) 8809 v.AuxInt = c 8810 v.AddArg(ptr) 8811 v.AddArg(idx) 8812 v.AddArg(val) 8813 v.AddArg(mem) 8814 return true 8815 } 8816 // match: (MOVWstoreidx ptr (SRAconst idx [c]) val mem) 8817 // result: (MOVWstoreshiftRA ptr idx [c] val mem) 8818 for { 8819 mem := v.Args[3] 8820 ptr := v.Args[0] 8821 v_1 := v.Args[1] 8822 if v_1.Op != OpARMSRAconst { 8823 break 8824 } 8825 c := v_1.AuxInt 8826 idx := v_1.Args[0] 8827 val := v.Args[2] 8828 v.reset(OpARMMOVWstoreshiftRA) 8829 v.AuxInt = c 8830 v.AddArg(ptr) 8831 v.AddArg(idx) 8832 v.AddArg(val) 8833 v.AddArg(mem) 8834 return true 8835 } 8836 // match: (MOVWstoreidx (SRAconst idx [c]) ptr val mem) 8837 // result: (MOVWstoreshiftRA ptr idx [c] val mem) 8838 for { 8839 mem := v.Args[3] 8840 v_0 := v.Args[0] 8841 if v_0.Op != OpARMSRAconst { 8842 break 8843 } 8844 c := v_0.AuxInt 8845 idx := v_0.Args[0] 8846 ptr := v.Args[1] 8847 val := v.Args[2] 8848 v.reset(OpARMMOVWstoreshiftRA) 8849 v.AuxInt = c 8850 v.AddArg(ptr) 8851 v.AddArg(idx) 8852 v.AddArg(val) 8853 v.AddArg(mem) 8854 return true 8855 } 8856 return false 8857 } 8858 func rewriteValueARM_OpARMMOVWstoreshiftLL_0(v *Value) bool { 8859 // match: (MOVWstoreshiftLL ptr (MOVWconst [c]) [d] val mem) 8860 // result: (MOVWstore [int64(uint32(c)<<uint64(d))] ptr val mem) 8861 for { 8862 d := v.AuxInt 8863 mem := v.Args[3] 8864 ptr := v.Args[0] 8865 v_1 := v.Args[1] 8866 if v_1.Op != OpARMMOVWconst { 8867 break 8868 } 8869 c := v_1.AuxInt 8870 val := v.Args[2] 8871 v.reset(OpARMMOVWstore) 8872 v.AuxInt = int64(uint32(c) << uint64(d)) 8873 v.AddArg(ptr) 8874 v.AddArg(val) 8875 v.AddArg(mem) 8876 return true 8877 } 8878 return false 8879 } 8880 func rewriteValueARM_OpARMMOVWstoreshiftRA_0(v *Value) bool { 8881 // match: (MOVWstoreshiftRA ptr (MOVWconst [c]) [d] val mem) 8882 // result: (MOVWstore [int64(int32(c)>>uint64(d))] ptr val mem) 8883 for { 8884 d := v.AuxInt 8885 mem := v.Args[3] 8886 ptr := v.Args[0] 8887 v_1 := v.Args[1] 8888 if v_1.Op != OpARMMOVWconst { 8889 break 8890 } 8891 c := v_1.AuxInt 8892 val := v.Args[2] 8893 v.reset(OpARMMOVWstore) 8894 v.AuxInt = int64(int32(c) >> uint64(d)) 8895 v.AddArg(ptr) 8896 v.AddArg(val) 8897 v.AddArg(mem) 8898 return true 8899 } 8900 return false 8901 } 8902 func rewriteValueARM_OpARMMOVWstoreshiftRL_0(v *Value) bool { 8903 // match: (MOVWstoreshiftRL ptr (MOVWconst [c]) [d] val mem) 8904 // result: (MOVWstore [int64(uint32(c)>>uint64(d))] ptr val mem) 8905 for { 8906 d := v.AuxInt 8907 mem := v.Args[3] 8908 ptr := v.Args[0] 8909 v_1 := v.Args[1] 8910 if v_1.Op != OpARMMOVWconst { 8911 break 8912 } 8913 c := v_1.AuxInt 8914 val := v.Args[2] 8915 v.reset(OpARMMOVWstore) 8916 v.AuxInt = int64(uint32(c) >> uint64(d)) 8917 v.AddArg(ptr) 8918 v.AddArg(val) 8919 v.AddArg(mem) 8920 return true 8921 } 8922 return false 8923 } 8924 func rewriteValueARM_OpARMMUL_0(v *Value) bool { 8925 // match: (MUL x (MOVWconst [c])) 8926 // cond: int32(c) == -1 8927 // result: (RSBconst [0] x) 8928 for { 8929 _ = v.Args[1] 8930 x := v.Args[0] 8931 v_1 := v.Args[1] 8932 if v_1.Op != OpARMMOVWconst { 8933 break 8934 } 8935 c := v_1.AuxInt 8936 if !(int32(c) == -1) { 8937 break 8938 } 8939 v.reset(OpARMRSBconst) 8940 v.AuxInt = 0 8941 v.AddArg(x) 8942 return true 8943 } 8944 // match: (MUL (MOVWconst [c]) x) 8945 // cond: int32(c) == -1 8946 // result: (RSBconst [0] x) 8947 for { 8948 x := v.Args[1] 8949 v_0 := v.Args[0] 8950 if v_0.Op != OpARMMOVWconst { 8951 break 8952 } 8953 c := v_0.AuxInt 8954 if !(int32(c) == -1) { 8955 break 8956 } 8957 v.reset(OpARMRSBconst) 8958 v.AuxInt = 0 8959 v.AddArg(x) 8960 return true 8961 } 8962 // match: (MUL _ (MOVWconst [0])) 8963 // result: (MOVWconst [0]) 8964 for { 8965 _ = v.Args[1] 8966 v_1 := v.Args[1] 8967 if v_1.Op != OpARMMOVWconst || v_1.AuxInt != 0 { 8968 break 8969 } 8970 v.reset(OpARMMOVWconst) 8971 v.AuxInt = 0 8972 return true 8973 } 8974 // match: (MUL (MOVWconst [0]) _) 8975 // result: (MOVWconst [0]) 8976 for { 8977 _ = v.Args[1] 8978 v_0 := v.Args[0] 8979 if v_0.Op != OpARMMOVWconst || v_0.AuxInt != 0 { 8980 break 8981 } 8982 v.reset(OpARMMOVWconst) 8983 v.AuxInt = 0 8984 return true 8985 } 8986 // match: (MUL x (MOVWconst [1])) 8987 // result: x 8988 for { 8989 _ = v.Args[1] 8990 x := v.Args[0] 8991 v_1 := v.Args[1] 8992 if v_1.Op != OpARMMOVWconst || v_1.AuxInt != 1 { 8993 break 8994 } 8995 v.reset(OpCopy) 8996 v.Type = x.Type 8997 v.AddArg(x) 8998 return true 8999 } 9000 // match: (MUL (MOVWconst [1]) x) 9001 // result: x 9002 for { 9003 x := v.Args[1] 9004 v_0 := v.Args[0] 9005 if v_0.Op != OpARMMOVWconst || v_0.AuxInt != 1 { 9006 break 9007 } 9008 v.reset(OpCopy) 9009 v.Type = x.Type 9010 v.AddArg(x) 9011 return true 9012 } 9013 // match: (MUL x (MOVWconst [c])) 9014 // cond: isPowerOfTwo(c) 9015 // result: (SLLconst [log2(c)] x) 9016 for { 9017 _ = v.Args[1] 9018 x := v.Args[0] 9019 v_1 := v.Args[1] 9020 if v_1.Op != OpARMMOVWconst { 9021 break 9022 } 9023 c := v_1.AuxInt 9024 if !(isPowerOfTwo(c)) { 9025 break 9026 } 9027 v.reset(OpARMSLLconst) 9028 v.AuxInt = log2(c) 9029 v.AddArg(x) 9030 return true 9031 } 9032 // match: (MUL (MOVWconst [c]) x) 9033 // cond: isPowerOfTwo(c) 9034 // result: (SLLconst [log2(c)] x) 9035 for { 9036 x := v.Args[1] 9037 v_0 := v.Args[0] 9038 if v_0.Op != OpARMMOVWconst { 9039 break 9040 } 9041 c := v_0.AuxInt 9042 if !(isPowerOfTwo(c)) { 9043 break 9044 } 9045 v.reset(OpARMSLLconst) 9046 v.AuxInt = log2(c) 9047 v.AddArg(x) 9048 return true 9049 } 9050 // match: (MUL x (MOVWconst [c])) 9051 // cond: isPowerOfTwo(c-1) && int32(c) >= 3 9052 // result: (ADDshiftLL x x [log2(c-1)]) 9053 for { 9054 _ = v.Args[1] 9055 x := v.Args[0] 9056 v_1 := v.Args[1] 9057 if v_1.Op != OpARMMOVWconst { 9058 break 9059 } 9060 c := v_1.AuxInt 9061 if !(isPowerOfTwo(c-1) && int32(c) >= 3) { 9062 break 9063 } 9064 v.reset(OpARMADDshiftLL) 9065 v.AuxInt = log2(c - 1) 9066 v.AddArg(x) 9067 v.AddArg(x) 9068 return true 9069 } 9070 // match: (MUL (MOVWconst [c]) x) 9071 // cond: isPowerOfTwo(c-1) && int32(c) >= 3 9072 // result: (ADDshiftLL x x [log2(c-1)]) 9073 for { 9074 x := v.Args[1] 9075 v_0 := v.Args[0] 9076 if v_0.Op != OpARMMOVWconst { 9077 break 9078 } 9079 c := v_0.AuxInt 9080 if !(isPowerOfTwo(c-1) && int32(c) >= 3) { 9081 break 9082 } 9083 v.reset(OpARMADDshiftLL) 9084 v.AuxInt = log2(c - 1) 9085 v.AddArg(x) 9086 v.AddArg(x) 9087 return true 9088 } 9089 return false 9090 } 9091 func rewriteValueARM_OpARMMUL_10(v *Value) bool { 9092 b := v.Block 9093 // match: (MUL x (MOVWconst [c])) 9094 // cond: isPowerOfTwo(c+1) && int32(c) >= 7 9095 // result: (RSBshiftLL x x [log2(c+1)]) 9096 for { 9097 _ = v.Args[1] 9098 x := v.Args[0] 9099 v_1 := v.Args[1] 9100 if v_1.Op != OpARMMOVWconst { 9101 break 9102 } 9103 c := v_1.AuxInt 9104 if !(isPowerOfTwo(c+1) && int32(c) >= 7) { 9105 break 9106 } 9107 v.reset(OpARMRSBshiftLL) 9108 v.AuxInt = log2(c + 1) 9109 v.AddArg(x) 9110 v.AddArg(x) 9111 return true 9112 } 9113 // match: (MUL (MOVWconst [c]) x) 9114 // cond: isPowerOfTwo(c+1) && int32(c) >= 7 9115 // result: (RSBshiftLL x x [log2(c+1)]) 9116 for { 9117 x := v.Args[1] 9118 v_0 := v.Args[0] 9119 if v_0.Op != OpARMMOVWconst { 9120 break 9121 } 9122 c := v_0.AuxInt 9123 if !(isPowerOfTwo(c+1) && int32(c) >= 7) { 9124 break 9125 } 9126 v.reset(OpARMRSBshiftLL) 9127 v.AuxInt = log2(c + 1) 9128 v.AddArg(x) 9129 v.AddArg(x) 9130 return true 9131 } 9132 // match: (MUL x (MOVWconst [c])) 9133 // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) 9134 // result: (SLLconst [log2(c/3)] (ADDshiftLL <x.Type> x x [1])) 9135 for { 9136 _ = v.Args[1] 9137 x := v.Args[0] 9138 v_1 := v.Args[1] 9139 if v_1.Op != OpARMMOVWconst { 9140 break 9141 } 9142 c := v_1.AuxInt 9143 if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) { 9144 break 9145 } 9146 v.reset(OpARMSLLconst) 9147 v.AuxInt = log2(c / 3) 9148 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9149 v0.AuxInt = 1 9150 v0.AddArg(x) 9151 v0.AddArg(x) 9152 v.AddArg(v0) 9153 return true 9154 } 9155 // match: (MUL (MOVWconst [c]) x) 9156 // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) 9157 // result: (SLLconst [log2(c/3)] (ADDshiftLL <x.Type> x x [1])) 9158 for { 9159 x := v.Args[1] 9160 v_0 := v.Args[0] 9161 if v_0.Op != OpARMMOVWconst { 9162 break 9163 } 9164 c := v_0.AuxInt 9165 if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) { 9166 break 9167 } 9168 v.reset(OpARMSLLconst) 9169 v.AuxInt = log2(c / 3) 9170 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9171 v0.AuxInt = 1 9172 v0.AddArg(x) 9173 v0.AddArg(x) 9174 v.AddArg(v0) 9175 return true 9176 } 9177 // match: (MUL x (MOVWconst [c])) 9178 // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) 9179 // result: (SLLconst [log2(c/5)] (ADDshiftLL <x.Type> x x [2])) 9180 for { 9181 _ = v.Args[1] 9182 x := v.Args[0] 9183 v_1 := v.Args[1] 9184 if v_1.Op != OpARMMOVWconst { 9185 break 9186 } 9187 c := v_1.AuxInt 9188 if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) { 9189 break 9190 } 9191 v.reset(OpARMSLLconst) 9192 v.AuxInt = log2(c / 5) 9193 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9194 v0.AuxInt = 2 9195 v0.AddArg(x) 9196 v0.AddArg(x) 9197 v.AddArg(v0) 9198 return true 9199 } 9200 // match: (MUL (MOVWconst [c]) x) 9201 // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) 9202 // result: (SLLconst [log2(c/5)] (ADDshiftLL <x.Type> x x [2])) 9203 for { 9204 x := v.Args[1] 9205 v_0 := v.Args[0] 9206 if v_0.Op != OpARMMOVWconst { 9207 break 9208 } 9209 c := v_0.AuxInt 9210 if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) { 9211 break 9212 } 9213 v.reset(OpARMSLLconst) 9214 v.AuxInt = log2(c / 5) 9215 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9216 v0.AuxInt = 2 9217 v0.AddArg(x) 9218 v0.AddArg(x) 9219 v.AddArg(v0) 9220 return true 9221 } 9222 // match: (MUL x (MOVWconst [c])) 9223 // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) 9224 // result: (SLLconst [log2(c/7)] (RSBshiftLL <x.Type> x x [3])) 9225 for { 9226 _ = v.Args[1] 9227 x := v.Args[0] 9228 v_1 := v.Args[1] 9229 if v_1.Op != OpARMMOVWconst { 9230 break 9231 } 9232 c := v_1.AuxInt 9233 if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) { 9234 break 9235 } 9236 v.reset(OpARMSLLconst) 9237 v.AuxInt = log2(c / 7) 9238 v0 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 9239 v0.AuxInt = 3 9240 v0.AddArg(x) 9241 v0.AddArg(x) 9242 v.AddArg(v0) 9243 return true 9244 } 9245 // match: (MUL (MOVWconst [c]) x) 9246 // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) 9247 // result: (SLLconst [log2(c/7)] (RSBshiftLL <x.Type> x x [3])) 9248 for { 9249 x := v.Args[1] 9250 v_0 := v.Args[0] 9251 if v_0.Op != OpARMMOVWconst { 9252 break 9253 } 9254 c := v_0.AuxInt 9255 if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) { 9256 break 9257 } 9258 v.reset(OpARMSLLconst) 9259 v.AuxInt = log2(c / 7) 9260 v0 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 9261 v0.AuxInt = 3 9262 v0.AddArg(x) 9263 v0.AddArg(x) 9264 v.AddArg(v0) 9265 return true 9266 } 9267 // match: (MUL x (MOVWconst [c])) 9268 // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) 9269 // result: (SLLconst [log2(c/9)] (ADDshiftLL <x.Type> x x [3])) 9270 for { 9271 _ = v.Args[1] 9272 x := v.Args[0] 9273 v_1 := v.Args[1] 9274 if v_1.Op != OpARMMOVWconst { 9275 break 9276 } 9277 c := v_1.AuxInt 9278 if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) { 9279 break 9280 } 9281 v.reset(OpARMSLLconst) 9282 v.AuxInt = log2(c / 9) 9283 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9284 v0.AuxInt = 3 9285 v0.AddArg(x) 9286 v0.AddArg(x) 9287 v.AddArg(v0) 9288 return true 9289 } 9290 // match: (MUL (MOVWconst [c]) x) 9291 // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) 9292 // result: (SLLconst [log2(c/9)] (ADDshiftLL <x.Type> x x [3])) 9293 for { 9294 x := v.Args[1] 9295 v_0 := v.Args[0] 9296 if v_0.Op != OpARMMOVWconst { 9297 break 9298 } 9299 c := v_0.AuxInt 9300 if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) { 9301 break 9302 } 9303 v.reset(OpARMSLLconst) 9304 v.AuxInt = log2(c / 9) 9305 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9306 v0.AuxInt = 3 9307 v0.AddArg(x) 9308 v0.AddArg(x) 9309 v.AddArg(v0) 9310 return true 9311 } 9312 return false 9313 } 9314 func rewriteValueARM_OpARMMUL_20(v *Value) bool { 9315 // match: (MUL (MOVWconst [c]) (MOVWconst [d])) 9316 // result: (MOVWconst [int64(int32(c*d))]) 9317 for { 9318 _ = v.Args[1] 9319 v_0 := v.Args[0] 9320 if v_0.Op != OpARMMOVWconst { 9321 break 9322 } 9323 c := v_0.AuxInt 9324 v_1 := v.Args[1] 9325 if v_1.Op != OpARMMOVWconst { 9326 break 9327 } 9328 d := v_1.AuxInt 9329 v.reset(OpARMMOVWconst) 9330 v.AuxInt = int64(int32(c * d)) 9331 return true 9332 } 9333 // match: (MUL (MOVWconst [d]) (MOVWconst [c])) 9334 // result: (MOVWconst [int64(int32(c*d))]) 9335 for { 9336 _ = v.Args[1] 9337 v_0 := v.Args[0] 9338 if v_0.Op != OpARMMOVWconst { 9339 break 9340 } 9341 d := v_0.AuxInt 9342 v_1 := v.Args[1] 9343 if v_1.Op != OpARMMOVWconst { 9344 break 9345 } 9346 c := v_1.AuxInt 9347 v.reset(OpARMMOVWconst) 9348 v.AuxInt = int64(int32(c * d)) 9349 return true 9350 } 9351 return false 9352 } 9353 func rewriteValueARM_OpARMMULA_0(v *Value) bool { 9354 b := v.Block 9355 // match: (MULA x (MOVWconst [c]) a) 9356 // cond: int32(c) == -1 9357 // result: (SUB a x) 9358 for { 9359 a := v.Args[2] 9360 x := v.Args[0] 9361 v_1 := v.Args[1] 9362 if v_1.Op != OpARMMOVWconst { 9363 break 9364 } 9365 c := v_1.AuxInt 9366 if !(int32(c) == -1) { 9367 break 9368 } 9369 v.reset(OpARMSUB) 9370 v.AddArg(a) 9371 v.AddArg(x) 9372 return true 9373 } 9374 // match: (MULA _ (MOVWconst [0]) a) 9375 // result: a 9376 for { 9377 a := v.Args[2] 9378 v_1 := v.Args[1] 9379 if v_1.Op != OpARMMOVWconst || v_1.AuxInt != 0 { 9380 break 9381 } 9382 v.reset(OpCopy) 9383 v.Type = a.Type 9384 v.AddArg(a) 9385 return true 9386 } 9387 // match: (MULA x (MOVWconst [1]) a) 9388 // result: (ADD x a) 9389 for { 9390 a := v.Args[2] 9391 x := v.Args[0] 9392 v_1 := v.Args[1] 9393 if v_1.Op != OpARMMOVWconst || v_1.AuxInt != 1 { 9394 break 9395 } 9396 v.reset(OpARMADD) 9397 v.AddArg(x) 9398 v.AddArg(a) 9399 return true 9400 } 9401 // match: (MULA x (MOVWconst [c]) a) 9402 // cond: isPowerOfTwo(c) 9403 // result: (ADD (SLLconst <x.Type> [log2(c)] x) a) 9404 for { 9405 a := v.Args[2] 9406 x := v.Args[0] 9407 v_1 := v.Args[1] 9408 if v_1.Op != OpARMMOVWconst { 9409 break 9410 } 9411 c := v_1.AuxInt 9412 if !(isPowerOfTwo(c)) { 9413 break 9414 } 9415 v.reset(OpARMADD) 9416 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9417 v0.AuxInt = log2(c) 9418 v0.AddArg(x) 9419 v.AddArg(v0) 9420 v.AddArg(a) 9421 return true 9422 } 9423 // match: (MULA x (MOVWconst [c]) a) 9424 // cond: isPowerOfTwo(c-1) && int32(c) >= 3 9425 // result: (ADD (ADDshiftLL <x.Type> x x [log2(c-1)]) a) 9426 for { 9427 a := v.Args[2] 9428 x := v.Args[0] 9429 v_1 := v.Args[1] 9430 if v_1.Op != OpARMMOVWconst { 9431 break 9432 } 9433 c := v_1.AuxInt 9434 if !(isPowerOfTwo(c-1) && int32(c) >= 3) { 9435 break 9436 } 9437 v.reset(OpARMADD) 9438 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9439 v0.AuxInt = log2(c - 1) 9440 v0.AddArg(x) 9441 v0.AddArg(x) 9442 v.AddArg(v0) 9443 v.AddArg(a) 9444 return true 9445 } 9446 // match: (MULA x (MOVWconst [c]) a) 9447 // cond: isPowerOfTwo(c+1) && int32(c) >= 7 9448 // result: (ADD (RSBshiftLL <x.Type> x x [log2(c+1)]) a) 9449 for { 9450 a := v.Args[2] 9451 x := v.Args[0] 9452 v_1 := v.Args[1] 9453 if v_1.Op != OpARMMOVWconst { 9454 break 9455 } 9456 c := v_1.AuxInt 9457 if !(isPowerOfTwo(c+1) && int32(c) >= 7) { 9458 break 9459 } 9460 v.reset(OpARMADD) 9461 v0 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 9462 v0.AuxInt = log2(c + 1) 9463 v0.AddArg(x) 9464 v0.AddArg(x) 9465 v.AddArg(v0) 9466 v.AddArg(a) 9467 return true 9468 } 9469 // match: (MULA x (MOVWconst [c]) a) 9470 // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) 9471 // result: (ADD (SLLconst <x.Type> [log2(c/3)] (ADDshiftLL <x.Type> x x [1])) a) 9472 for { 9473 a := v.Args[2] 9474 x := v.Args[0] 9475 v_1 := v.Args[1] 9476 if v_1.Op != OpARMMOVWconst { 9477 break 9478 } 9479 c := v_1.AuxInt 9480 if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) { 9481 break 9482 } 9483 v.reset(OpARMADD) 9484 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9485 v0.AuxInt = log2(c / 3) 9486 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9487 v1.AuxInt = 1 9488 v1.AddArg(x) 9489 v1.AddArg(x) 9490 v0.AddArg(v1) 9491 v.AddArg(v0) 9492 v.AddArg(a) 9493 return true 9494 } 9495 // match: (MULA x (MOVWconst [c]) a) 9496 // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) 9497 // result: (ADD (SLLconst <x.Type> [log2(c/5)] (ADDshiftLL <x.Type> x x [2])) a) 9498 for { 9499 a := v.Args[2] 9500 x := v.Args[0] 9501 v_1 := v.Args[1] 9502 if v_1.Op != OpARMMOVWconst { 9503 break 9504 } 9505 c := v_1.AuxInt 9506 if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) { 9507 break 9508 } 9509 v.reset(OpARMADD) 9510 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9511 v0.AuxInt = log2(c / 5) 9512 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9513 v1.AuxInt = 2 9514 v1.AddArg(x) 9515 v1.AddArg(x) 9516 v0.AddArg(v1) 9517 v.AddArg(v0) 9518 v.AddArg(a) 9519 return true 9520 } 9521 // match: (MULA x (MOVWconst [c]) a) 9522 // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) 9523 // result: (ADD (SLLconst <x.Type> [log2(c/7)] (RSBshiftLL <x.Type> x x [3])) a) 9524 for { 9525 a := v.Args[2] 9526 x := v.Args[0] 9527 v_1 := v.Args[1] 9528 if v_1.Op != OpARMMOVWconst { 9529 break 9530 } 9531 c := v_1.AuxInt 9532 if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) { 9533 break 9534 } 9535 v.reset(OpARMADD) 9536 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9537 v0.AuxInt = log2(c / 7) 9538 v1 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 9539 v1.AuxInt = 3 9540 v1.AddArg(x) 9541 v1.AddArg(x) 9542 v0.AddArg(v1) 9543 v.AddArg(v0) 9544 v.AddArg(a) 9545 return true 9546 } 9547 // match: (MULA x (MOVWconst [c]) a) 9548 // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) 9549 // result: (ADD (SLLconst <x.Type> [log2(c/9)] (ADDshiftLL <x.Type> x x [3])) a) 9550 for { 9551 a := v.Args[2] 9552 x := v.Args[0] 9553 v_1 := v.Args[1] 9554 if v_1.Op != OpARMMOVWconst { 9555 break 9556 } 9557 c := v_1.AuxInt 9558 if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) { 9559 break 9560 } 9561 v.reset(OpARMADD) 9562 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9563 v0.AuxInt = log2(c / 9) 9564 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9565 v1.AuxInt = 3 9566 v1.AddArg(x) 9567 v1.AddArg(x) 9568 v0.AddArg(v1) 9569 v.AddArg(v0) 9570 v.AddArg(a) 9571 return true 9572 } 9573 return false 9574 } 9575 func rewriteValueARM_OpARMMULA_10(v *Value) bool { 9576 b := v.Block 9577 // match: (MULA (MOVWconst [c]) x a) 9578 // cond: int32(c) == -1 9579 // result: (SUB a x) 9580 for { 9581 a := v.Args[2] 9582 v_0 := v.Args[0] 9583 if v_0.Op != OpARMMOVWconst { 9584 break 9585 } 9586 c := v_0.AuxInt 9587 x := v.Args[1] 9588 if !(int32(c) == -1) { 9589 break 9590 } 9591 v.reset(OpARMSUB) 9592 v.AddArg(a) 9593 v.AddArg(x) 9594 return true 9595 } 9596 // match: (MULA (MOVWconst [0]) _ a) 9597 // result: a 9598 for { 9599 a := v.Args[2] 9600 v_0 := v.Args[0] 9601 if v_0.Op != OpARMMOVWconst || v_0.AuxInt != 0 { 9602 break 9603 } 9604 v.reset(OpCopy) 9605 v.Type = a.Type 9606 v.AddArg(a) 9607 return true 9608 } 9609 // match: (MULA (MOVWconst [1]) x a) 9610 // result: (ADD x a) 9611 for { 9612 a := v.Args[2] 9613 v_0 := v.Args[0] 9614 if v_0.Op != OpARMMOVWconst || v_0.AuxInt != 1 { 9615 break 9616 } 9617 x := v.Args[1] 9618 v.reset(OpARMADD) 9619 v.AddArg(x) 9620 v.AddArg(a) 9621 return true 9622 } 9623 // match: (MULA (MOVWconst [c]) x a) 9624 // cond: isPowerOfTwo(c) 9625 // result: (ADD (SLLconst <x.Type> [log2(c)] x) a) 9626 for { 9627 a := v.Args[2] 9628 v_0 := v.Args[0] 9629 if v_0.Op != OpARMMOVWconst { 9630 break 9631 } 9632 c := v_0.AuxInt 9633 x := v.Args[1] 9634 if !(isPowerOfTwo(c)) { 9635 break 9636 } 9637 v.reset(OpARMADD) 9638 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9639 v0.AuxInt = log2(c) 9640 v0.AddArg(x) 9641 v.AddArg(v0) 9642 v.AddArg(a) 9643 return true 9644 } 9645 // match: (MULA (MOVWconst [c]) x a) 9646 // cond: isPowerOfTwo(c-1) && int32(c) >= 3 9647 // result: (ADD (ADDshiftLL <x.Type> x x [log2(c-1)]) a) 9648 for { 9649 a := v.Args[2] 9650 v_0 := v.Args[0] 9651 if v_0.Op != OpARMMOVWconst { 9652 break 9653 } 9654 c := v_0.AuxInt 9655 x := v.Args[1] 9656 if !(isPowerOfTwo(c-1) && int32(c) >= 3) { 9657 break 9658 } 9659 v.reset(OpARMADD) 9660 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9661 v0.AuxInt = log2(c - 1) 9662 v0.AddArg(x) 9663 v0.AddArg(x) 9664 v.AddArg(v0) 9665 v.AddArg(a) 9666 return true 9667 } 9668 // match: (MULA (MOVWconst [c]) x a) 9669 // cond: isPowerOfTwo(c+1) && int32(c) >= 7 9670 // result: (ADD (RSBshiftLL <x.Type> x x [log2(c+1)]) a) 9671 for { 9672 a := v.Args[2] 9673 v_0 := v.Args[0] 9674 if v_0.Op != OpARMMOVWconst { 9675 break 9676 } 9677 c := v_0.AuxInt 9678 x := v.Args[1] 9679 if !(isPowerOfTwo(c+1) && int32(c) >= 7) { 9680 break 9681 } 9682 v.reset(OpARMADD) 9683 v0 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 9684 v0.AuxInt = log2(c + 1) 9685 v0.AddArg(x) 9686 v0.AddArg(x) 9687 v.AddArg(v0) 9688 v.AddArg(a) 9689 return true 9690 } 9691 // match: (MULA (MOVWconst [c]) x a) 9692 // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) 9693 // result: (ADD (SLLconst <x.Type> [log2(c/3)] (ADDshiftLL <x.Type> x x [1])) a) 9694 for { 9695 a := v.Args[2] 9696 v_0 := v.Args[0] 9697 if v_0.Op != OpARMMOVWconst { 9698 break 9699 } 9700 c := v_0.AuxInt 9701 x := v.Args[1] 9702 if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) { 9703 break 9704 } 9705 v.reset(OpARMADD) 9706 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9707 v0.AuxInt = log2(c / 3) 9708 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9709 v1.AuxInt = 1 9710 v1.AddArg(x) 9711 v1.AddArg(x) 9712 v0.AddArg(v1) 9713 v.AddArg(v0) 9714 v.AddArg(a) 9715 return true 9716 } 9717 // match: (MULA (MOVWconst [c]) x a) 9718 // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) 9719 // result: (ADD (SLLconst <x.Type> [log2(c/5)] (ADDshiftLL <x.Type> x x [2])) a) 9720 for { 9721 a := v.Args[2] 9722 v_0 := v.Args[0] 9723 if v_0.Op != OpARMMOVWconst { 9724 break 9725 } 9726 c := v_0.AuxInt 9727 x := v.Args[1] 9728 if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) { 9729 break 9730 } 9731 v.reset(OpARMADD) 9732 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9733 v0.AuxInt = log2(c / 5) 9734 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9735 v1.AuxInt = 2 9736 v1.AddArg(x) 9737 v1.AddArg(x) 9738 v0.AddArg(v1) 9739 v.AddArg(v0) 9740 v.AddArg(a) 9741 return true 9742 } 9743 // match: (MULA (MOVWconst [c]) x a) 9744 // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) 9745 // result: (ADD (SLLconst <x.Type> [log2(c/7)] (RSBshiftLL <x.Type> x x [3])) a) 9746 for { 9747 a := v.Args[2] 9748 v_0 := v.Args[0] 9749 if v_0.Op != OpARMMOVWconst { 9750 break 9751 } 9752 c := v_0.AuxInt 9753 x := v.Args[1] 9754 if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) { 9755 break 9756 } 9757 v.reset(OpARMADD) 9758 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9759 v0.AuxInt = log2(c / 7) 9760 v1 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 9761 v1.AuxInt = 3 9762 v1.AddArg(x) 9763 v1.AddArg(x) 9764 v0.AddArg(v1) 9765 v.AddArg(v0) 9766 v.AddArg(a) 9767 return true 9768 } 9769 // match: (MULA (MOVWconst [c]) x a) 9770 // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) 9771 // result: (ADD (SLLconst <x.Type> [log2(c/9)] (ADDshiftLL <x.Type> x x [3])) a) 9772 for { 9773 a := v.Args[2] 9774 v_0 := v.Args[0] 9775 if v_0.Op != OpARMMOVWconst { 9776 break 9777 } 9778 c := v_0.AuxInt 9779 x := v.Args[1] 9780 if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) { 9781 break 9782 } 9783 v.reset(OpARMADD) 9784 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9785 v0.AuxInt = log2(c / 9) 9786 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9787 v1.AuxInt = 3 9788 v1.AddArg(x) 9789 v1.AddArg(x) 9790 v0.AddArg(v1) 9791 v.AddArg(v0) 9792 v.AddArg(a) 9793 return true 9794 } 9795 return false 9796 } 9797 func rewriteValueARM_OpARMMULA_20(v *Value) bool { 9798 // match: (MULA (MOVWconst [c]) (MOVWconst [d]) a) 9799 // result: (ADDconst [int64(int32(c*d))] a) 9800 for { 9801 a := v.Args[2] 9802 v_0 := v.Args[0] 9803 if v_0.Op != OpARMMOVWconst { 9804 break 9805 } 9806 c := v_0.AuxInt 9807 v_1 := v.Args[1] 9808 if v_1.Op != OpARMMOVWconst { 9809 break 9810 } 9811 d := v_1.AuxInt 9812 v.reset(OpARMADDconst) 9813 v.AuxInt = int64(int32(c * d)) 9814 v.AddArg(a) 9815 return true 9816 } 9817 return false 9818 } 9819 func rewriteValueARM_OpARMMULD_0(v *Value) bool { 9820 // match: (MULD (NEGD x) y) 9821 // cond: objabi.GOARM >= 6 9822 // result: (NMULD x y) 9823 for { 9824 y := v.Args[1] 9825 v_0 := v.Args[0] 9826 if v_0.Op != OpARMNEGD { 9827 break 9828 } 9829 x := v_0.Args[0] 9830 if !(objabi.GOARM >= 6) { 9831 break 9832 } 9833 v.reset(OpARMNMULD) 9834 v.AddArg(x) 9835 v.AddArg(y) 9836 return true 9837 } 9838 // match: (MULD y (NEGD x)) 9839 // cond: objabi.GOARM >= 6 9840 // result: (NMULD x y) 9841 for { 9842 _ = v.Args[1] 9843 y := v.Args[0] 9844 v_1 := v.Args[1] 9845 if v_1.Op != OpARMNEGD { 9846 break 9847 } 9848 x := v_1.Args[0] 9849 if !(objabi.GOARM >= 6) { 9850 break 9851 } 9852 v.reset(OpARMNMULD) 9853 v.AddArg(x) 9854 v.AddArg(y) 9855 return true 9856 } 9857 return false 9858 } 9859 func rewriteValueARM_OpARMMULF_0(v *Value) bool { 9860 // match: (MULF (NEGF x) y) 9861 // cond: objabi.GOARM >= 6 9862 // result: (NMULF x y) 9863 for { 9864 y := v.Args[1] 9865 v_0 := v.Args[0] 9866 if v_0.Op != OpARMNEGF { 9867 break 9868 } 9869 x := v_0.Args[0] 9870 if !(objabi.GOARM >= 6) { 9871 break 9872 } 9873 v.reset(OpARMNMULF) 9874 v.AddArg(x) 9875 v.AddArg(y) 9876 return true 9877 } 9878 // match: (MULF y (NEGF x)) 9879 // cond: objabi.GOARM >= 6 9880 // result: (NMULF x y) 9881 for { 9882 _ = v.Args[1] 9883 y := v.Args[0] 9884 v_1 := v.Args[1] 9885 if v_1.Op != OpARMNEGF { 9886 break 9887 } 9888 x := v_1.Args[0] 9889 if !(objabi.GOARM >= 6) { 9890 break 9891 } 9892 v.reset(OpARMNMULF) 9893 v.AddArg(x) 9894 v.AddArg(y) 9895 return true 9896 } 9897 return false 9898 } 9899 func rewriteValueARM_OpARMMULS_0(v *Value) bool { 9900 b := v.Block 9901 // match: (MULS x (MOVWconst [c]) a) 9902 // cond: int32(c) == -1 9903 // result: (ADD a x) 9904 for { 9905 a := v.Args[2] 9906 x := v.Args[0] 9907 v_1 := v.Args[1] 9908 if v_1.Op != OpARMMOVWconst { 9909 break 9910 } 9911 c := v_1.AuxInt 9912 if !(int32(c) == -1) { 9913 break 9914 } 9915 v.reset(OpARMADD) 9916 v.AddArg(a) 9917 v.AddArg(x) 9918 return true 9919 } 9920 // match: (MULS _ (MOVWconst [0]) a) 9921 // result: a 9922 for { 9923 a := v.Args[2] 9924 v_1 := v.Args[1] 9925 if v_1.Op != OpARMMOVWconst || v_1.AuxInt != 0 { 9926 break 9927 } 9928 v.reset(OpCopy) 9929 v.Type = a.Type 9930 v.AddArg(a) 9931 return true 9932 } 9933 // match: (MULS x (MOVWconst [1]) a) 9934 // result: (RSB x a) 9935 for { 9936 a := v.Args[2] 9937 x := v.Args[0] 9938 v_1 := v.Args[1] 9939 if v_1.Op != OpARMMOVWconst || v_1.AuxInt != 1 { 9940 break 9941 } 9942 v.reset(OpARMRSB) 9943 v.AddArg(x) 9944 v.AddArg(a) 9945 return true 9946 } 9947 // match: (MULS x (MOVWconst [c]) a) 9948 // cond: isPowerOfTwo(c) 9949 // result: (RSB (SLLconst <x.Type> [log2(c)] x) a) 9950 for { 9951 a := v.Args[2] 9952 x := v.Args[0] 9953 v_1 := v.Args[1] 9954 if v_1.Op != OpARMMOVWconst { 9955 break 9956 } 9957 c := v_1.AuxInt 9958 if !(isPowerOfTwo(c)) { 9959 break 9960 } 9961 v.reset(OpARMRSB) 9962 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 9963 v0.AuxInt = log2(c) 9964 v0.AddArg(x) 9965 v.AddArg(v0) 9966 v.AddArg(a) 9967 return true 9968 } 9969 // match: (MULS x (MOVWconst [c]) a) 9970 // cond: isPowerOfTwo(c-1) && int32(c) >= 3 9971 // result: (RSB (ADDshiftLL <x.Type> x x [log2(c-1)]) a) 9972 for { 9973 a := v.Args[2] 9974 x := v.Args[0] 9975 v_1 := v.Args[1] 9976 if v_1.Op != OpARMMOVWconst { 9977 break 9978 } 9979 c := v_1.AuxInt 9980 if !(isPowerOfTwo(c-1) && int32(c) >= 3) { 9981 break 9982 } 9983 v.reset(OpARMRSB) 9984 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 9985 v0.AuxInt = log2(c - 1) 9986 v0.AddArg(x) 9987 v0.AddArg(x) 9988 v.AddArg(v0) 9989 v.AddArg(a) 9990 return true 9991 } 9992 // match: (MULS x (MOVWconst [c]) a) 9993 // cond: isPowerOfTwo(c+1) && int32(c) >= 7 9994 // result: (RSB (RSBshiftLL <x.Type> x x [log2(c+1)]) a) 9995 for { 9996 a := v.Args[2] 9997 x := v.Args[0] 9998 v_1 := v.Args[1] 9999 if v_1.Op != OpARMMOVWconst { 10000 break 10001 } 10002 c := v_1.AuxInt 10003 if !(isPowerOfTwo(c+1) && int32(c) >= 7) { 10004 break 10005 } 10006 v.reset(OpARMRSB) 10007 v0 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 10008 v0.AuxInt = log2(c + 1) 10009 v0.AddArg(x) 10010 v0.AddArg(x) 10011 v.AddArg(v0) 10012 v.AddArg(a) 10013 return true 10014 } 10015 // match: (MULS x (MOVWconst [c]) a) 10016 // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) 10017 // result: (RSB (SLLconst <x.Type> [log2(c/3)] (ADDshiftLL <x.Type> x x [1])) a) 10018 for { 10019 a := v.Args[2] 10020 x := v.Args[0] 10021 v_1 := v.Args[1] 10022 if v_1.Op != OpARMMOVWconst { 10023 break 10024 } 10025 c := v_1.AuxInt 10026 if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) { 10027 break 10028 } 10029 v.reset(OpARMRSB) 10030 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 10031 v0.AuxInt = log2(c / 3) 10032 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 10033 v1.AuxInt = 1 10034 v1.AddArg(x) 10035 v1.AddArg(x) 10036 v0.AddArg(v1) 10037 v.AddArg(v0) 10038 v.AddArg(a) 10039 return true 10040 } 10041 // match: (MULS x (MOVWconst [c]) a) 10042 // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) 10043 // result: (RSB (SLLconst <x.Type> [log2(c/5)] (ADDshiftLL <x.Type> x x [2])) a) 10044 for { 10045 a := v.Args[2] 10046 x := v.Args[0] 10047 v_1 := v.Args[1] 10048 if v_1.Op != OpARMMOVWconst { 10049 break 10050 } 10051 c := v_1.AuxInt 10052 if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) { 10053 break 10054 } 10055 v.reset(OpARMRSB) 10056 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 10057 v0.AuxInt = log2(c / 5) 10058 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 10059 v1.AuxInt = 2 10060 v1.AddArg(x) 10061 v1.AddArg(x) 10062 v0.AddArg(v1) 10063 v.AddArg(v0) 10064 v.AddArg(a) 10065 return true 10066 } 10067 // match: (MULS x (MOVWconst [c]) a) 10068 // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) 10069 // result: (RSB (SLLconst <x.Type> [log2(c/7)] (RSBshiftLL <x.Type> x x [3])) a) 10070 for { 10071 a := v.Args[2] 10072 x := v.Args[0] 10073 v_1 := v.Args[1] 10074 if v_1.Op != OpARMMOVWconst { 10075 break 10076 } 10077 c := v_1.AuxInt 10078 if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) { 10079 break 10080 } 10081 v.reset(OpARMRSB) 10082 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 10083 v0.AuxInt = log2(c / 7) 10084 v1 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 10085 v1.AuxInt = 3 10086 v1.AddArg(x) 10087 v1.AddArg(x) 10088 v0.AddArg(v1) 10089 v.AddArg(v0) 10090 v.AddArg(a) 10091 return true 10092 } 10093 // match: (MULS x (MOVWconst [c]) a) 10094 // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) 10095 // result: (RSB (SLLconst <x.Type> [log2(c/9)] (ADDshiftLL <x.Type> x x [3])) a) 10096 for { 10097 a := v.Args[2] 10098 x := v.Args[0] 10099 v_1 := v.Args[1] 10100 if v_1.Op != OpARMMOVWconst { 10101 break 10102 } 10103 c := v_1.AuxInt 10104 if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) { 10105 break 10106 } 10107 v.reset(OpARMRSB) 10108 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 10109 v0.AuxInt = log2(c / 9) 10110 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 10111 v1.AuxInt = 3 10112 v1.AddArg(x) 10113 v1.AddArg(x) 10114 v0.AddArg(v1) 10115 v.AddArg(v0) 10116 v.AddArg(a) 10117 return true 10118 } 10119 return false 10120 } 10121 func rewriteValueARM_OpARMMULS_10(v *Value) bool { 10122 b := v.Block 10123 // match: (MULS (MOVWconst [c]) x a) 10124 // cond: int32(c) == -1 10125 // result: (ADD a x) 10126 for { 10127 a := v.Args[2] 10128 v_0 := v.Args[0] 10129 if v_0.Op != OpARMMOVWconst { 10130 break 10131 } 10132 c := v_0.AuxInt 10133 x := v.Args[1] 10134 if !(int32(c) == -1) { 10135 break 10136 } 10137 v.reset(OpARMADD) 10138 v.AddArg(a) 10139 v.AddArg(x) 10140 return true 10141 } 10142 // match: (MULS (MOVWconst [0]) _ a) 10143 // result: a 10144 for { 10145 a := v.Args[2] 10146 v_0 := v.Args[0] 10147 if v_0.Op != OpARMMOVWconst || v_0.AuxInt != 0 { 10148 break 10149 } 10150 v.reset(OpCopy) 10151 v.Type = a.Type 10152 v.AddArg(a) 10153 return true 10154 } 10155 // match: (MULS (MOVWconst [1]) x a) 10156 // result: (RSB x a) 10157 for { 10158 a := v.Args[2] 10159 v_0 := v.Args[0] 10160 if v_0.Op != OpARMMOVWconst || v_0.AuxInt != 1 { 10161 break 10162 } 10163 x := v.Args[1] 10164 v.reset(OpARMRSB) 10165 v.AddArg(x) 10166 v.AddArg(a) 10167 return true 10168 } 10169 // match: (MULS (MOVWconst [c]) x a) 10170 // cond: isPowerOfTwo(c) 10171 // result: (RSB (SLLconst <x.Type> [log2(c)] x) a) 10172 for { 10173 a := v.Args[2] 10174 v_0 := v.Args[0] 10175 if v_0.Op != OpARMMOVWconst { 10176 break 10177 } 10178 c := v_0.AuxInt 10179 x := v.Args[1] 10180 if !(isPowerOfTwo(c)) { 10181 break 10182 } 10183 v.reset(OpARMRSB) 10184 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 10185 v0.AuxInt = log2(c) 10186 v0.AddArg(x) 10187 v.AddArg(v0) 10188 v.AddArg(a) 10189 return true 10190 } 10191 // match: (MULS (MOVWconst [c]) x a) 10192 // cond: isPowerOfTwo(c-1) && int32(c) >= 3 10193 // result: (RSB (ADDshiftLL <x.Type> x x [log2(c-1)]) a) 10194 for { 10195 a := v.Args[2] 10196 v_0 := v.Args[0] 10197 if v_0.Op != OpARMMOVWconst { 10198 break 10199 } 10200 c := v_0.AuxInt 10201 x := v.Args[1] 10202 if !(isPowerOfTwo(c-1) && int32(c) >= 3) { 10203 break 10204 } 10205 v.reset(OpARMRSB) 10206 v0 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 10207 v0.AuxInt = log2(c - 1) 10208 v0.AddArg(x) 10209 v0.AddArg(x) 10210 v.AddArg(v0) 10211 v.AddArg(a) 10212 return true 10213 } 10214 // match: (MULS (MOVWconst [c]) x a) 10215 // cond: isPowerOfTwo(c+1) && int32(c) >= 7 10216 // result: (RSB (RSBshiftLL <x.Type> x x [log2(c+1)]) a) 10217 for { 10218 a := v.Args[2] 10219 v_0 := v.Args[0] 10220 if v_0.Op != OpARMMOVWconst { 10221 break 10222 } 10223 c := v_0.AuxInt 10224 x := v.Args[1] 10225 if !(isPowerOfTwo(c+1) && int32(c) >= 7) { 10226 break 10227 } 10228 v.reset(OpARMRSB) 10229 v0 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 10230 v0.AuxInt = log2(c + 1) 10231 v0.AddArg(x) 10232 v0.AddArg(x) 10233 v.AddArg(v0) 10234 v.AddArg(a) 10235 return true 10236 } 10237 // match: (MULS (MOVWconst [c]) x a) 10238 // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) 10239 // result: (RSB (SLLconst <x.Type> [log2(c/3)] (ADDshiftLL <x.Type> x x [1])) a) 10240 for { 10241 a := v.Args[2] 10242 v_0 := v.Args[0] 10243 if v_0.Op != OpARMMOVWconst { 10244 break 10245 } 10246 c := v_0.AuxInt 10247 x := v.Args[1] 10248 if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) { 10249 break 10250 } 10251 v.reset(OpARMRSB) 10252 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 10253 v0.AuxInt = log2(c / 3) 10254 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 10255 v1.AuxInt = 1 10256 v1.AddArg(x) 10257 v1.AddArg(x) 10258 v0.AddArg(v1) 10259 v.AddArg(v0) 10260 v.AddArg(a) 10261 return true 10262 } 10263 // match: (MULS (MOVWconst [c]) x a) 10264 // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) 10265 // result: (RSB (SLLconst <x.Type> [log2(c/5)] (ADDshiftLL <x.Type> x x [2])) a) 10266 for { 10267 a := v.Args[2] 10268 v_0 := v.Args[0] 10269 if v_0.Op != OpARMMOVWconst { 10270 break 10271 } 10272 c := v_0.AuxInt 10273 x := v.Args[1] 10274 if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) { 10275 break 10276 } 10277 v.reset(OpARMRSB) 10278 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 10279 v0.AuxInt = log2(c / 5) 10280 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 10281 v1.AuxInt = 2 10282 v1.AddArg(x) 10283 v1.AddArg(x) 10284 v0.AddArg(v1) 10285 v.AddArg(v0) 10286 v.AddArg(a) 10287 return true 10288 } 10289 // match: (MULS (MOVWconst [c]) x a) 10290 // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) 10291 // result: (RSB (SLLconst <x.Type> [log2(c/7)] (RSBshiftLL <x.Type> x x [3])) a) 10292 for { 10293 a := v.Args[2] 10294 v_0 := v.Args[0] 10295 if v_0.Op != OpARMMOVWconst { 10296 break 10297 } 10298 c := v_0.AuxInt 10299 x := v.Args[1] 10300 if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) { 10301 break 10302 } 10303 v.reset(OpARMRSB) 10304 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 10305 v0.AuxInt = log2(c / 7) 10306 v1 := b.NewValue0(v.Pos, OpARMRSBshiftLL, x.Type) 10307 v1.AuxInt = 3 10308 v1.AddArg(x) 10309 v1.AddArg(x) 10310 v0.AddArg(v1) 10311 v.AddArg(v0) 10312 v.AddArg(a) 10313 return true 10314 } 10315 // match: (MULS (MOVWconst [c]) x a) 10316 // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) 10317 // result: (RSB (SLLconst <x.Type> [log2(c/9)] (ADDshiftLL <x.Type> x x [3])) a) 10318 for { 10319 a := v.Args[2] 10320 v_0 := v.Args[0] 10321 if v_0.Op != OpARMMOVWconst { 10322 break 10323 } 10324 c := v_0.AuxInt 10325 x := v.Args[1] 10326 if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) { 10327 break 10328 } 10329 v.reset(OpARMRSB) 10330 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 10331 v0.AuxInt = log2(c / 9) 10332 v1 := b.NewValue0(v.Pos, OpARMADDshiftLL, x.Type) 10333 v1.AuxInt = 3 10334 v1.AddArg(x) 10335 v1.AddArg(x) 10336 v0.AddArg(v1) 10337 v.AddArg(v0) 10338 v.AddArg(a) 10339 return true 10340 } 10341 return false 10342 } 10343 func rewriteValueARM_OpARMMULS_20(v *Value) bool { 10344 // match: (MULS (MOVWconst [c]) (MOVWconst [d]) a) 10345 // result: (SUBconst [int64(int32(c*d))] a) 10346 for { 10347 a := v.Args[2] 10348 v_0 := v.Args[0] 10349 if v_0.Op != OpARMMOVWconst { 10350 break 10351 } 10352 c := v_0.AuxInt 10353 v_1 := v.Args[1] 10354 if v_1.Op != OpARMMOVWconst { 10355 break 10356 } 10357 d := v_1.AuxInt 10358 v.reset(OpARMSUBconst) 10359 v.AuxInt = int64(int32(c * d)) 10360 v.AddArg(a) 10361 return true 10362 } 10363 return false 10364 } 10365 func rewriteValueARM_OpARMMVN_0(v *Value) bool { 10366 // match: (MVN (MOVWconst [c])) 10367 // result: (MOVWconst [^c]) 10368 for { 10369 v_0 := v.Args[0] 10370 if v_0.Op != OpARMMOVWconst { 10371 break 10372 } 10373 c := v_0.AuxInt 10374 v.reset(OpARMMOVWconst) 10375 v.AuxInt = ^c 10376 return true 10377 } 10378 // match: (MVN (SLLconst [c] x)) 10379 // result: (MVNshiftLL x [c]) 10380 for { 10381 v_0 := v.Args[0] 10382 if v_0.Op != OpARMSLLconst { 10383 break 10384 } 10385 c := v_0.AuxInt 10386 x := v_0.Args[0] 10387 v.reset(OpARMMVNshiftLL) 10388 v.AuxInt = c 10389 v.AddArg(x) 10390 return true 10391 } 10392 // match: (MVN (SRLconst [c] x)) 10393 // result: (MVNshiftRL x [c]) 10394 for { 10395 v_0 := v.Args[0] 10396 if v_0.Op != OpARMSRLconst { 10397 break 10398 } 10399 c := v_0.AuxInt 10400 x := v_0.Args[0] 10401 v.reset(OpARMMVNshiftRL) 10402 v.AuxInt = c 10403 v.AddArg(x) 10404 return true 10405 } 10406 // match: (MVN (SRAconst [c] x)) 10407 // result: (MVNshiftRA x [c]) 10408 for { 10409 v_0 := v.Args[0] 10410 if v_0.Op != OpARMSRAconst { 10411 break 10412 } 10413 c := v_0.AuxInt 10414 x := v_0.Args[0] 10415 v.reset(OpARMMVNshiftRA) 10416 v.AuxInt = c 10417 v.AddArg(x) 10418 return true 10419 } 10420 // match: (MVN (SLL x y)) 10421 // result: (MVNshiftLLreg x y) 10422 for { 10423 v_0 := v.Args[0] 10424 if v_0.Op != OpARMSLL { 10425 break 10426 } 10427 y := v_0.Args[1] 10428 x := v_0.Args[0] 10429 v.reset(OpARMMVNshiftLLreg) 10430 v.AddArg(x) 10431 v.AddArg(y) 10432 return true 10433 } 10434 // match: (MVN (SRL x y)) 10435 // result: (MVNshiftRLreg x y) 10436 for { 10437 v_0 := v.Args[0] 10438 if v_0.Op != OpARMSRL { 10439 break 10440 } 10441 y := v_0.Args[1] 10442 x := v_0.Args[0] 10443 v.reset(OpARMMVNshiftRLreg) 10444 v.AddArg(x) 10445 v.AddArg(y) 10446 return true 10447 } 10448 // match: (MVN (SRA x y)) 10449 // result: (MVNshiftRAreg x y) 10450 for { 10451 v_0 := v.Args[0] 10452 if v_0.Op != OpARMSRA { 10453 break 10454 } 10455 y := v_0.Args[1] 10456 x := v_0.Args[0] 10457 v.reset(OpARMMVNshiftRAreg) 10458 v.AddArg(x) 10459 v.AddArg(y) 10460 return true 10461 } 10462 return false 10463 } 10464 func rewriteValueARM_OpARMMVNshiftLL_0(v *Value) bool { 10465 // match: (MVNshiftLL (MOVWconst [c]) [d]) 10466 // result: (MOVWconst [^int64(uint32(c)<<uint64(d))]) 10467 for { 10468 d := v.AuxInt 10469 v_0 := v.Args[0] 10470 if v_0.Op != OpARMMOVWconst { 10471 break 10472 } 10473 c := v_0.AuxInt 10474 v.reset(OpARMMOVWconst) 10475 v.AuxInt = ^int64(uint32(c) << uint64(d)) 10476 return true 10477 } 10478 return false 10479 } 10480 func rewriteValueARM_OpARMMVNshiftLLreg_0(v *Value) bool { 10481 // match: (MVNshiftLLreg x (MOVWconst [c])) 10482 // result: (MVNshiftLL x [c]) 10483 for { 10484 _ = v.Args[1] 10485 x := v.Args[0] 10486 v_1 := v.Args[1] 10487 if v_1.Op != OpARMMOVWconst { 10488 break 10489 } 10490 c := v_1.AuxInt 10491 v.reset(OpARMMVNshiftLL) 10492 v.AuxInt = c 10493 v.AddArg(x) 10494 return true 10495 } 10496 return false 10497 } 10498 func rewriteValueARM_OpARMMVNshiftRA_0(v *Value) bool { 10499 // match: (MVNshiftRA (MOVWconst [c]) [d]) 10500 // result: (MOVWconst [^int64(int32(c)>>uint64(d))]) 10501 for { 10502 d := v.AuxInt 10503 v_0 := v.Args[0] 10504 if v_0.Op != OpARMMOVWconst { 10505 break 10506 } 10507 c := v_0.AuxInt 10508 v.reset(OpARMMOVWconst) 10509 v.AuxInt = ^int64(int32(c) >> uint64(d)) 10510 return true 10511 } 10512 return false 10513 } 10514 func rewriteValueARM_OpARMMVNshiftRAreg_0(v *Value) bool { 10515 // match: (MVNshiftRAreg x (MOVWconst [c])) 10516 // result: (MVNshiftRA x [c]) 10517 for { 10518 _ = v.Args[1] 10519 x := v.Args[0] 10520 v_1 := v.Args[1] 10521 if v_1.Op != OpARMMOVWconst { 10522 break 10523 } 10524 c := v_1.AuxInt 10525 v.reset(OpARMMVNshiftRA) 10526 v.AuxInt = c 10527 v.AddArg(x) 10528 return true 10529 } 10530 return false 10531 } 10532 func rewriteValueARM_OpARMMVNshiftRL_0(v *Value) bool { 10533 // match: (MVNshiftRL (MOVWconst [c]) [d]) 10534 // result: (MOVWconst [^int64(uint32(c)>>uint64(d))]) 10535 for { 10536 d := v.AuxInt 10537 v_0 := v.Args[0] 10538 if v_0.Op != OpARMMOVWconst { 10539 break 10540 } 10541 c := v_0.AuxInt 10542 v.reset(OpARMMOVWconst) 10543 v.AuxInt = ^int64(uint32(c) >> uint64(d)) 10544 return true 10545 } 10546 return false 10547 } 10548 func rewriteValueARM_OpARMMVNshiftRLreg_0(v *Value) bool { 10549 // match: (MVNshiftRLreg x (MOVWconst [c])) 10550 // result: (MVNshiftRL x [c]) 10551 for { 10552 _ = v.Args[1] 10553 x := v.Args[0] 10554 v_1 := v.Args[1] 10555 if v_1.Op != OpARMMOVWconst { 10556 break 10557 } 10558 c := v_1.AuxInt 10559 v.reset(OpARMMVNshiftRL) 10560 v.AuxInt = c 10561 v.AddArg(x) 10562 return true 10563 } 10564 return false 10565 } 10566 func rewriteValueARM_OpARMNEGD_0(v *Value) bool { 10567 // match: (NEGD (MULD x y)) 10568 // cond: objabi.GOARM >= 6 10569 // result: (NMULD x y) 10570 for { 10571 v_0 := v.Args[0] 10572 if v_0.Op != OpARMMULD { 10573 break 10574 } 10575 y := v_0.Args[1] 10576 x := v_0.Args[0] 10577 if !(objabi.GOARM >= 6) { 10578 break 10579 } 10580 v.reset(OpARMNMULD) 10581 v.AddArg(x) 10582 v.AddArg(y) 10583 return true 10584 } 10585 return false 10586 } 10587 func rewriteValueARM_OpARMNEGF_0(v *Value) bool { 10588 // match: (NEGF (MULF x y)) 10589 // cond: objabi.GOARM >= 6 10590 // result: (NMULF x y) 10591 for { 10592 v_0 := v.Args[0] 10593 if v_0.Op != OpARMMULF { 10594 break 10595 } 10596 y := v_0.Args[1] 10597 x := v_0.Args[0] 10598 if !(objabi.GOARM >= 6) { 10599 break 10600 } 10601 v.reset(OpARMNMULF) 10602 v.AddArg(x) 10603 v.AddArg(y) 10604 return true 10605 } 10606 return false 10607 } 10608 func rewriteValueARM_OpARMNMULD_0(v *Value) bool { 10609 // match: (NMULD (NEGD x) y) 10610 // result: (MULD x y) 10611 for { 10612 y := v.Args[1] 10613 v_0 := v.Args[0] 10614 if v_0.Op != OpARMNEGD { 10615 break 10616 } 10617 x := v_0.Args[0] 10618 v.reset(OpARMMULD) 10619 v.AddArg(x) 10620 v.AddArg(y) 10621 return true 10622 } 10623 // match: (NMULD y (NEGD x)) 10624 // result: (MULD x y) 10625 for { 10626 _ = v.Args[1] 10627 y := v.Args[0] 10628 v_1 := v.Args[1] 10629 if v_1.Op != OpARMNEGD { 10630 break 10631 } 10632 x := v_1.Args[0] 10633 v.reset(OpARMMULD) 10634 v.AddArg(x) 10635 v.AddArg(y) 10636 return true 10637 } 10638 return false 10639 } 10640 func rewriteValueARM_OpARMNMULF_0(v *Value) bool { 10641 // match: (NMULF (NEGF x) y) 10642 // result: (MULF x y) 10643 for { 10644 y := v.Args[1] 10645 v_0 := v.Args[0] 10646 if v_0.Op != OpARMNEGF { 10647 break 10648 } 10649 x := v_0.Args[0] 10650 v.reset(OpARMMULF) 10651 v.AddArg(x) 10652 v.AddArg(y) 10653 return true 10654 } 10655 // match: (NMULF y (NEGF x)) 10656 // result: (MULF x y) 10657 for { 10658 _ = v.Args[1] 10659 y := v.Args[0] 10660 v_1 := v.Args[1] 10661 if v_1.Op != OpARMNEGF { 10662 break 10663 } 10664 x := v_1.Args[0] 10665 v.reset(OpARMMULF) 10666 v.AddArg(x) 10667 v.AddArg(y) 10668 return true 10669 } 10670 return false 10671 } 10672 func rewriteValueARM_OpARMNotEqual_0(v *Value) bool { 10673 // match: (NotEqual (FlagEQ)) 10674 // result: (MOVWconst [0]) 10675 for { 10676 v_0 := v.Args[0] 10677 if v_0.Op != OpARMFlagEQ { 10678 break 10679 } 10680 v.reset(OpARMMOVWconst) 10681 v.AuxInt = 0 10682 return true 10683 } 10684 // match: (NotEqual (FlagLT_ULT)) 10685 // result: (MOVWconst [1]) 10686 for { 10687 v_0 := v.Args[0] 10688 if v_0.Op != OpARMFlagLT_ULT { 10689 break 10690 } 10691 v.reset(OpARMMOVWconst) 10692 v.AuxInt = 1 10693 return true 10694 } 10695 // match: (NotEqual (FlagLT_UGT)) 10696 // result: (MOVWconst [1]) 10697 for { 10698 v_0 := v.Args[0] 10699 if v_0.Op != OpARMFlagLT_UGT { 10700 break 10701 } 10702 v.reset(OpARMMOVWconst) 10703 v.AuxInt = 1 10704 return true 10705 } 10706 // match: (NotEqual (FlagGT_ULT)) 10707 // result: (MOVWconst [1]) 10708 for { 10709 v_0 := v.Args[0] 10710 if v_0.Op != OpARMFlagGT_ULT { 10711 break 10712 } 10713 v.reset(OpARMMOVWconst) 10714 v.AuxInt = 1 10715 return true 10716 } 10717 // match: (NotEqual (FlagGT_UGT)) 10718 // result: (MOVWconst [1]) 10719 for { 10720 v_0 := v.Args[0] 10721 if v_0.Op != OpARMFlagGT_UGT { 10722 break 10723 } 10724 v.reset(OpARMMOVWconst) 10725 v.AuxInt = 1 10726 return true 10727 } 10728 // match: (NotEqual (InvertFlags x)) 10729 // result: (NotEqual x) 10730 for { 10731 v_0 := v.Args[0] 10732 if v_0.Op != OpARMInvertFlags { 10733 break 10734 } 10735 x := v_0.Args[0] 10736 v.reset(OpARMNotEqual) 10737 v.AddArg(x) 10738 return true 10739 } 10740 return false 10741 } 10742 func rewriteValueARM_OpARMOR_0(v *Value) bool { 10743 // match: (OR x (MOVWconst [c])) 10744 // result: (ORconst [c] x) 10745 for { 10746 _ = v.Args[1] 10747 x := v.Args[0] 10748 v_1 := v.Args[1] 10749 if v_1.Op != OpARMMOVWconst { 10750 break 10751 } 10752 c := v_1.AuxInt 10753 v.reset(OpARMORconst) 10754 v.AuxInt = c 10755 v.AddArg(x) 10756 return true 10757 } 10758 // match: (OR (MOVWconst [c]) x) 10759 // result: (ORconst [c] x) 10760 for { 10761 x := v.Args[1] 10762 v_0 := v.Args[0] 10763 if v_0.Op != OpARMMOVWconst { 10764 break 10765 } 10766 c := v_0.AuxInt 10767 v.reset(OpARMORconst) 10768 v.AuxInt = c 10769 v.AddArg(x) 10770 return true 10771 } 10772 // match: (OR x (SLLconst [c] y)) 10773 // result: (ORshiftLL x y [c]) 10774 for { 10775 _ = v.Args[1] 10776 x := v.Args[0] 10777 v_1 := v.Args[1] 10778 if v_1.Op != OpARMSLLconst { 10779 break 10780 } 10781 c := v_1.AuxInt 10782 y := v_1.Args[0] 10783 v.reset(OpARMORshiftLL) 10784 v.AuxInt = c 10785 v.AddArg(x) 10786 v.AddArg(y) 10787 return true 10788 } 10789 // match: (OR (SLLconst [c] y) x) 10790 // result: (ORshiftLL x y [c]) 10791 for { 10792 x := v.Args[1] 10793 v_0 := v.Args[0] 10794 if v_0.Op != OpARMSLLconst { 10795 break 10796 } 10797 c := v_0.AuxInt 10798 y := v_0.Args[0] 10799 v.reset(OpARMORshiftLL) 10800 v.AuxInt = c 10801 v.AddArg(x) 10802 v.AddArg(y) 10803 return true 10804 } 10805 // match: (OR x (SRLconst [c] y)) 10806 // result: (ORshiftRL x y [c]) 10807 for { 10808 _ = v.Args[1] 10809 x := v.Args[0] 10810 v_1 := v.Args[1] 10811 if v_1.Op != OpARMSRLconst { 10812 break 10813 } 10814 c := v_1.AuxInt 10815 y := v_1.Args[0] 10816 v.reset(OpARMORshiftRL) 10817 v.AuxInt = c 10818 v.AddArg(x) 10819 v.AddArg(y) 10820 return true 10821 } 10822 // match: (OR (SRLconst [c] y) x) 10823 // result: (ORshiftRL x y [c]) 10824 for { 10825 x := v.Args[1] 10826 v_0 := v.Args[0] 10827 if v_0.Op != OpARMSRLconst { 10828 break 10829 } 10830 c := v_0.AuxInt 10831 y := v_0.Args[0] 10832 v.reset(OpARMORshiftRL) 10833 v.AuxInt = c 10834 v.AddArg(x) 10835 v.AddArg(y) 10836 return true 10837 } 10838 // match: (OR x (SRAconst [c] y)) 10839 // result: (ORshiftRA x y [c]) 10840 for { 10841 _ = v.Args[1] 10842 x := v.Args[0] 10843 v_1 := v.Args[1] 10844 if v_1.Op != OpARMSRAconst { 10845 break 10846 } 10847 c := v_1.AuxInt 10848 y := v_1.Args[0] 10849 v.reset(OpARMORshiftRA) 10850 v.AuxInt = c 10851 v.AddArg(x) 10852 v.AddArg(y) 10853 return true 10854 } 10855 // match: (OR (SRAconst [c] y) x) 10856 // result: (ORshiftRA x y [c]) 10857 for { 10858 x := v.Args[1] 10859 v_0 := v.Args[0] 10860 if v_0.Op != OpARMSRAconst { 10861 break 10862 } 10863 c := v_0.AuxInt 10864 y := v_0.Args[0] 10865 v.reset(OpARMORshiftRA) 10866 v.AuxInt = c 10867 v.AddArg(x) 10868 v.AddArg(y) 10869 return true 10870 } 10871 // match: (OR x (SLL y z)) 10872 // result: (ORshiftLLreg x y z) 10873 for { 10874 _ = v.Args[1] 10875 x := v.Args[0] 10876 v_1 := v.Args[1] 10877 if v_1.Op != OpARMSLL { 10878 break 10879 } 10880 z := v_1.Args[1] 10881 y := v_1.Args[0] 10882 v.reset(OpARMORshiftLLreg) 10883 v.AddArg(x) 10884 v.AddArg(y) 10885 v.AddArg(z) 10886 return true 10887 } 10888 // match: (OR (SLL y z) x) 10889 // result: (ORshiftLLreg x y z) 10890 for { 10891 x := v.Args[1] 10892 v_0 := v.Args[0] 10893 if v_0.Op != OpARMSLL { 10894 break 10895 } 10896 z := v_0.Args[1] 10897 y := v_0.Args[0] 10898 v.reset(OpARMORshiftLLreg) 10899 v.AddArg(x) 10900 v.AddArg(y) 10901 v.AddArg(z) 10902 return true 10903 } 10904 return false 10905 } 10906 func rewriteValueARM_OpARMOR_10(v *Value) bool { 10907 // match: (OR x (SRL y z)) 10908 // result: (ORshiftRLreg x y z) 10909 for { 10910 _ = v.Args[1] 10911 x := v.Args[0] 10912 v_1 := v.Args[1] 10913 if v_1.Op != OpARMSRL { 10914 break 10915 } 10916 z := v_1.Args[1] 10917 y := v_1.Args[0] 10918 v.reset(OpARMORshiftRLreg) 10919 v.AddArg(x) 10920 v.AddArg(y) 10921 v.AddArg(z) 10922 return true 10923 } 10924 // match: (OR (SRL y z) x) 10925 // result: (ORshiftRLreg x y z) 10926 for { 10927 x := v.Args[1] 10928 v_0 := v.Args[0] 10929 if v_0.Op != OpARMSRL { 10930 break 10931 } 10932 z := v_0.Args[1] 10933 y := v_0.Args[0] 10934 v.reset(OpARMORshiftRLreg) 10935 v.AddArg(x) 10936 v.AddArg(y) 10937 v.AddArg(z) 10938 return true 10939 } 10940 // match: (OR x (SRA y z)) 10941 // result: (ORshiftRAreg x y z) 10942 for { 10943 _ = v.Args[1] 10944 x := v.Args[0] 10945 v_1 := v.Args[1] 10946 if v_1.Op != OpARMSRA { 10947 break 10948 } 10949 z := v_1.Args[1] 10950 y := v_1.Args[0] 10951 v.reset(OpARMORshiftRAreg) 10952 v.AddArg(x) 10953 v.AddArg(y) 10954 v.AddArg(z) 10955 return true 10956 } 10957 // match: (OR (SRA y z) x) 10958 // result: (ORshiftRAreg x y z) 10959 for { 10960 x := v.Args[1] 10961 v_0 := v.Args[0] 10962 if v_0.Op != OpARMSRA { 10963 break 10964 } 10965 z := v_0.Args[1] 10966 y := v_0.Args[0] 10967 v.reset(OpARMORshiftRAreg) 10968 v.AddArg(x) 10969 v.AddArg(y) 10970 v.AddArg(z) 10971 return true 10972 } 10973 // match: (OR x x) 10974 // result: x 10975 for { 10976 x := v.Args[1] 10977 if x != v.Args[0] { 10978 break 10979 } 10980 v.reset(OpCopy) 10981 v.Type = x.Type 10982 v.AddArg(x) 10983 return true 10984 } 10985 return false 10986 } 10987 func rewriteValueARM_OpARMORconst_0(v *Value) bool { 10988 // match: (ORconst [0] x) 10989 // result: x 10990 for { 10991 if v.AuxInt != 0 { 10992 break 10993 } 10994 x := v.Args[0] 10995 v.reset(OpCopy) 10996 v.Type = x.Type 10997 v.AddArg(x) 10998 return true 10999 } 11000 // match: (ORconst [c] _) 11001 // cond: int32(c)==-1 11002 // result: (MOVWconst [-1]) 11003 for { 11004 c := v.AuxInt 11005 if !(int32(c) == -1) { 11006 break 11007 } 11008 v.reset(OpARMMOVWconst) 11009 v.AuxInt = -1 11010 return true 11011 } 11012 // match: (ORconst [c] (MOVWconst [d])) 11013 // result: (MOVWconst [c|d]) 11014 for { 11015 c := v.AuxInt 11016 v_0 := v.Args[0] 11017 if v_0.Op != OpARMMOVWconst { 11018 break 11019 } 11020 d := v_0.AuxInt 11021 v.reset(OpARMMOVWconst) 11022 v.AuxInt = c | d 11023 return true 11024 } 11025 // match: (ORconst [c] (ORconst [d] x)) 11026 // result: (ORconst [c|d] x) 11027 for { 11028 c := v.AuxInt 11029 v_0 := v.Args[0] 11030 if v_0.Op != OpARMORconst { 11031 break 11032 } 11033 d := v_0.AuxInt 11034 x := v_0.Args[0] 11035 v.reset(OpARMORconst) 11036 v.AuxInt = c | d 11037 v.AddArg(x) 11038 return true 11039 } 11040 return false 11041 } 11042 func rewriteValueARM_OpARMORshiftLL_0(v *Value) bool { 11043 b := v.Block 11044 typ := &b.Func.Config.Types 11045 // match: (ORshiftLL (MOVWconst [c]) x [d]) 11046 // result: (ORconst [c] (SLLconst <x.Type> x [d])) 11047 for { 11048 d := v.AuxInt 11049 x := v.Args[1] 11050 v_0 := v.Args[0] 11051 if v_0.Op != OpARMMOVWconst { 11052 break 11053 } 11054 c := v_0.AuxInt 11055 v.reset(OpARMORconst) 11056 v.AuxInt = c 11057 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 11058 v0.AuxInt = d 11059 v0.AddArg(x) 11060 v.AddArg(v0) 11061 return true 11062 } 11063 // match: (ORshiftLL x (MOVWconst [c]) [d]) 11064 // result: (ORconst x [int64(int32(uint32(c)<<uint64(d)))]) 11065 for { 11066 d := v.AuxInt 11067 _ = v.Args[1] 11068 x := v.Args[0] 11069 v_1 := v.Args[1] 11070 if v_1.Op != OpARMMOVWconst { 11071 break 11072 } 11073 c := v_1.AuxInt 11074 v.reset(OpARMORconst) 11075 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 11076 v.AddArg(x) 11077 return true 11078 } 11079 // match: (ORshiftLL [c] (SRLconst x [32-c]) x) 11080 // result: (SRRconst [32-c] x) 11081 for { 11082 c := v.AuxInt 11083 x := v.Args[1] 11084 v_0 := v.Args[0] 11085 if v_0.Op != OpARMSRLconst || v_0.AuxInt != 32-c || x != v_0.Args[0] { 11086 break 11087 } 11088 v.reset(OpARMSRRconst) 11089 v.AuxInt = 32 - c 11090 v.AddArg(x) 11091 return true 11092 } 11093 // match: (ORshiftLL <typ.UInt16> [8] (BFXU <typ.UInt16> [armBFAuxInt(8, 8)] x) x) 11094 // result: (REV16 x) 11095 for { 11096 if v.Type != typ.UInt16 || v.AuxInt != 8 { 11097 break 11098 } 11099 x := v.Args[1] 11100 v_0 := v.Args[0] 11101 if v_0.Op != OpARMBFXU || v_0.Type != typ.UInt16 || v_0.AuxInt != armBFAuxInt(8, 8) || x != v_0.Args[0] { 11102 break 11103 } 11104 v.reset(OpARMREV16) 11105 v.AddArg(x) 11106 return true 11107 } 11108 // match: (ORshiftLL <typ.UInt16> [8] (SRLconst <typ.UInt16> [24] (SLLconst [16] x)) x) 11109 // cond: objabi.GOARM>=6 11110 // result: (REV16 x) 11111 for { 11112 if v.Type != typ.UInt16 || v.AuxInt != 8 { 11113 break 11114 } 11115 x := v.Args[1] 11116 v_0 := v.Args[0] 11117 if v_0.Op != OpARMSRLconst || v_0.Type != typ.UInt16 || v_0.AuxInt != 24 { 11118 break 11119 } 11120 v_0_0 := v_0.Args[0] 11121 if v_0_0.Op != OpARMSLLconst || v_0_0.AuxInt != 16 || x != v_0_0.Args[0] || !(objabi.GOARM >= 6) { 11122 break 11123 } 11124 v.reset(OpARMREV16) 11125 v.AddArg(x) 11126 return true 11127 } 11128 // match: (ORshiftLL x y:(SLLconst x [c]) [d]) 11129 // cond: c==d 11130 // result: y 11131 for { 11132 d := v.AuxInt 11133 _ = v.Args[1] 11134 x := v.Args[0] 11135 y := v.Args[1] 11136 if y.Op != OpARMSLLconst { 11137 break 11138 } 11139 c := y.AuxInt 11140 if x != y.Args[0] || !(c == d) { 11141 break 11142 } 11143 v.reset(OpCopy) 11144 v.Type = y.Type 11145 v.AddArg(y) 11146 return true 11147 } 11148 return false 11149 } 11150 func rewriteValueARM_OpARMORshiftLLreg_0(v *Value) bool { 11151 b := v.Block 11152 // match: (ORshiftLLreg (MOVWconst [c]) x y) 11153 // result: (ORconst [c] (SLL <x.Type> x y)) 11154 for { 11155 y := v.Args[2] 11156 v_0 := v.Args[0] 11157 if v_0.Op != OpARMMOVWconst { 11158 break 11159 } 11160 c := v_0.AuxInt 11161 x := v.Args[1] 11162 v.reset(OpARMORconst) 11163 v.AuxInt = c 11164 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 11165 v0.AddArg(x) 11166 v0.AddArg(y) 11167 v.AddArg(v0) 11168 return true 11169 } 11170 // match: (ORshiftLLreg x y (MOVWconst [c])) 11171 // result: (ORshiftLL x y [c]) 11172 for { 11173 _ = v.Args[2] 11174 x := v.Args[0] 11175 y := v.Args[1] 11176 v_2 := v.Args[2] 11177 if v_2.Op != OpARMMOVWconst { 11178 break 11179 } 11180 c := v_2.AuxInt 11181 v.reset(OpARMORshiftLL) 11182 v.AuxInt = c 11183 v.AddArg(x) 11184 v.AddArg(y) 11185 return true 11186 } 11187 return false 11188 } 11189 func rewriteValueARM_OpARMORshiftRA_0(v *Value) bool { 11190 b := v.Block 11191 // match: (ORshiftRA (MOVWconst [c]) x [d]) 11192 // result: (ORconst [c] (SRAconst <x.Type> x [d])) 11193 for { 11194 d := v.AuxInt 11195 x := v.Args[1] 11196 v_0 := v.Args[0] 11197 if v_0.Op != OpARMMOVWconst { 11198 break 11199 } 11200 c := v_0.AuxInt 11201 v.reset(OpARMORconst) 11202 v.AuxInt = c 11203 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 11204 v0.AuxInt = d 11205 v0.AddArg(x) 11206 v.AddArg(v0) 11207 return true 11208 } 11209 // match: (ORshiftRA x (MOVWconst [c]) [d]) 11210 // result: (ORconst x [int64(int32(c)>>uint64(d))]) 11211 for { 11212 d := v.AuxInt 11213 _ = v.Args[1] 11214 x := v.Args[0] 11215 v_1 := v.Args[1] 11216 if v_1.Op != OpARMMOVWconst { 11217 break 11218 } 11219 c := v_1.AuxInt 11220 v.reset(OpARMORconst) 11221 v.AuxInt = int64(int32(c) >> uint64(d)) 11222 v.AddArg(x) 11223 return true 11224 } 11225 // match: (ORshiftRA x y:(SRAconst x [c]) [d]) 11226 // cond: c==d 11227 // result: y 11228 for { 11229 d := v.AuxInt 11230 _ = v.Args[1] 11231 x := v.Args[0] 11232 y := v.Args[1] 11233 if y.Op != OpARMSRAconst { 11234 break 11235 } 11236 c := y.AuxInt 11237 if x != y.Args[0] || !(c == d) { 11238 break 11239 } 11240 v.reset(OpCopy) 11241 v.Type = y.Type 11242 v.AddArg(y) 11243 return true 11244 } 11245 return false 11246 } 11247 func rewriteValueARM_OpARMORshiftRAreg_0(v *Value) bool { 11248 b := v.Block 11249 // match: (ORshiftRAreg (MOVWconst [c]) x y) 11250 // result: (ORconst [c] (SRA <x.Type> x y)) 11251 for { 11252 y := v.Args[2] 11253 v_0 := v.Args[0] 11254 if v_0.Op != OpARMMOVWconst { 11255 break 11256 } 11257 c := v_0.AuxInt 11258 x := v.Args[1] 11259 v.reset(OpARMORconst) 11260 v.AuxInt = c 11261 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 11262 v0.AddArg(x) 11263 v0.AddArg(y) 11264 v.AddArg(v0) 11265 return true 11266 } 11267 // match: (ORshiftRAreg x y (MOVWconst [c])) 11268 // result: (ORshiftRA x y [c]) 11269 for { 11270 _ = v.Args[2] 11271 x := v.Args[0] 11272 y := v.Args[1] 11273 v_2 := v.Args[2] 11274 if v_2.Op != OpARMMOVWconst { 11275 break 11276 } 11277 c := v_2.AuxInt 11278 v.reset(OpARMORshiftRA) 11279 v.AuxInt = c 11280 v.AddArg(x) 11281 v.AddArg(y) 11282 return true 11283 } 11284 return false 11285 } 11286 func rewriteValueARM_OpARMORshiftRL_0(v *Value) bool { 11287 b := v.Block 11288 // match: (ORshiftRL (MOVWconst [c]) x [d]) 11289 // result: (ORconst [c] (SRLconst <x.Type> x [d])) 11290 for { 11291 d := v.AuxInt 11292 x := v.Args[1] 11293 v_0 := v.Args[0] 11294 if v_0.Op != OpARMMOVWconst { 11295 break 11296 } 11297 c := v_0.AuxInt 11298 v.reset(OpARMORconst) 11299 v.AuxInt = c 11300 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 11301 v0.AuxInt = d 11302 v0.AddArg(x) 11303 v.AddArg(v0) 11304 return true 11305 } 11306 // match: (ORshiftRL x (MOVWconst [c]) [d]) 11307 // result: (ORconst x [int64(int32(uint32(c)>>uint64(d)))]) 11308 for { 11309 d := v.AuxInt 11310 _ = v.Args[1] 11311 x := v.Args[0] 11312 v_1 := v.Args[1] 11313 if v_1.Op != OpARMMOVWconst { 11314 break 11315 } 11316 c := v_1.AuxInt 11317 v.reset(OpARMORconst) 11318 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 11319 v.AddArg(x) 11320 return true 11321 } 11322 // match: (ORshiftRL [c] (SLLconst x [32-c]) x) 11323 // result: (SRRconst [ c] x) 11324 for { 11325 c := v.AuxInt 11326 x := v.Args[1] 11327 v_0 := v.Args[0] 11328 if v_0.Op != OpARMSLLconst || v_0.AuxInt != 32-c || x != v_0.Args[0] { 11329 break 11330 } 11331 v.reset(OpARMSRRconst) 11332 v.AuxInt = c 11333 v.AddArg(x) 11334 return true 11335 } 11336 // match: (ORshiftRL x y:(SRLconst x [c]) [d]) 11337 // cond: c==d 11338 // result: y 11339 for { 11340 d := v.AuxInt 11341 _ = v.Args[1] 11342 x := v.Args[0] 11343 y := v.Args[1] 11344 if y.Op != OpARMSRLconst { 11345 break 11346 } 11347 c := y.AuxInt 11348 if x != y.Args[0] || !(c == d) { 11349 break 11350 } 11351 v.reset(OpCopy) 11352 v.Type = y.Type 11353 v.AddArg(y) 11354 return true 11355 } 11356 return false 11357 } 11358 func rewriteValueARM_OpARMORshiftRLreg_0(v *Value) bool { 11359 b := v.Block 11360 // match: (ORshiftRLreg (MOVWconst [c]) x y) 11361 // result: (ORconst [c] (SRL <x.Type> x y)) 11362 for { 11363 y := v.Args[2] 11364 v_0 := v.Args[0] 11365 if v_0.Op != OpARMMOVWconst { 11366 break 11367 } 11368 c := v_0.AuxInt 11369 x := v.Args[1] 11370 v.reset(OpARMORconst) 11371 v.AuxInt = c 11372 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 11373 v0.AddArg(x) 11374 v0.AddArg(y) 11375 v.AddArg(v0) 11376 return true 11377 } 11378 // match: (ORshiftRLreg x y (MOVWconst [c])) 11379 // result: (ORshiftRL x y [c]) 11380 for { 11381 _ = v.Args[2] 11382 x := v.Args[0] 11383 y := v.Args[1] 11384 v_2 := v.Args[2] 11385 if v_2.Op != OpARMMOVWconst { 11386 break 11387 } 11388 c := v_2.AuxInt 11389 v.reset(OpARMORshiftRL) 11390 v.AuxInt = c 11391 v.AddArg(x) 11392 v.AddArg(y) 11393 return true 11394 } 11395 return false 11396 } 11397 func rewriteValueARM_OpARMRSB_0(v *Value) bool { 11398 // match: (RSB (MOVWconst [c]) x) 11399 // result: (SUBconst [c] x) 11400 for { 11401 x := v.Args[1] 11402 v_0 := v.Args[0] 11403 if v_0.Op != OpARMMOVWconst { 11404 break 11405 } 11406 c := v_0.AuxInt 11407 v.reset(OpARMSUBconst) 11408 v.AuxInt = c 11409 v.AddArg(x) 11410 return true 11411 } 11412 // match: (RSB x (MOVWconst [c])) 11413 // result: (RSBconst [c] x) 11414 for { 11415 _ = v.Args[1] 11416 x := v.Args[0] 11417 v_1 := v.Args[1] 11418 if v_1.Op != OpARMMOVWconst { 11419 break 11420 } 11421 c := v_1.AuxInt 11422 v.reset(OpARMRSBconst) 11423 v.AuxInt = c 11424 v.AddArg(x) 11425 return true 11426 } 11427 // match: (RSB x (SLLconst [c] y)) 11428 // result: (RSBshiftLL x y [c]) 11429 for { 11430 _ = v.Args[1] 11431 x := v.Args[0] 11432 v_1 := v.Args[1] 11433 if v_1.Op != OpARMSLLconst { 11434 break 11435 } 11436 c := v_1.AuxInt 11437 y := v_1.Args[0] 11438 v.reset(OpARMRSBshiftLL) 11439 v.AuxInt = c 11440 v.AddArg(x) 11441 v.AddArg(y) 11442 return true 11443 } 11444 // match: (RSB (SLLconst [c] y) x) 11445 // result: (SUBshiftLL x y [c]) 11446 for { 11447 x := v.Args[1] 11448 v_0 := v.Args[0] 11449 if v_0.Op != OpARMSLLconst { 11450 break 11451 } 11452 c := v_0.AuxInt 11453 y := v_0.Args[0] 11454 v.reset(OpARMSUBshiftLL) 11455 v.AuxInt = c 11456 v.AddArg(x) 11457 v.AddArg(y) 11458 return true 11459 } 11460 // match: (RSB x (SRLconst [c] y)) 11461 // result: (RSBshiftRL x y [c]) 11462 for { 11463 _ = v.Args[1] 11464 x := v.Args[0] 11465 v_1 := v.Args[1] 11466 if v_1.Op != OpARMSRLconst { 11467 break 11468 } 11469 c := v_1.AuxInt 11470 y := v_1.Args[0] 11471 v.reset(OpARMRSBshiftRL) 11472 v.AuxInt = c 11473 v.AddArg(x) 11474 v.AddArg(y) 11475 return true 11476 } 11477 // match: (RSB (SRLconst [c] y) x) 11478 // result: (SUBshiftRL x y [c]) 11479 for { 11480 x := v.Args[1] 11481 v_0 := v.Args[0] 11482 if v_0.Op != OpARMSRLconst { 11483 break 11484 } 11485 c := v_0.AuxInt 11486 y := v_0.Args[0] 11487 v.reset(OpARMSUBshiftRL) 11488 v.AuxInt = c 11489 v.AddArg(x) 11490 v.AddArg(y) 11491 return true 11492 } 11493 // match: (RSB x (SRAconst [c] y)) 11494 // result: (RSBshiftRA x y [c]) 11495 for { 11496 _ = v.Args[1] 11497 x := v.Args[0] 11498 v_1 := v.Args[1] 11499 if v_1.Op != OpARMSRAconst { 11500 break 11501 } 11502 c := v_1.AuxInt 11503 y := v_1.Args[0] 11504 v.reset(OpARMRSBshiftRA) 11505 v.AuxInt = c 11506 v.AddArg(x) 11507 v.AddArg(y) 11508 return true 11509 } 11510 // match: (RSB (SRAconst [c] y) x) 11511 // result: (SUBshiftRA x y [c]) 11512 for { 11513 x := v.Args[1] 11514 v_0 := v.Args[0] 11515 if v_0.Op != OpARMSRAconst { 11516 break 11517 } 11518 c := v_0.AuxInt 11519 y := v_0.Args[0] 11520 v.reset(OpARMSUBshiftRA) 11521 v.AuxInt = c 11522 v.AddArg(x) 11523 v.AddArg(y) 11524 return true 11525 } 11526 // match: (RSB x (SLL y z)) 11527 // result: (RSBshiftLLreg x y z) 11528 for { 11529 _ = v.Args[1] 11530 x := v.Args[0] 11531 v_1 := v.Args[1] 11532 if v_1.Op != OpARMSLL { 11533 break 11534 } 11535 z := v_1.Args[1] 11536 y := v_1.Args[0] 11537 v.reset(OpARMRSBshiftLLreg) 11538 v.AddArg(x) 11539 v.AddArg(y) 11540 v.AddArg(z) 11541 return true 11542 } 11543 // match: (RSB (SLL y z) x) 11544 // result: (SUBshiftLLreg x y z) 11545 for { 11546 x := v.Args[1] 11547 v_0 := v.Args[0] 11548 if v_0.Op != OpARMSLL { 11549 break 11550 } 11551 z := v_0.Args[1] 11552 y := v_0.Args[0] 11553 v.reset(OpARMSUBshiftLLreg) 11554 v.AddArg(x) 11555 v.AddArg(y) 11556 v.AddArg(z) 11557 return true 11558 } 11559 return false 11560 } 11561 func rewriteValueARM_OpARMRSB_10(v *Value) bool { 11562 // match: (RSB x (SRL y z)) 11563 // result: (RSBshiftRLreg x y z) 11564 for { 11565 _ = v.Args[1] 11566 x := v.Args[0] 11567 v_1 := v.Args[1] 11568 if v_1.Op != OpARMSRL { 11569 break 11570 } 11571 z := v_1.Args[1] 11572 y := v_1.Args[0] 11573 v.reset(OpARMRSBshiftRLreg) 11574 v.AddArg(x) 11575 v.AddArg(y) 11576 v.AddArg(z) 11577 return true 11578 } 11579 // match: (RSB (SRL y z) x) 11580 // result: (SUBshiftRLreg x y z) 11581 for { 11582 x := v.Args[1] 11583 v_0 := v.Args[0] 11584 if v_0.Op != OpARMSRL { 11585 break 11586 } 11587 z := v_0.Args[1] 11588 y := v_0.Args[0] 11589 v.reset(OpARMSUBshiftRLreg) 11590 v.AddArg(x) 11591 v.AddArg(y) 11592 v.AddArg(z) 11593 return true 11594 } 11595 // match: (RSB x (SRA y z)) 11596 // result: (RSBshiftRAreg x y z) 11597 for { 11598 _ = v.Args[1] 11599 x := v.Args[0] 11600 v_1 := v.Args[1] 11601 if v_1.Op != OpARMSRA { 11602 break 11603 } 11604 z := v_1.Args[1] 11605 y := v_1.Args[0] 11606 v.reset(OpARMRSBshiftRAreg) 11607 v.AddArg(x) 11608 v.AddArg(y) 11609 v.AddArg(z) 11610 return true 11611 } 11612 // match: (RSB (SRA y z) x) 11613 // result: (SUBshiftRAreg x y z) 11614 for { 11615 x := v.Args[1] 11616 v_0 := v.Args[0] 11617 if v_0.Op != OpARMSRA { 11618 break 11619 } 11620 z := v_0.Args[1] 11621 y := v_0.Args[0] 11622 v.reset(OpARMSUBshiftRAreg) 11623 v.AddArg(x) 11624 v.AddArg(y) 11625 v.AddArg(z) 11626 return true 11627 } 11628 // match: (RSB x x) 11629 // result: (MOVWconst [0]) 11630 for { 11631 x := v.Args[1] 11632 if x != v.Args[0] { 11633 break 11634 } 11635 v.reset(OpARMMOVWconst) 11636 v.AuxInt = 0 11637 return true 11638 } 11639 // match: (RSB (MUL x y) a) 11640 // cond: objabi.GOARM == 7 11641 // result: (MULS x y a) 11642 for { 11643 a := v.Args[1] 11644 v_0 := v.Args[0] 11645 if v_0.Op != OpARMMUL { 11646 break 11647 } 11648 y := v_0.Args[1] 11649 x := v_0.Args[0] 11650 if !(objabi.GOARM == 7) { 11651 break 11652 } 11653 v.reset(OpARMMULS) 11654 v.AddArg(x) 11655 v.AddArg(y) 11656 v.AddArg(a) 11657 return true 11658 } 11659 return false 11660 } 11661 func rewriteValueARM_OpARMRSBSshiftLL_0(v *Value) bool { 11662 b := v.Block 11663 // match: (RSBSshiftLL (MOVWconst [c]) x [d]) 11664 // result: (SUBSconst [c] (SLLconst <x.Type> x [d])) 11665 for { 11666 d := v.AuxInt 11667 x := v.Args[1] 11668 v_0 := v.Args[0] 11669 if v_0.Op != OpARMMOVWconst { 11670 break 11671 } 11672 c := v_0.AuxInt 11673 v.reset(OpARMSUBSconst) 11674 v.AuxInt = c 11675 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 11676 v0.AuxInt = d 11677 v0.AddArg(x) 11678 v.AddArg(v0) 11679 return true 11680 } 11681 // match: (RSBSshiftLL x (MOVWconst [c]) [d]) 11682 // result: (RSBSconst x [int64(int32(uint32(c)<<uint64(d)))]) 11683 for { 11684 d := v.AuxInt 11685 _ = v.Args[1] 11686 x := v.Args[0] 11687 v_1 := v.Args[1] 11688 if v_1.Op != OpARMMOVWconst { 11689 break 11690 } 11691 c := v_1.AuxInt 11692 v.reset(OpARMRSBSconst) 11693 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 11694 v.AddArg(x) 11695 return true 11696 } 11697 return false 11698 } 11699 func rewriteValueARM_OpARMRSBSshiftLLreg_0(v *Value) bool { 11700 b := v.Block 11701 // match: (RSBSshiftLLreg (MOVWconst [c]) x y) 11702 // result: (SUBSconst [c] (SLL <x.Type> x y)) 11703 for { 11704 y := v.Args[2] 11705 v_0 := v.Args[0] 11706 if v_0.Op != OpARMMOVWconst { 11707 break 11708 } 11709 c := v_0.AuxInt 11710 x := v.Args[1] 11711 v.reset(OpARMSUBSconst) 11712 v.AuxInt = c 11713 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 11714 v0.AddArg(x) 11715 v0.AddArg(y) 11716 v.AddArg(v0) 11717 return true 11718 } 11719 // match: (RSBSshiftLLreg x y (MOVWconst [c])) 11720 // result: (RSBSshiftLL x y [c]) 11721 for { 11722 _ = v.Args[2] 11723 x := v.Args[0] 11724 y := v.Args[1] 11725 v_2 := v.Args[2] 11726 if v_2.Op != OpARMMOVWconst { 11727 break 11728 } 11729 c := v_2.AuxInt 11730 v.reset(OpARMRSBSshiftLL) 11731 v.AuxInt = c 11732 v.AddArg(x) 11733 v.AddArg(y) 11734 return true 11735 } 11736 return false 11737 } 11738 func rewriteValueARM_OpARMRSBSshiftRA_0(v *Value) bool { 11739 b := v.Block 11740 // match: (RSBSshiftRA (MOVWconst [c]) x [d]) 11741 // result: (SUBSconst [c] (SRAconst <x.Type> x [d])) 11742 for { 11743 d := v.AuxInt 11744 x := v.Args[1] 11745 v_0 := v.Args[0] 11746 if v_0.Op != OpARMMOVWconst { 11747 break 11748 } 11749 c := v_0.AuxInt 11750 v.reset(OpARMSUBSconst) 11751 v.AuxInt = c 11752 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 11753 v0.AuxInt = d 11754 v0.AddArg(x) 11755 v.AddArg(v0) 11756 return true 11757 } 11758 // match: (RSBSshiftRA x (MOVWconst [c]) [d]) 11759 // result: (RSBSconst x [int64(int32(c)>>uint64(d))]) 11760 for { 11761 d := v.AuxInt 11762 _ = v.Args[1] 11763 x := v.Args[0] 11764 v_1 := v.Args[1] 11765 if v_1.Op != OpARMMOVWconst { 11766 break 11767 } 11768 c := v_1.AuxInt 11769 v.reset(OpARMRSBSconst) 11770 v.AuxInt = int64(int32(c) >> uint64(d)) 11771 v.AddArg(x) 11772 return true 11773 } 11774 return false 11775 } 11776 func rewriteValueARM_OpARMRSBSshiftRAreg_0(v *Value) bool { 11777 b := v.Block 11778 // match: (RSBSshiftRAreg (MOVWconst [c]) x y) 11779 // result: (SUBSconst [c] (SRA <x.Type> x y)) 11780 for { 11781 y := v.Args[2] 11782 v_0 := v.Args[0] 11783 if v_0.Op != OpARMMOVWconst { 11784 break 11785 } 11786 c := v_0.AuxInt 11787 x := v.Args[1] 11788 v.reset(OpARMSUBSconst) 11789 v.AuxInt = c 11790 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 11791 v0.AddArg(x) 11792 v0.AddArg(y) 11793 v.AddArg(v0) 11794 return true 11795 } 11796 // match: (RSBSshiftRAreg x y (MOVWconst [c])) 11797 // result: (RSBSshiftRA x y [c]) 11798 for { 11799 _ = v.Args[2] 11800 x := v.Args[0] 11801 y := v.Args[1] 11802 v_2 := v.Args[2] 11803 if v_2.Op != OpARMMOVWconst { 11804 break 11805 } 11806 c := v_2.AuxInt 11807 v.reset(OpARMRSBSshiftRA) 11808 v.AuxInt = c 11809 v.AddArg(x) 11810 v.AddArg(y) 11811 return true 11812 } 11813 return false 11814 } 11815 func rewriteValueARM_OpARMRSBSshiftRL_0(v *Value) bool { 11816 b := v.Block 11817 // match: (RSBSshiftRL (MOVWconst [c]) x [d]) 11818 // result: (SUBSconst [c] (SRLconst <x.Type> x [d])) 11819 for { 11820 d := v.AuxInt 11821 x := v.Args[1] 11822 v_0 := v.Args[0] 11823 if v_0.Op != OpARMMOVWconst { 11824 break 11825 } 11826 c := v_0.AuxInt 11827 v.reset(OpARMSUBSconst) 11828 v.AuxInt = c 11829 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 11830 v0.AuxInt = d 11831 v0.AddArg(x) 11832 v.AddArg(v0) 11833 return true 11834 } 11835 // match: (RSBSshiftRL x (MOVWconst [c]) [d]) 11836 // result: (RSBSconst x [int64(int32(uint32(c)>>uint64(d)))]) 11837 for { 11838 d := v.AuxInt 11839 _ = v.Args[1] 11840 x := v.Args[0] 11841 v_1 := v.Args[1] 11842 if v_1.Op != OpARMMOVWconst { 11843 break 11844 } 11845 c := v_1.AuxInt 11846 v.reset(OpARMRSBSconst) 11847 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 11848 v.AddArg(x) 11849 return true 11850 } 11851 return false 11852 } 11853 func rewriteValueARM_OpARMRSBSshiftRLreg_0(v *Value) bool { 11854 b := v.Block 11855 // match: (RSBSshiftRLreg (MOVWconst [c]) x y) 11856 // result: (SUBSconst [c] (SRL <x.Type> x y)) 11857 for { 11858 y := v.Args[2] 11859 v_0 := v.Args[0] 11860 if v_0.Op != OpARMMOVWconst { 11861 break 11862 } 11863 c := v_0.AuxInt 11864 x := v.Args[1] 11865 v.reset(OpARMSUBSconst) 11866 v.AuxInt = c 11867 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 11868 v0.AddArg(x) 11869 v0.AddArg(y) 11870 v.AddArg(v0) 11871 return true 11872 } 11873 // match: (RSBSshiftRLreg x y (MOVWconst [c])) 11874 // result: (RSBSshiftRL x y [c]) 11875 for { 11876 _ = v.Args[2] 11877 x := v.Args[0] 11878 y := v.Args[1] 11879 v_2 := v.Args[2] 11880 if v_2.Op != OpARMMOVWconst { 11881 break 11882 } 11883 c := v_2.AuxInt 11884 v.reset(OpARMRSBSshiftRL) 11885 v.AuxInt = c 11886 v.AddArg(x) 11887 v.AddArg(y) 11888 return true 11889 } 11890 return false 11891 } 11892 func rewriteValueARM_OpARMRSBconst_0(v *Value) bool { 11893 // match: (RSBconst [c] (MOVWconst [d])) 11894 // result: (MOVWconst [int64(int32(c-d))]) 11895 for { 11896 c := v.AuxInt 11897 v_0 := v.Args[0] 11898 if v_0.Op != OpARMMOVWconst { 11899 break 11900 } 11901 d := v_0.AuxInt 11902 v.reset(OpARMMOVWconst) 11903 v.AuxInt = int64(int32(c - d)) 11904 return true 11905 } 11906 // match: (RSBconst [c] (RSBconst [d] x)) 11907 // result: (ADDconst [int64(int32(c-d))] x) 11908 for { 11909 c := v.AuxInt 11910 v_0 := v.Args[0] 11911 if v_0.Op != OpARMRSBconst { 11912 break 11913 } 11914 d := v_0.AuxInt 11915 x := v_0.Args[0] 11916 v.reset(OpARMADDconst) 11917 v.AuxInt = int64(int32(c - d)) 11918 v.AddArg(x) 11919 return true 11920 } 11921 // match: (RSBconst [c] (ADDconst [d] x)) 11922 // result: (RSBconst [int64(int32(c-d))] x) 11923 for { 11924 c := v.AuxInt 11925 v_0 := v.Args[0] 11926 if v_0.Op != OpARMADDconst { 11927 break 11928 } 11929 d := v_0.AuxInt 11930 x := v_0.Args[0] 11931 v.reset(OpARMRSBconst) 11932 v.AuxInt = int64(int32(c - d)) 11933 v.AddArg(x) 11934 return true 11935 } 11936 // match: (RSBconst [c] (SUBconst [d] x)) 11937 // result: (RSBconst [int64(int32(c+d))] x) 11938 for { 11939 c := v.AuxInt 11940 v_0 := v.Args[0] 11941 if v_0.Op != OpARMSUBconst { 11942 break 11943 } 11944 d := v_0.AuxInt 11945 x := v_0.Args[0] 11946 v.reset(OpARMRSBconst) 11947 v.AuxInt = int64(int32(c + d)) 11948 v.AddArg(x) 11949 return true 11950 } 11951 return false 11952 } 11953 func rewriteValueARM_OpARMRSBshiftLL_0(v *Value) bool { 11954 b := v.Block 11955 // match: (RSBshiftLL (MOVWconst [c]) x [d]) 11956 // result: (SUBconst [c] (SLLconst <x.Type> x [d])) 11957 for { 11958 d := v.AuxInt 11959 x := v.Args[1] 11960 v_0 := v.Args[0] 11961 if v_0.Op != OpARMMOVWconst { 11962 break 11963 } 11964 c := v_0.AuxInt 11965 v.reset(OpARMSUBconst) 11966 v.AuxInt = c 11967 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 11968 v0.AuxInt = d 11969 v0.AddArg(x) 11970 v.AddArg(v0) 11971 return true 11972 } 11973 // match: (RSBshiftLL x (MOVWconst [c]) [d]) 11974 // result: (RSBconst x [int64(int32(uint32(c)<<uint64(d)))]) 11975 for { 11976 d := v.AuxInt 11977 _ = v.Args[1] 11978 x := v.Args[0] 11979 v_1 := v.Args[1] 11980 if v_1.Op != OpARMMOVWconst { 11981 break 11982 } 11983 c := v_1.AuxInt 11984 v.reset(OpARMRSBconst) 11985 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 11986 v.AddArg(x) 11987 return true 11988 } 11989 // match: (RSBshiftLL x (SLLconst x [c]) [d]) 11990 // cond: c==d 11991 // result: (MOVWconst [0]) 11992 for { 11993 d := v.AuxInt 11994 _ = v.Args[1] 11995 x := v.Args[0] 11996 v_1 := v.Args[1] 11997 if v_1.Op != OpARMSLLconst { 11998 break 11999 } 12000 c := v_1.AuxInt 12001 if x != v_1.Args[0] || !(c == d) { 12002 break 12003 } 12004 v.reset(OpARMMOVWconst) 12005 v.AuxInt = 0 12006 return true 12007 } 12008 return false 12009 } 12010 func rewriteValueARM_OpARMRSBshiftLLreg_0(v *Value) bool { 12011 b := v.Block 12012 // match: (RSBshiftLLreg (MOVWconst [c]) x y) 12013 // result: (SUBconst [c] (SLL <x.Type> x y)) 12014 for { 12015 y := v.Args[2] 12016 v_0 := v.Args[0] 12017 if v_0.Op != OpARMMOVWconst { 12018 break 12019 } 12020 c := v_0.AuxInt 12021 x := v.Args[1] 12022 v.reset(OpARMSUBconst) 12023 v.AuxInt = c 12024 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 12025 v0.AddArg(x) 12026 v0.AddArg(y) 12027 v.AddArg(v0) 12028 return true 12029 } 12030 // match: (RSBshiftLLreg x y (MOVWconst [c])) 12031 // result: (RSBshiftLL x y [c]) 12032 for { 12033 _ = v.Args[2] 12034 x := v.Args[0] 12035 y := v.Args[1] 12036 v_2 := v.Args[2] 12037 if v_2.Op != OpARMMOVWconst { 12038 break 12039 } 12040 c := v_2.AuxInt 12041 v.reset(OpARMRSBshiftLL) 12042 v.AuxInt = c 12043 v.AddArg(x) 12044 v.AddArg(y) 12045 return true 12046 } 12047 return false 12048 } 12049 func rewriteValueARM_OpARMRSBshiftRA_0(v *Value) bool { 12050 b := v.Block 12051 // match: (RSBshiftRA (MOVWconst [c]) x [d]) 12052 // result: (SUBconst [c] (SRAconst <x.Type> x [d])) 12053 for { 12054 d := v.AuxInt 12055 x := v.Args[1] 12056 v_0 := v.Args[0] 12057 if v_0.Op != OpARMMOVWconst { 12058 break 12059 } 12060 c := v_0.AuxInt 12061 v.reset(OpARMSUBconst) 12062 v.AuxInt = c 12063 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 12064 v0.AuxInt = d 12065 v0.AddArg(x) 12066 v.AddArg(v0) 12067 return true 12068 } 12069 // match: (RSBshiftRA x (MOVWconst [c]) [d]) 12070 // result: (RSBconst x [int64(int32(c)>>uint64(d))]) 12071 for { 12072 d := v.AuxInt 12073 _ = v.Args[1] 12074 x := v.Args[0] 12075 v_1 := v.Args[1] 12076 if v_1.Op != OpARMMOVWconst { 12077 break 12078 } 12079 c := v_1.AuxInt 12080 v.reset(OpARMRSBconst) 12081 v.AuxInt = int64(int32(c) >> uint64(d)) 12082 v.AddArg(x) 12083 return true 12084 } 12085 // match: (RSBshiftRA x (SRAconst x [c]) [d]) 12086 // cond: c==d 12087 // result: (MOVWconst [0]) 12088 for { 12089 d := v.AuxInt 12090 _ = v.Args[1] 12091 x := v.Args[0] 12092 v_1 := v.Args[1] 12093 if v_1.Op != OpARMSRAconst { 12094 break 12095 } 12096 c := v_1.AuxInt 12097 if x != v_1.Args[0] || !(c == d) { 12098 break 12099 } 12100 v.reset(OpARMMOVWconst) 12101 v.AuxInt = 0 12102 return true 12103 } 12104 return false 12105 } 12106 func rewriteValueARM_OpARMRSBshiftRAreg_0(v *Value) bool { 12107 b := v.Block 12108 // match: (RSBshiftRAreg (MOVWconst [c]) x y) 12109 // result: (SUBconst [c] (SRA <x.Type> x y)) 12110 for { 12111 y := v.Args[2] 12112 v_0 := v.Args[0] 12113 if v_0.Op != OpARMMOVWconst { 12114 break 12115 } 12116 c := v_0.AuxInt 12117 x := v.Args[1] 12118 v.reset(OpARMSUBconst) 12119 v.AuxInt = c 12120 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 12121 v0.AddArg(x) 12122 v0.AddArg(y) 12123 v.AddArg(v0) 12124 return true 12125 } 12126 // match: (RSBshiftRAreg x y (MOVWconst [c])) 12127 // result: (RSBshiftRA x y [c]) 12128 for { 12129 _ = v.Args[2] 12130 x := v.Args[0] 12131 y := v.Args[1] 12132 v_2 := v.Args[2] 12133 if v_2.Op != OpARMMOVWconst { 12134 break 12135 } 12136 c := v_2.AuxInt 12137 v.reset(OpARMRSBshiftRA) 12138 v.AuxInt = c 12139 v.AddArg(x) 12140 v.AddArg(y) 12141 return true 12142 } 12143 return false 12144 } 12145 func rewriteValueARM_OpARMRSBshiftRL_0(v *Value) bool { 12146 b := v.Block 12147 // match: (RSBshiftRL (MOVWconst [c]) x [d]) 12148 // result: (SUBconst [c] (SRLconst <x.Type> x [d])) 12149 for { 12150 d := v.AuxInt 12151 x := v.Args[1] 12152 v_0 := v.Args[0] 12153 if v_0.Op != OpARMMOVWconst { 12154 break 12155 } 12156 c := v_0.AuxInt 12157 v.reset(OpARMSUBconst) 12158 v.AuxInt = c 12159 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 12160 v0.AuxInt = d 12161 v0.AddArg(x) 12162 v.AddArg(v0) 12163 return true 12164 } 12165 // match: (RSBshiftRL x (MOVWconst [c]) [d]) 12166 // result: (RSBconst x [int64(int32(uint32(c)>>uint64(d)))]) 12167 for { 12168 d := v.AuxInt 12169 _ = v.Args[1] 12170 x := v.Args[0] 12171 v_1 := v.Args[1] 12172 if v_1.Op != OpARMMOVWconst { 12173 break 12174 } 12175 c := v_1.AuxInt 12176 v.reset(OpARMRSBconst) 12177 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 12178 v.AddArg(x) 12179 return true 12180 } 12181 // match: (RSBshiftRL x (SRLconst x [c]) [d]) 12182 // cond: c==d 12183 // result: (MOVWconst [0]) 12184 for { 12185 d := v.AuxInt 12186 _ = v.Args[1] 12187 x := v.Args[0] 12188 v_1 := v.Args[1] 12189 if v_1.Op != OpARMSRLconst { 12190 break 12191 } 12192 c := v_1.AuxInt 12193 if x != v_1.Args[0] || !(c == d) { 12194 break 12195 } 12196 v.reset(OpARMMOVWconst) 12197 v.AuxInt = 0 12198 return true 12199 } 12200 return false 12201 } 12202 func rewriteValueARM_OpARMRSBshiftRLreg_0(v *Value) bool { 12203 b := v.Block 12204 // match: (RSBshiftRLreg (MOVWconst [c]) x y) 12205 // result: (SUBconst [c] (SRL <x.Type> x y)) 12206 for { 12207 y := v.Args[2] 12208 v_0 := v.Args[0] 12209 if v_0.Op != OpARMMOVWconst { 12210 break 12211 } 12212 c := v_0.AuxInt 12213 x := v.Args[1] 12214 v.reset(OpARMSUBconst) 12215 v.AuxInt = c 12216 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 12217 v0.AddArg(x) 12218 v0.AddArg(y) 12219 v.AddArg(v0) 12220 return true 12221 } 12222 // match: (RSBshiftRLreg x y (MOVWconst [c])) 12223 // result: (RSBshiftRL x y [c]) 12224 for { 12225 _ = v.Args[2] 12226 x := v.Args[0] 12227 y := v.Args[1] 12228 v_2 := v.Args[2] 12229 if v_2.Op != OpARMMOVWconst { 12230 break 12231 } 12232 c := v_2.AuxInt 12233 v.reset(OpARMRSBshiftRL) 12234 v.AuxInt = c 12235 v.AddArg(x) 12236 v.AddArg(y) 12237 return true 12238 } 12239 return false 12240 } 12241 func rewriteValueARM_OpARMRSCconst_0(v *Value) bool { 12242 // match: (RSCconst [c] (ADDconst [d] x) flags) 12243 // result: (RSCconst [int64(int32(c-d))] x flags) 12244 for { 12245 c := v.AuxInt 12246 flags := v.Args[1] 12247 v_0 := v.Args[0] 12248 if v_0.Op != OpARMADDconst { 12249 break 12250 } 12251 d := v_0.AuxInt 12252 x := v_0.Args[0] 12253 v.reset(OpARMRSCconst) 12254 v.AuxInt = int64(int32(c - d)) 12255 v.AddArg(x) 12256 v.AddArg(flags) 12257 return true 12258 } 12259 // match: (RSCconst [c] (SUBconst [d] x) flags) 12260 // result: (RSCconst [int64(int32(c+d))] x flags) 12261 for { 12262 c := v.AuxInt 12263 flags := v.Args[1] 12264 v_0 := v.Args[0] 12265 if v_0.Op != OpARMSUBconst { 12266 break 12267 } 12268 d := v_0.AuxInt 12269 x := v_0.Args[0] 12270 v.reset(OpARMRSCconst) 12271 v.AuxInt = int64(int32(c + d)) 12272 v.AddArg(x) 12273 v.AddArg(flags) 12274 return true 12275 } 12276 return false 12277 } 12278 func rewriteValueARM_OpARMRSCshiftLL_0(v *Value) bool { 12279 b := v.Block 12280 // match: (RSCshiftLL (MOVWconst [c]) x [d] flags) 12281 // result: (SBCconst [c] (SLLconst <x.Type> x [d]) flags) 12282 for { 12283 d := v.AuxInt 12284 flags := v.Args[2] 12285 v_0 := v.Args[0] 12286 if v_0.Op != OpARMMOVWconst { 12287 break 12288 } 12289 c := v_0.AuxInt 12290 x := v.Args[1] 12291 v.reset(OpARMSBCconst) 12292 v.AuxInt = c 12293 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 12294 v0.AuxInt = d 12295 v0.AddArg(x) 12296 v.AddArg(v0) 12297 v.AddArg(flags) 12298 return true 12299 } 12300 // match: (RSCshiftLL x (MOVWconst [c]) [d] flags) 12301 // result: (RSCconst x [int64(int32(uint32(c)<<uint64(d)))] flags) 12302 for { 12303 d := v.AuxInt 12304 flags := v.Args[2] 12305 x := v.Args[0] 12306 v_1 := v.Args[1] 12307 if v_1.Op != OpARMMOVWconst { 12308 break 12309 } 12310 c := v_1.AuxInt 12311 v.reset(OpARMRSCconst) 12312 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 12313 v.AddArg(x) 12314 v.AddArg(flags) 12315 return true 12316 } 12317 return false 12318 } 12319 func rewriteValueARM_OpARMRSCshiftLLreg_0(v *Value) bool { 12320 b := v.Block 12321 // match: (RSCshiftLLreg (MOVWconst [c]) x y flags) 12322 // result: (SBCconst [c] (SLL <x.Type> x y) flags) 12323 for { 12324 flags := v.Args[3] 12325 v_0 := v.Args[0] 12326 if v_0.Op != OpARMMOVWconst { 12327 break 12328 } 12329 c := v_0.AuxInt 12330 x := v.Args[1] 12331 y := v.Args[2] 12332 v.reset(OpARMSBCconst) 12333 v.AuxInt = c 12334 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 12335 v0.AddArg(x) 12336 v0.AddArg(y) 12337 v.AddArg(v0) 12338 v.AddArg(flags) 12339 return true 12340 } 12341 // match: (RSCshiftLLreg x y (MOVWconst [c]) flags) 12342 // result: (RSCshiftLL x y [c] flags) 12343 for { 12344 flags := v.Args[3] 12345 x := v.Args[0] 12346 y := v.Args[1] 12347 v_2 := v.Args[2] 12348 if v_2.Op != OpARMMOVWconst { 12349 break 12350 } 12351 c := v_2.AuxInt 12352 v.reset(OpARMRSCshiftLL) 12353 v.AuxInt = c 12354 v.AddArg(x) 12355 v.AddArg(y) 12356 v.AddArg(flags) 12357 return true 12358 } 12359 return false 12360 } 12361 func rewriteValueARM_OpARMRSCshiftRA_0(v *Value) bool { 12362 b := v.Block 12363 // match: (RSCshiftRA (MOVWconst [c]) x [d] flags) 12364 // result: (SBCconst [c] (SRAconst <x.Type> x [d]) flags) 12365 for { 12366 d := v.AuxInt 12367 flags := v.Args[2] 12368 v_0 := v.Args[0] 12369 if v_0.Op != OpARMMOVWconst { 12370 break 12371 } 12372 c := v_0.AuxInt 12373 x := v.Args[1] 12374 v.reset(OpARMSBCconst) 12375 v.AuxInt = c 12376 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 12377 v0.AuxInt = d 12378 v0.AddArg(x) 12379 v.AddArg(v0) 12380 v.AddArg(flags) 12381 return true 12382 } 12383 // match: (RSCshiftRA x (MOVWconst [c]) [d] flags) 12384 // result: (RSCconst x [int64(int32(c)>>uint64(d))] flags) 12385 for { 12386 d := v.AuxInt 12387 flags := v.Args[2] 12388 x := v.Args[0] 12389 v_1 := v.Args[1] 12390 if v_1.Op != OpARMMOVWconst { 12391 break 12392 } 12393 c := v_1.AuxInt 12394 v.reset(OpARMRSCconst) 12395 v.AuxInt = int64(int32(c) >> uint64(d)) 12396 v.AddArg(x) 12397 v.AddArg(flags) 12398 return true 12399 } 12400 return false 12401 } 12402 func rewriteValueARM_OpARMRSCshiftRAreg_0(v *Value) bool { 12403 b := v.Block 12404 // match: (RSCshiftRAreg (MOVWconst [c]) x y flags) 12405 // result: (SBCconst [c] (SRA <x.Type> x y) flags) 12406 for { 12407 flags := v.Args[3] 12408 v_0 := v.Args[0] 12409 if v_0.Op != OpARMMOVWconst { 12410 break 12411 } 12412 c := v_0.AuxInt 12413 x := v.Args[1] 12414 y := v.Args[2] 12415 v.reset(OpARMSBCconst) 12416 v.AuxInt = c 12417 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 12418 v0.AddArg(x) 12419 v0.AddArg(y) 12420 v.AddArg(v0) 12421 v.AddArg(flags) 12422 return true 12423 } 12424 // match: (RSCshiftRAreg x y (MOVWconst [c]) flags) 12425 // result: (RSCshiftRA x y [c] flags) 12426 for { 12427 flags := v.Args[3] 12428 x := v.Args[0] 12429 y := v.Args[1] 12430 v_2 := v.Args[2] 12431 if v_2.Op != OpARMMOVWconst { 12432 break 12433 } 12434 c := v_2.AuxInt 12435 v.reset(OpARMRSCshiftRA) 12436 v.AuxInt = c 12437 v.AddArg(x) 12438 v.AddArg(y) 12439 v.AddArg(flags) 12440 return true 12441 } 12442 return false 12443 } 12444 func rewriteValueARM_OpARMRSCshiftRL_0(v *Value) bool { 12445 b := v.Block 12446 // match: (RSCshiftRL (MOVWconst [c]) x [d] flags) 12447 // result: (SBCconst [c] (SRLconst <x.Type> x [d]) flags) 12448 for { 12449 d := v.AuxInt 12450 flags := v.Args[2] 12451 v_0 := v.Args[0] 12452 if v_0.Op != OpARMMOVWconst { 12453 break 12454 } 12455 c := v_0.AuxInt 12456 x := v.Args[1] 12457 v.reset(OpARMSBCconst) 12458 v.AuxInt = c 12459 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 12460 v0.AuxInt = d 12461 v0.AddArg(x) 12462 v.AddArg(v0) 12463 v.AddArg(flags) 12464 return true 12465 } 12466 // match: (RSCshiftRL x (MOVWconst [c]) [d] flags) 12467 // result: (RSCconst x [int64(int32(uint32(c)>>uint64(d)))] flags) 12468 for { 12469 d := v.AuxInt 12470 flags := v.Args[2] 12471 x := v.Args[0] 12472 v_1 := v.Args[1] 12473 if v_1.Op != OpARMMOVWconst { 12474 break 12475 } 12476 c := v_1.AuxInt 12477 v.reset(OpARMRSCconst) 12478 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 12479 v.AddArg(x) 12480 v.AddArg(flags) 12481 return true 12482 } 12483 return false 12484 } 12485 func rewriteValueARM_OpARMRSCshiftRLreg_0(v *Value) bool { 12486 b := v.Block 12487 // match: (RSCshiftRLreg (MOVWconst [c]) x y flags) 12488 // result: (SBCconst [c] (SRL <x.Type> x y) flags) 12489 for { 12490 flags := v.Args[3] 12491 v_0 := v.Args[0] 12492 if v_0.Op != OpARMMOVWconst { 12493 break 12494 } 12495 c := v_0.AuxInt 12496 x := v.Args[1] 12497 y := v.Args[2] 12498 v.reset(OpARMSBCconst) 12499 v.AuxInt = c 12500 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 12501 v0.AddArg(x) 12502 v0.AddArg(y) 12503 v.AddArg(v0) 12504 v.AddArg(flags) 12505 return true 12506 } 12507 // match: (RSCshiftRLreg x y (MOVWconst [c]) flags) 12508 // result: (RSCshiftRL x y [c] flags) 12509 for { 12510 flags := v.Args[3] 12511 x := v.Args[0] 12512 y := v.Args[1] 12513 v_2 := v.Args[2] 12514 if v_2.Op != OpARMMOVWconst { 12515 break 12516 } 12517 c := v_2.AuxInt 12518 v.reset(OpARMRSCshiftRL) 12519 v.AuxInt = c 12520 v.AddArg(x) 12521 v.AddArg(y) 12522 v.AddArg(flags) 12523 return true 12524 } 12525 return false 12526 } 12527 func rewriteValueARM_OpARMSBC_0(v *Value) bool { 12528 // match: (SBC (MOVWconst [c]) x flags) 12529 // result: (RSCconst [c] x flags) 12530 for { 12531 flags := v.Args[2] 12532 v_0 := v.Args[0] 12533 if v_0.Op != OpARMMOVWconst { 12534 break 12535 } 12536 c := v_0.AuxInt 12537 x := v.Args[1] 12538 v.reset(OpARMRSCconst) 12539 v.AuxInt = c 12540 v.AddArg(x) 12541 v.AddArg(flags) 12542 return true 12543 } 12544 // match: (SBC x (MOVWconst [c]) flags) 12545 // result: (SBCconst [c] x flags) 12546 for { 12547 flags := v.Args[2] 12548 x := v.Args[0] 12549 v_1 := v.Args[1] 12550 if v_1.Op != OpARMMOVWconst { 12551 break 12552 } 12553 c := v_1.AuxInt 12554 v.reset(OpARMSBCconst) 12555 v.AuxInt = c 12556 v.AddArg(x) 12557 v.AddArg(flags) 12558 return true 12559 } 12560 // match: (SBC x (SLLconst [c] y) flags) 12561 // result: (SBCshiftLL x y [c] flags) 12562 for { 12563 flags := v.Args[2] 12564 x := v.Args[0] 12565 v_1 := v.Args[1] 12566 if v_1.Op != OpARMSLLconst { 12567 break 12568 } 12569 c := v_1.AuxInt 12570 y := v_1.Args[0] 12571 v.reset(OpARMSBCshiftLL) 12572 v.AuxInt = c 12573 v.AddArg(x) 12574 v.AddArg(y) 12575 v.AddArg(flags) 12576 return true 12577 } 12578 // match: (SBC (SLLconst [c] y) x flags) 12579 // result: (RSCshiftLL x y [c] flags) 12580 for { 12581 flags := v.Args[2] 12582 v_0 := v.Args[0] 12583 if v_0.Op != OpARMSLLconst { 12584 break 12585 } 12586 c := v_0.AuxInt 12587 y := v_0.Args[0] 12588 x := v.Args[1] 12589 v.reset(OpARMRSCshiftLL) 12590 v.AuxInt = c 12591 v.AddArg(x) 12592 v.AddArg(y) 12593 v.AddArg(flags) 12594 return true 12595 } 12596 // match: (SBC x (SRLconst [c] y) flags) 12597 // result: (SBCshiftRL x y [c] flags) 12598 for { 12599 flags := v.Args[2] 12600 x := v.Args[0] 12601 v_1 := v.Args[1] 12602 if v_1.Op != OpARMSRLconst { 12603 break 12604 } 12605 c := v_1.AuxInt 12606 y := v_1.Args[0] 12607 v.reset(OpARMSBCshiftRL) 12608 v.AuxInt = c 12609 v.AddArg(x) 12610 v.AddArg(y) 12611 v.AddArg(flags) 12612 return true 12613 } 12614 // match: (SBC (SRLconst [c] y) x flags) 12615 // result: (RSCshiftRL x y [c] flags) 12616 for { 12617 flags := v.Args[2] 12618 v_0 := v.Args[0] 12619 if v_0.Op != OpARMSRLconst { 12620 break 12621 } 12622 c := v_0.AuxInt 12623 y := v_0.Args[0] 12624 x := v.Args[1] 12625 v.reset(OpARMRSCshiftRL) 12626 v.AuxInt = c 12627 v.AddArg(x) 12628 v.AddArg(y) 12629 v.AddArg(flags) 12630 return true 12631 } 12632 // match: (SBC x (SRAconst [c] y) flags) 12633 // result: (SBCshiftRA x y [c] flags) 12634 for { 12635 flags := v.Args[2] 12636 x := v.Args[0] 12637 v_1 := v.Args[1] 12638 if v_1.Op != OpARMSRAconst { 12639 break 12640 } 12641 c := v_1.AuxInt 12642 y := v_1.Args[0] 12643 v.reset(OpARMSBCshiftRA) 12644 v.AuxInt = c 12645 v.AddArg(x) 12646 v.AddArg(y) 12647 v.AddArg(flags) 12648 return true 12649 } 12650 // match: (SBC (SRAconst [c] y) x flags) 12651 // result: (RSCshiftRA x y [c] flags) 12652 for { 12653 flags := v.Args[2] 12654 v_0 := v.Args[0] 12655 if v_0.Op != OpARMSRAconst { 12656 break 12657 } 12658 c := v_0.AuxInt 12659 y := v_0.Args[0] 12660 x := v.Args[1] 12661 v.reset(OpARMRSCshiftRA) 12662 v.AuxInt = c 12663 v.AddArg(x) 12664 v.AddArg(y) 12665 v.AddArg(flags) 12666 return true 12667 } 12668 // match: (SBC x (SLL y z) flags) 12669 // result: (SBCshiftLLreg x y z flags) 12670 for { 12671 flags := v.Args[2] 12672 x := v.Args[0] 12673 v_1 := v.Args[1] 12674 if v_1.Op != OpARMSLL { 12675 break 12676 } 12677 z := v_1.Args[1] 12678 y := v_1.Args[0] 12679 v.reset(OpARMSBCshiftLLreg) 12680 v.AddArg(x) 12681 v.AddArg(y) 12682 v.AddArg(z) 12683 v.AddArg(flags) 12684 return true 12685 } 12686 // match: (SBC (SLL y z) x flags) 12687 // result: (RSCshiftLLreg x y z flags) 12688 for { 12689 flags := v.Args[2] 12690 v_0 := v.Args[0] 12691 if v_0.Op != OpARMSLL { 12692 break 12693 } 12694 z := v_0.Args[1] 12695 y := v_0.Args[0] 12696 x := v.Args[1] 12697 v.reset(OpARMRSCshiftLLreg) 12698 v.AddArg(x) 12699 v.AddArg(y) 12700 v.AddArg(z) 12701 v.AddArg(flags) 12702 return true 12703 } 12704 return false 12705 } 12706 func rewriteValueARM_OpARMSBC_10(v *Value) bool { 12707 // match: (SBC x (SRL y z) flags) 12708 // result: (SBCshiftRLreg x y z flags) 12709 for { 12710 flags := v.Args[2] 12711 x := v.Args[0] 12712 v_1 := v.Args[1] 12713 if v_1.Op != OpARMSRL { 12714 break 12715 } 12716 z := v_1.Args[1] 12717 y := v_1.Args[0] 12718 v.reset(OpARMSBCshiftRLreg) 12719 v.AddArg(x) 12720 v.AddArg(y) 12721 v.AddArg(z) 12722 v.AddArg(flags) 12723 return true 12724 } 12725 // match: (SBC (SRL y z) x flags) 12726 // result: (RSCshiftRLreg x y z flags) 12727 for { 12728 flags := v.Args[2] 12729 v_0 := v.Args[0] 12730 if v_0.Op != OpARMSRL { 12731 break 12732 } 12733 z := v_0.Args[1] 12734 y := v_0.Args[0] 12735 x := v.Args[1] 12736 v.reset(OpARMRSCshiftRLreg) 12737 v.AddArg(x) 12738 v.AddArg(y) 12739 v.AddArg(z) 12740 v.AddArg(flags) 12741 return true 12742 } 12743 // match: (SBC x (SRA y z) flags) 12744 // result: (SBCshiftRAreg x y z flags) 12745 for { 12746 flags := v.Args[2] 12747 x := v.Args[0] 12748 v_1 := v.Args[1] 12749 if v_1.Op != OpARMSRA { 12750 break 12751 } 12752 z := v_1.Args[1] 12753 y := v_1.Args[0] 12754 v.reset(OpARMSBCshiftRAreg) 12755 v.AddArg(x) 12756 v.AddArg(y) 12757 v.AddArg(z) 12758 v.AddArg(flags) 12759 return true 12760 } 12761 // match: (SBC (SRA y z) x flags) 12762 // result: (RSCshiftRAreg x y z flags) 12763 for { 12764 flags := v.Args[2] 12765 v_0 := v.Args[0] 12766 if v_0.Op != OpARMSRA { 12767 break 12768 } 12769 z := v_0.Args[1] 12770 y := v_0.Args[0] 12771 x := v.Args[1] 12772 v.reset(OpARMRSCshiftRAreg) 12773 v.AddArg(x) 12774 v.AddArg(y) 12775 v.AddArg(z) 12776 v.AddArg(flags) 12777 return true 12778 } 12779 return false 12780 } 12781 func rewriteValueARM_OpARMSBCconst_0(v *Value) bool { 12782 // match: (SBCconst [c] (ADDconst [d] x) flags) 12783 // result: (SBCconst [int64(int32(c-d))] x flags) 12784 for { 12785 c := v.AuxInt 12786 flags := v.Args[1] 12787 v_0 := v.Args[0] 12788 if v_0.Op != OpARMADDconst { 12789 break 12790 } 12791 d := v_0.AuxInt 12792 x := v_0.Args[0] 12793 v.reset(OpARMSBCconst) 12794 v.AuxInt = int64(int32(c - d)) 12795 v.AddArg(x) 12796 v.AddArg(flags) 12797 return true 12798 } 12799 // match: (SBCconst [c] (SUBconst [d] x) flags) 12800 // result: (SBCconst [int64(int32(c+d))] x flags) 12801 for { 12802 c := v.AuxInt 12803 flags := v.Args[1] 12804 v_0 := v.Args[0] 12805 if v_0.Op != OpARMSUBconst { 12806 break 12807 } 12808 d := v_0.AuxInt 12809 x := v_0.Args[0] 12810 v.reset(OpARMSBCconst) 12811 v.AuxInt = int64(int32(c + d)) 12812 v.AddArg(x) 12813 v.AddArg(flags) 12814 return true 12815 } 12816 return false 12817 } 12818 func rewriteValueARM_OpARMSBCshiftLL_0(v *Value) bool { 12819 b := v.Block 12820 // match: (SBCshiftLL (MOVWconst [c]) x [d] flags) 12821 // result: (RSCconst [c] (SLLconst <x.Type> x [d]) flags) 12822 for { 12823 d := v.AuxInt 12824 flags := v.Args[2] 12825 v_0 := v.Args[0] 12826 if v_0.Op != OpARMMOVWconst { 12827 break 12828 } 12829 c := v_0.AuxInt 12830 x := v.Args[1] 12831 v.reset(OpARMRSCconst) 12832 v.AuxInt = c 12833 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 12834 v0.AuxInt = d 12835 v0.AddArg(x) 12836 v.AddArg(v0) 12837 v.AddArg(flags) 12838 return true 12839 } 12840 // match: (SBCshiftLL x (MOVWconst [c]) [d] flags) 12841 // result: (SBCconst x [int64(int32(uint32(c)<<uint64(d)))] flags) 12842 for { 12843 d := v.AuxInt 12844 flags := v.Args[2] 12845 x := v.Args[0] 12846 v_1 := v.Args[1] 12847 if v_1.Op != OpARMMOVWconst { 12848 break 12849 } 12850 c := v_1.AuxInt 12851 v.reset(OpARMSBCconst) 12852 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 12853 v.AddArg(x) 12854 v.AddArg(flags) 12855 return true 12856 } 12857 return false 12858 } 12859 func rewriteValueARM_OpARMSBCshiftLLreg_0(v *Value) bool { 12860 b := v.Block 12861 // match: (SBCshiftLLreg (MOVWconst [c]) x y flags) 12862 // result: (RSCconst [c] (SLL <x.Type> x y) flags) 12863 for { 12864 flags := v.Args[3] 12865 v_0 := v.Args[0] 12866 if v_0.Op != OpARMMOVWconst { 12867 break 12868 } 12869 c := v_0.AuxInt 12870 x := v.Args[1] 12871 y := v.Args[2] 12872 v.reset(OpARMRSCconst) 12873 v.AuxInt = c 12874 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 12875 v0.AddArg(x) 12876 v0.AddArg(y) 12877 v.AddArg(v0) 12878 v.AddArg(flags) 12879 return true 12880 } 12881 // match: (SBCshiftLLreg x y (MOVWconst [c]) flags) 12882 // result: (SBCshiftLL x y [c] flags) 12883 for { 12884 flags := v.Args[3] 12885 x := v.Args[0] 12886 y := v.Args[1] 12887 v_2 := v.Args[2] 12888 if v_2.Op != OpARMMOVWconst { 12889 break 12890 } 12891 c := v_2.AuxInt 12892 v.reset(OpARMSBCshiftLL) 12893 v.AuxInt = c 12894 v.AddArg(x) 12895 v.AddArg(y) 12896 v.AddArg(flags) 12897 return true 12898 } 12899 return false 12900 } 12901 func rewriteValueARM_OpARMSBCshiftRA_0(v *Value) bool { 12902 b := v.Block 12903 // match: (SBCshiftRA (MOVWconst [c]) x [d] flags) 12904 // result: (RSCconst [c] (SRAconst <x.Type> x [d]) flags) 12905 for { 12906 d := v.AuxInt 12907 flags := v.Args[2] 12908 v_0 := v.Args[0] 12909 if v_0.Op != OpARMMOVWconst { 12910 break 12911 } 12912 c := v_0.AuxInt 12913 x := v.Args[1] 12914 v.reset(OpARMRSCconst) 12915 v.AuxInt = c 12916 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 12917 v0.AuxInt = d 12918 v0.AddArg(x) 12919 v.AddArg(v0) 12920 v.AddArg(flags) 12921 return true 12922 } 12923 // match: (SBCshiftRA x (MOVWconst [c]) [d] flags) 12924 // result: (SBCconst x [int64(int32(c)>>uint64(d))] flags) 12925 for { 12926 d := v.AuxInt 12927 flags := v.Args[2] 12928 x := v.Args[0] 12929 v_1 := v.Args[1] 12930 if v_1.Op != OpARMMOVWconst { 12931 break 12932 } 12933 c := v_1.AuxInt 12934 v.reset(OpARMSBCconst) 12935 v.AuxInt = int64(int32(c) >> uint64(d)) 12936 v.AddArg(x) 12937 v.AddArg(flags) 12938 return true 12939 } 12940 return false 12941 } 12942 func rewriteValueARM_OpARMSBCshiftRAreg_0(v *Value) bool { 12943 b := v.Block 12944 // match: (SBCshiftRAreg (MOVWconst [c]) x y flags) 12945 // result: (RSCconst [c] (SRA <x.Type> x y) flags) 12946 for { 12947 flags := v.Args[3] 12948 v_0 := v.Args[0] 12949 if v_0.Op != OpARMMOVWconst { 12950 break 12951 } 12952 c := v_0.AuxInt 12953 x := v.Args[1] 12954 y := v.Args[2] 12955 v.reset(OpARMRSCconst) 12956 v.AuxInt = c 12957 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 12958 v0.AddArg(x) 12959 v0.AddArg(y) 12960 v.AddArg(v0) 12961 v.AddArg(flags) 12962 return true 12963 } 12964 // match: (SBCshiftRAreg x y (MOVWconst [c]) flags) 12965 // result: (SBCshiftRA x y [c] flags) 12966 for { 12967 flags := v.Args[3] 12968 x := v.Args[0] 12969 y := v.Args[1] 12970 v_2 := v.Args[2] 12971 if v_2.Op != OpARMMOVWconst { 12972 break 12973 } 12974 c := v_2.AuxInt 12975 v.reset(OpARMSBCshiftRA) 12976 v.AuxInt = c 12977 v.AddArg(x) 12978 v.AddArg(y) 12979 v.AddArg(flags) 12980 return true 12981 } 12982 return false 12983 } 12984 func rewriteValueARM_OpARMSBCshiftRL_0(v *Value) bool { 12985 b := v.Block 12986 // match: (SBCshiftRL (MOVWconst [c]) x [d] flags) 12987 // result: (RSCconst [c] (SRLconst <x.Type> x [d]) flags) 12988 for { 12989 d := v.AuxInt 12990 flags := v.Args[2] 12991 v_0 := v.Args[0] 12992 if v_0.Op != OpARMMOVWconst { 12993 break 12994 } 12995 c := v_0.AuxInt 12996 x := v.Args[1] 12997 v.reset(OpARMRSCconst) 12998 v.AuxInt = c 12999 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 13000 v0.AuxInt = d 13001 v0.AddArg(x) 13002 v.AddArg(v0) 13003 v.AddArg(flags) 13004 return true 13005 } 13006 // match: (SBCshiftRL x (MOVWconst [c]) [d] flags) 13007 // result: (SBCconst x [int64(int32(uint32(c)>>uint64(d)))] flags) 13008 for { 13009 d := v.AuxInt 13010 flags := v.Args[2] 13011 x := v.Args[0] 13012 v_1 := v.Args[1] 13013 if v_1.Op != OpARMMOVWconst { 13014 break 13015 } 13016 c := v_1.AuxInt 13017 v.reset(OpARMSBCconst) 13018 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 13019 v.AddArg(x) 13020 v.AddArg(flags) 13021 return true 13022 } 13023 return false 13024 } 13025 func rewriteValueARM_OpARMSBCshiftRLreg_0(v *Value) bool { 13026 b := v.Block 13027 // match: (SBCshiftRLreg (MOVWconst [c]) x y flags) 13028 // result: (RSCconst [c] (SRL <x.Type> x y) flags) 13029 for { 13030 flags := v.Args[3] 13031 v_0 := v.Args[0] 13032 if v_0.Op != OpARMMOVWconst { 13033 break 13034 } 13035 c := v_0.AuxInt 13036 x := v.Args[1] 13037 y := v.Args[2] 13038 v.reset(OpARMRSCconst) 13039 v.AuxInt = c 13040 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 13041 v0.AddArg(x) 13042 v0.AddArg(y) 13043 v.AddArg(v0) 13044 v.AddArg(flags) 13045 return true 13046 } 13047 // match: (SBCshiftRLreg x y (MOVWconst [c]) flags) 13048 // result: (SBCshiftRL x y [c] flags) 13049 for { 13050 flags := v.Args[3] 13051 x := v.Args[0] 13052 y := v.Args[1] 13053 v_2 := v.Args[2] 13054 if v_2.Op != OpARMMOVWconst { 13055 break 13056 } 13057 c := v_2.AuxInt 13058 v.reset(OpARMSBCshiftRL) 13059 v.AuxInt = c 13060 v.AddArg(x) 13061 v.AddArg(y) 13062 v.AddArg(flags) 13063 return true 13064 } 13065 return false 13066 } 13067 func rewriteValueARM_OpARMSLL_0(v *Value) bool { 13068 // match: (SLL x (MOVWconst [c])) 13069 // result: (SLLconst x [c&31]) 13070 for { 13071 _ = v.Args[1] 13072 x := v.Args[0] 13073 v_1 := v.Args[1] 13074 if v_1.Op != OpARMMOVWconst { 13075 break 13076 } 13077 c := v_1.AuxInt 13078 v.reset(OpARMSLLconst) 13079 v.AuxInt = c & 31 13080 v.AddArg(x) 13081 return true 13082 } 13083 return false 13084 } 13085 func rewriteValueARM_OpARMSLLconst_0(v *Value) bool { 13086 // match: (SLLconst [c] (MOVWconst [d])) 13087 // result: (MOVWconst [int64(int32(uint32(d)<<uint64(c)))]) 13088 for { 13089 c := v.AuxInt 13090 v_0 := v.Args[0] 13091 if v_0.Op != OpARMMOVWconst { 13092 break 13093 } 13094 d := v_0.AuxInt 13095 v.reset(OpARMMOVWconst) 13096 v.AuxInt = int64(int32(uint32(d) << uint64(c))) 13097 return true 13098 } 13099 return false 13100 } 13101 func rewriteValueARM_OpARMSRA_0(v *Value) bool { 13102 // match: (SRA x (MOVWconst [c])) 13103 // result: (SRAconst x [c&31]) 13104 for { 13105 _ = v.Args[1] 13106 x := v.Args[0] 13107 v_1 := v.Args[1] 13108 if v_1.Op != OpARMMOVWconst { 13109 break 13110 } 13111 c := v_1.AuxInt 13112 v.reset(OpARMSRAconst) 13113 v.AuxInt = c & 31 13114 v.AddArg(x) 13115 return true 13116 } 13117 return false 13118 } 13119 func rewriteValueARM_OpARMSRAcond_0(v *Value) bool { 13120 // match: (SRAcond x _ (FlagEQ)) 13121 // result: (SRAconst x [31]) 13122 for { 13123 _ = v.Args[2] 13124 x := v.Args[0] 13125 v_2 := v.Args[2] 13126 if v_2.Op != OpARMFlagEQ { 13127 break 13128 } 13129 v.reset(OpARMSRAconst) 13130 v.AuxInt = 31 13131 v.AddArg(x) 13132 return true 13133 } 13134 // match: (SRAcond x y (FlagLT_ULT)) 13135 // result: (SRA x y) 13136 for { 13137 _ = v.Args[2] 13138 x := v.Args[0] 13139 y := v.Args[1] 13140 v_2 := v.Args[2] 13141 if v_2.Op != OpARMFlagLT_ULT { 13142 break 13143 } 13144 v.reset(OpARMSRA) 13145 v.AddArg(x) 13146 v.AddArg(y) 13147 return true 13148 } 13149 // match: (SRAcond x _ (FlagLT_UGT)) 13150 // result: (SRAconst x [31]) 13151 for { 13152 _ = v.Args[2] 13153 x := v.Args[0] 13154 v_2 := v.Args[2] 13155 if v_2.Op != OpARMFlagLT_UGT { 13156 break 13157 } 13158 v.reset(OpARMSRAconst) 13159 v.AuxInt = 31 13160 v.AddArg(x) 13161 return true 13162 } 13163 // match: (SRAcond x y (FlagGT_ULT)) 13164 // result: (SRA x y) 13165 for { 13166 _ = v.Args[2] 13167 x := v.Args[0] 13168 y := v.Args[1] 13169 v_2 := v.Args[2] 13170 if v_2.Op != OpARMFlagGT_ULT { 13171 break 13172 } 13173 v.reset(OpARMSRA) 13174 v.AddArg(x) 13175 v.AddArg(y) 13176 return true 13177 } 13178 // match: (SRAcond x _ (FlagGT_UGT)) 13179 // result: (SRAconst x [31]) 13180 for { 13181 _ = v.Args[2] 13182 x := v.Args[0] 13183 v_2 := v.Args[2] 13184 if v_2.Op != OpARMFlagGT_UGT { 13185 break 13186 } 13187 v.reset(OpARMSRAconst) 13188 v.AuxInt = 31 13189 v.AddArg(x) 13190 return true 13191 } 13192 return false 13193 } 13194 func rewriteValueARM_OpARMSRAconst_0(v *Value) bool { 13195 // match: (SRAconst [c] (MOVWconst [d])) 13196 // result: (MOVWconst [int64(int32(d)>>uint64(c))]) 13197 for { 13198 c := v.AuxInt 13199 v_0 := v.Args[0] 13200 if v_0.Op != OpARMMOVWconst { 13201 break 13202 } 13203 d := v_0.AuxInt 13204 v.reset(OpARMMOVWconst) 13205 v.AuxInt = int64(int32(d) >> uint64(c)) 13206 return true 13207 } 13208 // match: (SRAconst (SLLconst x [c]) [d]) 13209 // cond: objabi.GOARM==7 && uint64(d)>=uint64(c) && uint64(d)<=31 13210 // result: (BFX [(d-c)|(32-d)<<8] x) 13211 for { 13212 d := v.AuxInt 13213 v_0 := v.Args[0] 13214 if v_0.Op != OpARMSLLconst { 13215 break 13216 } 13217 c := v_0.AuxInt 13218 x := v_0.Args[0] 13219 if !(objabi.GOARM == 7 && uint64(d) >= uint64(c) && uint64(d) <= 31) { 13220 break 13221 } 13222 v.reset(OpARMBFX) 13223 v.AuxInt = (d - c) | (32-d)<<8 13224 v.AddArg(x) 13225 return true 13226 } 13227 return false 13228 } 13229 func rewriteValueARM_OpARMSRL_0(v *Value) bool { 13230 // match: (SRL x (MOVWconst [c])) 13231 // result: (SRLconst x [c&31]) 13232 for { 13233 _ = v.Args[1] 13234 x := v.Args[0] 13235 v_1 := v.Args[1] 13236 if v_1.Op != OpARMMOVWconst { 13237 break 13238 } 13239 c := v_1.AuxInt 13240 v.reset(OpARMSRLconst) 13241 v.AuxInt = c & 31 13242 v.AddArg(x) 13243 return true 13244 } 13245 return false 13246 } 13247 func rewriteValueARM_OpARMSRLconst_0(v *Value) bool { 13248 // match: (SRLconst [c] (MOVWconst [d])) 13249 // result: (MOVWconst [int64(int32(uint32(d)>>uint64(c)))]) 13250 for { 13251 c := v.AuxInt 13252 v_0 := v.Args[0] 13253 if v_0.Op != OpARMMOVWconst { 13254 break 13255 } 13256 d := v_0.AuxInt 13257 v.reset(OpARMMOVWconst) 13258 v.AuxInt = int64(int32(uint32(d) >> uint64(c))) 13259 return true 13260 } 13261 // match: (SRLconst (SLLconst x [c]) [d]) 13262 // cond: objabi.GOARM==7 && uint64(d)>=uint64(c) && uint64(d)<=31 13263 // result: (BFXU [(d-c)|(32-d)<<8] x) 13264 for { 13265 d := v.AuxInt 13266 v_0 := v.Args[0] 13267 if v_0.Op != OpARMSLLconst { 13268 break 13269 } 13270 c := v_0.AuxInt 13271 x := v_0.Args[0] 13272 if !(objabi.GOARM == 7 && uint64(d) >= uint64(c) && uint64(d) <= 31) { 13273 break 13274 } 13275 v.reset(OpARMBFXU) 13276 v.AuxInt = (d - c) | (32-d)<<8 13277 v.AddArg(x) 13278 return true 13279 } 13280 return false 13281 } 13282 func rewriteValueARM_OpARMSUB_0(v *Value) bool { 13283 // match: (SUB (MOVWconst [c]) x) 13284 // result: (RSBconst [c] x) 13285 for { 13286 x := v.Args[1] 13287 v_0 := v.Args[0] 13288 if v_0.Op != OpARMMOVWconst { 13289 break 13290 } 13291 c := v_0.AuxInt 13292 v.reset(OpARMRSBconst) 13293 v.AuxInt = c 13294 v.AddArg(x) 13295 return true 13296 } 13297 // match: (SUB x (MOVWconst [c])) 13298 // result: (SUBconst [c] x) 13299 for { 13300 _ = v.Args[1] 13301 x := v.Args[0] 13302 v_1 := v.Args[1] 13303 if v_1.Op != OpARMMOVWconst { 13304 break 13305 } 13306 c := v_1.AuxInt 13307 v.reset(OpARMSUBconst) 13308 v.AuxInt = c 13309 v.AddArg(x) 13310 return true 13311 } 13312 // match: (SUB x (SLLconst [c] y)) 13313 // result: (SUBshiftLL x y [c]) 13314 for { 13315 _ = v.Args[1] 13316 x := v.Args[0] 13317 v_1 := v.Args[1] 13318 if v_1.Op != OpARMSLLconst { 13319 break 13320 } 13321 c := v_1.AuxInt 13322 y := v_1.Args[0] 13323 v.reset(OpARMSUBshiftLL) 13324 v.AuxInt = c 13325 v.AddArg(x) 13326 v.AddArg(y) 13327 return true 13328 } 13329 // match: (SUB (SLLconst [c] y) x) 13330 // result: (RSBshiftLL x y [c]) 13331 for { 13332 x := v.Args[1] 13333 v_0 := v.Args[0] 13334 if v_0.Op != OpARMSLLconst { 13335 break 13336 } 13337 c := v_0.AuxInt 13338 y := v_0.Args[0] 13339 v.reset(OpARMRSBshiftLL) 13340 v.AuxInt = c 13341 v.AddArg(x) 13342 v.AddArg(y) 13343 return true 13344 } 13345 // match: (SUB x (SRLconst [c] y)) 13346 // result: (SUBshiftRL x y [c]) 13347 for { 13348 _ = v.Args[1] 13349 x := v.Args[0] 13350 v_1 := v.Args[1] 13351 if v_1.Op != OpARMSRLconst { 13352 break 13353 } 13354 c := v_1.AuxInt 13355 y := v_1.Args[0] 13356 v.reset(OpARMSUBshiftRL) 13357 v.AuxInt = c 13358 v.AddArg(x) 13359 v.AddArg(y) 13360 return true 13361 } 13362 // match: (SUB (SRLconst [c] y) x) 13363 // result: (RSBshiftRL x y [c]) 13364 for { 13365 x := v.Args[1] 13366 v_0 := v.Args[0] 13367 if v_0.Op != OpARMSRLconst { 13368 break 13369 } 13370 c := v_0.AuxInt 13371 y := v_0.Args[0] 13372 v.reset(OpARMRSBshiftRL) 13373 v.AuxInt = c 13374 v.AddArg(x) 13375 v.AddArg(y) 13376 return true 13377 } 13378 // match: (SUB x (SRAconst [c] y)) 13379 // result: (SUBshiftRA x y [c]) 13380 for { 13381 _ = v.Args[1] 13382 x := v.Args[0] 13383 v_1 := v.Args[1] 13384 if v_1.Op != OpARMSRAconst { 13385 break 13386 } 13387 c := v_1.AuxInt 13388 y := v_1.Args[0] 13389 v.reset(OpARMSUBshiftRA) 13390 v.AuxInt = c 13391 v.AddArg(x) 13392 v.AddArg(y) 13393 return true 13394 } 13395 // match: (SUB (SRAconst [c] y) x) 13396 // result: (RSBshiftRA x y [c]) 13397 for { 13398 x := v.Args[1] 13399 v_0 := v.Args[0] 13400 if v_0.Op != OpARMSRAconst { 13401 break 13402 } 13403 c := v_0.AuxInt 13404 y := v_0.Args[0] 13405 v.reset(OpARMRSBshiftRA) 13406 v.AuxInt = c 13407 v.AddArg(x) 13408 v.AddArg(y) 13409 return true 13410 } 13411 // match: (SUB x (SLL y z)) 13412 // result: (SUBshiftLLreg x y z) 13413 for { 13414 _ = v.Args[1] 13415 x := v.Args[0] 13416 v_1 := v.Args[1] 13417 if v_1.Op != OpARMSLL { 13418 break 13419 } 13420 z := v_1.Args[1] 13421 y := v_1.Args[0] 13422 v.reset(OpARMSUBshiftLLreg) 13423 v.AddArg(x) 13424 v.AddArg(y) 13425 v.AddArg(z) 13426 return true 13427 } 13428 // match: (SUB (SLL y z) x) 13429 // result: (RSBshiftLLreg x y z) 13430 for { 13431 x := v.Args[1] 13432 v_0 := v.Args[0] 13433 if v_0.Op != OpARMSLL { 13434 break 13435 } 13436 z := v_0.Args[1] 13437 y := v_0.Args[0] 13438 v.reset(OpARMRSBshiftLLreg) 13439 v.AddArg(x) 13440 v.AddArg(y) 13441 v.AddArg(z) 13442 return true 13443 } 13444 return false 13445 } 13446 func rewriteValueARM_OpARMSUB_10(v *Value) bool { 13447 // match: (SUB x (SRL y z)) 13448 // result: (SUBshiftRLreg x y z) 13449 for { 13450 _ = v.Args[1] 13451 x := v.Args[0] 13452 v_1 := v.Args[1] 13453 if v_1.Op != OpARMSRL { 13454 break 13455 } 13456 z := v_1.Args[1] 13457 y := v_1.Args[0] 13458 v.reset(OpARMSUBshiftRLreg) 13459 v.AddArg(x) 13460 v.AddArg(y) 13461 v.AddArg(z) 13462 return true 13463 } 13464 // match: (SUB (SRL y z) x) 13465 // result: (RSBshiftRLreg x y z) 13466 for { 13467 x := v.Args[1] 13468 v_0 := v.Args[0] 13469 if v_0.Op != OpARMSRL { 13470 break 13471 } 13472 z := v_0.Args[1] 13473 y := v_0.Args[0] 13474 v.reset(OpARMRSBshiftRLreg) 13475 v.AddArg(x) 13476 v.AddArg(y) 13477 v.AddArg(z) 13478 return true 13479 } 13480 // match: (SUB x (SRA y z)) 13481 // result: (SUBshiftRAreg x y z) 13482 for { 13483 _ = v.Args[1] 13484 x := v.Args[0] 13485 v_1 := v.Args[1] 13486 if v_1.Op != OpARMSRA { 13487 break 13488 } 13489 z := v_1.Args[1] 13490 y := v_1.Args[0] 13491 v.reset(OpARMSUBshiftRAreg) 13492 v.AddArg(x) 13493 v.AddArg(y) 13494 v.AddArg(z) 13495 return true 13496 } 13497 // match: (SUB (SRA y z) x) 13498 // result: (RSBshiftRAreg x y z) 13499 for { 13500 x := v.Args[1] 13501 v_0 := v.Args[0] 13502 if v_0.Op != OpARMSRA { 13503 break 13504 } 13505 z := v_0.Args[1] 13506 y := v_0.Args[0] 13507 v.reset(OpARMRSBshiftRAreg) 13508 v.AddArg(x) 13509 v.AddArg(y) 13510 v.AddArg(z) 13511 return true 13512 } 13513 // match: (SUB x x) 13514 // result: (MOVWconst [0]) 13515 for { 13516 x := v.Args[1] 13517 if x != v.Args[0] { 13518 break 13519 } 13520 v.reset(OpARMMOVWconst) 13521 v.AuxInt = 0 13522 return true 13523 } 13524 // match: (SUB a (MUL x y)) 13525 // cond: objabi.GOARM == 7 13526 // result: (MULS x y a) 13527 for { 13528 _ = v.Args[1] 13529 a := v.Args[0] 13530 v_1 := v.Args[1] 13531 if v_1.Op != OpARMMUL { 13532 break 13533 } 13534 y := v_1.Args[1] 13535 x := v_1.Args[0] 13536 if !(objabi.GOARM == 7) { 13537 break 13538 } 13539 v.reset(OpARMMULS) 13540 v.AddArg(x) 13541 v.AddArg(y) 13542 v.AddArg(a) 13543 return true 13544 } 13545 return false 13546 } 13547 func rewriteValueARM_OpARMSUBD_0(v *Value) bool { 13548 // match: (SUBD a (MULD x y)) 13549 // cond: a.Uses == 1 && objabi.GOARM >= 6 13550 // result: (MULSD a x y) 13551 for { 13552 _ = v.Args[1] 13553 a := v.Args[0] 13554 v_1 := v.Args[1] 13555 if v_1.Op != OpARMMULD { 13556 break 13557 } 13558 y := v_1.Args[1] 13559 x := v_1.Args[0] 13560 if !(a.Uses == 1 && objabi.GOARM >= 6) { 13561 break 13562 } 13563 v.reset(OpARMMULSD) 13564 v.AddArg(a) 13565 v.AddArg(x) 13566 v.AddArg(y) 13567 return true 13568 } 13569 // match: (SUBD a (NMULD x y)) 13570 // cond: a.Uses == 1 && objabi.GOARM >= 6 13571 // result: (MULAD a x y) 13572 for { 13573 _ = v.Args[1] 13574 a := v.Args[0] 13575 v_1 := v.Args[1] 13576 if v_1.Op != OpARMNMULD { 13577 break 13578 } 13579 y := v_1.Args[1] 13580 x := v_1.Args[0] 13581 if !(a.Uses == 1 && objabi.GOARM >= 6) { 13582 break 13583 } 13584 v.reset(OpARMMULAD) 13585 v.AddArg(a) 13586 v.AddArg(x) 13587 v.AddArg(y) 13588 return true 13589 } 13590 return false 13591 } 13592 func rewriteValueARM_OpARMSUBF_0(v *Value) bool { 13593 // match: (SUBF a (MULF x y)) 13594 // cond: a.Uses == 1 && objabi.GOARM >= 6 13595 // result: (MULSF a x y) 13596 for { 13597 _ = v.Args[1] 13598 a := v.Args[0] 13599 v_1 := v.Args[1] 13600 if v_1.Op != OpARMMULF { 13601 break 13602 } 13603 y := v_1.Args[1] 13604 x := v_1.Args[0] 13605 if !(a.Uses == 1 && objabi.GOARM >= 6) { 13606 break 13607 } 13608 v.reset(OpARMMULSF) 13609 v.AddArg(a) 13610 v.AddArg(x) 13611 v.AddArg(y) 13612 return true 13613 } 13614 // match: (SUBF a (NMULF x y)) 13615 // cond: a.Uses == 1 && objabi.GOARM >= 6 13616 // result: (MULAF a x y) 13617 for { 13618 _ = v.Args[1] 13619 a := v.Args[0] 13620 v_1 := v.Args[1] 13621 if v_1.Op != OpARMNMULF { 13622 break 13623 } 13624 y := v_1.Args[1] 13625 x := v_1.Args[0] 13626 if !(a.Uses == 1 && objabi.GOARM >= 6) { 13627 break 13628 } 13629 v.reset(OpARMMULAF) 13630 v.AddArg(a) 13631 v.AddArg(x) 13632 v.AddArg(y) 13633 return true 13634 } 13635 return false 13636 } 13637 func rewriteValueARM_OpARMSUBS_0(v *Value) bool { 13638 // match: (SUBS x (MOVWconst [c])) 13639 // result: (SUBSconst [c] x) 13640 for { 13641 _ = v.Args[1] 13642 x := v.Args[0] 13643 v_1 := v.Args[1] 13644 if v_1.Op != OpARMMOVWconst { 13645 break 13646 } 13647 c := v_1.AuxInt 13648 v.reset(OpARMSUBSconst) 13649 v.AuxInt = c 13650 v.AddArg(x) 13651 return true 13652 } 13653 // match: (SUBS x (SLLconst [c] y)) 13654 // result: (SUBSshiftLL x y [c]) 13655 for { 13656 _ = v.Args[1] 13657 x := v.Args[0] 13658 v_1 := v.Args[1] 13659 if v_1.Op != OpARMSLLconst { 13660 break 13661 } 13662 c := v_1.AuxInt 13663 y := v_1.Args[0] 13664 v.reset(OpARMSUBSshiftLL) 13665 v.AuxInt = c 13666 v.AddArg(x) 13667 v.AddArg(y) 13668 return true 13669 } 13670 // match: (SUBS (SLLconst [c] y) x) 13671 // result: (RSBSshiftLL x y [c]) 13672 for { 13673 x := v.Args[1] 13674 v_0 := v.Args[0] 13675 if v_0.Op != OpARMSLLconst { 13676 break 13677 } 13678 c := v_0.AuxInt 13679 y := v_0.Args[0] 13680 v.reset(OpARMRSBSshiftLL) 13681 v.AuxInt = c 13682 v.AddArg(x) 13683 v.AddArg(y) 13684 return true 13685 } 13686 // match: (SUBS x (SRLconst [c] y)) 13687 // result: (SUBSshiftRL x y [c]) 13688 for { 13689 _ = v.Args[1] 13690 x := v.Args[0] 13691 v_1 := v.Args[1] 13692 if v_1.Op != OpARMSRLconst { 13693 break 13694 } 13695 c := v_1.AuxInt 13696 y := v_1.Args[0] 13697 v.reset(OpARMSUBSshiftRL) 13698 v.AuxInt = c 13699 v.AddArg(x) 13700 v.AddArg(y) 13701 return true 13702 } 13703 // match: (SUBS (SRLconst [c] y) x) 13704 // result: (RSBSshiftRL x y [c]) 13705 for { 13706 x := v.Args[1] 13707 v_0 := v.Args[0] 13708 if v_0.Op != OpARMSRLconst { 13709 break 13710 } 13711 c := v_0.AuxInt 13712 y := v_0.Args[0] 13713 v.reset(OpARMRSBSshiftRL) 13714 v.AuxInt = c 13715 v.AddArg(x) 13716 v.AddArg(y) 13717 return true 13718 } 13719 // match: (SUBS x (SRAconst [c] y)) 13720 // result: (SUBSshiftRA x y [c]) 13721 for { 13722 _ = v.Args[1] 13723 x := v.Args[0] 13724 v_1 := v.Args[1] 13725 if v_1.Op != OpARMSRAconst { 13726 break 13727 } 13728 c := v_1.AuxInt 13729 y := v_1.Args[0] 13730 v.reset(OpARMSUBSshiftRA) 13731 v.AuxInt = c 13732 v.AddArg(x) 13733 v.AddArg(y) 13734 return true 13735 } 13736 // match: (SUBS (SRAconst [c] y) x) 13737 // result: (RSBSshiftRA x y [c]) 13738 for { 13739 x := v.Args[1] 13740 v_0 := v.Args[0] 13741 if v_0.Op != OpARMSRAconst { 13742 break 13743 } 13744 c := v_0.AuxInt 13745 y := v_0.Args[0] 13746 v.reset(OpARMRSBSshiftRA) 13747 v.AuxInt = c 13748 v.AddArg(x) 13749 v.AddArg(y) 13750 return true 13751 } 13752 // match: (SUBS x (SLL y z)) 13753 // result: (SUBSshiftLLreg x y z) 13754 for { 13755 _ = v.Args[1] 13756 x := v.Args[0] 13757 v_1 := v.Args[1] 13758 if v_1.Op != OpARMSLL { 13759 break 13760 } 13761 z := v_1.Args[1] 13762 y := v_1.Args[0] 13763 v.reset(OpARMSUBSshiftLLreg) 13764 v.AddArg(x) 13765 v.AddArg(y) 13766 v.AddArg(z) 13767 return true 13768 } 13769 // match: (SUBS (SLL y z) x) 13770 // result: (RSBSshiftLLreg x y z) 13771 for { 13772 x := v.Args[1] 13773 v_0 := v.Args[0] 13774 if v_0.Op != OpARMSLL { 13775 break 13776 } 13777 z := v_0.Args[1] 13778 y := v_0.Args[0] 13779 v.reset(OpARMRSBSshiftLLreg) 13780 v.AddArg(x) 13781 v.AddArg(y) 13782 v.AddArg(z) 13783 return true 13784 } 13785 // match: (SUBS x (SRL y z)) 13786 // result: (SUBSshiftRLreg x y z) 13787 for { 13788 _ = v.Args[1] 13789 x := v.Args[0] 13790 v_1 := v.Args[1] 13791 if v_1.Op != OpARMSRL { 13792 break 13793 } 13794 z := v_1.Args[1] 13795 y := v_1.Args[0] 13796 v.reset(OpARMSUBSshiftRLreg) 13797 v.AddArg(x) 13798 v.AddArg(y) 13799 v.AddArg(z) 13800 return true 13801 } 13802 return false 13803 } 13804 func rewriteValueARM_OpARMSUBS_10(v *Value) bool { 13805 // match: (SUBS (SRL y z) x) 13806 // result: (RSBSshiftRLreg x y z) 13807 for { 13808 x := v.Args[1] 13809 v_0 := v.Args[0] 13810 if v_0.Op != OpARMSRL { 13811 break 13812 } 13813 z := v_0.Args[1] 13814 y := v_0.Args[0] 13815 v.reset(OpARMRSBSshiftRLreg) 13816 v.AddArg(x) 13817 v.AddArg(y) 13818 v.AddArg(z) 13819 return true 13820 } 13821 // match: (SUBS x (SRA y z)) 13822 // result: (SUBSshiftRAreg x y z) 13823 for { 13824 _ = v.Args[1] 13825 x := v.Args[0] 13826 v_1 := v.Args[1] 13827 if v_1.Op != OpARMSRA { 13828 break 13829 } 13830 z := v_1.Args[1] 13831 y := v_1.Args[0] 13832 v.reset(OpARMSUBSshiftRAreg) 13833 v.AddArg(x) 13834 v.AddArg(y) 13835 v.AddArg(z) 13836 return true 13837 } 13838 // match: (SUBS (SRA y z) x) 13839 // result: (RSBSshiftRAreg x y z) 13840 for { 13841 x := v.Args[1] 13842 v_0 := v.Args[0] 13843 if v_0.Op != OpARMSRA { 13844 break 13845 } 13846 z := v_0.Args[1] 13847 y := v_0.Args[0] 13848 v.reset(OpARMRSBSshiftRAreg) 13849 v.AddArg(x) 13850 v.AddArg(y) 13851 v.AddArg(z) 13852 return true 13853 } 13854 return false 13855 } 13856 func rewriteValueARM_OpARMSUBSshiftLL_0(v *Value) bool { 13857 b := v.Block 13858 // match: (SUBSshiftLL (MOVWconst [c]) x [d]) 13859 // result: (RSBSconst [c] (SLLconst <x.Type> x [d])) 13860 for { 13861 d := v.AuxInt 13862 x := v.Args[1] 13863 v_0 := v.Args[0] 13864 if v_0.Op != OpARMMOVWconst { 13865 break 13866 } 13867 c := v_0.AuxInt 13868 v.reset(OpARMRSBSconst) 13869 v.AuxInt = c 13870 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 13871 v0.AuxInt = d 13872 v0.AddArg(x) 13873 v.AddArg(v0) 13874 return true 13875 } 13876 // match: (SUBSshiftLL x (MOVWconst [c]) [d]) 13877 // result: (SUBSconst x [int64(int32(uint32(c)<<uint64(d)))]) 13878 for { 13879 d := v.AuxInt 13880 _ = v.Args[1] 13881 x := v.Args[0] 13882 v_1 := v.Args[1] 13883 if v_1.Op != OpARMMOVWconst { 13884 break 13885 } 13886 c := v_1.AuxInt 13887 v.reset(OpARMSUBSconst) 13888 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 13889 v.AddArg(x) 13890 return true 13891 } 13892 return false 13893 } 13894 func rewriteValueARM_OpARMSUBSshiftLLreg_0(v *Value) bool { 13895 b := v.Block 13896 // match: (SUBSshiftLLreg (MOVWconst [c]) x y) 13897 // result: (RSBSconst [c] (SLL <x.Type> x y)) 13898 for { 13899 y := v.Args[2] 13900 v_0 := v.Args[0] 13901 if v_0.Op != OpARMMOVWconst { 13902 break 13903 } 13904 c := v_0.AuxInt 13905 x := v.Args[1] 13906 v.reset(OpARMRSBSconst) 13907 v.AuxInt = c 13908 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 13909 v0.AddArg(x) 13910 v0.AddArg(y) 13911 v.AddArg(v0) 13912 return true 13913 } 13914 // match: (SUBSshiftLLreg x y (MOVWconst [c])) 13915 // result: (SUBSshiftLL x y [c]) 13916 for { 13917 _ = v.Args[2] 13918 x := v.Args[0] 13919 y := v.Args[1] 13920 v_2 := v.Args[2] 13921 if v_2.Op != OpARMMOVWconst { 13922 break 13923 } 13924 c := v_2.AuxInt 13925 v.reset(OpARMSUBSshiftLL) 13926 v.AuxInt = c 13927 v.AddArg(x) 13928 v.AddArg(y) 13929 return true 13930 } 13931 return false 13932 } 13933 func rewriteValueARM_OpARMSUBSshiftRA_0(v *Value) bool { 13934 b := v.Block 13935 // match: (SUBSshiftRA (MOVWconst [c]) x [d]) 13936 // result: (RSBSconst [c] (SRAconst <x.Type> x [d])) 13937 for { 13938 d := v.AuxInt 13939 x := v.Args[1] 13940 v_0 := v.Args[0] 13941 if v_0.Op != OpARMMOVWconst { 13942 break 13943 } 13944 c := v_0.AuxInt 13945 v.reset(OpARMRSBSconst) 13946 v.AuxInt = c 13947 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 13948 v0.AuxInt = d 13949 v0.AddArg(x) 13950 v.AddArg(v0) 13951 return true 13952 } 13953 // match: (SUBSshiftRA x (MOVWconst [c]) [d]) 13954 // result: (SUBSconst x [int64(int32(c)>>uint64(d))]) 13955 for { 13956 d := v.AuxInt 13957 _ = v.Args[1] 13958 x := v.Args[0] 13959 v_1 := v.Args[1] 13960 if v_1.Op != OpARMMOVWconst { 13961 break 13962 } 13963 c := v_1.AuxInt 13964 v.reset(OpARMSUBSconst) 13965 v.AuxInt = int64(int32(c) >> uint64(d)) 13966 v.AddArg(x) 13967 return true 13968 } 13969 return false 13970 } 13971 func rewriteValueARM_OpARMSUBSshiftRAreg_0(v *Value) bool { 13972 b := v.Block 13973 // match: (SUBSshiftRAreg (MOVWconst [c]) x y) 13974 // result: (RSBSconst [c] (SRA <x.Type> x y)) 13975 for { 13976 y := v.Args[2] 13977 v_0 := v.Args[0] 13978 if v_0.Op != OpARMMOVWconst { 13979 break 13980 } 13981 c := v_0.AuxInt 13982 x := v.Args[1] 13983 v.reset(OpARMRSBSconst) 13984 v.AuxInt = c 13985 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 13986 v0.AddArg(x) 13987 v0.AddArg(y) 13988 v.AddArg(v0) 13989 return true 13990 } 13991 // match: (SUBSshiftRAreg x y (MOVWconst [c])) 13992 // result: (SUBSshiftRA x y [c]) 13993 for { 13994 _ = v.Args[2] 13995 x := v.Args[0] 13996 y := v.Args[1] 13997 v_2 := v.Args[2] 13998 if v_2.Op != OpARMMOVWconst { 13999 break 14000 } 14001 c := v_2.AuxInt 14002 v.reset(OpARMSUBSshiftRA) 14003 v.AuxInt = c 14004 v.AddArg(x) 14005 v.AddArg(y) 14006 return true 14007 } 14008 return false 14009 } 14010 func rewriteValueARM_OpARMSUBSshiftRL_0(v *Value) bool { 14011 b := v.Block 14012 // match: (SUBSshiftRL (MOVWconst [c]) x [d]) 14013 // result: (RSBSconst [c] (SRLconst <x.Type> x [d])) 14014 for { 14015 d := v.AuxInt 14016 x := v.Args[1] 14017 v_0 := v.Args[0] 14018 if v_0.Op != OpARMMOVWconst { 14019 break 14020 } 14021 c := v_0.AuxInt 14022 v.reset(OpARMRSBSconst) 14023 v.AuxInt = c 14024 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 14025 v0.AuxInt = d 14026 v0.AddArg(x) 14027 v.AddArg(v0) 14028 return true 14029 } 14030 // match: (SUBSshiftRL x (MOVWconst [c]) [d]) 14031 // result: (SUBSconst x [int64(int32(uint32(c)>>uint64(d)))]) 14032 for { 14033 d := v.AuxInt 14034 _ = v.Args[1] 14035 x := v.Args[0] 14036 v_1 := v.Args[1] 14037 if v_1.Op != OpARMMOVWconst { 14038 break 14039 } 14040 c := v_1.AuxInt 14041 v.reset(OpARMSUBSconst) 14042 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 14043 v.AddArg(x) 14044 return true 14045 } 14046 return false 14047 } 14048 func rewriteValueARM_OpARMSUBSshiftRLreg_0(v *Value) bool { 14049 b := v.Block 14050 // match: (SUBSshiftRLreg (MOVWconst [c]) x y) 14051 // result: (RSBSconst [c] (SRL <x.Type> x y)) 14052 for { 14053 y := v.Args[2] 14054 v_0 := v.Args[0] 14055 if v_0.Op != OpARMMOVWconst { 14056 break 14057 } 14058 c := v_0.AuxInt 14059 x := v.Args[1] 14060 v.reset(OpARMRSBSconst) 14061 v.AuxInt = c 14062 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 14063 v0.AddArg(x) 14064 v0.AddArg(y) 14065 v.AddArg(v0) 14066 return true 14067 } 14068 // match: (SUBSshiftRLreg x y (MOVWconst [c])) 14069 // result: (SUBSshiftRL x y [c]) 14070 for { 14071 _ = v.Args[2] 14072 x := v.Args[0] 14073 y := v.Args[1] 14074 v_2 := v.Args[2] 14075 if v_2.Op != OpARMMOVWconst { 14076 break 14077 } 14078 c := v_2.AuxInt 14079 v.reset(OpARMSUBSshiftRL) 14080 v.AuxInt = c 14081 v.AddArg(x) 14082 v.AddArg(y) 14083 return true 14084 } 14085 return false 14086 } 14087 func rewriteValueARM_OpARMSUBconst_0(v *Value) bool { 14088 // match: (SUBconst [off1] (MOVWaddr [off2] {sym} ptr)) 14089 // result: (MOVWaddr [off2-off1] {sym} ptr) 14090 for { 14091 off1 := v.AuxInt 14092 v_0 := v.Args[0] 14093 if v_0.Op != OpARMMOVWaddr { 14094 break 14095 } 14096 off2 := v_0.AuxInt 14097 sym := v_0.Aux 14098 ptr := v_0.Args[0] 14099 v.reset(OpARMMOVWaddr) 14100 v.AuxInt = off2 - off1 14101 v.Aux = sym 14102 v.AddArg(ptr) 14103 return true 14104 } 14105 // match: (SUBconst [0] x) 14106 // result: x 14107 for { 14108 if v.AuxInt != 0 { 14109 break 14110 } 14111 x := v.Args[0] 14112 v.reset(OpCopy) 14113 v.Type = x.Type 14114 v.AddArg(x) 14115 return true 14116 } 14117 // match: (SUBconst [c] x) 14118 // cond: !isARMImmRot(uint32(c)) && isARMImmRot(uint32(-c)) 14119 // result: (ADDconst [int64(int32(-c))] x) 14120 for { 14121 c := v.AuxInt 14122 x := v.Args[0] 14123 if !(!isARMImmRot(uint32(c)) && isARMImmRot(uint32(-c))) { 14124 break 14125 } 14126 v.reset(OpARMADDconst) 14127 v.AuxInt = int64(int32(-c)) 14128 v.AddArg(x) 14129 return true 14130 } 14131 // match: (SUBconst [c] x) 14132 // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff 14133 // result: (ANDconst [int64(int32(-c))] x) 14134 for { 14135 c := v.AuxInt 14136 x := v.Args[0] 14137 if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && uint32(-c) <= 0xffff) { 14138 break 14139 } 14140 v.reset(OpARMANDconst) 14141 v.AuxInt = int64(int32(-c)) 14142 v.AddArg(x) 14143 return true 14144 } 14145 // match: (SUBconst [c] (MOVWconst [d])) 14146 // result: (MOVWconst [int64(int32(d-c))]) 14147 for { 14148 c := v.AuxInt 14149 v_0 := v.Args[0] 14150 if v_0.Op != OpARMMOVWconst { 14151 break 14152 } 14153 d := v_0.AuxInt 14154 v.reset(OpARMMOVWconst) 14155 v.AuxInt = int64(int32(d - c)) 14156 return true 14157 } 14158 // match: (SUBconst [c] (SUBconst [d] x)) 14159 // result: (ADDconst [int64(int32(-c-d))] x) 14160 for { 14161 c := v.AuxInt 14162 v_0 := v.Args[0] 14163 if v_0.Op != OpARMSUBconst { 14164 break 14165 } 14166 d := v_0.AuxInt 14167 x := v_0.Args[0] 14168 v.reset(OpARMADDconst) 14169 v.AuxInt = int64(int32(-c - d)) 14170 v.AddArg(x) 14171 return true 14172 } 14173 // match: (SUBconst [c] (ADDconst [d] x)) 14174 // result: (ADDconst [int64(int32(-c+d))] x) 14175 for { 14176 c := v.AuxInt 14177 v_0 := v.Args[0] 14178 if v_0.Op != OpARMADDconst { 14179 break 14180 } 14181 d := v_0.AuxInt 14182 x := v_0.Args[0] 14183 v.reset(OpARMADDconst) 14184 v.AuxInt = int64(int32(-c + d)) 14185 v.AddArg(x) 14186 return true 14187 } 14188 // match: (SUBconst [c] (RSBconst [d] x)) 14189 // result: (RSBconst [int64(int32(-c+d))] x) 14190 for { 14191 c := v.AuxInt 14192 v_0 := v.Args[0] 14193 if v_0.Op != OpARMRSBconst { 14194 break 14195 } 14196 d := v_0.AuxInt 14197 x := v_0.Args[0] 14198 v.reset(OpARMRSBconst) 14199 v.AuxInt = int64(int32(-c + d)) 14200 v.AddArg(x) 14201 return true 14202 } 14203 return false 14204 } 14205 func rewriteValueARM_OpARMSUBshiftLL_0(v *Value) bool { 14206 b := v.Block 14207 // match: (SUBshiftLL (MOVWconst [c]) x [d]) 14208 // result: (RSBconst [c] (SLLconst <x.Type> x [d])) 14209 for { 14210 d := v.AuxInt 14211 x := v.Args[1] 14212 v_0 := v.Args[0] 14213 if v_0.Op != OpARMMOVWconst { 14214 break 14215 } 14216 c := v_0.AuxInt 14217 v.reset(OpARMRSBconst) 14218 v.AuxInt = c 14219 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 14220 v0.AuxInt = d 14221 v0.AddArg(x) 14222 v.AddArg(v0) 14223 return true 14224 } 14225 // match: (SUBshiftLL x (MOVWconst [c]) [d]) 14226 // result: (SUBconst x [int64(int32(uint32(c)<<uint64(d)))]) 14227 for { 14228 d := v.AuxInt 14229 _ = v.Args[1] 14230 x := v.Args[0] 14231 v_1 := v.Args[1] 14232 if v_1.Op != OpARMMOVWconst { 14233 break 14234 } 14235 c := v_1.AuxInt 14236 v.reset(OpARMSUBconst) 14237 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 14238 v.AddArg(x) 14239 return true 14240 } 14241 // match: (SUBshiftLL x (SLLconst x [c]) [d]) 14242 // cond: c==d 14243 // result: (MOVWconst [0]) 14244 for { 14245 d := v.AuxInt 14246 _ = v.Args[1] 14247 x := v.Args[0] 14248 v_1 := v.Args[1] 14249 if v_1.Op != OpARMSLLconst { 14250 break 14251 } 14252 c := v_1.AuxInt 14253 if x != v_1.Args[0] || !(c == d) { 14254 break 14255 } 14256 v.reset(OpARMMOVWconst) 14257 v.AuxInt = 0 14258 return true 14259 } 14260 return false 14261 } 14262 func rewriteValueARM_OpARMSUBshiftLLreg_0(v *Value) bool { 14263 b := v.Block 14264 // match: (SUBshiftLLreg (MOVWconst [c]) x y) 14265 // result: (RSBconst [c] (SLL <x.Type> x y)) 14266 for { 14267 y := v.Args[2] 14268 v_0 := v.Args[0] 14269 if v_0.Op != OpARMMOVWconst { 14270 break 14271 } 14272 c := v_0.AuxInt 14273 x := v.Args[1] 14274 v.reset(OpARMRSBconst) 14275 v.AuxInt = c 14276 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 14277 v0.AddArg(x) 14278 v0.AddArg(y) 14279 v.AddArg(v0) 14280 return true 14281 } 14282 // match: (SUBshiftLLreg x y (MOVWconst [c])) 14283 // result: (SUBshiftLL x y [c]) 14284 for { 14285 _ = v.Args[2] 14286 x := v.Args[0] 14287 y := v.Args[1] 14288 v_2 := v.Args[2] 14289 if v_2.Op != OpARMMOVWconst { 14290 break 14291 } 14292 c := v_2.AuxInt 14293 v.reset(OpARMSUBshiftLL) 14294 v.AuxInt = c 14295 v.AddArg(x) 14296 v.AddArg(y) 14297 return true 14298 } 14299 return false 14300 } 14301 func rewriteValueARM_OpARMSUBshiftRA_0(v *Value) bool { 14302 b := v.Block 14303 // match: (SUBshiftRA (MOVWconst [c]) x [d]) 14304 // result: (RSBconst [c] (SRAconst <x.Type> x [d])) 14305 for { 14306 d := v.AuxInt 14307 x := v.Args[1] 14308 v_0 := v.Args[0] 14309 if v_0.Op != OpARMMOVWconst { 14310 break 14311 } 14312 c := v_0.AuxInt 14313 v.reset(OpARMRSBconst) 14314 v.AuxInt = c 14315 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 14316 v0.AuxInt = d 14317 v0.AddArg(x) 14318 v.AddArg(v0) 14319 return true 14320 } 14321 // match: (SUBshiftRA x (MOVWconst [c]) [d]) 14322 // result: (SUBconst x [int64(int32(c)>>uint64(d))]) 14323 for { 14324 d := v.AuxInt 14325 _ = v.Args[1] 14326 x := v.Args[0] 14327 v_1 := v.Args[1] 14328 if v_1.Op != OpARMMOVWconst { 14329 break 14330 } 14331 c := v_1.AuxInt 14332 v.reset(OpARMSUBconst) 14333 v.AuxInt = int64(int32(c) >> uint64(d)) 14334 v.AddArg(x) 14335 return true 14336 } 14337 // match: (SUBshiftRA x (SRAconst x [c]) [d]) 14338 // cond: c==d 14339 // result: (MOVWconst [0]) 14340 for { 14341 d := v.AuxInt 14342 _ = v.Args[1] 14343 x := v.Args[0] 14344 v_1 := v.Args[1] 14345 if v_1.Op != OpARMSRAconst { 14346 break 14347 } 14348 c := v_1.AuxInt 14349 if x != v_1.Args[0] || !(c == d) { 14350 break 14351 } 14352 v.reset(OpARMMOVWconst) 14353 v.AuxInt = 0 14354 return true 14355 } 14356 return false 14357 } 14358 func rewriteValueARM_OpARMSUBshiftRAreg_0(v *Value) bool { 14359 b := v.Block 14360 // match: (SUBshiftRAreg (MOVWconst [c]) x y) 14361 // result: (RSBconst [c] (SRA <x.Type> x y)) 14362 for { 14363 y := v.Args[2] 14364 v_0 := v.Args[0] 14365 if v_0.Op != OpARMMOVWconst { 14366 break 14367 } 14368 c := v_0.AuxInt 14369 x := v.Args[1] 14370 v.reset(OpARMRSBconst) 14371 v.AuxInt = c 14372 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 14373 v0.AddArg(x) 14374 v0.AddArg(y) 14375 v.AddArg(v0) 14376 return true 14377 } 14378 // match: (SUBshiftRAreg x y (MOVWconst [c])) 14379 // result: (SUBshiftRA x y [c]) 14380 for { 14381 _ = v.Args[2] 14382 x := v.Args[0] 14383 y := v.Args[1] 14384 v_2 := v.Args[2] 14385 if v_2.Op != OpARMMOVWconst { 14386 break 14387 } 14388 c := v_2.AuxInt 14389 v.reset(OpARMSUBshiftRA) 14390 v.AuxInt = c 14391 v.AddArg(x) 14392 v.AddArg(y) 14393 return true 14394 } 14395 return false 14396 } 14397 func rewriteValueARM_OpARMSUBshiftRL_0(v *Value) bool { 14398 b := v.Block 14399 // match: (SUBshiftRL (MOVWconst [c]) x [d]) 14400 // result: (RSBconst [c] (SRLconst <x.Type> x [d])) 14401 for { 14402 d := v.AuxInt 14403 x := v.Args[1] 14404 v_0 := v.Args[0] 14405 if v_0.Op != OpARMMOVWconst { 14406 break 14407 } 14408 c := v_0.AuxInt 14409 v.reset(OpARMRSBconst) 14410 v.AuxInt = c 14411 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 14412 v0.AuxInt = d 14413 v0.AddArg(x) 14414 v.AddArg(v0) 14415 return true 14416 } 14417 // match: (SUBshiftRL x (MOVWconst [c]) [d]) 14418 // result: (SUBconst x [int64(int32(uint32(c)>>uint64(d)))]) 14419 for { 14420 d := v.AuxInt 14421 _ = v.Args[1] 14422 x := v.Args[0] 14423 v_1 := v.Args[1] 14424 if v_1.Op != OpARMMOVWconst { 14425 break 14426 } 14427 c := v_1.AuxInt 14428 v.reset(OpARMSUBconst) 14429 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 14430 v.AddArg(x) 14431 return true 14432 } 14433 // match: (SUBshiftRL x (SRLconst x [c]) [d]) 14434 // cond: c==d 14435 // result: (MOVWconst [0]) 14436 for { 14437 d := v.AuxInt 14438 _ = v.Args[1] 14439 x := v.Args[0] 14440 v_1 := v.Args[1] 14441 if v_1.Op != OpARMSRLconst { 14442 break 14443 } 14444 c := v_1.AuxInt 14445 if x != v_1.Args[0] || !(c == d) { 14446 break 14447 } 14448 v.reset(OpARMMOVWconst) 14449 v.AuxInt = 0 14450 return true 14451 } 14452 return false 14453 } 14454 func rewriteValueARM_OpARMSUBshiftRLreg_0(v *Value) bool { 14455 b := v.Block 14456 // match: (SUBshiftRLreg (MOVWconst [c]) x y) 14457 // result: (RSBconst [c] (SRL <x.Type> x y)) 14458 for { 14459 y := v.Args[2] 14460 v_0 := v.Args[0] 14461 if v_0.Op != OpARMMOVWconst { 14462 break 14463 } 14464 c := v_0.AuxInt 14465 x := v.Args[1] 14466 v.reset(OpARMRSBconst) 14467 v.AuxInt = c 14468 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 14469 v0.AddArg(x) 14470 v0.AddArg(y) 14471 v.AddArg(v0) 14472 return true 14473 } 14474 // match: (SUBshiftRLreg x y (MOVWconst [c])) 14475 // result: (SUBshiftRL x y [c]) 14476 for { 14477 _ = v.Args[2] 14478 x := v.Args[0] 14479 y := v.Args[1] 14480 v_2 := v.Args[2] 14481 if v_2.Op != OpARMMOVWconst { 14482 break 14483 } 14484 c := v_2.AuxInt 14485 v.reset(OpARMSUBshiftRL) 14486 v.AuxInt = c 14487 v.AddArg(x) 14488 v.AddArg(y) 14489 return true 14490 } 14491 return false 14492 } 14493 func rewriteValueARM_OpARMTEQ_0(v *Value) bool { 14494 // match: (TEQ x (MOVWconst [c])) 14495 // result: (TEQconst [c] x) 14496 for { 14497 _ = v.Args[1] 14498 x := v.Args[0] 14499 v_1 := v.Args[1] 14500 if v_1.Op != OpARMMOVWconst { 14501 break 14502 } 14503 c := v_1.AuxInt 14504 v.reset(OpARMTEQconst) 14505 v.AuxInt = c 14506 v.AddArg(x) 14507 return true 14508 } 14509 // match: (TEQ (MOVWconst [c]) x) 14510 // result: (TEQconst [c] x) 14511 for { 14512 x := v.Args[1] 14513 v_0 := v.Args[0] 14514 if v_0.Op != OpARMMOVWconst { 14515 break 14516 } 14517 c := v_0.AuxInt 14518 v.reset(OpARMTEQconst) 14519 v.AuxInt = c 14520 v.AddArg(x) 14521 return true 14522 } 14523 // match: (TEQ x (SLLconst [c] y)) 14524 // result: (TEQshiftLL x y [c]) 14525 for { 14526 _ = v.Args[1] 14527 x := v.Args[0] 14528 v_1 := v.Args[1] 14529 if v_1.Op != OpARMSLLconst { 14530 break 14531 } 14532 c := v_1.AuxInt 14533 y := v_1.Args[0] 14534 v.reset(OpARMTEQshiftLL) 14535 v.AuxInt = c 14536 v.AddArg(x) 14537 v.AddArg(y) 14538 return true 14539 } 14540 // match: (TEQ (SLLconst [c] y) x) 14541 // result: (TEQshiftLL x y [c]) 14542 for { 14543 x := v.Args[1] 14544 v_0 := v.Args[0] 14545 if v_0.Op != OpARMSLLconst { 14546 break 14547 } 14548 c := v_0.AuxInt 14549 y := v_0.Args[0] 14550 v.reset(OpARMTEQshiftLL) 14551 v.AuxInt = c 14552 v.AddArg(x) 14553 v.AddArg(y) 14554 return true 14555 } 14556 // match: (TEQ x (SRLconst [c] y)) 14557 // result: (TEQshiftRL x y [c]) 14558 for { 14559 _ = v.Args[1] 14560 x := v.Args[0] 14561 v_1 := v.Args[1] 14562 if v_1.Op != OpARMSRLconst { 14563 break 14564 } 14565 c := v_1.AuxInt 14566 y := v_1.Args[0] 14567 v.reset(OpARMTEQshiftRL) 14568 v.AuxInt = c 14569 v.AddArg(x) 14570 v.AddArg(y) 14571 return true 14572 } 14573 // match: (TEQ (SRLconst [c] y) x) 14574 // result: (TEQshiftRL x y [c]) 14575 for { 14576 x := v.Args[1] 14577 v_0 := v.Args[0] 14578 if v_0.Op != OpARMSRLconst { 14579 break 14580 } 14581 c := v_0.AuxInt 14582 y := v_0.Args[0] 14583 v.reset(OpARMTEQshiftRL) 14584 v.AuxInt = c 14585 v.AddArg(x) 14586 v.AddArg(y) 14587 return true 14588 } 14589 // match: (TEQ x (SRAconst [c] y)) 14590 // result: (TEQshiftRA x y [c]) 14591 for { 14592 _ = v.Args[1] 14593 x := v.Args[0] 14594 v_1 := v.Args[1] 14595 if v_1.Op != OpARMSRAconst { 14596 break 14597 } 14598 c := v_1.AuxInt 14599 y := v_1.Args[0] 14600 v.reset(OpARMTEQshiftRA) 14601 v.AuxInt = c 14602 v.AddArg(x) 14603 v.AddArg(y) 14604 return true 14605 } 14606 // match: (TEQ (SRAconst [c] y) x) 14607 // result: (TEQshiftRA x y [c]) 14608 for { 14609 x := v.Args[1] 14610 v_0 := v.Args[0] 14611 if v_0.Op != OpARMSRAconst { 14612 break 14613 } 14614 c := v_0.AuxInt 14615 y := v_0.Args[0] 14616 v.reset(OpARMTEQshiftRA) 14617 v.AuxInt = c 14618 v.AddArg(x) 14619 v.AddArg(y) 14620 return true 14621 } 14622 // match: (TEQ x (SLL y z)) 14623 // result: (TEQshiftLLreg x y z) 14624 for { 14625 _ = v.Args[1] 14626 x := v.Args[0] 14627 v_1 := v.Args[1] 14628 if v_1.Op != OpARMSLL { 14629 break 14630 } 14631 z := v_1.Args[1] 14632 y := v_1.Args[0] 14633 v.reset(OpARMTEQshiftLLreg) 14634 v.AddArg(x) 14635 v.AddArg(y) 14636 v.AddArg(z) 14637 return true 14638 } 14639 // match: (TEQ (SLL y z) x) 14640 // result: (TEQshiftLLreg x y z) 14641 for { 14642 x := v.Args[1] 14643 v_0 := v.Args[0] 14644 if v_0.Op != OpARMSLL { 14645 break 14646 } 14647 z := v_0.Args[1] 14648 y := v_0.Args[0] 14649 v.reset(OpARMTEQshiftLLreg) 14650 v.AddArg(x) 14651 v.AddArg(y) 14652 v.AddArg(z) 14653 return true 14654 } 14655 return false 14656 } 14657 func rewriteValueARM_OpARMTEQ_10(v *Value) bool { 14658 // match: (TEQ x (SRL y z)) 14659 // result: (TEQshiftRLreg x y z) 14660 for { 14661 _ = v.Args[1] 14662 x := v.Args[0] 14663 v_1 := v.Args[1] 14664 if v_1.Op != OpARMSRL { 14665 break 14666 } 14667 z := v_1.Args[1] 14668 y := v_1.Args[0] 14669 v.reset(OpARMTEQshiftRLreg) 14670 v.AddArg(x) 14671 v.AddArg(y) 14672 v.AddArg(z) 14673 return true 14674 } 14675 // match: (TEQ (SRL y z) x) 14676 // result: (TEQshiftRLreg x y z) 14677 for { 14678 x := v.Args[1] 14679 v_0 := v.Args[0] 14680 if v_0.Op != OpARMSRL { 14681 break 14682 } 14683 z := v_0.Args[1] 14684 y := v_0.Args[0] 14685 v.reset(OpARMTEQshiftRLreg) 14686 v.AddArg(x) 14687 v.AddArg(y) 14688 v.AddArg(z) 14689 return true 14690 } 14691 // match: (TEQ x (SRA y z)) 14692 // result: (TEQshiftRAreg x y z) 14693 for { 14694 _ = v.Args[1] 14695 x := v.Args[0] 14696 v_1 := v.Args[1] 14697 if v_1.Op != OpARMSRA { 14698 break 14699 } 14700 z := v_1.Args[1] 14701 y := v_1.Args[0] 14702 v.reset(OpARMTEQshiftRAreg) 14703 v.AddArg(x) 14704 v.AddArg(y) 14705 v.AddArg(z) 14706 return true 14707 } 14708 // match: (TEQ (SRA y z) x) 14709 // result: (TEQshiftRAreg x y z) 14710 for { 14711 x := v.Args[1] 14712 v_0 := v.Args[0] 14713 if v_0.Op != OpARMSRA { 14714 break 14715 } 14716 z := v_0.Args[1] 14717 y := v_0.Args[0] 14718 v.reset(OpARMTEQshiftRAreg) 14719 v.AddArg(x) 14720 v.AddArg(y) 14721 v.AddArg(z) 14722 return true 14723 } 14724 return false 14725 } 14726 func rewriteValueARM_OpARMTEQconst_0(v *Value) bool { 14727 // match: (TEQconst (MOVWconst [x]) [y]) 14728 // cond: int32(x^y)==0 14729 // result: (FlagEQ) 14730 for { 14731 y := v.AuxInt 14732 v_0 := v.Args[0] 14733 if v_0.Op != OpARMMOVWconst { 14734 break 14735 } 14736 x := v_0.AuxInt 14737 if !(int32(x^y) == 0) { 14738 break 14739 } 14740 v.reset(OpARMFlagEQ) 14741 return true 14742 } 14743 // match: (TEQconst (MOVWconst [x]) [y]) 14744 // cond: int32(x^y)<0 14745 // result: (FlagLT_UGT) 14746 for { 14747 y := v.AuxInt 14748 v_0 := v.Args[0] 14749 if v_0.Op != OpARMMOVWconst { 14750 break 14751 } 14752 x := v_0.AuxInt 14753 if !(int32(x^y) < 0) { 14754 break 14755 } 14756 v.reset(OpARMFlagLT_UGT) 14757 return true 14758 } 14759 // match: (TEQconst (MOVWconst [x]) [y]) 14760 // cond: int32(x^y)>0 14761 // result: (FlagGT_UGT) 14762 for { 14763 y := v.AuxInt 14764 v_0 := v.Args[0] 14765 if v_0.Op != OpARMMOVWconst { 14766 break 14767 } 14768 x := v_0.AuxInt 14769 if !(int32(x^y) > 0) { 14770 break 14771 } 14772 v.reset(OpARMFlagGT_UGT) 14773 return true 14774 } 14775 return false 14776 } 14777 func rewriteValueARM_OpARMTEQshiftLL_0(v *Value) bool { 14778 b := v.Block 14779 // match: (TEQshiftLL (MOVWconst [c]) x [d]) 14780 // result: (TEQconst [c] (SLLconst <x.Type> x [d])) 14781 for { 14782 d := v.AuxInt 14783 x := v.Args[1] 14784 v_0 := v.Args[0] 14785 if v_0.Op != OpARMMOVWconst { 14786 break 14787 } 14788 c := v_0.AuxInt 14789 v.reset(OpARMTEQconst) 14790 v.AuxInt = c 14791 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 14792 v0.AuxInt = d 14793 v0.AddArg(x) 14794 v.AddArg(v0) 14795 return true 14796 } 14797 // match: (TEQshiftLL x (MOVWconst [c]) [d]) 14798 // result: (TEQconst x [int64(int32(uint32(c)<<uint64(d)))]) 14799 for { 14800 d := v.AuxInt 14801 _ = v.Args[1] 14802 x := v.Args[0] 14803 v_1 := v.Args[1] 14804 if v_1.Op != OpARMMOVWconst { 14805 break 14806 } 14807 c := v_1.AuxInt 14808 v.reset(OpARMTEQconst) 14809 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 14810 v.AddArg(x) 14811 return true 14812 } 14813 return false 14814 } 14815 func rewriteValueARM_OpARMTEQshiftLLreg_0(v *Value) bool { 14816 b := v.Block 14817 // match: (TEQshiftLLreg (MOVWconst [c]) x y) 14818 // result: (TEQconst [c] (SLL <x.Type> x y)) 14819 for { 14820 y := v.Args[2] 14821 v_0 := v.Args[0] 14822 if v_0.Op != OpARMMOVWconst { 14823 break 14824 } 14825 c := v_0.AuxInt 14826 x := v.Args[1] 14827 v.reset(OpARMTEQconst) 14828 v.AuxInt = c 14829 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 14830 v0.AddArg(x) 14831 v0.AddArg(y) 14832 v.AddArg(v0) 14833 return true 14834 } 14835 // match: (TEQshiftLLreg x y (MOVWconst [c])) 14836 // result: (TEQshiftLL x y [c]) 14837 for { 14838 _ = v.Args[2] 14839 x := v.Args[0] 14840 y := v.Args[1] 14841 v_2 := v.Args[2] 14842 if v_2.Op != OpARMMOVWconst { 14843 break 14844 } 14845 c := v_2.AuxInt 14846 v.reset(OpARMTEQshiftLL) 14847 v.AuxInt = c 14848 v.AddArg(x) 14849 v.AddArg(y) 14850 return true 14851 } 14852 return false 14853 } 14854 func rewriteValueARM_OpARMTEQshiftRA_0(v *Value) bool { 14855 b := v.Block 14856 // match: (TEQshiftRA (MOVWconst [c]) x [d]) 14857 // result: (TEQconst [c] (SRAconst <x.Type> x [d])) 14858 for { 14859 d := v.AuxInt 14860 x := v.Args[1] 14861 v_0 := v.Args[0] 14862 if v_0.Op != OpARMMOVWconst { 14863 break 14864 } 14865 c := v_0.AuxInt 14866 v.reset(OpARMTEQconst) 14867 v.AuxInt = c 14868 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 14869 v0.AuxInt = d 14870 v0.AddArg(x) 14871 v.AddArg(v0) 14872 return true 14873 } 14874 // match: (TEQshiftRA x (MOVWconst [c]) [d]) 14875 // result: (TEQconst x [int64(int32(c)>>uint64(d))]) 14876 for { 14877 d := v.AuxInt 14878 _ = v.Args[1] 14879 x := v.Args[0] 14880 v_1 := v.Args[1] 14881 if v_1.Op != OpARMMOVWconst { 14882 break 14883 } 14884 c := v_1.AuxInt 14885 v.reset(OpARMTEQconst) 14886 v.AuxInt = int64(int32(c) >> uint64(d)) 14887 v.AddArg(x) 14888 return true 14889 } 14890 return false 14891 } 14892 func rewriteValueARM_OpARMTEQshiftRAreg_0(v *Value) bool { 14893 b := v.Block 14894 // match: (TEQshiftRAreg (MOVWconst [c]) x y) 14895 // result: (TEQconst [c] (SRA <x.Type> x y)) 14896 for { 14897 y := v.Args[2] 14898 v_0 := v.Args[0] 14899 if v_0.Op != OpARMMOVWconst { 14900 break 14901 } 14902 c := v_0.AuxInt 14903 x := v.Args[1] 14904 v.reset(OpARMTEQconst) 14905 v.AuxInt = c 14906 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 14907 v0.AddArg(x) 14908 v0.AddArg(y) 14909 v.AddArg(v0) 14910 return true 14911 } 14912 // match: (TEQshiftRAreg x y (MOVWconst [c])) 14913 // result: (TEQshiftRA x y [c]) 14914 for { 14915 _ = v.Args[2] 14916 x := v.Args[0] 14917 y := v.Args[1] 14918 v_2 := v.Args[2] 14919 if v_2.Op != OpARMMOVWconst { 14920 break 14921 } 14922 c := v_2.AuxInt 14923 v.reset(OpARMTEQshiftRA) 14924 v.AuxInt = c 14925 v.AddArg(x) 14926 v.AddArg(y) 14927 return true 14928 } 14929 return false 14930 } 14931 func rewriteValueARM_OpARMTEQshiftRL_0(v *Value) bool { 14932 b := v.Block 14933 // match: (TEQshiftRL (MOVWconst [c]) x [d]) 14934 // result: (TEQconst [c] (SRLconst <x.Type> x [d])) 14935 for { 14936 d := v.AuxInt 14937 x := v.Args[1] 14938 v_0 := v.Args[0] 14939 if v_0.Op != OpARMMOVWconst { 14940 break 14941 } 14942 c := v_0.AuxInt 14943 v.reset(OpARMTEQconst) 14944 v.AuxInt = c 14945 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 14946 v0.AuxInt = d 14947 v0.AddArg(x) 14948 v.AddArg(v0) 14949 return true 14950 } 14951 // match: (TEQshiftRL x (MOVWconst [c]) [d]) 14952 // result: (TEQconst x [int64(int32(uint32(c)>>uint64(d)))]) 14953 for { 14954 d := v.AuxInt 14955 _ = v.Args[1] 14956 x := v.Args[0] 14957 v_1 := v.Args[1] 14958 if v_1.Op != OpARMMOVWconst { 14959 break 14960 } 14961 c := v_1.AuxInt 14962 v.reset(OpARMTEQconst) 14963 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 14964 v.AddArg(x) 14965 return true 14966 } 14967 return false 14968 } 14969 func rewriteValueARM_OpARMTEQshiftRLreg_0(v *Value) bool { 14970 b := v.Block 14971 // match: (TEQshiftRLreg (MOVWconst [c]) x y) 14972 // result: (TEQconst [c] (SRL <x.Type> x y)) 14973 for { 14974 y := v.Args[2] 14975 v_0 := v.Args[0] 14976 if v_0.Op != OpARMMOVWconst { 14977 break 14978 } 14979 c := v_0.AuxInt 14980 x := v.Args[1] 14981 v.reset(OpARMTEQconst) 14982 v.AuxInt = c 14983 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 14984 v0.AddArg(x) 14985 v0.AddArg(y) 14986 v.AddArg(v0) 14987 return true 14988 } 14989 // match: (TEQshiftRLreg x y (MOVWconst [c])) 14990 // result: (TEQshiftRL x y [c]) 14991 for { 14992 _ = v.Args[2] 14993 x := v.Args[0] 14994 y := v.Args[1] 14995 v_2 := v.Args[2] 14996 if v_2.Op != OpARMMOVWconst { 14997 break 14998 } 14999 c := v_2.AuxInt 15000 v.reset(OpARMTEQshiftRL) 15001 v.AuxInt = c 15002 v.AddArg(x) 15003 v.AddArg(y) 15004 return true 15005 } 15006 return false 15007 } 15008 func rewriteValueARM_OpARMTST_0(v *Value) bool { 15009 // match: (TST x (MOVWconst [c])) 15010 // result: (TSTconst [c] x) 15011 for { 15012 _ = v.Args[1] 15013 x := v.Args[0] 15014 v_1 := v.Args[1] 15015 if v_1.Op != OpARMMOVWconst { 15016 break 15017 } 15018 c := v_1.AuxInt 15019 v.reset(OpARMTSTconst) 15020 v.AuxInt = c 15021 v.AddArg(x) 15022 return true 15023 } 15024 // match: (TST (MOVWconst [c]) x) 15025 // result: (TSTconst [c] x) 15026 for { 15027 x := v.Args[1] 15028 v_0 := v.Args[0] 15029 if v_0.Op != OpARMMOVWconst { 15030 break 15031 } 15032 c := v_0.AuxInt 15033 v.reset(OpARMTSTconst) 15034 v.AuxInt = c 15035 v.AddArg(x) 15036 return true 15037 } 15038 // match: (TST x (SLLconst [c] y)) 15039 // result: (TSTshiftLL x y [c]) 15040 for { 15041 _ = v.Args[1] 15042 x := v.Args[0] 15043 v_1 := v.Args[1] 15044 if v_1.Op != OpARMSLLconst { 15045 break 15046 } 15047 c := v_1.AuxInt 15048 y := v_1.Args[0] 15049 v.reset(OpARMTSTshiftLL) 15050 v.AuxInt = c 15051 v.AddArg(x) 15052 v.AddArg(y) 15053 return true 15054 } 15055 // match: (TST (SLLconst [c] y) x) 15056 // result: (TSTshiftLL x y [c]) 15057 for { 15058 x := v.Args[1] 15059 v_0 := v.Args[0] 15060 if v_0.Op != OpARMSLLconst { 15061 break 15062 } 15063 c := v_0.AuxInt 15064 y := v_0.Args[0] 15065 v.reset(OpARMTSTshiftLL) 15066 v.AuxInt = c 15067 v.AddArg(x) 15068 v.AddArg(y) 15069 return true 15070 } 15071 // match: (TST x (SRLconst [c] y)) 15072 // result: (TSTshiftRL x y [c]) 15073 for { 15074 _ = v.Args[1] 15075 x := v.Args[0] 15076 v_1 := v.Args[1] 15077 if v_1.Op != OpARMSRLconst { 15078 break 15079 } 15080 c := v_1.AuxInt 15081 y := v_1.Args[0] 15082 v.reset(OpARMTSTshiftRL) 15083 v.AuxInt = c 15084 v.AddArg(x) 15085 v.AddArg(y) 15086 return true 15087 } 15088 // match: (TST (SRLconst [c] y) x) 15089 // result: (TSTshiftRL x y [c]) 15090 for { 15091 x := v.Args[1] 15092 v_0 := v.Args[0] 15093 if v_0.Op != OpARMSRLconst { 15094 break 15095 } 15096 c := v_0.AuxInt 15097 y := v_0.Args[0] 15098 v.reset(OpARMTSTshiftRL) 15099 v.AuxInt = c 15100 v.AddArg(x) 15101 v.AddArg(y) 15102 return true 15103 } 15104 // match: (TST x (SRAconst [c] y)) 15105 // result: (TSTshiftRA x y [c]) 15106 for { 15107 _ = v.Args[1] 15108 x := v.Args[0] 15109 v_1 := v.Args[1] 15110 if v_1.Op != OpARMSRAconst { 15111 break 15112 } 15113 c := v_1.AuxInt 15114 y := v_1.Args[0] 15115 v.reset(OpARMTSTshiftRA) 15116 v.AuxInt = c 15117 v.AddArg(x) 15118 v.AddArg(y) 15119 return true 15120 } 15121 // match: (TST (SRAconst [c] y) x) 15122 // result: (TSTshiftRA x y [c]) 15123 for { 15124 x := v.Args[1] 15125 v_0 := v.Args[0] 15126 if v_0.Op != OpARMSRAconst { 15127 break 15128 } 15129 c := v_0.AuxInt 15130 y := v_0.Args[0] 15131 v.reset(OpARMTSTshiftRA) 15132 v.AuxInt = c 15133 v.AddArg(x) 15134 v.AddArg(y) 15135 return true 15136 } 15137 // match: (TST x (SLL y z)) 15138 // result: (TSTshiftLLreg x y z) 15139 for { 15140 _ = v.Args[1] 15141 x := v.Args[0] 15142 v_1 := v.Args[1] 15143 if v_1.Op != OpARMSLL { 15144 break 15145 } 15146 z := v_1.Args[1] 15147 y := v_1.Args[0] 15148 v.reset(OpARMTSTshiftLLreg) 15149 v.AddArg(x) 15150 v.AddArg(y) 15151 v.AddArg(z) 15152 return true 15153 } 15154 // match: (TST (SLL y z) x) 15155 // result: (TSTshiftLLreg x y z) 15156 for { 15157 x := v.Args[1] 15158 v_0 := v.Args[0] 15159 if v_0.Op != OpARMSLL { 15160 break 15161 } 15162 z := v_0.Args[1] 15163 y := v_0.Args[0] 15164 v.reset(OpARMTSTshiftLLreg) 15165 v.AddArg(x) 15166 v.AddArg(y) 15167 v.AddArg(z) 15168 return true 15169 } 15170 return false 15171 } 15172 func rewriteValueARM_OpARMTST_10(v *Value) bool { 15173 // match: (TST x (SRL y z)) 15174 // result: (TSTshiftRLreg x y z) 15175 for { 15176 _ = v.Args[1] 15177 x := v.Args[0] 15178 v_1 := v.Args[1] 15179 if v_1.Op != OpARMSRL { 15180 break 15181 } 15182 z := v_1.Args[1] 15183 y := v_1.Args[0] 15184 v.reset(OpARMTSTshiftRLreg) 15185 v.AddArg(x) 15186 v.AddArg(y) 15187 v.AddArg(z) 15188 return true 15189 } 15190 // match: (TST (SRL y z) x) 15191 // result: (TSTshiftRLreg x y z) 15192 for { 15193 x := v.Args[1] 15194 v_0 := v.Args[0] 15195 if v_0.Op != OpARMSRL { 15196 break 15197 } 15198 z := v_0.Args[1] 15199 y := v_0.Args[0] 15200 v.reset(OpARMTSTshiftRLreg) 15201 v.AddArg(x) 15202 v.AddArg(y) 15203 v.AddArg(z) 15204 return true 15205 } 15206 // match: (TST x (SRA y z)) 15207 // result: (TSTshiftRAreg x y z) 15208 for { 15209 _ = v.Args[1] 15210 x := v.Args[0] 15211 v_1 := v.Args[1] 15212 if v_1.Op != OpARMSRA { 15213 break 15214 } 15215 z := v_1.Args[1] 15216 y := v_1.Args[0] 15217 v.reset(OpARMTSTshiftRAreg) 15218 v.AddArg(x) 15219 v.AddArg(y) 15220 v.AddArg(z) 15221 return true 15222 } 15223 // match: (TST (SRA y z) x) 15224 // result: (TSTshiftRAreg x y z) 15225 for { 15226 x := v.Args[1] 15227 v_0 := v.Args[0] 15228 if v_0.Op != OpARMSRA { 15229 break 15230 } 15231 z := v_0.Args[1] 15232 y := v_0.Args[0] 15233 v.reset(OpARMTSTshiftRAreg) 15234 v.AddArg(x) 15235 v.AddArg(y) 15236 v.AddArg(z) 15237 return true 15238 } 15239 return false 15240 } 15241 func rewriteValueARM_OpARMTSTconst_0(v *Value) bool { 15242 // match: (TSTconst (MOVWconst [x]) [y]) 15243 // cond: int32(x&y)==0 15244 // result: (FlagEQ) 15245 for { 15246 y := v.AuxInt 15247 v_0 := v.Args[0] 15248 if v_0.Op != OpARMMOVWconst { 15249 break 15250 } 15251 x := v_0.AuxInt 15252 if !(int32(x&y) == 0) { 15253 break 15254 } 15255 v.reset(OpARMFlagEQ) 15256 return true 15257 } 15258 // match: (TSTconst (MOVWconst [x]) [y]) 15259 // cond: int32(x&y)<0 15260 // result: (FlagLT_UGT) 15261 for { 15262 y := v.AuxInt 15263 v_0 := v.Args[0] 15264 if v_0.Op != OpARMMOVWconst { 15265 break 15266 } 15267 x := v_0.AuxInt 15268 if !(int32(x&y) < 0) { 15269 break 15270 } 15271 v.reset(OpARMFlagLT_UGT) 15272 return true 15273 } 15274 // match: (TSTconst (MOVWconst [x]) [y]) 15275 // cond: int32(x&y)>0 15276 // result: (FlagGT_UGT) 15277 for { 15278 y := v.AuxInt 15279 v_0 := v.Args[0] 15280 if v_0.Op != OpARMMOVWconst { 15281 break 15282 } 15283 x := v_0.AuxInt 15284 if !(int32(x&y) > 0) { 15285 break 15286 } 15287 v.reset(OpARMFlagGT_UGT) 15288 return true 15289 } 15290 return false 15291 } 15292 func rewriteValueARM_OpARMTSTshiftLL_0(v *Value) bool { 15293 b := v.Block 15294 // match: (TSTshiftLL (MOVWconst [c]) x [d]) 15295 // result: (TSTconst [c] (SLLconst <x.Type> x [d])) 15296 for { 15297 d := v.AuxInt 15298 x := v.Args[1] 15299 v_0 := v.Args[0] 15300 if v_0.Op != OpARMMOVWconst { 15301 break 15302 } 15303 c := v_0.AuxInt 15304 v.reset(OpARMTSTconst) 15305 v.AuxInt = c 15306 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 15307 v0.AuxInt = d 15308 v0.AddArg(x) 15309 v.AddArg(v0) 15310 return true 15311 } 15312 // match: (TSTshiftLL x (MOVWconst [c]) [d]) 15313 // result: (TSTconst x [int64(int32(uint32(c)<<uint64(d)))]) 15314 for { 15315 d := v.AuxInt 15316 _ = v.Args[1] 15317 x := v.Args[0] 15318 v_1 := v.Args[1] 15319 if v_1.Op != OpARMMOVWconst { 15320 break 15321 } 15322 c := v_1.AuxInt 15323 v.reset(OpARMTSTconst) 15324 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 15325 v.AddArg(x) 15326 return true 15327 } 15328 return false 15329 } 15330 func rewriteValueARM_OpARMTSTshiftLLreg_0(v *Value) bool { 15331 b := v.Block 15332 // match: (TSTshiftLLreg (MOVWconst [c]) x y) 15333 // result: (TSTconst [c] (SLL <x.Type> x y)) 15334 for { 15335 y := v.Args[2] 15336 v_0 := v.Args[0] 15337 if v_0.Op != OpARMMOVWconst { 15338 break 15339 } 15340 c := v_0.AuxInt 15341 x := v.Args[1] 15342 v.reset(OpARMTSTconst) 15343 v.AuxInt = c 15344 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 15345 v0.AddArg(x) 15346 v0.AddArg(y) 15347 v.AddArg(v0) 15348 return true 15349 } 15350 // match: (TSTshiftLLreg x y (MOVWconst [c])) 15351 // result: (TSTshiftLL x y [c]) 15352 for { 15353 _ = v.Args[2] 15354 x := v.Args[0] 15355 y := v.Args[1] 15356 v_2 := v.Args[2] 15357 if v_2.Op != OpARMMOVWconst { 15358 break 15359 } 15360 c := v_2.AuxInt 15361 v.reset(OpARMTSTshiftLL) 15362 v.AuxInt = c 15363 v.AddArg(x) 15364 v.AddArg(y) 15365 return true 15366 } 15367 return false 15368 } 15369 func rewriteValueARM_OpARMTSTshiftRA_0(v *Value) bool { 15370 b := v.Block 15371 // match: (TSTshiftRA (MOVWconst [c]) x [d]) 15372 // result: (TSTconst [c] (SRAconst <x.Type> x [d])) 15373 for { 15374 d := v.AuxInt 15375 x := v.Args[1] 15376 v_0 := v.Args[0] 15377 if v_0.Op != OpARMMOVWconst { 15378 break 15379 } 15380 c := v_0.AuxInt 15381 v.reset(OpARMTSTconst) 15382 v.AuxInt = c 15383 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 15384 v0.AuxInt = d 15385 v0.AddArg(x) 15386 v.AddArg(v0) 15387 return true 15388 } 15389 // match: (TSTshiftRA x (MOVWconst [c]) [d]) 15390 // result: (TSTconst x [int64(int32(c)>>uint64(d))]) 15391 for { 15392 d := v.AuxInt 15393 _ = v.Args[1] 15394 x := v.Args[0] 15395 v_1 := v.Args[1] 15396 if v_1.Op != OpARMMOVWconst { 15397 break 15398 } 15399 c := v_1.AuxInt 15400 v.reset(OpARMTSTconst) 15401 v.AuxInt = int64(int32(c) >> uint64(d)) 15402 v.AddArg(x) 15403 return true 15404 } 15405 return false 15406 } 15407 func rewriteValueARM_OpARMTSTshiftRAreg_0(v *Value) bool { 15408 b := v.Block 15409 // match: (TSTshiftRAreg (MOVWconst [c]) x y) 15410 // result: (TSTconst [c] (SRA <x.Type> x y)) 15411 for { 15412 y := v.Args[2] 15413 v_0 := v.Args[0] 15414 if v_0.Op != OpARMMOVWconst { 15415 break 15416 } 15417 c := v_0.AuxInt 15418 x := v.Args[1] 15419 v.reset(OpARMTSTconst) 15420 v.AuxInt = c 15421 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 15422 v0.AddArg(x) 15423 v0.AddArg(y) 15424 v.AddArg(v0) 15425 return true 15426 } 15427 // match: (TSTshiftRAreg x y (MOVWconst [c])) 15428 // result: (TSTshiftRA x y [c]) 15429 for { 15430 _ = v.Args[2] 15431 x := v.Args[0] 15432 y := v.Args[1] 15433 v_2 := v.Args[2] 15434 if v_2.Op != OpARMMOVWconst { 15435 break 15436 } 15437 c := v_2.AuxInt 15438 v.reset(OpARMTSTshiftRA) 15439 v.AuxInt = c 15440 v.AddArg(x) 15441 v.AddArg(y) 15442 return true 15443 } 15444 return false 15445 } 15446 func rewriteValueARM_OpARMTSTshiftRL_0(v *Value) bool { 15447 b := v.Block 15448 // match: (TSTshiftRL (MOVWconst [c]) x [d]) 15449 // result: (TSTconst [c] (SRLconst <x.Type> x [d])) 15450 for { 15451 d := v.AuxInt 15452 x := v.Args[1] 15453 v_0 := v.Args[0] 15454 if v_0.Op != OpARMMOVWconst { 15455 break 15456 } 15457 c := v_0.AuxInt 15458 v.reset(OpARMTSTconst) 15459 v.AuxInt = c 15460 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 15461 v0.AuxInt = d 15462 v0.AddArg(x) 15463 v.AddArg(v0) 15464 return true 15465 } 15466 // match: (TSTshiftRL x (MOVWconst [c]) [d]) 15467 // result: (TSTconst x [int64(int32(uint32(c)>>uint64(d)))]) 15468 for { 15469 d := v.AuxInt 15470 _ = v.Args[1] 15471 x := v.Args[0] 15472 v_1 := v.Args[1] 15473 if v_1.Op != OpARMMOVWconst { 15474 break 15475 } 15476 c := v_1.AuxInt 15477 v.reset(OpARMTSTconst) 15478 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 15479 v.AddArg(x) 15480 return true 15481 } 15482 return false 15483 } 15484 func rewriteValueARM_OpARMTSTshiftRLreg_0(v *Value) bool { 15485 b := v.Block 15486 // match: (TSTshiftRLreg (MOVWconst [c]) x y) 15487 // result: (TSTconst [c] (SRL <x.Type> x y)) 15488 for { 15489 y := v.Args[2] 15490 v_0 := v.Args[0] 15491 if v_0.Op != OpARMMOVWconst { 15492 break 15493 } 15494 c := v_0.AuxInt 15495 x := v.Args[1] 15496 v.reset(OpARMTSTconst) 15497 v.AuxInt = c 15498 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 15499 v0.AddArg(x) 15500 v0.AddArg(y) 15501 v.AddArg(v0) 15502 return true 15503 } 15504 // match: (TSTshiftRLreg x y (MOVWconst [c])) 15505 // result: (TSTshiftRL x y [c]) 15506 for { 15507 _ = v.Args[2] 15508 x := v.Args[0] 15509 y := v.Args[1] 15510 v_2 := v.Args[2] 15511 if v_2.Op != OpARMMOVWconst { 15512 break 15513 } 15514 c := v_2.AuxInt 15515 v.reset(OpARMTSTshiftRL) 15516 v.AuxInt = c 15517 v.AddArg(x) 15518 v.AddArg(y) 15519 return true 15520 } 15521 return false 15522 } 15523 func rewriteValueARM_OpARMXOR_0(v *Value) bool { 15524 // match: (XOR x (MOVWconst [c])) 15525 // result: (XORconst [c] x) 15526 for { 15527 _ = v.Args[1] 15528 x := v.Args[0] 15529 v_1 := v.Args[1] 15530 if v_1.Op != OpARMMOVWconst { 15531 break 15532 } 15533 c := v_1.AuxInt 15534 v.reset(OpARMXORconst) 15535 v.AuxInt = c 15536 v.AddArg(x) 15537 return true 15538 } 15539 // match: (XOR (MOVWconst [c]) x) 15540 // result: (XORconst [c] x) 15541 for { 15542 x := v.Args[1] 15543 v_0 := v.Args[0] 15544 if v_0.Op != OpARMMOVWconst { 15545 break 15546 } 15547 c := v_0.AuxInt 15548 v.reset(OpARMXORconst) 15549 v.AuxInt = c 15550 v.AddArg(x) 15551 return true 15552 } 15553 // match: (XOR x (SLLconst [c] y)) 15554 // result: (XORshiftLL x y [c]) 15555 for { 15556 _ = v.Args[1] 15557 x := v.Args[0] 15558 v_1 := v.Args[1] 15559 if v_1.Op != OpARMSLLconst { 15560 break 15561 } 15562 c := v_1.AuxInt 15563 y := v_1.Args[0] 15564 v.reset(OpARMXORshiftLL) 15565 v.AuxInt = c 15566 v.AddArg(x) 15567 v.AddArg(y) 15568 return true 15569 } 15570 // match: (XOR (SLLconst [c] y) x) 15571 // result: (XORshiftLL x y [c]) 15572 for { 15573 x := v.Args[1] 15574 v_0 := v.Args[0] 15575 if v_0.Op != OpARMSLLconst { 15576 break 15577 } 15578 c := v_0.AuxInt 15579 y := v_0.Args[0] 15580 v.reset(OpARMXORshiftLL) 15581 v.AuxInt = c 15582 v.AddArg(x) 15583 v.AddArg(y) 15584 return true 15585 } 15586 // match: (XOR x (SRLconst [c] y)) 15587 // result: (XORshiftRL x y [c]) 15588 for { 15589 _ = v.Args[1] 15590 x := v.Args[0] 15591 v_1 := v.Args[1] 15592 if v_1.Op != OpARMSRLconst { 15593 break 15594 } 15595 c := v_1.AuxInt 15596 y := v_1.Args[0] 15597 v.reset(OpARMXORshiftRL) 15598 v.AuxInt = c 15599 v.AddArg(x) 15600 v.AddArg(y) 15601 return true 15602 } 15603 // match: (XOR (SRLconst [c] y) x) 15604 // result: (XORshiftRL x y [c]) 15605 for { 15606 x := v.Args[1] 15607 v_0 := v.Args[0] 15608 if v_0.Op != OpARMSRLconst { 15609 break 15610 } 15611 c := v_0.AuxInt 15612 y := v_0.Args[0] 15613 v.reset(OpARMXORshiftRL) 15614 v.AuxInt = c 15615 v.AddArg(x) 15616 v.AddArg(y) 15617 return true 15618 } 15619 // match: (XOR x (SRAconst [c] y)) 15620 // result: (XORshiftRA x y [c]) 15621 for { 15622 _ = v.Args[1] 15623 x := v.Args[0] 15624 v_1 := v.Args[1] 15625 if v_1.Op != OpARMSRAconst { 15626 break 15627 } 15628 c := v_1.AuxInt 15629 y := v_1.Args[0] 15630 v.reset(OpARMXORshiftRA) 15631 v.AuxInt = c 15632 v.AddArg(x) 15633 v.AddArg(y) 15634 return true 15635 } 15636 // match: (XOR (SRAconst [c] y) x) 15637 // result: (XORshiftRA x y [c]) 15638 for { 15639 x := v.Args[1] 15640 v_0 := v.Args[0] 15641 if v_0.Op != OpARMSRAconst { 15642 break 15643 } 15644 c := v_0.AuxInt 15645 y := v_0.Args[0] 15646 v.reset(OpARMXORshiftRA) 15647 v.AuxInt = c 15648 v.AddArg(x) 15649 v.AddArg(y) 15650 return true 15651 } 15652 // match: (XOR x (SRRconst [c] y)) 15653 // result: (XORshiftRR x y [c]) 15654 for { 15655 _ = v.Args[1] 15656 x := v.Args[0] 15657 v_1 := v.Args[1] 15658 if v_1.Op != OpARMSRRconst { 15659 break 15660 } 15661 c := v_1.AuxInt 15662 y := v_1.Args[0] 15663 v.reset(OpARMXORshiftRR) 15664 v.AuxInt = c 15665 v.AddArg(x) 15666 v.AddArg(y) 15667 return true 15668 } 15669 // match: (XOR (SRRconst [c] y) x) 15670 // result: (XORshiftRR x y [c]) 15671 for { 15672 x := v.Args[1] 15673 v_0 := v.Args[0] 15674 if v_0.Op != OpARMSRRconst { 15675 break 15676 } 15677 c := v_0.AuxInt 15678 y := v_0.Args[0] 15679 v.reset(OpARMXORshiftRR) 15680 v.AuxInt = c 15681 v.AddArg(x) 15682 v.AddArg(y) 15683 return true 15684 } 15685 return false 15686 } 15687 func rewriteValueARM_OpARMXOR_10(v *Value) bool { 15688 // match: (XOR x (SLL y z)) 15689 // result: (XORshiftLLreg x y z) 15690 for { 15691 _ = v.Args[1] 15692 x := v.Args[0] 15693 v_1 := v.Args[1] 15694 if v_1.Op != OpARMSLL { 15695 break 15696 } 15697 z := v_1.Args[1] 15698 y := v_1.Args[0] 15699 v.reset(OpARMXORshiftLLreg) 15700 v.AddArg(x) 15701 v.AddArg(y) 15702 v.AddArg(z) 15703 return true 15704 } 15705 // match: (XOR (SLL y z) x) 15706 // result: (XORshiftLLreg x y z) 15707 for { 15708 x := v.Args[1] 15709 v_0 := v.Args[0] 15710 if v_0.Op != OpARMSLL { 15711 break 15712 } 15713 z := v_0.Args[1] 15714 y := v_0.Args[0] 15715 v.reset(OpARMXORshiftLLreg) 15716 v.AddArg(x) 15717 v.AddArg(y) 15718 v.AddArg(z) 15719 return true 15720 } 15721 // match: (XOR x (SRL y z)) 15722 // result: (XORshiftRLreg x y z) 15723 for { 15724 _ = v.Args[1] 15725 x := v.Args[0] 15726 v_1 := v.Args[1] 15727 if v_1.Op != OpARMSRL { 15728 break 15729 } 15730 z := v_1.Args[1] 15731 y := v_1.Args[0] 15732 v.reset(OpARMXORshiftRLreg) 15733 v.AddArg(x) 15734 v.AddArg(y) 15735 v.AddArg(z) 15736 return true 15737 } 15738 // match: (XOR (SRL y z) x) 15739 // result: (XORshiftRLreg x y z) 15740 for { 15741 x := v.Args[1] 15742 v_0 := v.Args[0] 15743 if v_0.Op != OpARMSRL { 15744 break 15745 } 15746 z := v_0.Args[1] 15747 y := v_0.Args[0] 15748 v.reset(OpARMXORshiftRLreg) 15749 v.AddArg(x) 15750 v.AddArg(y) 15751 v.AddArg(z) 15752 return true 15753 } 15754 // match: (XOR x (SRA y z)) 15755 // result: (XORshiftRAreg x y z) 15756 for { 15757 _ = v.Args[1] 15758 x := v.Args[0] 15759 v_1 := v.Args[1] 15760 if v_1.Op != OpARMSRA { 15761 break 15762 } 15763 z := v_1.Args[1] 15764 y := v_1.Args[0] 15765 v.reset(OpARMXORshiftRAreg) 15766 v.AddArg(x) 15767 v.AddArg(y) 15768 v.AddArg(z) 15769 return true 15770 } 15771 // match: (XOR (SRA y z) x) 15772 // result: (XORshiftRAreg x y z) 15773 for { 15774 x := v.Args[1] 15775 v_0 := v.Args[0] 15776 if v_0.Op != OpARMSRA { 15777 break 15778 } 15779 z := v_0.Args[1] 15780 y := v_0.Args[0] 15781 v.reset(OpARMXORshiftRAreg) 15782 v.AddArg(x) 15783 v.AddArg(y) 15784 v.AddArg(z) 15785 return true 15786 } 15787 // match: (XOR x x) 15788 // result: (MOVWconst [0]) 15789 for { 15790 x := v.Args[1] 15791 if x != v.Args[0] { 15792 break 15793 } 15794 v.reset(OpARMMOVWconst) 15795 v.AuxInt = 0 15796 return true 15797 } 15798 return false 15799 } 15800 func rewriteValueARM_OpARMXORconst_0(v *Value) bool { 15801 // match: (XORconst [0] x) 15802 // result: x 15803 for { 15804 if v.AuxInt != 0 { 15805 break 15806 } 15807 x := v.Args[0] 15808 v.reset(OpCopy) 15809 v.Type = x.Type 15810 v.AddArg(x) 15811 return true 15812 } 15813 // match: (XORconst [c] (MOVWconst [d])) 15814 // result: (MOVWconst [c^d]) 15815 for { 15816 c := v.AuxInt 15817 v_0 := v.Args[0] 15818 if v_0.Op != OpARMMOVWconst { 15819 break 15820 } 15821 d := v_0.AuxInt 15822 v.reset(OpARMMOVWconst) 15823 v.AuxInt = c ^ d 15824 return true 15825 } 15826 // match: (XORconst [c] (XORconst [d] x)) 15827 // result: (XORconst [c^d] x) 15828 for { 15829 c := v.AuxInt 15830 v_0 := v.Args[0] 15831 if v_0.Op != OpARMXORconst { 15832 break 15833 } 15834 d := v_0.AuxInt 15835 x := v_0.Args[0] 15836 v.reset(OpARMXORconst) 15837 v.AuxInt = c ^ d 15838 v.AddArg(x) 15839 return true 15840 } 15841 return false 15842 } 15843 func rewriteValueARM_OpARMXORshiftLL_0(v *Value) bool { 15844 b := v.Block 15845 typ := &b.Func.Config.Types 15846 // match: (XORshiftLL (MOVWconst [c]) x [d]) 15847 // result: (XORconst [c] (SLLconst <x.Type> x [d])) 15848 for { 15849 d := v.AuxInt 15850 x := v.Args[1] 15851 v_0 := v.Args[0] 15852 if v_0.Op != OpARMMOVWconst { 15853 break 15854 } 15855 c := v_0.AuxInt 15856 v.reset(OpARMXORconst) 15857 v.AuxInt = c 15858 v0 := b.NewValue0(v.Pos, OpARMSLLconst, x.Type) 15859 v0.AuxInt = d 15860 v0.AddArg(x) 15861 v.AddArg(v0) 15862 return true 15863 } 15864 // match: (XORshiftLL x (MOVWconst [c]) [d]) 15865 // result: (XORconst x [int64(int32(uint32(c)<<uint64(d)))]) 15866 for { 15867 d := v.AuxInt 15868 _ = v.Args[1] 15869 x := v.Args[0] 15870 v_1 := v.Args[1] 15871 if v_1.Op != OpARMMOVWconst { 15872 break 15873 } 15874 c := v_1.AuxInt 15875 v.reset(OpARMXORconst) 15876 v.AuxInt = int64(int32(uint32(c) << uint64(d))) 15877 v.AddArg(x) 15878 return true 15879 } 15880 // match: (XORshiftLL [c] (SRLconst x [32-c]) x) 15881 // result: (SRRconst [32-c] x) 15882 for { 15883 c := v.AuxInt 15884 x := v.Args[1] 15885 v_0 := v.Args[0] 15886 if v_0.Op != OpARMSRLconst || v_0.AuxInt != 32-c || x != v_0.Args[0] { 15887 break 15888 } 15889 v.reset(OpARMSRRconst) 15890 v.AuxInt = 32 - c 15891 v.AddArg(x) 15892 return true 15893 } 15894 // match: (XORshiftLL <typ.UInt16> [8] (BFXU <typ.UInt16> [armBFAuxInt(8, 8)] x) x) 15895 // result: (REV16 x) 15896 for { 15897 if v.Type != typ.UInt16 || v.AuxInt != 8 { 15898 break 15899 } 15900 x := v.Args[1] 15901 v_0 := v.Args[0] 15902 if v_0.Op != OpARMBFXU || v_0.Type != typ.UInt16 || v_0.AuxInt != armBFAuxInt(8, 8) || x != v_0.Args[0] { 15903 break 15904 } 15905 v.reset(OpARMREV16) 15906 v.AddArg(x) 15907 return true 15908 } 15909 // match: (XORshiftLL <typ.UInt16> [8] (SRLconst <typ.UInt16> [24] (SLLconst [16] x)) x) 15910 // cond: objabi.GOARM>=6 15911 // result: (REV16 x) 15912 for { 15913 if v.Type != typ.UInt16 || v.AuxInt != 8 { 15914 break 15915 } 15916 x := v.Args[1] 15917 v_0 := v.Args[0] 15918 if v_0.Op != OpARMSRLconst || v_0.Type != typ.UInt16 || v_0.AuxInt != 24 { 15919 break 15920 } 15921 v_0_0 := v_0.Args[0] 15922 if v_0_0.Op != OpARMSLLconst || v_0_0.AuxInt != 16 || x != v_0_0.Args[0] || !(objabi.GOARM >= 6) { 15923 break 15924 } 15925 v.reset(OpARMREV16) 15926 v.AddArg(x) 15927 return true 15928 } 15929 // match: (XORshiftLL x (SLLconst x [c]) [d]) 15930 // cond: c==d 15931 // result: (MOVWconst [0]) 15932 for { 15933 d := v.AuxInt 15934 _ = v.Args[1] 15935 x := v.Args[0] 15936 v_1 := v.Args[1] 15937 if v_1.Op != OpARMSLLconst { 15938 break 15939 } 15940 c := v_1.AuxInt 15941 if x != v_1.Args[0] || !(c == d) { 15942 break 15943 } 15944 v.reset(OpARMMOVWconst) 15945 v.AuxInt = 0 15946 return true 15947 } 15948 return false 15949 } 15950 func rewriteValueARM_OpARMXORshiftLLreg_0(v *Value) bool { 15951 b := v.Block 15952 // match: (XORshiftLLreg (MOVWconst [c]) x y) 15953 // result: (XORconst [c] (SLL <x.Type> x y)) 15954 for { 15955 y := v.Args[2] 15956 v_0 := v.Args[0] 15957 if v_0.Op != OpARMMOVWconst { 15958 break 15959 } 15960 c := v_0.AuxInt 15961 x := v.Args[1] 15962 v.reset(OpARMXORconst) 15963 v.AuxInt = c 15964 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 15965 v0.AddArg(x) 15966 v0.AddArg(y) 15967 v.AddArg(v0) 15968 return true 15969 } 15970 // match: (XORshiftLLreg x y (MOVWconst [c])) 15971 // result: (XORshiftLL x y [c]) 15972 for { 15973 _ = v.Args[2] 15974 x := v.Args[0] 15975 y := v.Args[1] 15976 v_2 := v.Args[2] 15977 if v_2.Op != OpARMMOVWconst { 15978 break 15979 } 15980 c := v_2.AuxInt 15981 v.reset(OpARMXORshiftLL) 15982 v.AuxInt = c 15983 v.AddArg(x) 15984 v.AddArg(y) 15985 return true 15986 } 15987 return false 15988 } 15989 func rewriteValueARM_OpARMXORshiftRA_0(v *Value) bool { 15990 b := v.Block 15991 // match: (XORshiftRA (MOVWconst [c]) x [d]) 15992 // result: (XORconst [c] (SRAconst <x.Type> x [d])) 15993 for { 15994 d := v.AuxInt 15995 x := v.Args[1] 15996 v_0 := v.Args[0] 15997 if v_0.Op != OpARMMOVWconst { 15998 break 15999 } 16000 c := v_0.AuxInt 16001 v.reset(OpARMXORconst) 16002 v.AuxInt = c 16003 v0 := b.NewValue0(v.Pos, OpARMSRAconst, x.Type) 16004 v0.AuxInt = d 16005 v0.AddArg(x) 16006 v.AddArg(v0) 16007 return true 16008 } 16009 // match: (XORshiftRA x (MOVWconst [c]) [d]) 16010 // result: (XORconst x [int64(int32(c)>>uint64(d))]) 16011 for { 16012 d := v.AuxInt 16013 _ = v.Args[1] 16014 x := v.Args[0] 16015 v_1 := v.Args[1] 16016 if v_1.Op != OpARMMOVWconst { 16017 break 16018 } 16019 c := v_1.AuxInt 16020 v.reset(OpARMXORconst) 16021 v.AuxInt = int64(int32(c) >> uint64(d)) 16022 v.AddArg(x) 16023 return true 16024 } 16025 // match: (XORshiftRA x (SRAconst x [c]) [d]) 16026 // cond: c==d 16027 // result: (MOVWconst [0]) 16028 for { 16029 d := v.AuxInt 16030 _ = v.Args[1] 16031 x := v.Args[0] 16032 v_1 := v.Args[1] 16033 if v_1.Op != OpARMSRAconst { 16034 break 16035 } 16036 c := v_1.AuxInt 16037 if x != v_1.Args[0] || !(c == d) { 16038 break 16039 } 16040 v.reset(OpARMMOVWconst) 16041 v.AuxInt = 0 16042 return true 16043 } 16044 return false 16045 } 16046 func rewriteValueARM_OpARMXORshiftRAreg_0(v *Value) bool { 16047 b := v.Block 16048 // match: (XORshiftRAreg (MOVWconst [c]) x y) 16049 // result: (XORconst [c] (SRA <x.Type> x y)) 16050 for { 16051 y := v.Args[2] 16052 v_0 := v.Args[0] 16053 if v_0.Op != OpARMMOVWconst { 16054 break 16055 } 16056 c := v_0.AuxInt 16057 x := v.Args[1] 16058 v.reset(OpARMXORconst) 16059 v.AuxInt = c 16060 v0 := b.NewValue0(v.Pos, OpARMSRA, x.Type) 16061 v0.AddArg(x) 16062 v0.AddArg(y) 16063 v.AddArg(v0) 16064 return true 16065 } 16066 // match: (XORshiftRAreg x y (MOVWconst [c])) 16067 // result: (XORshiftRA x y [c]) 16068 for { 16069 _ = v.Args[2] 16070 x := v.Args[0] 16071 y := v.Args[1] 16072 v_2 := v.Args[2] 16073 if v_2.Op != OpARMMOVWconst { 16074 break 16075 } 16076 c := v_2.AuxInt 16077 v.reset(OpARMXORshiftRA) 16078 v.AuxInt = c 16079 v.AddArg(x) 16080 v.AddArg(y) 16081 return true 16082 } 16083 return false 16084 } 16085 func rewriteValueARM_OpARMXORshiftRL_0(v *Value) bool { 16086 b := v.Block 16087 // match: (XORshiftRL (MOVWconst [c]) x [d]) 16088 // result: (XORconst [c] (SRLconst <x.Type> x [d])) 16089 for { 16090 d := v.AuxInt 16091 x := v.Args[1] 16092 v_0 := v.Args[0] 16093 if v_0.Op != OpARMMOVWconst { 16094 break 16095 } 16096 c := v_0.AuxInt 16097 v.reset(OpARMXORconst) 16098 v.AuxInt = c 16099 v0 := b.NewValue0(v.Pos, OpARMSRLconst, x.Type) 16100 v0.AuxInt = d 16101 v0.AddArg(x) 16102 v.AddArg(v0) 16103 return true 16104 } 16105 // match: (XORshiftRL x (MOVWconst [c]) [d]) 16106 // result: (XORconst x [int64(int32(uint32(c)>>uint64(d)))]) 16107 for { 16108 d := v.AuxInt 16109 _ = v.Args[1] 16110 x := v.Args[0] 16111 v_1 := v.Args[1] 16112 if v_1.Op != OpARMMOVWconst { 16113 break 16114 } 16115 c := v_1.AuxInt 16116 v.reset(OpARMXORconst) 16117 v.AuxInt = int64(int32(uint32(c) >> uint64(d))) 16118 v.AddArg(x) 16119 return true 16120 } 16121 // match: (XORshiftRL [c] (SLLconst x [32-c]) x) 16122 // result: (SRRconst [ c] x) 16123 for { 16124 c := v.AuxInt 16125 x := v.Args[1] 16126 v_0 := v.Args[0] 16127 if v_0.Op != OpARMSLLconst || v_0.AuxInt != 32-c || x != v_0.Args[0] { 16128 break 16129 } 16130 v.reset(OpARMSRRconst) 16131 v.AuxInt = c 16132 v.AddArg(x) 16133 return true 16134 } 16135 // match: (XORshiftRL x (SRLconst x [c]) [d]) 16136 // cond: c==d 16137 // result: (MOVWconst [0]) 16138 for { 16139 d := v.AuxInt 16140 _ = v.Args[1] 16141 x := v.Args[0] 16142 v_1 := v.Args[1] 16143 if v_1.Op != OpARMSRLconst { 16144 break 16145 } 16146 c := v_1.AuxInt 16147 if x != v_1.Args[0] || !(c == d) { 16148 break 16149 } 16150 v.reset(OpARMMOVWconst) 16151 v.AuxInt = 0 16152 return true 16153 } 16154 return false 16155 } 16156 func rewriteValueARM_OpARMXORshiftRLreg_0(v *Value) bool { 16157 b := v.Block 16158 // match: (XORshiftRLreg (MOVWconst [c]) x y) 16159 // result: (XORconst [c] (SRL <x.Type> x y)) 16160 for { 16161 y := v.Args[2] 16162 v_0 := v.Args[0] 16163 if v_0.Op != OpARMMOVWconst { 16164 break 16165 } 16166 c := v_0.AuxInt 16167 x := v.Args[1] 16168 v.reset(OpARMXORconst) 16169 v.AuxInt = c 16170 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 16171 v0.AddArg(x) 16172 v0.AddArg(y) 16173 v.AddArg(v0) 16174 return true 16175 } 16176 // match: (XORshiftRLreg x y (MOVWconst [c])) 16177 // result: (XORshiftRL x y [c]) 16178 for { 16179 _ = v.Args[2] 16180 x := v.Args[0] 16181 y := v.Args[1] 16182 v_2 := v.Args[2] 16183 if v_2.Op != OpARMMOVWconst { 16184 break 16185 } 16186 c := v_2.AuxInt 16187 v.reset(OpARMXORshiftRL) 16188 v.AuxInt = c 16189 v.AddArg(x) 16190 v.AddArg(y) 16191 return true 16192 } 16193 return false 16194 } 16195 func rewriteValueARM_OpARMXORshiftRR_0(v *Value) bool { 16196 b := v.Block 16197 // match: (XORshiftRR (MOVWconst [c]) x [d]) 16198 // result: (XORconst [c] (SRRconst <x.Type> x [d])) 16199 for { 16200 d := v.AuxInt 16201 x := v.Args[1] 16202 v_0 := v.Args[0] 16203 if v_0.Op != OpARMMOVWconst { 16204 break 16205 } 16206 c := v_0.AuxInt 16207 v.reset(OpARMXORconst) 16208 v.AuxInt = c 16209 v0 := b.NewValue0(v.Pos, OpARMSRRconst, x.Type) 16210 v0.AuxInt = d 16211 v0.AddArg(x) 16212 v.AddArg(v0) 16213 return true 16214 } 16215 // match: (XORshiftRR x (MOVWconst [c]) [d]) 16216 // result: (XORconst x [int64(int32(uint32(c)>>uint64(d)|uint32(c)<<uint64(32-d)))]) 16217 for { 16218 d := v.AuxInt 16219 _ = v.Args[1] 16220 x := v.Args[0] 16221 v_1 := v.Args[1] 16222 if v_1.Op != OpARMMOVWconst { 16223 break 16224 } 16225 c := v_1.AuxInt 16226 v.reset(OpARMXORconst) 16227 v.AuxInt = int64(int32(uint32(c)>>uint64(d) | uint32(c)<<uint64(32-d))) 16228 v.AddArg(x) 16229 return true 16230 } 16231 return false 16232 } 16233 func rewriteValueARM_OpAbs_0(v *Value) bool { 16234 // match: (Abs x) 16235 // result: (ABSD x) 16236 for { 16237 x := v.Args[0] 16238 v.reset(OpARMABSD) 16239 v.AddArg(x) 16240 return true 16241 } 16242 } 16243 func rewriteValueARM_OpAdd16_0(v *Value) bool { 16244 // match: (Add16 x y) 16245 // result: (ADD x y) 16246 for { 16247 y := v.Args[1] 16248 x := v.Args[0] 16249 v.reset(OpARMADD) 16250 v.AddArg(x) 16251 v.AddArg(y) 16252 return true 16253 } 16254 } 16255 func rewriteValueARM_OpAdd32_0(v *Value) bool { 16256 // match: (Add32 x y) 16257 // result: (ADD x y) 16258 for { 16259 y := v.Args[1] 16260 x := v.Args[0] 16261 v.reset(OpARMADD) 16262 v.AddArg(x) 16263 v.AddArg(y) 16264 return true 16265 } 16266 } 16267 func rewriteValueARM_OpAdd32F_0(v *Value) bool { 16268 // match: (Add32F x y) 16269 // result: (ADDF x y) 16270 for { 16271 y := v.Args[1] 16272 x := v.Args[0] 16273 v.reset(OpARMADDF) 16274 v.AddArg(x) 16275 v.AddArg(y) 16276 return true 16277 } 16278 } 16279 func rewriteValueARM_OpAdd32carry_0(v *Value) bool { 16280 // match: (Add32carry x y) 16281 // result: (ADDS x y) 16282 for { 16283 y := v.Args[1] 16284 x := v.Args[0] 16285 v.reset(OpARMADDS) 16286 v.AddArg(x) 16287 v.AddArg(y) 16288 return true 16289 } 16290 } 16291 func rewriteValueARM_OpAdd32withcarry_0(v *Value) bool { 16292 // match: (Add32withcarry x y c) 16293 // result: (ADC x y c) 16294 for { 16295 c := v.Args[2] 16296 x := v.Args[0] 16297 y := v.Args[1] 16298 v.reset(OpARMADC) 16299 v.AddArg(x) 16300 v.AddArg(y) 16301 v.AddArg(c) 16302 return true 16303 } 16304 } 16305 func rewriteValueARM_OpAdd64F_0(v *Value) bool { 16306 // match: (Add64F x y) 16307 // result: (ADDD x y) 16308 for { 16309 y := v.Args[1] 16310 x := v.Args[0] 16311 v.reset(OpARMADDD) 16312 v.AddArg(x) 16313 v.AddArg(y) 16314 return true 16315 } 16316 } 16317 func rewriteValueARM_OpAdd8_0(v *Value) bool { 16318 // match: (Add8 x y) 16319 // result: (ADD x y) 16320 for { 16321 y := v.Args[1] 16322 x := v.Args[0] 16323 v.reset(OpARMADD) 16324 v.AddArg(x) 16325 v.AddArg(y) 16326 return true 16327 } 16328 } 16329 func rewriteValueARM_OpAddPtr_0(v *Value) bool { 16330 // match: (AddPtr x y) 16331 // result: (ADD x y) 16332 for { 16333 y := v.Args[1] 16334 x := v.Args[0] 16335 v.reset(OpARMADD) 16336 v.AddArg(x) 16337 v.AddArg(y) 16338 return true 16339 } 16340 } 16341 func rewriteValueARM_OpAddr_0(v *Value) bool { 16342 // match: (Addr {sym} base) 16343 // result: (MOVWaddr {sym} base) 16344 for { 16345 sym := v.Aux 16346 base := v.Args[0] 16347 v.reset(OpARMMOVWaddr) 16348 v.Aux = sym 16349 v.AddArg(base) 16350 return true 16351 } 16352 } 16353 func rewriteValueARM_OpAnd16_0(v *Value) bool { 16354 // match: (And16 x y) 16355 // result: (AND x y) 16356 for { 16357 y := v.Args[1] 16358 x := v.Args[0] 16359 v.reset(OpARMAND) 16360 v.AddArg(x) 16361 v.AddArg(y) 16362 return true 16363 } 16364 } 16365 func rewriteValueARM_OpAnd32_0(v *Value) bool { 16366 // match: (And32 x y) 16367 // result: (AND x y) 16368 for { 16369 y := v.Args[1] 16370 x := v.Args[0] 16371 v.reset(OpARMAND) 16372 v.AddArg(x) 16373 v.AddArg(y) 16374 return true 16375 } 16376 } 16377 func rewriteValueARM_OpAnd8_0(v *Value) bool { 16378 // match: (And8 x y) 16379 // result: (AND x y) 16380 for { 16381 y := v.Args[1] 16382 x := v.Args[0] 16383 v.reset(OpARMAND) 16384 v.AddArg(x) 16385 v.AddArg(y) 16386 return true 16387 } 16388 } 16389 func rewriteValueARM_OpAndB_0(v *Value) bool { 16390 // match: (AndB x y) 16391 // result: (AND x y) 16392 for { 16393 y := v.Args[1] 16394 x := v.Args[0] 16395 v.reset(OpARMAND) 16396 v.AddArg(x) 16397 v.AddArg(y) 16398 return true 16399 } 16400 } 16401 func rewriteValueARM_OpAvg32u_0(v *Value) bool { 16402 b := v.Block 16403 // match: (Avg32u <t> x y) 16404 // result: (ADD (SRLconst <t> (SUB <t> x y) [1]) y) 16405 for { 16406 t := v.Type 16407 y := v.Args[1] 16408 x := v.Args[0] 16409 v.reset(OpARMADD) 16410 v0 := b.NewValue0(v.Pos, OpARMSRLconst, t) 16411 v0.AuxInt = 1 16412 v1 := b.NewValue0(v.Pos, OpARMSUB, t) 16413 v1.AddArg(x) 16414 v1.AddArg(y) 16415 v0.AddArg(v1) 16416 v.AddArg(v0) 16417 v.AddArg(y) 16418 return true 16419 } 16420 } 16421 func rewriteValueARM_OpBitLen32_0(v *Value) bool { 16422 b := v.Block 16423 // match: (BitLen32 <t> x) 16424 // result: (RSBconst [32] (CLZ <t> x)) 16425 for { 16426 t := v.Type 16427 x := v.Args[0] 16428 v.reset(OpARMRSBconst) 16429 v.AuxInt = 32 16430 v0 := b.NewValue0(v.Pos, OpARMCLZ, t) 16431 v0.AddArg(x) 16432 v.AddArg(v0) 16433 return true 16434 } 16435 } 16436 func rewriteValueARM_OpBswap32_0(v *Value) bool { 16437 b := v.Block 16438 // match: (Bswap32 <t> x) 16439 // cond: objabi.GOARM==5 16440 // result: (XOR <t> (SRLconst <t> (BICconst <t> (XOR <t> x (SRRconst <t> [16] x)) [0xff0000]) [8]) (SRRconst <t> x [8])) 16441 for { 16442 t := v.Type 16443 x := v.Args[0] 16444 if !(objabi.GOARM == 5) { 16445 break 16446 } 16447 v.reset(OpARMXOR) 16448 v.Type = t 16449 v0 := b.NewValue0(v.Pos, OpARMSRLconst, t) 16450 v0.AuxInt = 8 16451 v1 := b.NewValue0(v.Pos, OpARMBICconst, t) 16452 v1.AuxInt = 0xff0000 16453 v2 := b.NewValue0(v.Pos, OpARMXOR, t) 16454 v2.AddArg(x) 16455 v3 := b.NewValue0(v.Pos, OpARMSRRconst, t) 16456 v3.AuxInt = 16 16457 v3.AddArg(x) 16458 v2.AddArg(v3) 16459 v1.AddArg(v2) 16460 v0.AddArg(v1) 16461 v.AddArg(v0) 16462 v4 := b.NewValue0(v.Pos, OpARMSRRconst, t) 16463 v4.AuxInt = 8 16464 v4.AddArg(x) 16465 v.AddArg(v4) 16466 return true 16467 } 16468 // match: (Bswap32 x) 16469 // cond: objabi.GOARM>=6 16470 // result: (REV x) 16471 for { 16472 x := v.Args[0] 16473 if !(objabi.GOARM >= 6) { 16474 break 16475 } 16476 v.reset(OpARMREV) 16477 v.AddArg(x) 16478 return true 16479 } 16480 return false 16481 } 16482 func rewriteValueARM_OpClosureCall_0(v *Value) bool { 16483 // match: (ClosureCall [argwid] entry closure mem) 16484 // result: (CALLclosure [argwid] entry closure mem) 16485 for { 16486 argwid := v.AuxInt 16487 mem := v.Args[2] 16488 entry := v.Args[0] 16489 closure := v.Args[1] 16490 v.reset(OpARMCALLclosure) 16491 v.AuxInt = argwid 16492 v.AddArg(entry) 16493 v.AddArg(closure) 16494 v.AddArg(mem) 16495 return true 16496 } 16497 } 16498 func rewriteValueARM_OpCom16_0(v *Value) bool { 16499 // match: (Com16 x) 16500 // result: (MVN x) 16501 for { 16502 x := v.Args[0] 16503 v.reset(OpARMMVN) 16504 v.AddArg(x) 16505 return true 16506 } 16507 } 16508 func rewriteValueARM_OpCom32_0(v *Value) bool { 16509 // match: (Com32 x) 16510 // result: (MVN x) 16511 for { 16512 x := v.Args[0] 16513 v.reset(OpARMMVN) 16514 v.AddArg(x) 16515 return true 16516 } 16517 } 16518 func rewriteValueARM_OpCom8_0(v *Value) bool { 16519 // match: (Com8 x) 16520 // result: (MVN x) 16521 for { 16522 x := v.Args[0] 16523 v.reset(OpARMMVN) 16524 v.AddArg(x) 16525 return true 16526 } 16527 } 16528 func rewriteValueARM_OpConst16_0(v *Value) bool { 16529 // match: (Const16 [val]) 16530 // result: (MOVWconst [val]) 16531 for { 16532 val := v.AuxInt 16533 v.reset(OpARMMOVWconst) 16534 v.AuxInt = val 16535 return true 16536 } 16537 } 16538 func rewriteValueARM_OpConst32_0(v *Value) bool { 16539 // match: (Const32 [val]) 16540 // result: (MOVWconst [val]) 16541 for { 16542 val := v.AuxInt 16543 v.reset(OpARMMOVWconst) 16544 v.AuxInt = val 16545 return true 16546 } 16547 } 16548 func rewriteValueARM_OpConst32F_0(v *Value) bool { 16549 // match: (Const32F [val]) 16550 // result: (MOVFconst [val]) 16551 for { 16552 val := v.AuxInt 16553 v.reset(OpARMMOVFconst) 16554 v.AuxInt = val 16555 return true 16556 } 16557 } 16558 func rewriteValueARM_OpConst64F_0(v *Value) bool { 16559 // match: (Const64F [val]) 16560 // result: (MOVDconst [val]) 16561 for { 16562 val := v.AuxInt 16563 v.reset(OpARMMOVDconst) 16564 v.AuxInt = val 16565 return true 16566 } 16567 } 16568 func rewriteValueARM_OpConst8_0(v *Value) bool { 16569 // match: (Const8 [val]) 16570 // result: (MOVWconst [val]) 16571 for { 16572 val := v.AuxInt 16573 v.reset(OpARMMOVWconst) 16574 v.AuxInt = val 16575 return true 16576 } 16577 } 16578 func rewriteValueARM_OpConstBool_0(v *Value) bool { 16579 // match: (ConstBool [b]) 16580 // result: (MOVWconst [b]) 16581 for { 16582 b := v.AuxInt 16583 v.reset(OpARMMOVWconst) 16584 v.AuxInt = b 16585 return true 16586 } 16587 } 16588 func rewriteValueARM_OpConstNil_0(v *Value) bool { 16589 // match: (ConstNil) 16590 // result: (MOVWconst [0]) 16591 for { 16592 v.reset(OpARMMOVWconst) 16593 v.AuxInt = 0 16594 return true 16595 } 16596 } 16597 func rewriteValueARM_OpCtz16_0(v *Value) bool { 16598 b := v.Block 16599 typ := &b.Func.Config.Types 16600 // match: (Ctz16 <t> x) 16601 // cond: objabi.GOARM<=6 16602 // result: (RSBconst [32] (CLZ <t> (SUBconst <typ.UInt32> (AND <typ.UInt32> (ORconst <typ.UInt32> [0x10000] x) (RSBconst <typ.UInt32> [0] (ORconst <typ.UInt32> [0x10000] x))) [1]))) 16603 for { 16604 t := v.Type 16605 x := v.Args[0] 16606 if !(objabi.GOARM <= 6) { 16607 break 16608 } 16609 v.reset(OpARMRSBconst) 16610 v.AuxInt = 32 16611 v0 := b.NewValue0(v.Pos, OpARMCLZ, t) 16612 v1 := b.NewValue0(v.Pos, OpARMSUBconst, typ.UInt32) 16613 v1.AuxInt = 1 16614 v2 := b.NewValue0(v.Pos, OpARMAND, typ.UInt32) 16615 v3 := b.NewValue0(v.Pos, OpARMORconst, typ.UInt32) 16616 v3.AuxInt = 0x10000 16617 v3.AddArg(x) 16618 v2.AddArg(v3) 16619 v4 := b.NewValue0(v.Pos, OpARMRSBconst, typ.UInt32) 16620 v4.AuxInt = 0 16621 v5 := b.NewValue0(v.Pos, OpARMORconst, typ.UInt32) 16622 v5.AuxInt = 0x10000 16623 v5.AddArg(x) 16624 v4.AddArg(v5) 16625 v2.AddArg(v4) 16626 v1.AddArg(v2) 16627 v0.AddArg(v1) 16628 v.AddArg(v0) 16629 return true 16630 } 16631 // match: (Ctz16 <t> x) 16632 // cond: objabi.GOARM==7 16633 // result: (CLZ <t> (RBIT <typ.UInt32> (ORconst <typ.UInt32> [0x10000] x))) 16634 for { 16635 t := v.Type 16636 x := v.Args[0] 16637 if !(objabi.GOARM == 7) { 16638 break 16639 } 16640 v.reset(OpARMCLZ) 16641 v.Type = t 16642 v0 := b.NewValue0(v.Pos, OpARMRBIT, typ.UInt32) 16643 v1 := b.NewValue0(v.Pos, OpARMORconst, typ.UInt32) 16644 v1.AuxInt = 0x10000 16645 v1.AddArg(x) 16646 v0.AddArg(v1) 16647 v.AddArg(v0) 16648 return true 16649 } 16650 return false 16651 } 16652 func rewriteValueARM_OpCtz16NonZero_0(v *Value) bool { 16653 // match: (Ctz16NonZero x) 16654 // result: (Ctz32 x) 16655 for { 16656 x := v.Args[0] 16657 v.reset(OpCtz32) 16658 v.AddArg(x) 16659 return true 16660 } 16661 } 16662 func rewriteValueARM_OpCtz32_0(v *Value) bool { 16663 b := v.Block 16664 // match: (Ctz32 <t> x) 16665 // cond: objabi.GOARM<=6 16666 // result: (RSBconst [32] (CLZ <t> (SUBconst <t> (AND <t> x (RSBconst <t> [0] x)) [1]))) 16667 for { 16668 t := v.Type 16669 x := v.Args[0] 16670 if !(objabi.GOARM <= 6) { 16671 break 16672 } 16673 v.reset(OpARMRSBconst) 16674 v.AuxInt = 32 16675 v0 := b.NewValue0(v.Pos, OpARMCLZ, t) 16676 v1 := b.NewValue0(v.Pos, OpARMSUBconst, t) 16677 v1.AuxInt = 1 16678 v2 := b.NewValue0(v.Pos, OpARMAND, t) 16679 v2.AddArg(x) 16680 v3 := b.NewValue0(v.Pos, OpARMRSBconst, t) 16681 v3.AuxInt = 0 16682 v3.AddArg(x) 16683 v2.AddArg(v3) 16684 v1.AddArg(v2) 16685 v0.AddArg(v1) 16686 v.AddArg(v0) 16687 return true 16688 } 16689 // match: (Ctz32 <t> x) 16690 // cond: objabi.GOARM==7 16691 // result: (CLZ <t> (RBIT <t> x)) 16692 for { 16693 t := v.Type 16694 x := v.Args[0] 16695 if !(objabi.GOARM == 7) { 16696 break 16697 } 16698 v.reset(OpARMCLZ) 16699 v.Type = t 16700 v0 := b.NewValue0(v.Pos, OpARMRBIT, t) 16701 v0.AddArg(x) 16702 v.AddArg(v0) 16703 return true 16704 } 16705 return false 16706 } 16707 func rewriteValueARM_OpCtz32NonZero_0(v *Value) bool { 16708 // match: (Ctz32NonZero x) 16709 // result: (Ctz32 x) 16710 for { 16711 x := v.Args[0] 16712 v.reset(OpCtz32) 16713 v.AddArg(x) 16714 return true 16715 } 16716 } 16717 func rewriteValueARM_OpCtz8_0(v *Value) bool { 16718 b := v.Block 16719 typ := &b.Func.Config.Types 16720 // match: (Ctz8 <t> x) 16721 // cond: objabi.GOARM<=6 16722 // result: (RSBconst [32] (CLZ <t> (SUBconst <typ.UInt32> (AND <typ.UInt32> (ORconst <typ.UInt32> [0x100] x) (RSBconst <typ.UInt32> [0] (ORconst <typ.UInt32> [0x100] x))) [1]))) 16723 for { 16724 t := v.Type 16725 x := v.Args[0] 16726 if !(objabi.GOARM <= 6) { 16727 break 16728 } 16729 v.reset(OpARMRSBconst) 16730 v.AuxInt = 32 16731 v0 := b.NewValue0(v.Pos, OpARMCLZ, t) 16732 v1 := b.NewValue0(v.Pos, OpARMSUBconst, typ.UInt32) 16733 v1.AuxInt = 1 16734 v2 := b.NewValue0(v.Pos, OpARMAND, typ.UInt32) 16735 v3 := b.NewValue0(v.Pos, OpARMORconst, typ.UInt32) 16736 v3.AuxInt = 0x100 16737 v3.AddArg(x) 16738 v2.AddArg(v3) 16739 v4 := b.NewValue0(v.Pos, OpARMRSBconst, typ.UInt32) 16740 v4.AuxInt = 0 16741 v5 := b.NewValue0(v.Pos, OpARMORconst, typ.UInt32) 16742 v5.AuxInt = 0x100 16743 v5.AddArg(x) 16744 v4.AddArg(v5) 16745 v2.AddArg(v4) 16746 v1.AddArg(v2) 16747 v0.AddArg(v1) 16748 v.AddArg(v0) 16749 return true 16750 } 16751 // match: (Ctz8 <t> x) 16752 // cond: objabi.GOARM==7 16753 // result: (CLZ <t> (RBIT <typ.UInt32> (ORconst <typ.UInt32> [0x100] x))) 16754 for { 16755 t := v.Type 16756 x := v.Args[0] 16757 if !(objabi.GOARM == 7) { 16758 break 16759 } 16760 v.reset(OpARMCLZ) 16761 v.Type = t 16762 v0 := b.NewValue0(v.Pos, OpARMRBIT, typ.UInt32) 16763 v1 := b.NewValue0(v.Pos, OpARMORconst, typ.UInt32) 16764 v1.AuxInt = 0x100 16765 v1.AddArg(x) 16766 v0.AddArg(v1) 16767 v.AddArg(v0) 16768 return true 16769 } 16770 return false 16771 } 16772 func rewriteValueARM_OpCtz8NonZero_0(v *Value) bool { 16773 // match: (Ctz8NonZero x) 16774 // result: (Ctz32 x) 16775 for { 16776 x := v.Args[0] 16777 v.reset(OpCtz32) 16778 v.AddArg(x) 16779 return true 16780 } 16781 } 16782 func rewriteValueARM_OpCvt32Fto32_0(v *Value) bool { 16783 // match: (Cvt32Fto32 x) 16784 // result: (MOVFW x) 16785 for { 16786 x := v.Args[0] 16787 v.reset(OpARMMOVFW) 16788 v.AddArg(x) 16789 return true 16790 } 16791 } 16792 func rewriteValueARM_OpCvt32Fto32U_0(v *Value) bool { 16793 // match: (Cvt32Fto32U x) 16794 // result: (MOVFWU x) 16795 for { 16796 x := v.Args[0] 16797 v.reset(OpARMMOVFWU) 16798 v.AddArg(x) 16799 return true 16800 } 16801 } 16802 func rewriteValueARM_OpCvt32Fto64F_0(v *Value) bool { 16803 // match: (Cvt32Fto64F x) 16804 // result: (MOVFD x) 16805 for { 16806 x := v.Args[0] 16807 v.reset(OpARMMOVFD) 16808 v.AddArg(x) 16809 return true 16810 } 16811 } 16812 func rewriteValueARM_OpCvt32Uto32F_0(v *Value) bool { 16813 // match: (Cvt32Uto32F x) 16814 // result: (MOVWUF x) 16815 for { 16816 x := v.Args[0] 16817 v.reset(OpARMMOVWUF) 16818 v.AddArg(x) 16819 return true 16820 } 16821 } 16822 func rewriteValueARM_OpCvt32Uto64F_0(v *Value) bool { 16823 // match: (Cvt32Uto64F x) 16824 // result: (MOVWUD x) 16825 for { 16826 x := v.Args[0] 16827 v.reset(OpARMMOVWUD) 16828 v.AddArg(x) 16829 return true 16830 } 16831 } 16832 func rewriteValueARM_OpCvt32to32F_0(v *Value) bool { 16833 // match: (Cvt32to32F x) 16834 // result: (MOVWF x) 16835 for { 16836 x := v.Args[0] 16837 v.reset(OpARMMOVWF) 16838 v.AddArg(x) 16839 return true 16840 } 16841 } 16842 func rewriteValueARM_OpCvt32to64F_0(v *Value) bool { 16843 // match: (Cvt32to64F x) 16844 // result: (MOVWD x) 16845 for { 16846 x := v.Args[0] 16847 v.reset(OpARMMOVWD) 16848 v.AddArg(x) 16849 return true 16850 } 16851 } 16852 func rewriteValueARM_OpCvt64Fto32_0(v *Value) bool { 16853 // match: (Cvt64Fto32 x) 16854 // result: (MOVDW x) 16855 for { 16856 x := v.Args[0] 16857 v.reset(OpARMMOVDW) 16858 v.AddArg(x) 16859 return true 16860 } 16861 } 16862 func rewriteValueARM_OpCvt64Fto32F_0(v *Value) bool { 16863 // match: (Cvt64Fto32F x) 16864 // result: (MOVDF x) 16865 for { 16866 x := v.Args[0] 16867 v.reset(OpARMMOVDF) 16868 v.AddArg(x) 16869 return true 16870 } 16871 } 16872 func rewriteValueARM_OpCvt64Fto32U_0(v *Value) bool { 16873 // match: (Cvt64Fto32U x) 16874 // result: (MOVDWU x) 16875 for { 16876 x := v.Args[0] 16877 v.reset(OpARMMOVDWU) 16878 v.AddArg(x) 16879 return true 16880 } 16881 } 16882 func rewriteValueARM_OpDiv16_0(v *Value) bool { 16883 b := v.Block 16884 typ := &b.Func.Config.Types 16885 // match: (Div16 x y) 16886 // result: (Div32 (SignExt16to32 x) (SignExt16to32 y)) 16887 for { 16888 y := v.Args[1] 16889 x := v.Args[0] 16890 v.reset(OpDiv32) 16891 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 16892 v0.AddArg(x) 16893 v.AddArg(v0) 16894 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 16895 v1.AddArg(y) 16896 v.AddArg(v1) 16897 return true 16898 } 16899 } 16900 func rewriteValueARM_OpDiv16u_0(v *Value) bool { 16901 b := v.Block 16902 typ := &b.Func.Config.Types 16903 // match: (Div16u x y) 16904 // result: (Div32u (ZeroExt16to32 x) (ZeroExt16to32 y)) 16905 for { 16906 y := v.Args[1] 16907 x := v.Args[0] 16908 v.reset(OpDiv32u) 16909 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 16910 v0.AddArg(x) 16911 v.AddArg(v0) 16912 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 16913 v1.AddArg(y) 16914 v.AddArg(v1) 16915 return true 16916 } 16917 } 16918 func rewriteValueARM_OpDiv32_0(v *Value) bool { 16919 b := v.Block 16920 typ := &b.Func.Config.Types 16921 // match: (Div32 x y) 16922 // result: (SUB (XOR <typ.UInt32> (Select0 <typ.UInt32> (CALLudiv (SUB <typ.UInt32> (XOR x <typ.UInt32> (Signmask x)) (Signmask x)) (SUB <typ.UInt32> (XOR y <typ.UInt32> (Signmask y)) (Signmask y)))) (Signmask (XOR <typ.UInt32> x y))) (Signmask (XOR <typ.UInt32> x y))) 16923 for { 16924 y := v.Args[1] 16925 x := v.Args[0] 16926 v.reset(OpARMSUB) 16927 v0 := b.NewValue0(v.Pos, OpARMXOR, typ.UInt32) 16928 v1 := b.NewValue0(v.Pos, OpSelect0, typ.UInt32) 16929 v2 := b.NewValue0(v.Pos, OpARMCALLudiv, types.NewTuple(typ.UInt32, typ.UInt32)) 16930 v3 := b.NewValue0(v.Pos, OpARMSUB, typ.UInt32) 16931 v4 := b.NewValue0(v.Pos, OpARMXOR, typ.UInt32) 16932 v4.AddArg(x) 16933 v5 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 16934 v5.AddArg(x) 16935 v4.AddArg(v5) 16936 v3.AddArg(v4) 16937 v6 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 16938 v6.AddArg(x) 16939 v3.AddArg(v6) 16940 v2.AddArg(v3) 16941 v7 := b.NewValue0(v.Pos, OpARMSUB, typ.UInt32) 16942 v8 := b.NewValue0(v.Pos, OpARMXOR, typ.UInt32) 16943 v8.AddArg(y) 16944 v9 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 16945 v9.AddArg(y) 16946 v8.AddArg(v9) 16947 v7.AddArg(v8) 16948 v10 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 16949 v10.AddArg(y) 16950 v7.AddArg(v10) 16951 v2.AddArg(v7) 16952 v1.AddArg(v2) 16953 v0.AddArg(v1) 16954 v11 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 16955 v12 := b.NewValue0(v.Pos, OpARMXOR, typ.UInt32) 16956 v12.AddArg(x) 16957 v12.AddArg(y) 16958 v11.AddArg(v12) 16959 v0.AddArg(v11) 16960 v.AddArg(v0) 16961 v13 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 16962 v14 := b.NewValue0(v.Pos, OpARMXOR, typ.UInt32) 16963 v14.AddArg(x) 16964 v14.AddArg(y) 16965 v13.AddArg(v14) 16966 v.AddArg(v13) 16967 return true 16968 } 16969 } 16970 func rewriteValueARM_OpDiv32F_0(v *Value) bool { 16971 // match: (Div32F x y) 16972 // result: (DIVF x y) 16973 for { 16974 y := v.Args[1] 16975 x := v.Args[0] 16976 v.reset(OpARMDIVF) 16977 v.AddArg(x) 16978 v.AddArg(y) 16979 return true 16980 } 16981 } 16982 func rewriteValueARM_OpDiv32u_0(v *Value) bool { 16983 b := v.Block 16984 typ := &b.Func.Config.Types 16985 // match: (Div32u x y) 16986 // result: (Select0 <typ.UInt32> (CALLudiv x y)) 16987 for { 16988 y := v.Args[1] 16989 x := v.Args[0] 16990 v.reset(OpSelect0) 16991 v.Type = typ.UInt32 16992 v0 := b.NewValue0(v.Pos, OpARMCALLudiv, types.NewTuple(typ.UInt32, typ.UInt32)) 16993 v0.AddArg(x) 16994 v0.AddArg(y) 16995 v.AddArg(v0) 16996 return true 16997 } 16998 } 16999 func rewriteValueARM_OpDiv64F_0(v *Value) bool { 17000 // match: (Div64F x y) 17001 // result: (DIVD x y) 17002 for { 17003 y := v.Args[1] 17004 x := v.Args[0] 17005 v.reset(OpARMDIVD) 17006 v.AddArg(x) 17007 v.AddArg(y) 17008 return true 17009 } 17010 } 17011 func rewriteValueARM_OpDiv8_0(v *Value) bool { 17012 b := v.Block 17013 typ := &b.Func.Config.Types 17014 // match: (Div8 x y) 17015 // result: (Div32 (SignExt8to32 x) (SignExt8to32 y)) 17016 for { 17017 y := v.Args[1] 17018 x := v.Args[0] 17019 v.reset(OpDiv32) 17020 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17021 v0.AddArg(x) 17022 v.AddArg(v0) 17023 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17024 v1.AddArg(y) 17025 v.AddArg(v1) 17026 return true 17027 } 17028 } 17029 func rewriteValueARM_OpDiv8u_0(v *Value) bool { 17030 b := v.Block 17031 typ := &b.Func.Config.Types 17032 // match: (Div8u x y) 17033 // result: (Div32u (ZeroExt8to32 x) (ZeroExt8to32 y)) 17034 for { 17035 y := v.Args[1] 17036 x := v.Args[0] 17037 v.reset(OpDiv32u) 17038 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17039 v0.AddArg(x) 17040 v.AddArg(v0) 17041 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17042 v1.AddArg(y) 17043 v.AddArg(v1) 17044 return true 17045 } 17046 } 17047 func rewriteValueARM_OpEq16_0(v *Value) bool { 17048 b := v.Block 17049 typ := &b.Func.Config.Types 17050 // match: (Eq16 x y) 17051 // result: (Equal (CMP (ZeroExt16to32 x) (ZeroExt16to32 y))) 17052 for { 17053 y := v.Args[1] 17054 x := v.Args[0] 17055 v.reset(OpARMEqual) 17056 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17057 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17058 v1.AddArg(x) 17059 v0.AddArg(v1) 17060 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17061 v2.AddArg(y) 17062 v0.AddArg(v2) 17063 v.AddArg(v0) 17064 return true 17065 } 17066 } 17067 func rewriteValueARM_OpEq32_0(v *Value) bool { 17068 b := v.Block 17069 // match: (Eq32 x y) 17070 // result: (Equal (CMP x y)) 17071 for { 17072 y := v.Args[1] 17073 x := v.Args[0] 17074 v.reset(OpARMEqual) 17075 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17076 v0.AddArg(x) 17077 v0.AddArg(y) 17078 v.AddArg(v0) 17079 return true 17080 } 17081 } 17082 func rewriteValueARM_OpEq32F_0(v *Value) bool { 17083 b := v.Block 17084 // match: (Eq32F x y) 17085 // result: (Equal (CMPF x y)) 17086 for { 17087 y := v.Args[1] 17088 x := v.Args[0] 17089 v.reset(OpARMEqual) 17090 v0 := b.NewValue0(v.Pos, OpARMCMPF, types.TypeFlags) 17091 v0.AddArg(x) 17092 v0.AddArg(y) 17093 v.AddArg(v0) 17094 return true 17095 } 17096 } 17097 func rewriteValueARM_OpEq64F_0(v *Value) bool { 17098 b := v.Block 17099 // match: (Eq64F x y) 17100 // result: (Equal (CMPD x y)) 17101 for { 17102 y := v.Args[1] 17103 x := v.Args[0] 17104 v.reset(OpARMEqual) 17105 v0 := b.NewValue0(v.Pos, OpARMCMPD, types.TypeFlags) 17106 v0.AddArg(x) 17107 v0.AddArg(y) 17108 v.AddArg(v0) 17109 return true 17110 } 17111 } 17112 func rewriteValueARM_OpEq8_0(v *Value) bool { 17113 b := v.Block 17114 typ := &b.Func.Config.Types 17115 // match: (Eq8 x y) 17116 // result: (Equal (CMP (ZeroExt8to32 x) (ZeroExt8to32 y))) 17117 for { 17118 y := v.Args[1] 17119 x := v.Args[0] 17120 v.reset(OpARMEqual) 17121 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17122 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17123 v1.AddArg(x) 17124 v0.AddArg(v1) 17125 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17126 v2.AddArg(y) 17127 v0.AddArg(v2) 17128 v.AddArg(v0) 17129 return true 17130 } 17131 } 17132 func rewriteValueARM_OpEqB_0(v *Value) bool { 17133 b := v.Block 17134 typ := &b.Func.Config.Types 17135 // match: (EqB x y) 17136 // result: (XORconst [1] (XOR <typ.Bool> x y)) 17137 for { 17138 y := v.Args[1] 17139 x := v.Args[0] 17140 v.reset(OpARMXORconst) 17141 v.AuxInt = 1 17142 v0 := b.NewValue0(v.Pos, OpARMXOR, typ.Bool) 17143 v0.AddArg(x) 17144 v0.AddArg(y) 17145 v.AddArg(v0) 17146 return true 17147 } 17148 } 17149 func rewriteValueARM_OpEqPtr_0(v *Value) bool { 17150 b := v.Block 17151 // match: (EqPtr x y) 17152 // result: (Equal (CMP x y)) 17153 for { 17154 y := v.Args[1] 17155 x := v.Args[0] 17156 v.reset(OpARMEqual) 17157 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17158 v0.AddArg(x) 17159 v0.AddArg(y) 17160 v.AddArg(v0) 17161 return true 17162 } 17163 } 17164 func rewriteValueARM_OpFMA_0(v *Value) bool { 17165 // match: (FMA x y z) 17166 // result: (FMULAD z x y) 17167 for { 17168 z := v.Args[2] 17169 x := v.Args[0] 17170 y := v.Args[1] 17171 v.reset(OpARMFMULAD) 17172 v.AddArg(z) 17173 v.AddArg(x) 17174 v.AddArg(y) 17175 return true 17176 } 17177 } 17178 func rewriteValueARM_OpGeq16_0(v *Value) bool { 17179 b := v.Block 17180 typ := &b.Func.Config.Types 17181 // match: (Geq16 x y) 17182 // result: (GreaterEqual (CMP (SignExt16to32 x) (SignExt16to32 y))) 17183 for { 17184 y := v.Args[1] 17185 x := v.Args[0] 17186 v.reset(OpARMGreaterEqual) 17187 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17188 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 17189 v1.AddArg(x) 17190 v0.AddArg(v1) 17191 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 17192 v2.AddArg(y) 17193 v0.AddArg(v2) 17194 v.AddArg(v0) 17195 return true 17196 } 17197 } 17198 func rewriteValueARM_OpGeq16U_0(v *Value) bool { 17199 b := v.Block 17200 typ := &b.Func.Config.Types 17201 // match: (Geq16U x y) 17202 // result: (GreaterEqualU (CMP (ZeroExt16to32 x) (ZeroExt16to32 y))) 17203 for { 17204 y := v.Args[1] 17205 x := v.Args[0] 17206 v.reset(OpARMGreaterEqualU) 17207 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17208 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17209 v1.AddArg(x) 17210 v0.AddArg(v1) 17211 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17212 v2.AddArg(y) 17213 v0.AddArg(v2) 17214 v.AddArg(v0) 17215 return true 17216 } 17217 } 17218 func rewriteValueARM_OpGeq32_0(v *Value) bool { 17219 b := v.Block 17220 // match: (Geq32 x y) 17221 // result: (GreaterEqual (CMP x y)) 17222 for { 17223 y := v.Args[1] 17224 x := v.Args[0] 17225 v.reset(OpARMGreaterEqual) 17226 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17227 v0.AddArg(x) 17228 v0.AddArg(y) 17229 v.AddArg(v0) 17230 return true 17231 } 17232 } 17233 func rewriteValueARM_OpGeq32F_0(v *Value) bool { 17234 b := v.Block 17235 // match: (Geq32F x y) 17236 // result: (GreaterEqual (CMPF x y)) 17237 for { 17238 y := v.Args[1] 17239 x := v.Args[0] 17240 v.reset(OpARMGreaterEqual) 17241 v0 := b.NewValue0(v.Pos, OpARMCMPF, types.TypeFlags) 17242 v0.AddArg(x) 17243 v0.AddArg(y) 17244 v.AddArg(v0) 17245 return true 17246 } 17247 } 17248 func rewriteValueARM_OpGeq32U_0(v *Value) bool { 17249 b := v.Block 17250 // match: (Geq32U x y) 17251 // result: (GreaterEqualU (CMP x y)) 17252 for { 17253 y := v.Args[1] 17254 x := v.Args[0] 17255 v.reset(OpARMGreaterEqualU) 17256 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17257 v0.AddArg(x) 17258 v0.AddArg(y) 17259 v.AddArg(v0) 17260 return true 17261 } 17262 } 17263 func rewriteValueARM_OpGeq64F_0(v *Value) bool { 17264 b := v.Block 17265 // match: (Geq64F x y) 17266 // result: (GreaterEqual (CMPD x y)) 17267 for { 17268 y := v.Args[1] 17269 x := v.Args[0] 17270 v.reset(OpARMGreaterEqual) 17271 v0 := b.NewValue0(v.Pos, OpARMCMPD, types.TypeFlags) 17272 v0.AddArg(x) 17273 v0.AddArg(y) 17274 v.AddArg(v0) 17275 return true 17276 } 17277 } 17278 func rewriteValueARM_OpGeq8_0(v *Value) bool { 17279 b := v.Block 17280 typ := &b.Func.Config.Types 17281 // match: (Geq8 x y) 17282 // result: (GreaterEqual (CMP (SignExt8to32 x) (SignExt8to32 y))) 17283 for { 17284 y := v.Args[1] 17285 x := v.Args[0] 17286 v.reset(OpARMGreaterEqual) 17287 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17288 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17289 v1.AddArg(x) 17290 v0.AddArg(v1) 17291 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17292 v2.AddArg(y) 17293 v0.AddArg(v2) 17294 v.AddArg(v0) 17295 return true 17296 } 17297 } 17298 func rewriteValueARM_OpGeq8U_0(v *Value) bool { 17299 b := v.Block 17300 typ := &b.Func.Config.Types 17301 // match: (Geq8U x y) 17302 // result: (GreaterEqualU (CMP (ZeroExt8to32 x) (ZeroExt8to32 y))) 17303 for { 17304 y := v.Args[1] 17305 x := v.Args[0] 17306 v.reset(OpARMGreaterEqualU) 17307 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17308 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17309 v1.AddArg(x) 17310 v0.AddArg(v1) 17311 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17312 v2.AddArg(y) 17313 v0.AddArg(v2) 17314 v.AddArg(v0) 17315 return true 17316 } 17317 } 17318 func rewriteValueARM_OpGetCallerPC_0(v *Value) bool { 17319 // match: (GetCallerPC) 17320 // result: (LoweredGetCallerPC) 17321 for { 17322 v.reset(OpARMLoweredGetCallerPC) 17323 return true 17324 } 17325 } 17326 func rewriteValueARM_OpGetCallerSP_0(v *Value) bool { 17327 // match: (GetCallerSP) 17328 // result: (LoweredGetCallerSP) 17329 for { 17330 v.reset(OpARMLoweredGetCallerSP) 17331 return true 17332 } 17333 } 17334 func rewriteValueARM_OpGetClosurePtr_0(v *Value) bool { 17335 // match: (GetClosurePtr) 17336 // result: (LoweredGetClosurePtr) 17337 for { 17338 v.reset(OpARMLoweredGetClosurePtr) 17339 return true 17340 } 17341 } 17342 func rewriteValueARM_OpGreater16_0(v *Value) bool { 17343 b := v.Block 17344 typ := &b.Func.Config.Types 17345 // match: (Greater16 x y) 17346 // result: (GreaterThan (CMP (SignExt16to32 x) (SignExt16to32 y))) 17347 for { 17348 y := v.Args[1] 17349 x := v.Args[0] 17350 v.reset(OpARMGreaterThan) 17351 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17352 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 17353 v1.AddArg(x) 17354 v0.AddArg(v1) 17355 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 17356 v2.AddArg(y) 17357 v0.AddArg(v2) 17358 v.AddArg(v0) 17359 return true 17360 } 17361 } 17362 func rewriteValueARM_OpGreater16U_0(v *Value) bool { 17363 b := v.Block 17364 typ := &b.Func.Config.Types 17365 // match: (Greater16U x y) 17366 // result: (GreaterThanU (CMP (ZeroExt16to32 x) (ZeroExt16to32 y))) 17367 for { 17368 y := v.Args[1] 17369 x := v.Args[0] 17370 v.reset(OpARMGreaterThanU) 17371 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17372 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17373 v1.AddArg(x) 17374 v0.AddArg(v1) 17375 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17376 v2.AddArg(y) 17377 v0.AddArg(v2) 17378 v.AddArg(v0) 17379 return true 17380 } 17381 } 17382 func rewriteValueARM_OpGreater32_0(v *Value) bool { 17383 b := v.Block 17384 // match: (Greater32 x y) 17385 // result: (GreaterThan (CMP x y)) 17386 for { 17387 y := v.Args[1] 17388 x := v.Args[0] 17389 v.reset(OpARMGreaterThan) 17390 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17391 v0.AddArg(x) 17392 v0.AddArg(y) 17393 v.AddArg(v0) 17394 return true 17395 } 17396 } 17397 func rewriteValueARM_OpGreater32F_0(v *Value) bool { 17398 b := v.Block 17399 // match: (Greater32F x y) 17400 // result: (GreaterThan (CMPF x y)) 17401 for { 17402 y := v.Args[1] 17403 x := v.Args[0] 17404 v.reset(OpARMGreaterThan) 17405 v0 := b.NewValue0(v.Pos, OpARMCMPF, types.TypeFlags) 17406 v0.AddArg(x) 17407 v0.AddArg(y) 17408 v.AddArg(v0) 17409 return true 17410 } 17411 } 17412 func rewriteValueARM_OpGreater32U_0(v *Value) bool { 17413 b := v.Block 17414 // match: (Greater32U x y) 17415 // result: (GreaterThanU (CMP x y)) 17416 for { 17417 y := v.Args[1] 17418 x := v.Args[0] 17419 v.reset(OpARMGreaterThanU) 17420 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17421 v0.AddArg(x) 17422 v0.AddArg(y) 17423 v.AddArg(v0) 17424 return true 17425 } 17426 } 17427 func rewriteValueARM_OpGreater64F_0(v *Value) bool { 17428 b := v.Block 17429 // match: (Greater64F x y) 17430 // result: (GreaterThan (CMPD x y)) 17431 for { 17432 y := v.Args[1] 17433 x := v.Args[0] 17434 v.reset(OpARMGreaterThan) 17435 v0 := b.NewValue0(v.Pos, OpARMCMPD, types.TypeFlags) 17436 v0.AddArg(x) 17437 v0.AddArg(y) 17438 v.AddArg(v0) 17439 return true 17440 } 17441 } 17442 func rewriteValueARM_OpGreater8_0(v *Value) bool { 17443 b := v.Block 17444 typ := &b.Func.Config.Types 17445 // match: (Greater8 x y) 17446 // result: (GreaterThan (CMP (SignExt8to32 x) (SignExt8to32 y))) 17447 for { 17448 y := v.Args[1] 17449 x := v.Args[0] 17450 v.reset(OpARMGreaterThan) 17451 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17452 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17453 v1.AddArg(x) 17454 v0.AddArg(v1) 17455 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17456 v2.AddArg(y) 17457 v0.AddArg(v2) 17458 v.AddArg(v0) 17459 return true 17460 } 17461 } 17462 func rewriteValueARM_OpGreater8U_0(v *Value) bool { 17463 b := v.Block 17464 typ := &b.Func.Config.Types 17465 // match: (Greater8U x y) 17466 // result: (GreaterThanU (CMP (ZeroExt8to32 x) (ZeroExt8to32 y))) 17467 for { 17468 y := v.Args[1] 17469 x := v.Args[0] 17470 v.reset(OpARMGreaterThanU) 17471 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17472 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17473 v1.AddArg(x) 17474 v0.AddArg(v1) 17475 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17476 v2.AddArg(y) 17477 v0.AddArg(v2) 17478 v.AddArg(v0) 17479 return true 17480 } 17481 } 17482 func rewriteValueARM_OpHmul32_0(v *Value) bool { 17483 // match: (Hmul32 x y) 17484 // result: (HMUL x y) 17485 for { 17486 y := v.Args[1] 17487 x := v.Args[0] 17488 v.reset(OpARMHMUL) 17489 v.AddArg(x) 17490 v.AddArg(y) 17491 return true 17492 } 17493 } 17494 func rewriteValueARM_OpHmul32u_0(v *Value) bool { 17495 // match: (Hmul32u x y) 17496 // result: (HMULU x y) 17497 for { 17498 y := v.Args[1] 17499 x := v.Args[0] 17500 v.reset(OpARMHMULU) 17501 v.AddArg(x) 17502 v.AddArg(y) 17503 return true 17504 } 17505 } 17506 func rewriteValueARM_OpInterCall_0(v *Value) bool { 17507 // match: (InterCall [argwid] entry mem) 17508 // result: (CALLinter [argwid] entry mem) 17509 for { 17510 argwid := v.AuxInt 17511 mem := v.Args[1] 17512 entry := v.Args[0] 17513 v.reset(OpARMCALLinter) 17514 v.AuxInt = argwid 17515 v.AddArg(entry) 17516 v.AddArg(mem) 17517 return true 17518 } 17519 } 17520 func rewriteValueARM_OpIsInBounds_0(v *Value) bool { 17521 b := v.Block 17522 // match: (IsInBounds idx len) 17523 // result: (LessThanU (CMP idx len)) 17524 for { 17525 len := v.Args[1] 17526 idx := v.Args[0] 17527 v.reset(OpARMLessThanU) 17528 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17529 v0.AddArg(idx) 17530 v0.AddArg(len) 17531 v.AddArg(v0) 17532 return true 17533 } 17534 } 17535 func rewriteValueARM_OpIsNonNil_0(v *Value) bool { 17536 b := v.Block 17537 // match: (IsNonNil ptr) 17538 // result: (NotEqual (CMPconst [0] ptr)) 17539 for { 17540 ptr := v.Args[0] 17541 v.reset(OpARMNotEqual) 17542 v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 17543 v0.AuxInt = 0 17544 v0.AddArg(ptr) 17545 v.AddArg(v0) 17546 return true 17547 } 17548 } 17549 func rewriteValueARM_OpIsSliceInBounds_0(v *Value) bool { 17550 b := v.Block 17551 // match: (IsSliceInBounds idx len) 17552 // result: (LessEqualU (CMP idx len)) 17553 for { 17554 len := v.Args[1] 17555 idx := v.Args[0] 17556 v.reset(OpARMLessEqualU) 17557 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17558 v0.AddArg(idx) 17559 v0.AddArg(len) 17560 v.AddArg(v0) 17561 return true 17562 } 17563 } 17564 func rewriteValueARM_OpLeq16_0(v *Value) bool { 17565 b := v.Block 17566 typ := &b.Func.Config.Types 17567 // match: (Leq16 x y) 17568 // result: (LessEqual (CMP (SignExt16to32 x) (SignExt16to32 y))) 17569 for { 17570 y := v.Args[1] 17571 x := v.Args[0] 17572 v.reset(OpARMLessEqual) 17573 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17574 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 17575 v1.AddArg(x) 17576 v0.AddArg(v1) 17577 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 17578 v2.AddArg(y) 17579 v0.AddArg(v2) 17580 v.AddArg(v0) 17581 return true 17582 } 17583 } 17584 func rewriteValueARM_OpLeq16U_0(v *Value) bool { 17585 b := v.Block 17586 typ := &b.Func.Config.Types 17587 // match: (Leq16U x y) 17588 // result: (LessEqualU (CMP (ZeroExt16to32 x) (ZeroExt16to32 y))) 17589 for { 17590 y := v.Args[1] 17591 x := v.Args[0] 17592 v.reset(OpARMLessEqualU) 17593 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17594 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17595 v1.AddArg(x) 17596 v0.AddArg(v1) 17597 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17598 v2.AddArg(y) 17599 v0.AddArg(v2) 17600 v.AddArg(v0) 17601 return true 17602 } 17603 } 17604 func rewriteValueARM_OpLeq32_0(v *Value) bool { 17605 b := v.Block 17606 // match: (Leq32 x y) 17607 // result: (LessEqual (CMP x y)) 17608 for { 17609 y := v.Args[1] 17610 x := v.Args[0] 17611 v.reset(OpARMLessEqual) 17612 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17613 v0.AddArg(x) 17614 v0.AddArg(y) 17615 v.AddArg(v0) 17616 return true 17617 } 17618 } 17619 func rewriteValueARM_OpLeq32F_0(v *Value) bool { 17620 b := v.Block 17621 // match: (Leq32F x y) 17622 // result: (GreaterEqual (CMPF y x)) 17623 for { 17624 y := v.Args[1] 17625 x := v.Args[0] 17626 v.reset(OpARMGreaterEqual) 17627 v0 := b.NewValue0(v.Pos, OpARMCMPF, types.TypeFlags) 17628 v0.AddArg(y) 17629 v0.AddArg(x) 17630 v.AddArg(v0) 17631 return true 17632 } 17633 } 17634 func rewriteValueARM_OpLeq32U_0(v *Value) bool { 17635 b := v.Block 17636 // match: (Leq32U x y) 17637 // result: (LessEqualU (CMP x y)) 17638 for { 17639 y := v.Args[1] 17640 x := v.Args[0] 17641 v.reset(OpARMLessEqualU) 17642 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17643 v0.AddArg(x) 17644 v0.AddArg(y) 17645 v.AddArg(v0) 17646 return true 17647 } 17648 } 17649 func rewriteValueARM_OpLeq64F_0(v *Value) bool { 17650 b := v.Block 17651 // match: (Leq64F x y) 17652 // result: (GreaterEqual (CMPD y x)) 17653 for { 17654 y := v.Args[1] 17655 x := v.Args[0] 17656 v.reset(OpARMGreaterEqual) 17657 v0 := b.NewValue0(v.Pos, OpARMCMPD, types.TypeFlags) 17658 v0.AddArg(y) 17659 v0.AddArg(x) 17660 v.AddArg(v0) 17661 return true 17662 } 17663 } 17664 func rewriteValueARM_OpLeq8_0(v *Value) bool { 17665 b := v.Block 17666 typ := &b.Func.Config.Types 17667 // match: (Leq8 x y) 17668 // result: (LessEqual (CMP (SignExt8to32 x) (SignExt8to32 y))) 17669 for { 17670 y := v.Args[1] 17671 x := v.Args[0] 17672 v.reset(OpARMLessEqual) 17673 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17674 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17675 v1.AddArg(x) 17676 v0.AddArg(v1) 17677 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17678 v2.AddArg(y) 17679 v0.AddArg(v2) 17680 v.AddArg(v0) 17681 return true 17682 } 17683 } 17684 func rewriteValueARM_OpLeq8U_0(v *Value) bool { 17685 b := v.Block 17686 typ := &b.Func.Config.Types 17687 // match: (Leq8U x y) 17688 // result: (LessEqualU (CMP (ZeroExt8to32 x) (ZeroExt8to32 y))) 17689 for { 17690 y := v.Args[1] 17691 x := v.Args[0] 17692 v.reset(OpARMLessEqualU) 17693 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17694 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17695 v1.AddArg(x) 17696 v0.AddArg(v1) 17697 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17698 v2.AddArg(y) 17699 v0.AddArg(v2) 17700 v.AddArg(v0) 17701 return true 17702 } 17703 } 17704 func rewriteValueARM_OpLess16_0(v *Value) bool { 17705 b := v.Block 17706 typ := &b.Func.Config.Types 17707 // match: (Less16 x y) 17708 // result: (LessThan (CMP (SignExt16to32 x) (SignExt16to32 y))) 17709 for { 17710 y := v.Args[1] 17711 x := v.Args[0] 17712 v.reset(OpARMLessThan) 17713 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17714 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 17715 v1.AddArg(x) 17716 v0.AddArg(v1) 17717 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 17718 v2.AddArg(y) 17719 v0.AddArg(v2) 17720 v.AddArg(v0) 17721 return true 17722 } 17723 } 17724 func rewriteValueARM_OpLess16U_0(v *Value) bool { 17725 b := v.Block 17726 typ := &b.Func.Config.Types 17727 // match: (Less16U x y) 17728 // result: (LessThanU (CMP (ZeroExt16to32 x) (ZeroExt16to32 y))) 17729 for { 17730 y := v.Args[1] 17731 x := v.Args[0] 17732 v.reset(OpARMLessThanU) 17733 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17734 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17735 v1.AddArg(x) 17736 v0.AddArg(v1) 17737 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17738 v2.AddArg(y) 17739 v0.AddArg(v2) 17740 v.AddArg(v0) 17741 return true 17742 } 17743 } 17744 func rewriteValueARM_OpLess32_0(v *Value) bool { 17745 b := v.Block 17746 // match: (Less32 x y) 17747 // result: (LessThan (CMP x y)) 17748 for { 17749 y := v.Args[1] 17750 x := v.Args[0] 17751 v.reset(OpARMLessThan) 17752 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17753 v0.AddArg(x) 17754 v0.AddArg(y) 17755 v.AddArg(v0) 17756 return true 17757 } 17758 } 17759 func rewriteValueARM_OpLess32F_0(v *Value) bool { 17760 b := v.Block 17761 // match: (Less32F x y) 17762 // result: (GreaterThan (CMPF y x)) 17763 for { 17764 y := v.Args[1] 17765 x := v.Args[0] 17766 v.reset(OpARMGreaterThan) 17767 v0 := b.NewValue0(v.Pos, OpARMCMPF, types.TypeFlags) 17768 v0.AddArg(y) 17769 v0.AddArg(x) 17770 v.AddArg(v0) 17771 return true 17772 } 17773 } 17774 func rewriteValueARM_OpLess32U_0(v *Value) bool { 17775 b := v.Block 17776 // match: (Less32U x y) 17777 // result: (LessThanU (CMP x y)) 17778 for { 17779 y := v.Args[1] 17780 x := v.Args[0] 17781 v.reset(OpARMLessThanU) 17782 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17783 v0.AddArg(x) 17784 v0.AddArg(y) 17785 v.AddArg(v0) 17786 return true 17787 } 17788 } 17789 func rewriteValueARM_OpLess64F_0(v *Value) bool { 17790 b := v.Block 17791 // match: (Less64F x y) 17792 // result: (GreaterThan (CMPD y x)) 17793 for { 17794 y := v.Args[1] 17795 x := v.Args[0] 17796 v.reset(OpARMGreaterThan) 17797 v0 := b.NewValue0(v.Pos, OpARMCMPD, types.TypeFlags) 17798 v0.AddArg(y) 17799 v0.AddArg(x) 17800 v.AddArg(v0) 17801 return true 17802 } 17803 } 17804 func rewriteValueARM_OpLess8_0(v *Value) bool { 17805 b := v.Block 17806 typ := &b.Func.Config.Types 17807 // match: (Less8 x y) 17808 // result: (LessThan (CMP (SignExt8to32 x) (SignExt8to32 y))) 17809 for { 17810 y := v.Args[1] 17811 x := v.Args[0] 17812 v.reset(OpARMLessThan) 17813 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17814 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17815 v1.AddArg(x) 17816 v0.AddArg(v1) 17817 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 17818 v2.AddArg(y) 17819 v0.AddArg(v2) 17820 v.AddArg(v0) 17821 return true 17822 } 17823 } 17824 func rewriteValueARM_OpLess8U_0(v *Value) bool { 17825 b := v.Block 17826 typ := &b.Func.Config.Types 17827 // match: (Less8U x y) 17828 // result: (LessThanU (CMP (ZeroExt8to32 x) (ZeroExt8to32 y))) 17829 for { 17830 y := v.Args[1] 17831 x := v.Args[0] 17832 v.reset(OpARMLessThanU) 17833 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 17834 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17835 v1.AddArg(x) 17836 v0.AddArg(v1) 17837 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 17838 v2.AddArg(y) 17839 v0.AddArg(v2) 17840 v.AddArg(v0) 17841 return true 17842 } 17843 } 17844 func rewriteValueARM_OpLoad_0(v *Value) bool { 17845 // match: (Load <t> ptr mem) 17846 // cond: t.IsBoolean() 17847 // result: (MOVBUload ptr mem) 17848 for { 17849 t := v.Type 17850 mem := v.Args[1] 17851 ptr := v.Args[0] 17852 if !(t.IsBoolean()) { 17853 break 17854 } 17855 v.reset(OpARMMOVBUload) 17856 v.AddArg(ptr) 17857 v.AddArg(mem) 17858 return true 17859 } 17860 // match: (Load <t> ptr mem) 17861 // cond: (is8BitInt(t) && isSigned(t)) 17862 // result: (MOVBload ptr mem) 17863 for { 17864 t := v.Type 17865 mem := v.Args[1] 17866 ptr := v.Args[0] 17867 if !(is8BitInt(t) && isSigned(t)) { 17868 break 17869 } 17870 v.reset(OpARMMOVBload) 17871 v.AddArg(ptr) 17872 v.AddArg(mem) 17873 return true 17874 } 17875 // match: (Load <t> ptr mem) 17876 // cond: (is8BitInt(t) && !isSigned(t)) 17877 // result: (MOVBUload ptr mem) 17878 for { 17879 t := v.Type 17880 mem := v.Args[1] 17881 ptr := v.Args[0] 17882 if !(is8BitInt(t) && !isSigned(t)) { 17883 break 17884 } 17885 v.reset(OpARMMOVBUload) 17886 v.AddArg(ptr) 17887 v.AddArg(mem) 17888 return true 17889 } 17890 // match: (Load <t> ptr mem) 17891 // cond: (is16BitInt(t) && isSigned(t)) 17892 // result: (MOVHload ptr mem) 17893 for { 17894 t := v.Type 17895 mem := v.Args[1] 17896 ptr := v.Args[0] 17897 if !(is16BitInt(t) && isSigned(t)) { 17898 break 17899 } 17900 v.reset(OpARMMOVHload) 17901 v.AddArg(ptr) 17902 v.AddArg(mem) 17903 return true 17904 } 17905 // match: (Load <t> ptr mem) 17906 // cond: (is16BitInt(t) && !isSigned(t)) 17907 // result: (MOVHUload ptr mem) 17908 for { 17909 t := v.Type 17910 mem := v.Args[1] 17911 ptr := v.Args[0] 17912 if !(is16BitInt(t) && !isSigned(t)) { 17913 break 17914 } 17915 v.reset(OpARMMOVHUload) 17916 v.AddArg(ptr) 17917 v.AddArg(mem) 17918 return true 17919 } 17920 // match: (Load <t> ptr mem) 17921 // cond: (is32BitInt(t) || isPtr(t)) 17922 // result: (MOVWload ptr mem) 17923 for { 17924 t := v.Type 17925 mem := v.Args[1] 17926 ptr := v.Args[0] 17927 if !(is32BitInt(t) || isPtr(t)) { 17928 break 17929 } 17930 v.reset(OpARMMOVWload) 17931 v.AddArg(ptr) 17932 v.AddArg(mem) 17933 return true 17934 } 17935 // match: (Load <t> ptr mem) 17936 // cond: is32BitFloat(t) 17937 // result: (MOVFload ptr mem) 17938 for { 17939 t := v.Type 17940 mem := v.Args[1] 17941 ptr := v.Args[0] 17942 if !(is32BitFloat(t)) { 17943 break 17944 } 17945 v.reset(OpARMMOVFload) 17946 v.AddArg(ptr) 17947 v.AddArg(mem) 17948 return true 17949 } 17950 // match: (Load <t> ptr mem) 17951 // cond: is64BitFloat(t) 17952 // result: (MOVDload ptr mem) 17953 for { 17954 t := v.Type 17955 mem := v.Args[1] 17956 ptr := v.Args[0] 17957 if !(is64BitFloat(t)) { 17958 break 17959 } 17960 v.reset(OpARMMOVDload) 17961 v.AddArg(ptr) 17962 v.AddArg(mem) 17963 return true 17964 } 17965 return false 17966 } 17967 func rewriteValueARM_OpLocalAddr_0(v *Value) bool { 17968 // match: (LocalAddr {sym} base _) 17969 // result: (MOVWaddr {sym} base) 17970 for { 17971 sym := v.Aux 17972 _ = v.Args[1] 17973 base := v.Args[0] 17974 v.reset(OpARMMOVWaddr) 17975 v.Aux = sym 17976 v.AddArg(base) 17977 return true 17978 } 17979 } 17980 func rewriteValueARM_OpLsh16x16_0(v *Value) bool { 17981 b := v.Block 17982 typ := &b.Func.Config.Types 17983 // match: (Lsh16x16 x y) 17984 // result: (CMOVWHSconst (SLL <x.Type> x (ZeroExt16to32 y)) (CMPconst [256] (ZeroExt16to32 y)) [0]) 17985 for { 17986 y := v.Args[1] 17987 x := v.Args[0] 17988 v.reset(OpARMCMOVWHSconst) 17989 v.AuxInt = 0 17990 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 17991 v0.AddArg(x) 17992 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17993 v1.AddArg(y) 17994 v0.AddArg(v1) 17995 v.AddArg(v0) 17996 v2 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 17997 v2.AuxInt = 256 17998 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 17999 v3.AddArg(y) 18000 v2.AddArg(v3) 18001 v.AddArg(v2) 18002 return true 18003 } 18004 } 18005 func rewriteValueARM_OpLsh16x32_0(v *Value) bool { 18006 b := v.Block 18007 // match: (Lsh16x32 x y) 18008 // result: (CMOVWHSconst (SLL <x.Type> x y) (CMPconst [256] y) [0]) 18009 for { 18010 y := v.Args[1] 18011 x := v.Args[0] 18012 v.reset(OpARMCMOVWHSconst) 18013 v.AuxInt = 0 18014 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 18015 v0.AddArg(x) 18016 v0.AddArg(y) 18017 v.AddArg(v0) 18018 v1 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 18019 v1.AuxInt = 256 18020 v1.AddArg(y) 18021 v.AddArg(v1) 18022 return true 18023 } 18024 } 18025 func rewriteValueARM_OpLsh16x64_0(v *Value) bool { 18026 // match: (Lsh16x64 x (Const64 [c])) 18027 // cond: uint64(c) < 16 18028 // result: (SLLconst x [c]) 18029 for { 18030 _ = v.Args[1] 18031 x := v.Args[0] 18032 v_1 := v.Args[1] 18033 if v_1.Op != OpConst64 { 18034 break 18035 } 18036 c := v_1.AuxInt 18037 if !(uint64(c) < 16) { 18038 break 18039 } 18040 v.reset(OpARMSLLconst) 18041 v.AuxInt = c 18042 v.AddArg(x) 18043 return true 18044 } 18045 // match: (Lsh16x64 _ (Const64 [c])) 18046 // cond: uint64(c) >= 16 18047 // result: (Const16 [0]) 18048 for { 18049 _ = v.Args[1] 18050 v_1 := v.Args[1] 18051 if v_1.Op != OpConst64 { 18052 break 18053 } 18054 c := v_1.AuxInt 18055 if !(uint64(c) >= 16) { 18056 break 18057 } 18058 v.reset(OpConst16) 18059 v.AuxInt = 0 18060 return true 18061 } 18062 return false 18063 } 18064 func rewriteValueARM_OpLsh16x8_0(v *Value) bool { 18065 b := v.Block 18066 typ := &b.Func.Config.Types 18067 // match: (Lsh16x8 x y) 18068 // result: (SLL x (ZeroExt8to32 y)) 18069 for { 18070 y := v.Args[1] 18071 x := v.Args[0] 18072 v.reset(OpARMSLL) 18073 v.AddArg(x) 18074 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 18075 v0.AddArg(y) 18076 v.AddArg(v0) 18077 return true 18078 } 18079 } 18080 func rewriteValueARM_OpLsh32x16_0(v *Value) bool { 18081 b := v.Block 18082 typ := &b.Func.Config.Types 18083 // match: (Lsh32x16 x y) 18084 // result: (CMOVWHSconst (SLL <x.Type> x (ZeroExt16to32 y)) (CMPconst [256] (ZeroExt16to32 y)) [0]) 18085 for { 18086 y := v.Args[1] 18087 x := v.Args[0] 18088 v.reset(OpARMCMOVWHSconst) 18089 v.AuxInt = 0 18090 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 18091 v0.AddArg(x) 18092 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 18093 v1.AddArg(y) 18094 v0.AddArg(v1) 18095 v.AddArg(v0) 18096 v2 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 18097 v2.AuxInt = 256 18098 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 18099 v3.AddArg(y) 18100 v2.AddArg(v3) 18101 v.AddArg(v2) 18102 return true 18103 } 18104 } 18105 func rewriteValueARM_OpLsh32x32_0(v *Value) bool { 18106 b := v.Block 18107 // match: (Lsh32x32 x y) 18108 // result: (CMOVWHSconst (SLL <x.Type> x y) (CMPconst [256] y) [0]) 18109 for { 18110 y := v.Args[1] 18111 x := v.Args[0] 18112 v.reset(OpARMCMOVWHSconst) 18113 v.AuxInt = 0 18114 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 18115 v0.AddArg(x) 18116 v0.AddArg(y) 18117 v.AddArg(v0) 18118 v1 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 18119 v1.AuxInt = 256 18120 v1.AddArg(y) 18121 v.AddArg(v1) 18122 return true 18123 } 18124 } 18125 func rewriteValueARM_OpLsh32x64_0(v *Value) bool { 18126 // match: (Lsh32x64 x (Const64 [c])) 18127 // cond: uint64(c) < 32 18128 // result: (SLLconst x [c]) 18129 for { 18130 _ = v.Args[1] 18131 x := v.Args[0] 18132 v_1 := v.Args[1] 18133 if v_1.Op != OpConst64 { 18134 break 18135 } 18136 c := v_1.AuxInt 18137 if !(uint64(c) < 32) { 18138 break 18139 } 18140 v.reset(OpARMSLLconst) 18141 v.AuxInt = c 18142 v.AddArg(x) 18143 return true 18144 } 18145 // match: (Lsh32x64 _ (Const64 [c])) 18146 // cond: uint64(c) >= 32 18147 // result: (Const32 [0]) 18148 for { 18149 _ = v.Args[1] 18150 v_1 := v.Args[1] 18151 if v_1.Op != OpConst64 { 18152 break 18153 } 18154 c := v_1.AuxInt 18155 if !(uint64(c) >= 32) { 18156 break 18157 } 18158 v.reset(OpConst32) 18159 v.AuxInt = 0 18160 return true 18161 } 18162 return false 18163 } 18164 func rewriteValueARM_OpLsh32x8_0(v *Value) bool { 18165 b := v.Block 18166 typ := &b.Func.Config.Types 18167 // match: (Lsh32x8 x y) 18168 // result: (SLL x (ZeroExt8to32 y)) 18169 for { 18170 y := v.Args[1] 18171 x := v.Args[0] 18172 v.reset(OpARMSLL) 18173 v.AddArg(x) 18174 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 18175 v0.AddArg(y) 18176 v.AddArg(v0) 18177 return true 18178 } 18179 } 18180 func rewriteValueARM_OpLsh8x16_0(v *Value) bool { 18181 b := v.Block 18182 typ := &b.Func.Config.Types 18183 // match: (Lsh8x16 x y) 18184 // result: (CMOVWHSconst (SLL <x.Type> x (ZeroExt16to32 y)) (CMPconst [256] (ZeroExt16to32 y)) [0]) 18185 for { 18186 y := v.Args[1] 18187 x := v.Args[0] 18188 v.reset(OpARMCMOVWHSconst) 18189 v.AuxInt = 0 18190 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 18191 v0.AddArg(x) 18192 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 18193 v1.AddArg(y) 18194 v0.AddArg(v1) 18195 v.AddArg(v0) 18196 v2 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 18197 v2.AuxInt = 256 18198 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 18199 v3.AddArg(y) 18200 v2.AddArg(v3) 18201 v.AddArg(v2) 18202 return true 18203 } 18204 } 18205 func rewriteValueARM_OpLsh8x32_0(v *Value) bool { 18206 b := v.Block 18207 // match: (Lsh8x32 x y) 18208 // result: (CMOVWHSconst (SLL <x.Type> x y) (CMPconst [256] y) [0]) 18209 for { 18210 y := v.Args[1] 18211 x := v.Args[0] 18212 v.reset(OpARMCMOVWHSconst) 18213 v.AuxInt = 0 18214 v0 := b.NewValue0(v.Pos, OpARMSLL, x.Type) 18215 v0.AddArg(x) 18216 v0.AddArg(y) 18217 v.AddArg(v0) 18218 v1 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 18219 v1.AuxInt = 256 18220 v1.AddArg(y) 18221 v.AddArg(v1) 18222 return true 18223 } 18224 } 18225 func rewriteValueARM_OpLsh8x64_0(v *Value) bool { 18226 // match: (Lsh8x64 x (Const64 [c])) 18227 // cond: uint64(c) < 8 18228 // result: (SLLconst x [c]) 18229 for { 18230 _ = v.Args[1] 18231 x := v.Args[0] 18232 v_1 := v.Args[1] 18233 if v_1.Op != OpConst64 { 18234 break 18235 } 18236 c := v_1.AuxInt 18237 if !(uint64(c) < 8) { 18238 break 18239 } 18240 v.reset(OpARMSLLconst) 18241 v.AuxInt = c 18242 v.AddArg(x) 18243 return true 18244 } 18245 // match: (Lsh8x64 _ (Const64 [c])) 18246 // cond: uint64(c) >= 8 18247 // result: (Const8 [0]) 18248 for { 18249 _ = v.Args[1] 18250 v_1 := v.Args[1] 18251 if v_1.Op != OpConst64 { 18252 break 18253 } 18254 c := v_1.AuxInt 18255 if !(uint64(c) >= 8) { 18256 break 18257 } 18258 v.reset(OpConst8) 18259 v.AuxInt = 0 18260 return true 18261 } 18262 return false 18263 } 18264 func rewriteValueARM_OpLsh8x8_0(v *Value) bool { 18265 b := v.Block 18266 typ := &b.Func.Config.Types 18267 // match: (Lsh8x8 x y) 18268 // result: (SLL x (ZeroExt8to32 y)) 18269 for { 18270 y := v.Args[1] 18271 x := v.Args[0] 18272 v.reset(OpARMSLL) 18273 v.AddArg(x) 18274 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 18275 v0.AddArg(y) 18276 v.AddArg(v0) 18277 return true 18278 } 18279 } 18280 func rewriteValueARM_OpMod16_0(v *Value) bool { 18281 b := v.Block 18282 typ := &b.Func.Config.Types 18283 // match: (Mod16 x y) 18284 // result: (Mod32 (SignExt16to32 x) (SignExt16to32 y)) 18285 for { 18286 y := v.Args[1] 18287 x := v.Args[0] 18288 v.reset(OpMod32) 18289 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 18290 v0.AddArg(x) 18291 v.AddArg(v0) 18292 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 18293 v1.AddArg(y) 18294 v.AddArg(v1) 18295 return true 18296 } 18297 } 18298 func rewriteValueARM_OpMod16u_0(v *Value) bool { 18299 b := v.Block 18300 typ := &b.Func.Config.Types 18301 // match: (Mod16u x y) 18302 // result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y)) 18303 for { 18304 y := v.Args[1] 18305 x := v.Args[0] 18306 v.reset(OpMod32u) 18307 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 18308 v0.AddArg(x) 18309 v.AddArg(v0) 18310 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 18311 v1.AddArg(y) 18312 v.AddArg(v1) 18313 return true 18314 } 18315 } 18316 func rewriteValueARM_OpMod32_0(v *Value) bool { 18317 b := v.Block 18318 typ := &b.Func.Config.Types 18319 // match: (Mod32 x y) 18320 // result: (SUB (XOR <typ.UInt32> (Select1 <typ.UInt32> (CALLudiv (SUB <typ.UInt32> (XOR <typ.UInt32> x (Signmask x)) (Signmask x)) (SUB <typ.UInt32> (XOR <typ.UInt32> y (Signmask y)) (Signmask y)))) (Signmask x)) (Signmask x)) 18321 for { 18322 y := v.Args[1] 18323 x := v.Args[0] 18324 v.reset(OpARMSUB) 18325 v0 := b.NewValue0(v.Pos, OpARMXOR, typ.UInt32) 18326 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt32) 18327 v2 := b.NewValue0(v.Pos, OpARMCALLudiv, types.NewTuple(typ.UInt32, typ.UInt32)) 18328 v3 := b.NewValue0(v.Pos, OpARMSUB, typ.UInt32) 18329 v4 := b.NewValue0(v.Pos, OpARMXOR, typ.UInt32) 18330 v4.AddArg(x) 18331 v5 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 18332 v5.AddArg(x) 18333 v4.AddArg(v5) 18334 v3.AddArg(v4) 18335 v6 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 18336 v6.AddArg(x) 18337 v3.AddArg(v6) 18338 v2.AddArg(v3) 18339 v7 := b.NewValue0(v.Pos, OpARMSUB, typ.UInt32) 18340 v8 := b.NewValue0(v.Pos, OpARMXOR, typ.UInt32) 18341 v8.AddArg(y) 18342 v9 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 18343 v9.AddArg(y) 18344 v8.AddArg(v9) 18345 v7.AddArg(v8) 18346 v10 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 18347 v10.AddArg(y) 18348 v7.AddArg(v10) 18349 v2.AddArg(v7) 18350 v1.AddArg(v2) 18351 v0.AddArg(v1) 18352 v11 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 18353 v11.AddArg(x) 18354 v0.AddArg(v11) 18355 v.AddArg(v0) 18356 v12 := b.NewValue0(v.Pos, OpSignmask, typ.Int32) 18357 v12.AddArg(x) 18358 v.AddArg(v12) 18359 return true 18360 } 18361 } 18362 func rewriteValueARM_OpMod32u_0(v *Value) bool { 18363 b := v.Block 18364 typ := &b.Func.Config.Types 18365 // match: (Mod32u x y) 18366 // result: (Select1 <typ.UInt32> (CALLudiv x y)) 18367 for { 18368 y := v.Args[1] 18369 x := v.Args[0] 18370 v.reset(OpSelect1) 18371 v.Type = typ.UInt32 18372 v0 := b.NewValue0(v.Pos, OpARMCALLudiv, types.NewTuple(typ.UInt32, typ.UInt32)) 18373 v0.AddArg(x) 18374 v0.AddArg(y) 18375 v.AddArg(v0) 18376 return true 18377 } 18378 } 18379 func rewriteValueARM_OpMod8_0(v *Value) bool { 18380 b := v.Block 18381 typ := &b.Func.Config.Types 18382 // match: (Mod8 x y) 18383 // result: (Mod32 (SignExt8to32 x) (SignExt8to32 y)) 18384 for { 18385 y := v.Args[1] 18386 x := v.Args[0] 18387 v.reset(OpMod32) 18388 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 18389 v0.AddArg(x) 18390 v.AddArg(v0) 18391 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 18392 v1.AddArg(y) 18393 v.AddArg(v1) 18394 return true 18395 } 18396 } 18397 func rewriteValueARM_OpMod8u_0(v *Value) bool { 18398 b := v.Block 18399 typ := &b.Func.Config.Types 18400 // match: (Mod8u x y) 18401 // result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y)) 18402 for { 18403 y := v.Args[1] 18404 x := v.Args[0] 18405 v.reset(OpMod32u) 18406 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 18407 v0.AddArg(x) 18408 v.AddArg(v0) 18409 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 18410 v1.AddArg(y) 18411 v.AddArg(v1) 18412 return true 18413 } 18414 } 18415 func rewriteValueARM_OpMove_0(v *Value) bool { 18416 b := v.Block 18417 config := b.Func.Config 18418 typ := &b.Func.Config.Types 18419 // match: (Move [0] _ _ mem) 18420 // result: mem 18421 for { 18422 if v.AuxInt != 0 { 18423 break 18424 } 18425 mem := v.Args[2] 18426 v.reset(OpCopy) 18427 v.Type = mem.Type 18428 v.AddArg(mem) 18429 return true 18430 } 18431 // match: (Move [1] dst src mem) 18432 // result: (MOVBstore dst (MOVBUload src mem) mem) 18433 for { 18434 if v.AuxInt != 1 { 18435 break 18436 } 18437 mem := v.Args[2] 18438 dst := v.Args[0] 18439 src := v.Args[1] 18440 v.reset(OpARMMOVBstore) 18441 v.AddArg(dst) 18442 v0 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18443 v0.AddArg(src) 18444 v0.AddArg(mem) 18445 v.AddArg(v0) 18446 v.AddArg(mem) 18447 return true 18448 } 18449 // match: (Move [2] {t} dst src mem) 18450 // cond: t.(*types.Type).Alignment()%2 == 0 18451 // result: (MOVHstore dst (MOVHUload src mem) mem) 18452 for { 18453 if v.AuxInt != 2 { 18454 break 18455 } 18456 t := v.Aux 18457 mem := v.Args[2] 18458 dst := v.Args[0] 18459 src := v.Args[1] 18460 if !(t.(*types.Type).Alignment()%2 == 0) { 18461 break 18462 } 18463 v.reset(OpARMMOVHstore) 18464 v.AddArg(dst) 18465 v0 := b.NewValue0(v.Pos, OpARMMOVHUload, typ.UInt16) 18466 v0.AddArg(src) 18467 v0.AddArg(mem) 18468 v.AddArg(v0) 18469 v.AddArg(mem) 18470 return true 18471 } 18472 // match: (Move [2] dst src mem) 18473 // result: (MOVBstore [1] dst (MOVBUload [1] src mem) (MOVBstore dst (MOVBUload src mem) mem)) 18474 for { 18475 if v.AuxInt != 2 { 18476 break 18477 } 18478 mem := v.Args[2] 18479 dst := v.Args[0] 18480 src := v.Args[1] 18481 v.reset(OpARMMOVBstore) 18482 v.AuxInt = 1 18483 v.AddArg(dst) 18484 v0 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18485 v0.AuxInt = 1 18486 v0.AddArg(src) 18487 v0.AddArg(mem) 18488 v.AddArg(v0) 18489 v1 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 18490 v1.AddArg(dst) 18491 v2 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18492 v2.AddArg(src) 18493 v2.AddArg(mem) 18494 v1.AddArg(v2) 18495 v1.AddArg(mem) 18496 v.AddArg(v1) 18497 return true 18498 } 18499 // match: (Move [4] {t} dst src mem) 18500 // cond: t.(*types.Type).Alignment()%4 == 0 18501 // result: (MOVWstore dst (MOVWload src mem) mem) 18502 for { 18503 if v.AuxInt != 4 { 18504 break 18505 } 18506 t := v.Aux 18507 mem := v.Args[2] 18508 dst := v.Args[0] 18509 src := v.Args[1] 18510 if !(t.(*types.Type).Alignment()%4 == 0) { 18511 break 18512 } 18513 v.reset(OpARMMOVWstore) 18514 v.AddArg(dst) 18515 v0 := b.NewValue0(v.Pos, OpARMMOVWload, typ.UInt32) 18516 v0.AddArg(src) 18517 v0.AddArg(mem) 18518 v.AddArg(v0) 18519 v.AddArg(mem) 18520 return true 18521 } 18522 // match: (Move [4] {t} dst src mem) 18523 // cond: t.(*types.Type).Alignment()%2 == 0 18524 // result: (MOVHstore [2] dst (MOVHUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem)) 18525 for { 18526 if v.AuxInt != 4 { 18527 break 18528 } 18529 t := v.Aux 18530 mem := v.Args[2] 18531 dst := v.Args[0] 18532 src := v.Args[1] 18533 if !(t.(*types.Type).Alignment()%2 == 0) { 18534 break 18535 } 18536 v.reset(OpARMMOVHstore) 18537 v.AuxInt = 2 18538 v.AddArg(dst) 18539 v0 := b.NewValue0(v.Pos, OpARMMOVHUload, typ.UInt16) 18540 v0.AuxInt = 2 18541 v0.AddArg(src) 18542 v0.AddArg(mem) 18543 v.AddArg(v0) 18544 v1 := b.NewValue0(v.Pos, OpARMMOVHstore, types.TypeMem) 18545 v1.AddArg(dst) 18546 v2 := b.NewValue0(v.Pos, OpARMMOVHUload, typ.UInt16) 18547 v2.AddArg(src) 18548 v2.AddArg(mem) 18549 v1.AddArg(v2) 18550 v1.AddArg(mem) 18551 v.AddArg(v1) 18552 return true 18553 } 18554 // match: (Move [4] dst src mem) 18555 // result: (MOVBstore [3] dst (MOVBUload [3] src mem) (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVBstore [1] dst (MOVBUload [1] src mem) (MOVBstore dst (MOVBUload src mem) mem)))) 18556 for { 18557 if v.AuxInt != 4 { 18558 break 18559 } 18560 mem := v.Args[2] 18561 dst := v.Args[0] 18562 src := v.Args[1] 18563 v.reset(OpARMMOVBstore) 18564 v.AuxInt = 3 18565 v.AddArg(dst) 18566 v0 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18567 v0.AuxInt = 3 18568 v0.AddArg(src) 18569 v0.AddArg(mem) 18570 v.AddArg(v0) 18571 v1 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 18572 v1.AuxInt = 2 18573 v1.AddArg(dst) 18574 v2 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18575 v2.AuxInt = 2 18576 v2.AddArg(src) 18577 v2.AddArg(mem) 18578 v1.AddArg(v2) 18579 v3 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 18580 v3.AuxInt = 1 18581 v3.AddArg(dst) 18582 v4 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18583 v4.AuxInt = 1 18584 v4.AddArg(src) 18585 v4.AddArg(mem) 18586 v3.AddArg(v4) 18587 v5 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 18588 v5.AddArg(dst) 18589 v6 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18590 v6.AddArg(src) 18591 v6.AddArg(mem) 18592 v5.AddArg(v6) 18593 v5.AddArg(mem) 18594 v3.AddArg(v5) 18595 v1.AddArg(v3) 18596 v.AddArg(v1) 18597 return true 18598 } 18599 // match: (Move [3] dst src mem) 18600 // result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVBstore [1] dst (MOVBUload [1] src mem) (MOVBstore dst (MOVBUload src mem) mem))) 18601 for { 18602 if v.AuxInt != 3 { 18603 break 18604 } 18605 mem := v.Args[2] 18606 dst := v.Args[0] 18607 src := v.Args[1] 18608 v.reset(OpARMMOVBstore) 18609 v.AuxInt = 2 18610 v.AddArg(dst) 18611 v0 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18612 v0.AuxInt = 2 18613 v0.AddArg(src) 18614 v0.AddArg(mem) 18615 v.AddArg(v0) 18616 v1 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 18617 v1.AuxInt = 1 18618 v1.AddArg(dst) 18619 v2 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18620 v2.AuxInt = 1 18621 v2.AddArg(src) 18622 v2.AddArg(mem) 18623 v1.AddArg(v2) 18624 v3 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 18625 v3.AddArg(dst) 18626 v4 := b.NewValue0(v.Pos, OpARMMOVBUload, typ.UInt8) 18627 v4.AddArg(src) 18628 v4.AddArg(mem) 18629 v3.AddArg(v4) 18630 v3.AddArg(mem) 18631 v1.AddArg(v3) 18632 v.AddArg(v1) 18633 return true 18634 } 18635 // match: (Move [s] {t} dst src mem) 18636 // cond: s%4 == 0 && s > 4 && s <= 512 && t.(*types.Type).Alignment()%4 == 0 && !config.noDuffDevice 18637 // result: (DUFFCOPY [8 * (128 - s/4)] dst src mem) 18638 for { 18639 s := v.AuxInt 18640 t := v.Aux 18641 mem := v.Args[2] 18642 dst := v.Args[0] 18643 src := v.Args[1] 18644 if !(s%4 == 0 && s > 4 && s <= 512 && t.(*types.Type).Alignment()%4 == 0 && !config.noDuffDevice) { 18645 break 18646 } 18647 v.reset(OpARMDUFFCOPY) 18648 v.AuxInt = 8 * (128 - s/4) 18649 v.AddArg(dst) 18650 v.AddArg(src) 18651 v.AddArg(mem) 18652 return true 18653 } 18654 // match: (Move [s] {t} dst src mem) 18655 // cond: (s > 512 || config.noDuffDevice) || t.(*types.Type).Alignment()%4 != 0 18656 // result: (LoweredMove [t.(*types.Type).Alignment()] dst src (ADDconst <src.Type> src [s-moveSize(t.(*types.Type).Alignment(), config)]) mem) 18657 for { 18658 s := v.AuxInt 18659 t := v.Aux 18660 mem := v.Args[2] 18661 dst := v.Args[0] 18662 src := v.Args[1] 18663 if !((s > 512 || config.noDuffDevice) || t.(*types.Type).Alignment()%4 != 0) { 18664 break 18665 } 18666 v.reset(OpARMLoweredMove) 18667 v.AuxInt = t.(*types.Type).Alignment() 18668 v.AddArg(dst) 18669 v.AddArg(src) 18670 v0 := b.NewValue0(v.Pos, OpARMADDconst, src.Type) 18671 v0.AuxInt = s - moveSize(t.(*types.Type).Alignment(), config) 18672 v0.AddArg(src) 18673 v.AddArg(v0) 18674 v.AddArg(mem) 18675 return true 18676 } 18677 return false 18678 } 18679 func rewriteValueARM_OpMul16_0(v *Value) bool { 18680 // match: (Mul16 x y) 18681 // result: (MUL x y) 18682 for { 18683 y := v.Args[1] 18684 x := v.Args[0] 18685 v.reset(OpARMMUL) 18686 v.AddArg(x) 18687 v.AddArg(y) 18688 return true 18689 } 18690 } 18691 func rewriteValueARM_OpMul32_0(v *Value) bool { 18692 // match: (Mul32 x y) 18693 // result: (MUL x y) 18694 for { 18695 y := v.Args[1] 18696 x := v.Args[0] 18697 v.reset(OpARMMUL) 18698 v.AddArg(x) 18699 v.AddArg(y) 18700 return true 18701 } 18702 } 18703 func rewriteValueARM_OpMul32F_0(v *Value) bool { 18704 // match: (Mul32F x y) 18705 // result: (MULF x y) 18706 for { 18707 y := v.Args[1] 18708 x := v.Args[0] 18709 v.reset(OpARMMULF) 18710 v.AddArg(x) 18711 v.AddArg(y) 18712 return true 18713 } 18714 } 18715 func rewriteValueARM_OpMul32uhilo_0(v *Value) bool { 18716 // match: (Mul32uhilo x y) 18717 // result: (MULLU x y) 18718 for { 18719 y := v.Args[1] 18720 x := v.Args[0] 18721 v.reset(OpARMMULLU) 18722 v.AddArg(x) 18723 v.AddArg(y) 18724 return true 18725 } 18726 } 18727 func rewriteValueARM_OpMul64F_0(v *Value) bool { 18728 // match: (Mul64F x y) 18729 // result: (MULD x y) 18730 for { 18731 y := v.Args[1] 18732 x := v.Args[0] 18733 v.reset(OpARMMULD) 18734 v.AddArg(x) 18735 v.AddArg(y) 18736 return true 18737 } 18738 } 18739 func rewriteValueARM_OpMul8_0(v *Value) bool { 18740 // match: (Mul8 x y) 18741 // result: (MUL x y) 18742 for { 18743 y := v.Args[1] 18744 x := v.Args[0] 18745 v.reset(OpARMMUL) 18746 v.AddArg(x) 18747 v.AddArg(y) 18748 return true 18749 } 18750 } 18751 func rewriteValueARM_OpNeg16_0(v *Value) bool { 18752 // match: (Neg16 x) 18753 // result: (RSBconst [0] x) 18754 for { 18755 x := v.Args[0] 18756 v.reset(OpARMRSBconst) 18757 v.AuxInt = 0 18758 v.AddArg(x) 18759 return true 18760 } 18761 } 18762 func rewriteValueARM_OpNeg32_0(v *Value) bool { 18763 // match: (Neg32 x) 18764 // result: (RSBconst [0] x) 18765 for { 18766 x := v.Args[0] 18767 v.reset(OpARMRSBconst) 18768 v.AuxInt = 0 18769 v.AddArg(x) 18770 return true 18771 } 18772 } 18773 func rewriteValueARM_OpNeg32F_0(v *Value) bool { 18774 // match: (Neg32F x) 18775 // result: (NEGF x) 18776 for { 18777 x := v.Args[0] 18778 v.reset(OpARMNEGF) 18779 v.AddArg(x) 18780 return true 18781 } 18782 } 18783 func rewriteValueARM_OpNeg64F_0(v *Value) bool { 18784 // match: (Neg64F x) 18785 // result: (NEGD x) 18786 for { 18787 x := v.Args[0] 18788 v.reset(OpARMNEGD) 18789 v.AddArg(x) 18790 return true 18791 } 18792 } 18793 func rewriteValueARM_OpNeg8_0(v *Value) bool { 18794 // match: (Neg8 x) 18795 // result: (RSBconst [0] x) 18796 for { 18797 x := v.Args[0] 18798 v.reset(OpARMRSBconst) 18799 v.AuxInt = 0 18800 v.AddArg(x) 18801 return true 18802 } 18803 } 18804 func rewriteValueARM_OpNeq16_0(v *Value) bool { 18805 b := v.Block 18806 typ := &b.Func.Config.Types 18807 // match: (Neq16 x y) 18808 // result: (NotEqual (CMP (ZeroExt16to32 x) (ZeroExt16to32 y))) 18809 for { 18810 y := v.Args[1] 18811 x := v.Args[0] 18812 v.reset(OpARMNotEqual) 18813 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 18814 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 18815 v1.AddArg(x) 18816 v0.AddArg(v1) 18817 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 18818 v2.AddArg(y) 18819 v0.AddArg(v2) 18820 v.AddArg(v0) 18821 return true 18822 } 18823 } 18824 func rewriteValueARM_OpNeq32_0(v *Value) bool { 18825 b := v.Block 18826 // match: (Neq32 x y) 18827 // result: (NotEqual (CMP x y)) 18828 for { 18829 y := v.Args[1] 18830 x := v.Args[0] 18831 v.reset(OpARMNotEqual) 18832 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 18833 v0.AddArg(x) 18834 v0.AddArg(y) 18835 v.AddArg(v0) 18836 return true 18837 } 18838 } 18839 func rewriteValueARM_OpNeq32F_0(v *Value) bool { 18840 b := v.Block 18841 // match: (Neq32F x y) 18842 // result: (NotEqual (CMPF x y)) 18843 for { 18844 y := v.Args[1] 18845 x := v.Args[0] 18846 v.reset(OpARMNotEqual) 18847 v0 := b.NewValue0(v.Pos, OpARMCMPF, types.TypeFlags) 18848 v0.AddArg(x) 18849 v0.AddArg(y) 18850 v.AddArg(v0) 18851 return true 18852 } 18853 } 18854 func rewriteValueARM_OpNeq64F_0(v *Value) bool { 18855 b := v.Block 18856 // match: (Neq64F x y) 18857 // result: (NotEqual (CMPD x y)) 18858 for { 18859 y := v.Args[1] 18860 x := v.Args[0] 18861 v.reset(OpARMNotEqual) 18862 v0 := b.NewValue0(v.Pos, OpARMCMPD, types.TypeFlags) 18863 v0.AddArg(x) 18864 v0.AddArg(y) 18865 v.AddArg(v0) 18866 return true 18867 } 18868 } 18869 func rewriteValueARM_OpNeq8_0(v *Value) bool { 18870 b := v.Block 18871 typ := &b.Func.Config.Types 18872 // match: (Neq8 x y) 18873 // result: (NotEqual (CMP (ZeroExt8to32 x) (ZeroExt8to32 y))) 18874 for { 18875 y := v.Args[1] 18876 x := v.Args[0] 18877 v.reset(OpARMNotEqual) 18878 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 18879 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 18880 v1.AddArg(x) 18881 v0.AddArg(v1) 18882 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 18883 v2.AddArg(y) 18884 v0.AddArg(v2) 18885 v.AddArg(v0) 18886 return true 18887 } 18888 } 18889 func rewriteValueARM_OpNeqB_0(v *Value) bool { 18890 // match: (NeqB x y) 18891 // result: (XOR x y) 18892 for { 18893 y := v.Args[1] 18894 x := v.Args[0] 18895 v.reset(OpARMXOR) 18896 v.AddArg(x) 18897 v.AddArg(y) 18898 return true 18899 } 18900 } 18901 func rewriteValueARM_OpNeqPtr_0(v *Value) bool { 18902 b := v.Block 18903 // match: (NeqPtr x y) 18904 // result: (NotEqual (CMP x y)) 18905 for { 18906 y := v.Args[1] 18907 x := v.Args[0] 18908 v.reset(OpARMNotEqual) 18909 v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags) 18910 v0.AddArg(x) 18911 v0.AddArg(y) 18912 v.AddArg(v0) 18913 return true 18914 } 18915 } 18916 func rewriteValueARM_OpNilCheck_0(v *Value) bool { 18917 // match: (NilCheck ptr mem) 18918 // result: (LoweredNilCheck ptr mem) 18919 for { 18920 mem := v.Args[1] 18921 ptr := v.Args[0] 18922 v.reset(OpARMLoweredNilCheck) 18923 v.AddArg(ptr) 18924 v.AddArg(mem) 18925 return true 18926 } 18927 } 18928 func rewriteValueARM_OpNot_0(v *Value) bool { 18929 // match: (Not x) 18930 // result: (XORconst [1] x) 18931 for { 18932 x := v.Args[0] 18933 v.reset(OpARMXORconst) 18934 v.AuxInt = 1 18935 v.AddArg(x) 18936 return true 18937 } 18938 } 18939 func rewriteValueARM_OpOffPtr_0(v *Value) bool { 18940 // match: (OffPtr [off] ptr:(SP)) 18941 // result: (MOVWaddr [off] ptr) 18942 for { 18943 off := v.AuxInt 18944 ptr := v.Args[0] 18945 if ptr.Op != OpSP { 18946 break 18947 } 18948 v.reset(OpARMMOVWaddr) 18949 v.AuxInt = off 18950 v.AddArg(ptr) 18951 return true 18952 } 18953 // match: (OffPtr [off] ptr) 18954 // result: (ADDconst [off] ptr) 18955 for { 18956 off := v.AuxInt 18957 ptr := v.Args[0] 18958 v.reset(OpARMADDconst) 18959 v.AuxInt = off 18960 v.AddArg(ptr) 18961 return true 18962 } 18963 } 18964 func rewriteValueARM_OpOr16_0(v *Value) bool { 18965 // match: (Or16 x y) 18966 // result: (OR x y) 18967 for { 18968 y := v.Args[1] 18969 x := v.Args[0] 18970 v.reset(OpARMOR) 18971 v.AddArg(x) 18972 v.AddArg(y) 18973 return true 18974 } 18975 } 18976 func rewriteValueARM_OpOr32_0(v *Value) bool { 18977 // match: (Or32 x y) 18978 // result: (OR x y) 18979 for { 18980 y := v.Args[1] 18981 x := v.Args[0] 18982 v.reset(OpARMOR) 18983 v.AddArg(x) 18984 v.AddArg(y) 18985 return true 18986 } 18987 } 18988 func rewriteValueARM_OpOr8_0(v *Value) bool { 18989 // match: (Or8 x y) 18990 // result: (OR x y) 18991 for { 18992 y := v.Args[1] 18993 x := v.Args[0] 18994 v.reset(OpARMOR) 18995 v.AddArg(x) 18996 v.AddArg(y) 18997 return true 18998 } 18999 } 19000 func rewriteValueARM_OpOrB_0(v *Value) bool { 19001 // match: (OrB x y) 19002 // result: (OR x y) 19003 for { 19004 y := v.Args[1] 19005 x := v.Args[0] 19006 v.reset(OpARMOR) 19007 v.AddArg(x) 19008 v.AddArg(y) 19009 return true 19010 } 19011 } 19012 func rewriteValueARM_OpPanicBounds_0(v *Value) bool { 19013 // match: (PanicBounds [kind] x y mem) 19014 // cond: boundsABI(kind) == 0 19015 // result: (LoweredPanicBoundsA [kind] x y mem) 19016 for { 19017 kind := v.AuxInt 19018 mem := v.Args[2] 19019 x := v.Args[0] 19020 y := v.Args[1] 19021 if !(boundsABI(kind) == 0) { 19022 break 19023 } 19024 v.reset(OpARMLoweredPanicBoundsA) 19025 v.AuxInt = kind 19026 v.AddArg(x) 19027 v.AddArg(y) 19028 v.AddArg(mem) 19029 return true 19030 } 19031 // match: (PanicBounds [kind] x y mem) 19032 // cond: boundsABI(kind) == 1 19033 // result: (LoweredPanicBoundsB [kind] x y mem) 19034 for { 19035 kind := v.AuxInt 19036 mem := v.Args[2] 19037 x := v.Args[0] 19038 y := v.Args[1] 19039 if !(boundsABI(kind) == 1) { 19040 break 19041 } 19042 v.reset(OpARMLoweredPanicBoundsB) 19043 v.AuxInt = kind 19044 v.AddArg(x) 19045 v.AddArg(y) 19046 v.AddArg(mem) 19047 return true 19048 } 19049 // match: (PanicBounds [kind] x y mem) 19050 // cond: boundsABI(kind) == 2 19051 // result: (LoweredPanicBoundsC [kind] x y mem) 19052 for { 19053 kind := v.AuxInt 19054 mem := v.Args[2] 19055 x := v.Args[0] 19056 y := v.Args[1] 19057 if !(boundsABI(kind) == 2) { 19058 break 19059 } 19060 v.reset(OpARMLoweredPanicBoundsC) 19061 v.AuxInt = kind 19062 v.AddArg(x) 19063 v.AddArg(y) 19064 v.AddArg(mem) 19065 return true 19066 } 19067 return false 19068 } 19069 func rewriteValueARM_OpPanicExtend_0(v *Value) bool { 19070 // match: (PanicExtend [kind] hi lo y mem) 19071 // cond: boundsABI(kind) == 0 19072 // result: (LoweredPanicExtendA [kind] hi lo y mem) 19073 for { 19074 kind := v.AuxInt 19075 mem := v.Args[3] 19076 hi := v.Args[0] 19077 lo := v.Args[1] 19078 y := v.Args[2] 19079 if !(boundsABI(kind) == 0) { 19080 break 19081 } 19082 v.reset(OpARMLoweredPanicExtendA) 19083 v.AuxInt = kind 19084 v.AddArg(hi) 19085 v.AddArg(lo) 19086 v.AddArg(y) 19087 v.AddArg(mem) 19088 return true 19089 } 19090 // match: (PanicExtend [kind] hi lo y mem) 19091 // cond: boundsABI(kind) == 1 19092 // result: (LoweredPanicExtendB [kind] hi lo y mem) 19093 for { 19094 kind := v.AuxInt 19095 mem := v.Args[3] 19096 hi := v.Args[0] 19097 lo := v.Args[1] 19098 y := v.Args[2] 19099 if !(boundsABI(kind) == 1) { 19100 break 19101 } 19102 v.reset(OpARMLoweredPanicExtendB) 19103 v.AuxInt = kind 19104 v.AddArg(hi) 19105 v.AddArg(lo) 19106 v.AddArg(y) 19107 v.AddArg(mem) 19108 return true 19109 } 19110 // match: (PanicExtend [kind] hi lo y mem) 19111 // cond: boundsABI(kind) == 2 19112 // result: (LoweredPanicExtendC [kind] hi lo y mem) 19113 for { 19114 kind := v.AuxInt 19115 mem := v.Args[3] 19116 hi := v.Args[0] 19117 lo := v.Args[1] 19118 y := v.Args[2] 19119 if !(boundsABI(kind) == 2) { 19120 break 19121 } 19122 v.reset(OpARMLoweredPanicExtendC) 19123 v.AuxInt = kind 19124 v.AddArg(hi) 19125 v.AddArg(lo) 19126 v.AddArg(y) 19127 v.AddArg(mem) 19128 return true 19129 } 19130 return false 19131 } 19132 func rewriteValueARM_OpRotateLeft16_0(v *Value) bool { 19133 b := v.Block 19134 typ := &b.Func.Config.Types 19135 // match: (RotateLeft16 <t> x (MOVWconst [c])) 19136 // result: (Or16 (Lsh16x32 <t> x (MOVWconst [c&15])) (Rsh16Ux32 <t> x (MOVWconst [-c&15]))) 19137 for { 19138 t := v.Type 19139 _ = v.Args[1] 19140 x := v.Args[0] 19141 v_1 := v.Args[1] 19142 if v_1.Op != OpARMMOVWconst { 19143 break 19144 } 19145 c := v_1.AuxInt 19146 v.reset(OpOr16) 19147 v0 := b.NewValue0(v.Pos, OpLsh16x32, t) 19148 v0.AddArg(x) 19149 v1 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 19150 v1.AuxInt = c & 15 19151 v0.AddArg(v1) 19152 v.AddArg(v0) 19153 v2 := b.NewValue0(v.Pos, OpRsh16Ux32, t) 19154 v2.AddArg(x) 19155 v3 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 19156 v3.AuxInt = -c & 15 19157 v2.AddArg(v3) 19158 v.AddArg(v2) 19159 return true 19160 } 19161 return false 19162 } 19163 func rewriteValueARM_OpRotateLeft32_0(v *Value) bool { 19164 b := v.Block 19165 // match: (RotateLeft32 x (MOVWconst [c])) 19166 // result: (SRRconst [-c&31] x) 19167 for { 19168 _ = v.Args[1] 19169 x := v.Args[0] 19170 v_1 := v.Args[1] 19171 if v_1.Op != OpARMMOVWconst { 19172 break 19173 } 19174 c := v_1.AuxInt 19175 v.reset(OpARMSRRconst) 19176 v.AuxInt = -c & 31 19177 v.AddArg(x) 19178 return true 19179 } 19180 // match: (RotateLeft32 x y) 19181 // result: (SRR x (RSBconst [0] <y.Type> y)) 19182 for { 19183 y := v.Args[1] 19184 x := v.Args[0] 19185 v.reset(OpARMSRR) 19186 v.AddArg(x) 19187 v0 := b.NewValue0(v.Pos, OpARMRSBconst, y.Type) 19188 v0.AuxInt = 0 19189 v0.AddArg(y) 19190 v.AddArg(v0) 19191 return true 19192 } 19193 } 19194 func rewriteValueARM_OpRotateLeft8_0(v *Value) bool { 19195 b := v.Block 19196 typ := &b.Func.Config.Types 19197 // match: (RotateLeft8 <t> x (MOVWconst [c])) 19198 // result: (Or8 (Lsh8x32 <t> x (MOVWconst [c&7])) (Rsh8Ux32 <t> x (MOVWconst [-c&7]))) 19199 for { 19200 t := v.Type 19201 _ = v.Args[1] 19202 x := v.Args[0] 19203 v_1 := v.Args[1] 19204 if v_1.Op != OpARMMOVWconst { 19205 break 19206 } 19207 c := v_1.AuxInt 19208 v.reset(OpOr8) 19209 v0 := b.NewValue0(v.Pos, OpLsh8x32, t) 19210 v0.AddArg(x) 19211 v1 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 19212 v1.AuxInt = c & 7 19213 v0.AddArg(v1) 19214 v.AddArg(v0) 19215 v2 := b.NewValue0(v.Pos, OpRsh8Ux32, t) 19216 v2.AddArg(x) 19217 v3 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 19218 v3.AuxInt = -c & 7 19219 v2.AddArg(v3) 19220 v.AddArg(v2) 19221 return true 19222 } 19223 return false 19224 } 19225 func rewriteValueARM_OpRound32F_0(v *Value) bool { 19226 // match: (Round32F x) 19227 // result: x 19228 for { 19229 x := v.Args[0] 19230 v.reset(OpCopy) 19231 v.Type = x.Type 19232 v.AddArg(x) 19233 return true 19234 } 19235 } 19236 func rewriteValueARM_OpRound64F_0(v *Value) bool { 19237 // match: (Round64F x) 19238 // result: x 19239 for { 19240 x := v.Args[0] 19241 v.reset(OpCopy) 19242 v.Type = x.Type 19243 v.AddArg(x) 19244 return true 19245 } 19246 } 19247 func rewriteValueARM_OpRsh16Ux16_0(v *Value) bool { 19248 b := v.Block 19249 typ := &b.Func.Config.Types 19250 // match: (Rsh16Ux16 x y) 19251 // result: (CMOVWHSconst (SRL <x.Type> (ZeroExt16to32 x) (ZeroExt16to32 y)) (CMPconst [256] (ZeroExt16to32 y)) [0]) 19252 for { 19253 y := v.Args[1] 19254 x := v.Args[0] 19255 v.reset(OpARMCMOVWHSconst) 19256 v.AuxInt = 0 19257 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 19258 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19259 v1.AddArg(x) 19260 v0.AddArg(v1) 19261 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19262 v2.AddArg(y) 19263 v0.AddArg(v2) 19264 v.AddArg(v0) 19265 v3 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19266 v3.AuxInt = 256 19267 v4 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19268 v4.AddArg(y) 19269 v3.AddArg(v4) 19270 v.AddArg(v3) 19271 return true 19272 } 19273 } 19274 func rewriteValueARM_OpRsh16Ux32_0(v *Value) bool { 19275 b := v.Block 19276 typ := &b.Func.Config.Types 19277 // match: (Rsh16Ux32 x y) 19278 // result: (CMOVWHSconst (SRL <x.Type> (ZeroExt16to32 x) y) (CMPconst [256] y) [0]) 19279 for { 19280 y := v.Args[1] 19281 x := v.Args[0] 19282 v.reset(OpARMCMOVWHSconst) 19283 v.AuxInt = 0 19284 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 19285 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19286 v1.AddArg(x) 19287 v0.AddArg(v1) 19288 v0.AddArg(y) 19289 v.AddArg(v0) 19290 v2 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19291 v2.AuxInt = 256 19292 v2.AddArg(y) 19293 v.AddArg(v2) 19294 return true 19295 } 19296 } 19297 func rewriteValueARM_OpRsh16Ux64_0(v *Value) bool { 19298 b := v.Block 19299 typ := &b.Func.Config.Types 19300 // match: (Rsh16Ux64 x (Const64 [c])) 19301 // cond: uint64(c) < 16 19302 // result: (SRLconst (SLLconst <typ.UInt32> x [16]) [c+16]) 19303 for { 19304 _ = v.Args[1] 19305 x := v.Args[0] 19306 v_1 := v.Args[1] 19307 if v_1.Op != OpConst64 { 19308 break 19309 } 19310 c := v_1.AuxInt 19311 if !(uint64(c) < 16) { 19312 break 19313 } 19314 v.reset(OpARMSRLconst) 19315 v.AuxInt = c + 16 19316 v0 := b.NewValue0(v.Pos, OpARMSLLconst, typ.UInt32) 19317 v0.AuxInt = 16 19318 v0.AddArg(x) 19319 v.AddArg(v0) 19320 return true 19321 } 19322 // match: (Rsh16Ux64 _ (Const64 [c])) 19323 // cond: uint64(c) >= 16 19324 // result: (Const16 [0]) 19325 for { 19326 _ = v.Args[1] 19327 v_1 := v.Args[1] 19328 if v_1.Op != OpConst64 { 19329 break 19330 } 19331 c := v_1.AuxInt 19332 if !(uint64(c) >= 16) { 19333 break 19334 } 19335 v.reset(OpConst16) 19336 v.AuxInt = 0 19337 return true 19338 } 19339 return false 19340 } 19341 func rewriteValueARM_OpRsh16Ux8_0(v *Value) bool { 19342 b := v.Block 19343 typ := &b.Func.Config.Types 19344 // match: (Rsh16Ux8 x y) 19345 // result: (SRL (ZeroExt16to32 x) (ZeroExt8to32 y)) 19346 for { 19347 y := v.Args[1] 19348 x := v.Args[0] 19349 v.reset(OpARMSRL) 19350 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19351 v0.AddArg(x) 19352 v.AddArg(v0) 19353 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 19354 v1.AddArg(y) 19355 v.AddArg(v1) 19356 return true 19357 } 19358 } 19359 func rewriteValueARM_OpRsh16x16_0(v *Value) bool { 19360 b := v.Block 19361 typ := &b.Func.Config.Types 19362 // match: (Rsh16x16 x y) 19363 // result: (SRAcond (SignExt16to32 x) (ZeroExt16to32 y) (CMPconst [256] (ZeroExt16to32 y))) 19364 for { 19365 y := v.Args[1] 19366 x := v.Args[0] 19367 v.reset(OpARMSRAcond) 19368 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 19369 v0.AddArg(x) 19370 v.AddArg(v0) 19371 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19372 v1.AddArg(y) 19373 v.AddArg(v1) 19374 v2 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19375 v2.AuxInt = 256 19376 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19377 v3.AddArg(y) 19378 v2.AddArg(v3) 19379 v.AddArg(v2) 19380 return true 19381 } 19382 } 19383 func rewriteValueARM_OpRsh16x32_0(v *Value) bool { 19384 b := v.Block 19385 typ := &b.Func.Config.Types 19386 // match: (Rsh16x32 x y) 19387 // result: (SRAcond (SignExt16to32 x) y (CMPconst [256] y)) 19388 for { 19389 y := v.Args[1] 19390 x := v.Args[0] 19391 v.reset(OpARMSRAcond) 19392 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 19393 v0.AddArg(x) 19394 v.AddArg(v0) 19395 v.AddArg(y) 19396 v1 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19397 v1.AuxInt = 256 19398 v1.AddArg(y) 19399 v.AddArg(v1) 19400 return true 19401 } 19402 } 19403 func rewriteValueARM_OpRsh16x64_0(v *Value) bool { 19404 b := v.Block 19405 typ := &b.Func.Config.Types 19406 // match: (Rsh16x64 x (Const64 [c])) 19407 // cond: uint64(c) < 16 19408 // result: (SRAconst (SLLconst <typ.UInt32> x [16]) [c+16]) 19409 for { 19410 _ = v.Args[1] 19411 x := v.Args[0] 19412 v_1 := v.Args[1] 19413 if v_1.Op != OpConst64 { 19414 break 19415 } 19416 c := v_1.AuxInt 19417 if !(uint64(c) < 16) { 19418 break 19419 } 19420 v.reset(OpARMSRAconst) 19421 v.AuxInt = c + 16 19422 v0 := b.NewValue0(v.Pos, OpARMSLLconst, typ.UInt32) 19423 v0.AuxInt = 16 19424 v0.AddArg(x) 19425 v.AddArg(v0) 19426 return true 19427 } 19428 // match: (Rsh16x64 x (Const64 [c])) 19429 // cond: uint64(c) >= 16 19430 // result: (SRAconst (SLLconst <typ.UInt32> x [16]) [31]) 19431 for { 19432 _ = v.Args[1] 19433 x := v.Args[0] 19434 v_1 := v.Args[1] 19435 if v_1.Op != OpConst64 { 19436 break 19437 } 19438 c := v_1.AuxInt 19439 if !(uint64(c) >= 16) { 19440 break 19441 } 19442 v.reset(OpARMSRAconst) 19443 v.AuxInt = 31 19444 v0 := b.NewValue0(v.Pos, OpARMSLLconst, typ.UInt32) 19445 v0.AuxInt = 16 19446 v0.AddArg(x) 19447 v.AddArg(v0) 19448 return true 19449 } 19450 return false 19451 } 19452 func rewriteValueARM_OpRsh16x8_0(v *Value) bool { 19453 b := v.Block 19454 typ := &b.Func.Config.Types 19455 // match: (Rsh16x8 x y) 19456 // result: (SRA (SignExt16to32 x) (ZeroExt8to32 y)) 19457 for { 19458 y := v.Args[1] 19459 x := v.Args[0] 19460 v.reset(OpARMSRA) 19461 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32) 19462 v0.AddArg(x) 19463 v.AddArg(v0) 19464 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 19465 v1.AddArg(y) 19466 v.AddArg(v1) 19467 return true 19468 } 19469 } 19470 func rewriteValueARM_OpRsh32Ux16_0(v *Value) bool { 19471 b := v.Block 19472 typ := &b.Func.Config.Types 19473 // match: (Rsh32Ux16 x y) 19474 // result: (CMOVWHSconst (SRL <x.Type> x (ZeroExt16to32 y)) (CMPconst [256] (ZeroExt16to32 y)) [0]) 19475 for { 19476 y := v.Args[1] 19477 x := v.Args[0] 19478 v.reset(OpARMCMOVWHSconst) 19479 v.AuxInt = 0 19480 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 19481 v0.AddArg(x) 19482 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19483 v1.AddArg(y) 19484 v0.AddArg(v1) 19485 v.AddArg(v0) 19486 v2 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19487 v2.AuxInt = 256 19488 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19489 v3.AddArg(y) 19490 v2.AddArg(v3) 19491 v.AddArg(v2) 19492 return true 19493 } 19494 } 19495 func rewriteValueARM_OpRsh32Ux32_0(v *Value) bool { 19496 b := v.Block 19497 // match: (Rsh32Ux32 x y) 19498 // result: (CMOVWHSconst (SRL <x.Type> x y) (CMPconst [256] y) [0]) 19499 for { 19500 y := v.Args[1] 19501 x := v.Args[0] 19502 v.reset(OpARMCMOVWHSconst) 19503 v.AuxInt = 0 19504 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 19505 v0.AddArg(x) 19506 v0.AddArg(y) 19507 v.AddArg(v0) 19508 v1 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19509 v1.AuxInt = 256 19510 v1.AddArg(y) 19511 v.AddArg(v1) 19512 return true 19513 } 19514 } 19515 func rewriteValueARM_OpRsh32Ux64_0(v *Value) bool { 19516 // match: (Rsh32Ux64 x (Const64 [c])) 19517 // cond: uint64(c) < 32 19518 // result: (SRLconst x [c]) 19519 for { 19520 _ = v.Args[1] 19521 x := v.Args[0] 19522 v_1 := v.Args[1] 19523 if v_1.Op != OpConst64 { 19524 break 19525 } 19526 c := v_1.AuxInt 19527 if !(uint64(c) < 32) { 19528 break 19529 } 19530 v.reset(OpARMSRLconst) 19531 v.AuxInt = c 19532 v.AddArg(x) 19533 return true 19534 } 19535 // match: (Rsh32Ux64 _ (Const64 [c])) 19536 // cond: uint64(c) >= 32 19537 // result: (Const32 [0]) 19538 for { 19539 _ = v.Args[1] 19540 v_1 := v.Args[1] 19541 if v_1.Op != OpConst64 { 19542 break 19543 } 19544 c := v_1.AuxInt 19545 if !(uint64(c) >= 32) { 19546 break 19547 } 19548 v.reset(OpConst32) 19549 v.AuxInt = 0 19550 return true 19551 } 19552 return false 19553 } 19554 func rewriteValueARM_OpRsh32Ux8_0(v *Value) bool { 19555 b := v.Block 19556 typ := &b.Func.Config.Types 19557 // match: (Rsh32Ux8 x y) 19558 // result: (SRL x (ZeroExt8to32 y)) 19559 for { 19560 y := v.Args[1] 19561 x := v.Args[0] 19562 v.reset(OpARMSRL) 19563 v.AddArg(x) 19564 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 19565 v0.AddArg(y) 19566 v.AddArg(v0) 19567 return true 19568 } 19569 } 19570 func rewriteValueARM_OpRsh32x16_0(v *Value) bool { 19571 b := v.Block 19572 typ := &b.Func.Config.Types 19573 // match: (Rsh32x16 x y) 19574 // result: (SRAcond x (ZeroExt16to32 y) (CMPconst [256] (ZeroExt16to32 y))) 19575 for { 19576 y := v.Args[1] 19577 x := v.Args[0] 19578 v.reset(OpARMSRAcond) 19579 v.AddArg(x) 19580 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19581 v0.AddArg(y) 19582 v.AddArg(v0) 19583 v1 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19584 v1.AuxInt = 256 19585 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19586 v2.AddArg(y) 19587 v1.AddArg(v2) 19588 v.AddArg(v1) 19589 return true 19590 } 19591 } 19592 func rewriteValueARM_OpRsh32x32_0(v *Value) bool { 19593 b := v.Block 19594 // match: (Rsh32x32 x y) 19595 // result: (SRAcond x y (CMPconst [256] y)) 19596 for { 19597 y := v.Args[1] 19598 x := v.Args[0] 19599 v.reset(OpARMSRAcond) 19600 v.AddArg(x) 19601 v.AddArg(y) 19602 v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19603 v0.AuxInt = 256 19604 v0.AddArg(y) 19605 v.AddArg(v0) 19606 return true 19607 } 19608 } 19609 func rewriteValueARM_OpRsh32x64_0(v *Value) bool { 19610 // match: (Rsh32x64 x (Const64 [c])) 19611 // cond: uint64(c) < 32 19612 // result: (SRAconst x [c]) 19613 for { 19614 _ = v.Args[1] 19615 x := v.Args[0] 19616 v_1 := v.Args[1] 19617 if v_1.Op != OpConst64 { 19618 break 19619 } 19620 c := v_1.AuxInt 19621 if !(uint64(c) < 32) { 19622 break 19623 } 19624 v.reset(OpARMSRAconst) 19625 v.AuxInt = c 19626 v.AddArg(x) 19627 return true 19628 } 19629 // match: (Rsh32x64 x (Const64 [c])) 19630 // cond: uint64(c) >= 32 19631 // result: (SRAconst x [31]) 19632 for { 19633 _ = v.Args[1] 19634 x := v.Args[0] 19635 v_1 := v.Args[1] 19636 if v_1.Op != OpConst64 { 19637 break 19638 } 19639 c := v_1.AuxInt 19640 if !(uint64(c) >= 32) { 19641 break 19642 } 19643 v.reset(OpARMSRAconst) 19644 v.AuxInt = 31 19645 v.AddArg(x) 19646 return true 19647 } 19648 return false 19649 } 19650 func rewriteValueARM_OpRsh32x8_0(v *Value) bool { 19651 b := v.Block 19652 typ := &b.Func.Config.Types 19653 // match: (Rsh32x8 x y) 19654 // result: (SRA x (ZeroExt8to32 y)) 19655 for { 19656 y := v.Args[1] 19657 x := v.Args[0] 19658 v.reset(OpARMSRA) 19659 v.AddArg(x) 19660 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 19661 v0.AddArg(y) 19662 v.AddArg(v0) 19663 return true 19664 } 19665 } 19666 func rewriteValueARM_OpRsh8Ux16_0(v *Value) bool { 19667 b := v.Block 19668 typ := &b.Func.Config.Types 19669 // match: (Rsh8Ux16 x y) 19670 // result: (CMOVWHSconst (SRL <x.Type> (ZeroExt8to32 x) (ZeroExt16to32 y)) (CMPconst [256] (ZeroExt16to32 y)) [0]) 19671 for { 19672 y := v.Args[1] 19673 x := v.Args[0] 19674 v.reset(OpARMCMOVWHSconst) 19675 v.AuxInt = 0 19676 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 19677 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 19678 v1.AddArg(x) 19679 v0.AddArg(v1) 19680 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19681 v2.AddArg(y) 19682 v0.AddArg(v2) 19683 v.AddArg(v0) 19684 v3 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19685 v3.AuxInt = 256 19686 v4 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19687 v4.AddArg(y) 19688 v3.AddArg(v4) 19689 v.AddArg(v3) 19690 return true 19691 } 19692 } 19693 func rewriteValueARM_OpRsh8Ux32_0(v *Value) bool { 19694 b := v.Block 19695 typ := &b.Func.Config.Types 19696 // match: (Rsh8Ux32 x y) 19697 // result: (CMOVWHSconst (SRL <x.Type> (ZeroExt8to32 x) y) (CMPconst [256] y) [0]) 19698 for { 19699 y := v.Args[1] 19700 x := v.Args[0] 19701 v.reset(OpARMCMOVWHSconst) 19702 v.AuxInt = 0 19703 v0 := b.NewValue0(v.Pos, OpARMSRL, x.Type) 19704 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 19705 v1.AddArg(x) 19706 v0.AddArg(v1) 19707 v0.AddArg(y) 19708 v.AddArg(v0) 19709 v2 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19710 v2.AuxInt = 256 19711 v2.AddArg(y) 19712 v.AddArg(v2) 19713 return true 19714 } 19715 } 19716 func rewriteValueARM_OpRsh8Ux64_0(v *Value) bool { 19717 b := v.Block 19718 typ := &b.Func.Config.Types 19719 // match: (Rsh8Ux64 x (Const64 [c])) 19720 // cond: uint64(c) < 8 19721 // result: (SRLconst (SLLconst <typ.UInt32> x [24]) [c+24]) 19722 for { 19723 _ = v.Args[1] 19724 x := v.Args[0] 19725 v_1 := v.Args[1] 19726 if v_1.Op != OpConst64 { 19727 break 19728 } 19729 c := v_1.AuxInt 19730 if !(uint64(c) < 8) { 19731 break 19732 } 19733 v.reset(OpARMSRLconst) 19734 v.AuxInt = c + 24 19735 v0 := b.NewValue0(v.Pos, OpARMSLLconst, typ.UInt32) 19736 v0.AuxInt = 24 19737 v0.AddArg(x) 19738 v.AddArg(v0) 19739 return true 19740 } 19741 // match: (Rsh8Ux64 _ (Const64 [c])) 19742 // cond: uint64(c) >= 8 19743 // result: (Const8 [0]) 19744 for { 19745 _ = v.Args[1] 19746 v_1 := v.Args[1] 19747 if v_1.Op != OpConst64 { 19748 break 19749 } 19750 c := v_1.AuxInt 19751 if !(uint64(c) >= 8) { 19752 break 19753 } 19754 v.reset(OpConst8) 19755 v.AuxInt = 0 19756 return true 19757 } 19758 return false 19759 } 19760 func rewriteValueARM_OpRsh8Ux8_0(v *Value) bool { 19761 b := v.Block 19762 typ := &b.Func.Config.Types 19763 // match: (Rsh8Ux8 x y) 19764 // result: (SRL (ZeroExt8to32 x) (ZeroExt8to32 y)) 19765 for { 19766 y := v.Args[1] 19767 x := v.Args[0] 19768 v.reset(OpARMSRL) 19769 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 19770 v0.AddArg(x) 19771 v.AddArg(v0) 19772 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 19773 v1.AddArg(y) 19774 v.AddArg(v1) 19775 return true 19776 } 19777 } 19778 func rewriteValueARM_OpRsh8x16_0(v *Value) bool { 19779 b := v.Block 19780 typ := &b.Func.Config.Types 19781 // match: (Rsh8x16 x y) 19782 // result: (SRAcond (SignExt8to32 x) (ZeroExt16to32 y) (CMPconst [256] (ZeroExt16to32 y))) 19783 for { 19784 y := v.Args[1] 19785 x := v.Args[0] 19786 v.reset(OpARMSRAcond) 19787 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 19788 v0.AddArg(x) 19789 v.AddArg(v0) 19790 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19791 v1.AddArg(y) 19792 v.AddArg(v1) 19793 v2 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19794 v2.AuxInt = 256 19795 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32) 19796 v3.AddArg(y) 19797 v2.AddArg(v3) 19798 v.AddArg(v2) 19799 return true 19800 } 19801 } 19802 func rewriteValueARM_OpRsh8x32_0(v *Value) bool { 19803 b := v.Block 19804 typ := &b.Func.Config.Types 19805 // match: (Rsh8x32 x y) 19806 // result: (SRAcond (SignExt8to32 x) y (CMPconst [256] y)) 19807 for { 19808 y := v.Args[1] 19809 x := v.Args[0] 19810 v.reset(OpARMSRAcond) 19811 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 19812 v0.AddArg(x) 19813 v.AddArg(v0) 19814 v.AddArg(y) 19815 v1 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags) 19816 v1.AuxInt = 256 19817 v1.AddArg(y) 19818 v.AddArg(v1) 19819 return true 19820 } 19821 } 19822 func rewriteValueARM_OpRsh8x64_0(v *Value) bool { 19823 b := v.Block 19824 typ := &b.Func.Config.Types 19825 // match: (Rsh8x64 x (Const64 [c])) 19826 // cond: uint64(c) < 8 19827 // result: (SRAconst (SLLconst <typ.UInt32> x [24]) [c+24]) 19828 for { 19829 _ = v.Args[1] 19830 x := v.Args[0] 19831 v_1 := v.Args[1] 19832 if v_1.Op != OpConst64 { 19833 break 19834 } 19835 c := v_1.AuxInt 19836 if !(uint64(c) < 8) { 19837 break 19838 } 19839 v.reset(OpARMSRAconst) 19840 v.AuxInt = c + 24 19841 v0 := b.NewValue0(v.Pos, OpARMSLLconst, typ.UInt32) 19842 v0.AuxInt = 24 19843 v0.AddArg(x) 19844 v.AddArg(v0) 19845 return true 19846 } 19847 // match: (Rsh8x64 x (Const64 [c])) 19848 // cond: uint64(c) >= 8 19849 // result: (SRAconst (SLLconst <typ.UInt32> x [24]) [31]) 19850 for { 19851 _ = v.Args[1] 19852 x := v.Args[0] 19853 v_1 := v.Args[1] 19854 if v_1.Op != OpConst64 { 19855 break 19856 } 19857 c := v_1.AuxInt 19858 if !(uint64(c) >= 8) { 19859 break 19860 } 19861 v.reset(OpARMSRAconst) 19862 v.AuxInt = 31 19863 v0 := b.NewValue0(v.Pos, OpARMSLLconst, typ.UInt32) 19864 v0.AuxInt = 24 19865 v0.AddArg(x) 19866 v.AddArg(v0) 19867 return true 19868 } 19869 return false 19870 } 19871 func rewriteValueARM_OpRsh8x8_0(v *Value) bool { 19872 b := v.Block 19873 typ := &b.Func.Config.Types 19874 // match: (Rsh8x8 x y) 19875 // result: (SRA (SignExt8to32 x) (ZeroExt8to32 y)) 19876 for { 19877 y := v.Args[1] 19878 x := v.Args[0] 19879 v.reset(OpARMSRA) 19880 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32) 19881 v0.AddArg(x) 19882 v.AddArg(v0) 19883 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32) 19884 v1.AddArg(y) 19885 v.AddArg(v1) 19886 return true 19887 } 19888 } 19889 func rewriteValueARM_OpSelect0_0(v *Value) bool { 19890 // match: (Select0 (CALLudiv x (MOVWconst [1]))) 19891 // result: x 19892 for { 19893 v_0 := v.Args[0] 19894 if v_0.Op != OpARMCALLudiv { 19895 break 19896 } 19897 _ = v_0.Args[1] 19898 x := v_0.Args[0] 19899 v_0_1 := v_0.Args[1] 19900 if v_0_1.Op != OpARMMOVWconst || v_0_1.AuxInt != 1 { 19901 break 19902 } 19903 v.reset(OpCopy) 19904 v.Type = x.Type 19905 v.AddArg(x) 19906 return true 19907 } 19908 // match: (Select0 (CALLudiv x (MOVWconst [c]))) 19909 // cond: isPowerOfTwo(c) 19910 // result: (SRLconst [log2(c)] x) 19911 for { 19912 v_0 := v.Args[0] 19913 if v_0.Op != OpARMCALLudiv { 19914 break 19915 } 19916 _ = v_0.Args[1] 19917 x := v_0.Args[0] 19918 v_0_1 := v_0.Args[1] 19919 if v_0_1.Op != OpARMMOVWconst { 19920 break 19921 } 19922 c := v_0_1.AuxInt 19923 if !(isPowerOfTwo(c)) { 19924 break 19925 } 19926 v.reset(OpARMSRLconst) 19927 v.AuxInt = log2(c) 19928 v.AddArg(x) 19929 return true 19930 } 19931 // match: (Select0 (CALLudiv (MOVWconst [c]) (MOVWconst [d]))) 19932 // result: (MOVWconst [int64(int32(uint32(c)/uint32(d)))]) 19933 for { 19934 v_0 := v.Args[0] 19935 if v_0.Op != OpARMCALLudiv { 19936 break 19937 } 19938 _ = v_0.Args[1] 19939 v_0_0 := v_0.Args[0] 19940 if v_0_0.Op != OpARMMOVWconst { 19941 break 19942 } 19943 c := v_0_0.AuxInt 19944 v_0_1 := v_0.Args[1] 19945 if v_0_1.Op != OpARMMOVWconst { 19946 break 19947 } 19948 d := v_0_1.AuxInt 19949 v.reset(OpARMMOVWconst) 19950 v.AuxInt = int64(int32(uint32(c) / uint32(d))) 19951 return true 19952 } 19953 return false 19954 } 19955 func rewriteValueARM_OpSelect1_0(v *Value) bool { 19956 // match: (Select1 (CALLudiv _ (MOVWconst [1]))) 19957 // result: (MOVWconst [0]) 19958 for { 19959 v_0 := v.Args[0] 19960 if v_0.Op != OpARMCALLudiv { 19961 break 19962 } 19963 _ = v_0.Args[1] 19964 v_0_1 := v_0.Args[1] 19965 if v_0_1.Op != OpARMMOVWconst || v_0_1.AuxInt != 1 { 19966 break 19967 } 19968 v.reset(OpARMMOVWconst) 19969 v.AuxInt = 0 19970 return true 19971 } 19972 // match: (Select1 (CALLudiv x (MOVWconst [c]))) 19973 // cond: isPowerOfTwo(c) 19974 // result: (ANDconst [c-1] x) 19975 for { 19976 v_0 := v.Args[0] 19977 if v_0.Op != OpARMCALLudiv { 19978 break 19979 } 19980 _ = v_0.Args[1] 19981 x := v_0.Args[0] 19982 v_0_1 := v_0.Args[1] 19983 if v_0_1.Op != OpARMMOVWconst { 19984 break 19985 } 19986 c := v_0_1.AuxInt 19987 if !(isPowerOfTwo(c)) { 19988 break 19989 } 19990 v.reset(OpARMANDconst) 19991 v.AuxInt = c - 1 19992 v.AddArg(x) 19993 return true 19994 } 19995 // match: (Select1 (CALLudiv (MOVWconst [c]) (MOVWconst [d]))) 19996 // result: (MOVWconst [int64(int32(uint32(c)%uint32(d)))]) 19997 for { 19998 v_0 := v.Args[0] 19999 if v_0.Op != OpARMCALLudiv { 20000 break 20001 } 20002 _ = v_0.Args[1] 20003 v_0_0 := v_0.Args[0] 20004 if v_0_0.Op != OpARMMOVWconst { 20005 break 20006 } 20007 c := v_0_0.AuxInt 20008 v_0_1 := v_0.Args[1] 20009 if v_0_1.Op != OpARMMOVWconst { 20010 break 20011 } 20012 d := v_0_1.AuxInt 20013 v.reset(OpARMMOVWconst) 20014 v.AuxInt = int64(int32(uint32(c) % uint32(d))) 20015 return true 20016 } 20017 return false 20018 } 20019 func rewriteValueARM_OpSignExt16to32_0(v *Value) bool { 20020 // match: (SignExt16to32 x) 20021 // result: (MOVHreg x) 20022 for { 20023 x := v.Args[0] 20024 v.reset(OpARMMOVHreg) 20025 v.AddArg(x) 20026 return true 20027 } 20028 } 20029 func rewriteValueARM_OpSignExt8to16_0(v *Value) bool { 20030 // match: (SignExt8to16 x) 20031 // result: (MOVBreg x) 20032 for { 20033 x := v.Args[0] 20034 v.reset(OpARMMOVBreg) 20035 v.AddArg(x) 20036 return true 20037 } 20038 } 20039 func rewriteValueARM_OpSignExt8to32_0(v *Value) bool { 20040 // match: (SignExt8to32 x) 20041 // result: (MOVBreg x) 20042 for { 20043 x := v.Args[0] 20044 v.reset(OpARMMOVBreg) 20045 v.AddArg(x) 20046 return true 20047 } 20048 } 20049 func rewriteValueARM_OpSignmask_0(v *Value) bool { 20050 // match: (Signmask x) 20051 // result: (SRAconst x [31]) 20052 for { 20053 x := v.Args[0] 20054 v.reset(OpARMSRAconst) 20055 v.AuxInt = 31 20056 v.AddArg(x) 20057 return true 20058 } 20059 } 20060 func rewriteValueARM_OpSlicemask_0(v *Value) bool { 20061 b := v.Block 20062 // match: (Slicemask <t> x) 20063 // result: (SRAconst (RSBconst <t> [0] x) [31]) 20064 for { 20065 t := v.Type 20066 x := v.Args[0] 20067 v.reset(OpARMSRAconst) 20068 v.AuxInt = 31 20069 v0 := b.NewValue0(v.Pos, OpARMRSBconst, t) 20070 v0.AuxInt = 0 20071 v0.AddArg(x) 20072 v.AddArg(v0) 20073 return true 20074 } 20075 } 20076 func rewriteValueARM_OpSqrt_0(v *Value) bool { 20077 // match: (Sqrt x) 20078 // result: (SQRTD x) 20079 for { 20080 x := v.Args[0] 20081 v.reset(OpARMSQRTD) 20082 v.AddArg(x) 20083 return true 20084 } 20085 } 20086 func rewriteValueARM_OpStaticCall_0(v *Value) bool { 20087 // match: (StaticCall [argwid] {target} mem) 20088 // result: (CALLstatic [argwid] {target} mem) 20089 for { 20090 argwid := v.AuxInt 20091 target := v.Aux 20092 mem := v.Args[0] 20093 v.reset(OpARMCALLstatic) 20094 v.AuxInt = argwid 20095 v.Aux = target 20096 v.AddArg(mem) 20097 return true 20098 } 20099 } 20100 func rewriteValueARM_OpStore_0(v *Value) bool { 20101 // match: (Store {t} ptr val mem) 20102 // cond: t.(*types.Type).Size() == 1 20103 // result: (MOVBstore ptr val mem) 20104 for { 20105 t := v.Aux 20106 mem := v.Args[2] 20107 ptr := v.Args[0] 20108 val := v.Args[1] 20109 if !(t.(*types.Type).Size() == 1) { 20110 break 20111 } 20112 v.reset(OpARMMOVBstore) 20113 v.AddArg(ptr) 20114 v.AddArg(val) 20115 v.AddArg(mem) 20116 return true 20117 } 20118 // match: (Store {t} ptr val mem) 20119 // cond: t.(*types.Type).Size() == 2 20120 // result: (MOVHstore ptr val mem) 20121 for { 20122 t := v.Aux 20123 mem := v.Args[2] 20124 ptr := v.Args[0] 20125 val := v.Args[1] 20126 if !(t.(*types.Type).Size() == 2) { 20127 break 20128 } 20129 v.reset(OpARMMOVHstore) 20130 v.AddArg(ptr) 20131 v.AddArg(val) 20132 v.AddArg(mem) 20133 return true 20134 } 20135 // match: (Store {t} ptr val mem) 20136 // cond: t.(*types.Type).Size() == 4 && !is32BitFloat(val.Type) 20137 // result: (MOVWstore ptr val mem) 20138 for { 20139 t := v.Aux 20140 mem := v.Args[2] 20141 ptr := v.Args[0] 20142 val := v.Args[1] 20143 if !(t.(*types.Type).Size() == 4 && !is32BitFloat(val.Type)) { 20144 break 20145 } 20146 v.reset(OpARMMOVWstore) 20147 v.AddArg(ptr) 20148 v.AddArg(val) 20149 v.AddArg(mem) 20150 return true 20151 } 20152 // match: (Store {t} ptr val mem) 20153 // cond: t.(*types.Type).Size() == 4 && is32BitFloat(val.Type) 20154 // result: (MOVFstore ptr val mem) 20155 for { 20156 t := v.Aux 20157 mem := v.Args[2] 20158 ptr := v.Args[0] 20159 val := v.Args[1] 20160 if !(t.(*types.Type).Size() == 4 && is32BitFloat(val.Type)) { 20161 break 20162 } 20163 v.reset(OpARMMOVFstore) 20164 v.AddArg(ptr) 20165 v.AddArg(val) 20166 v.AddArg(mem) 20167 return true 20168 } 20169 // match: (Store {t} ptr val mem) 20170 // cond: t.(*types.Type).Size() == 8 && is64BitFloat(val.Type) 20171 // result: (MOVDstore ptr val mem) 20172 for { 20173 t := v.Aux 20174 mem := v.Args[2] 20175 ptr := v.Args[0] 20176 val := v.Args[1] 20177 if !(t.(*types.Type).Size() == 8 && is64BitFloat(val.Type)) { 20178 break 20179 } 20180 v.reset(OpARMMOVDstore) 20181 v.AddArg(ptr) 20182 v.AddArg(val) 20183 v.AddArg(mem) 20184 return true 20185 } 20186 return false 20187 } 20188 func rewriteValueARM_OpSub16_0(v *Value) bool { 20189 // match: (Sub16 x y) 20190 // result: (SUB x y) 20191 for { 20192 y := v.Args[1] 20193 x := v.Args[0] 20194 v.reset(OpARMSUB) 20195 v.AddArg(x) 20196 v.AddArg(y) 20197 return true 20198 } 20199 } 20200 func rewriteValueARM_OpSub32_0(v *Value) bool { 20201 // match: (Sub32 x y) 20202 // result: (SUB x y) 20203 for { 20204 y := v.Args[1] 20205 x := v.Args[0] 20206 v.reset(OpARMSUB) 20207 v.AddArg(x) 20208 v.AddArg(y) 20209 return true 20210 } 20211 } 20212 func rewriteValueARM_OpSub32F_0(v *Value) bool { 20213 // match: (Sub32F x y) 20214 // result: (SUBF x y) 20215 for { 20216 y := v.Args[1] 20217 x := v.Args[0] 20218 v.reset(OpARMSUBF) 20219 v.AddArg(x) 20220 v.AddArg(y) 20221 return true 20222 } 20223 } 20224 func rewriteValueARM_OpSub32carry_0(v *Value) bool { 20225 // match: (Sub32carry x y) 20226 // result: (SUBS x y) 20227 for { 20228 y := v.Args[1] 20229 x := v.Args[0] 20230 v.reset(OpARMSUBS) 20231 v.AddArg(x) 20232 v.AddArg(y) 20233 return true 20234 } 20235 } 20236 func rewriteValueARM_OpSub32withcarry_0(v *Value) bool { 20237 // match: (Sub32withcarry x y c) 20238 // result: (SBC x y c) 20239 for { 20240 c := v.Args[2] 20241 x := v.Args[0] 20242 y := v.Args[1] 20243 v.reset(OpARMSBC) 20244 v.AddArg(x) 20245 v.AddArg(y) 20246 v.AddArg(c) 20247 return true 20248 } 20249 } 20250 func rewriteValueARM_OpSub64F_0(v *Value) bool { 20251 // match: (Sub64F x y) 20252 // result: (SUBD x y) 20253 for { 20254 y := v.Args[1] 20255 x := v.Args[0] 20256 v.reset(OpARMSUBD) 20257 v.AddArg(x) 20258 v.AddArg(y) 20259 return true 20260 } 20261 } 20262 func rewriteValueARM_OpSub8_0(v *Value) bool { 20263 // match: (Sub8 x y) 20264 // result: (SUB x y) 20265 for { 20266 y := v.Args[1] 20267 x := v.Args[0] 20268 v.reset(OpARMSUB) 20269 v.AddArg(x) 20270 v.AddArg(y) 20271 return true 20272 } 20273 } 20274 func rewriteValueARM_OpSubPtr_0(v *Value) bool { 20275 // match: (SubPtr x y) 20276 // result: (SUB x y) 20277 for { 20278 y := v.Args[1] 20279 x := v.Args[0] 20280 v.reset(OpARMSUB) 20281 v.AddArg(x) 20282 v.AddArg(y) 20283 return true 20284 } 20285 } 20286 func rewriteValueARM_OpTrunc16to8_0(v *Value) bool { 20287 // match: (Trunc16to8 x) 20288 // result: x 20289 for { 20290 x := v.Args[0] 20291 v.reset(OpCopy) 20292 v.Type = x.Type 20293 v.AddArg(x) 20294 return true 20295 } 20296 } 20297 func rewriteValueARM_OpTrunc32to16_0(v *Value) bool { 20298 // match: (Trunc32to16 x) 20299 // result: x 20300 for { 20301 x := v.Args[0] 20302 v.reset(OpCopy) 20303 v.Type = x.Type 20304 v.AddArg(x) 20305 return true 20306 } 20307 } 20308 func rewriteValueARM_OpTrunc32to8_0(v *Value) bool { 20309 // match: (Trunc32to8 x) 20310 // result: x 20311 for { 20312 x := v.Args[0] 20313 v.reset(OpCopy) 20314 v.Type = x.Type 20315 v.AddArg(x) 20316 return true 20317 } 20318 } 20319 func rewriteValueARM_OpWB_0(v *Value) bool { 20320 // match: (WB {fn} destptr srcptr mem) 20321 // result: (LoweredWB {fn} destptr srcptr mem) 20322 for { 20323 fn := v.Aux 20324 mem := v.Args[2] 20325 destptr := v.Args[0] 20326 srcptr := v.Args[1] 20327 v.reset(OpARMLoweredWB) 20328 v.Aux = fn 20329 v.AddArg(destptr) 20330 v.AddArg(srcptr) 20331 v.AddArg(mem) 20332 return true 20333 } 20334 } 20335 func rewriteValueARM_OpXor16_0(v *Value) bool { 20336 // match: (Xor16 x y) 20337 // result: (XOR x y) 20338 for { 20339 y := v.Args[1] 20340 x := v.Args[0] 20341 v.reset(OpARMXOR) 20342 v.AddArg(x) 20343 v.AddArg(y) 20344 return true 20345 } 20346 } 20347 func rewriteValueARM_OpXor32_0(v *Value) bool { 20348 // match: (Xor32 x y) 20349 // result: (XOR x y) 20350 for { 20351 y := v.Args[1] 20352 x := v.Args[0] 20353 v.reset(OpARMXOR) 20354 v.AddArg(x) 20355 v.AddArg(y) 20356 return true 20357 } 20358 } 20359 func rewriteValueARM_OpXor8_0(v *Value) bool { 20360 // match: (Xor8 x y) 20361 // result: (XOR x y) 20362 for { 20363 y := v.Args[1] 20364 x := v.Args[0] 20365 v.reset(OpARMXOR) 20366 v.AddArg(x) 20367 v.AddArg(y) 20368 return true 20369 } 20370 } 20371 func rewriteValueARM_OpZero_0(v *Value) bool { 20372 b := v.Block 20373 config := b.Func.Config 20374 typ := &b.Func.Config.Types 20375 // match: (Zero [0] _ mem) 20376 // result: mem 20377 for { 20378 if v.AuxInt != 0 { 20379 break 20380 } 20381 mem := v.Args[1] 20382 v.reset(OpCopy) 20383 v.Type = mem.Type 20384 v.AddArg(mem) 20385 return true 20386 } 20387 // match: (Zero [1] ptr mem) 20388 // result: (MOVBstore ptr (MOVWconst [0]) mem) 20389 for { 20390 if v.AuxInt != 1 { 20391 break 20392 } 20393 mem := v.Args[1] 20394 ptr := v.Args[0] 20395 v.reset(OpARMMOVBstore) 20396 v.AddArg(ptr) 20397 v0 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20398 v0.AuxInt = 0 20399 v.AddArg(v0) 20400 v.AddArg(mem) 20401 return true 20402 } 20403 // match: (Zero [2] {t} ptr mem) 20404 // cond: t.(*types.Type).Alignment()%2 == 0 20405 // result: (MOVHstore ptr (MOVWconst [0]) mem) 20406 for { 20407 if v.AuxInt != 2 { 20408 break 20409 } 20410 t := v.Aux 20411 mem := v.Args[1] 20412 ptr := v.Args[0] 20413 if !(t.(*types.Type).Alignment()%2 == 0) { 20414 break 20415 } 20416 v.reset(OpARMMOVHstore) 20417 v.AddArg(ptr) 20418 v0 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20419 v0.AuxInt = 0 20420 v.AddArg(v0) 20421 v.AddArg(mem) 20422 return true 20423 } 20424 // match: (Zero [2] ptr mem) 20425 // result: (MOVBstore [1] ptr (MOVWconst [0]) (MOVBstore [0] ptr (MOVWconst [0]) mem)) 20426 for { 20427 if v.AuxInt != 2 { 20428 break 20429 } 20430 mem := v.Args[1] 20431 ptr := v.Args[0] 20432 v.reset(OpARMMOVBstore) 20433 v.AuxInt = 1 20434 v.AddArg(ptr) 20435 v0 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20436 v0.AuxInt = 0 20437 v.AddArg(v0) 20438 v1 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 20439 v1.AuxInt = 0 20440 v1.AddArg(ptr) 20441 v2 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20442 v2.AuxInt = 0 20443 v1.AddArg(v2) 20444 v1.AddArg(mem) 20445 v.AddArg(v1) 20446 return true 20447 } 20448 // match: (Zero [4] {t} ptr mem) 20449 // cond: t.(*types.Type).Alignment()%4 == 0 20450 // result: (MOVWstore ptr (MOVWconst [0]) mem) 20451 for { 20452 if v.AuxInt != 4 { 20453 break 20454 } 20455 t := v.Aux 20456 mem := v.Args[1] 20457 ptr := v.Args[0] 20458 if !(t.(*types.Type).Alignment()%4 == 0) { 20459 break 20460 } 20461 v.reset(OpARMMOVWstore) 20462 v.AddArg(ptr) 20463 v0 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20464 v0.AuxInt = 0 20465 v.AddArg(v0) 20466 v.AddArg(mem) 20467 return true 20468 } 20469 // match: (Zero [4] {t} ptr mem) 20470 // cond: t.(*types.Type).Alignment()%2 == 0 20471 // result: (MOVHstore [2] ptr (MOVWconst [0]) (MOVHstore [0] ptr (MOVWconst [0]) mem)) 20472 for { 20473 if v.AuxInt != 4 { 20474 break 20475 } 20476 t := v.Aux 20477 mem := v.Args[1] 20478 ptr := v.Args[0] 20479 if !(t.(*types.Type).Alignment()%2 == 0) { 20480 break 20481 } 20482 v.reset(OpARMMOVHstore) 20483 v.AuxInt = 2 20484 v.AddArg(ptr) 20485 v0 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20486 v0.AuxInt = 0 20487 v.AddArg(v0) 20488 v1 := b.NewValue0(v.Pos, OpARMMOVHstore, types.TypeMem) 20489 v1.AuxInt = 0 20490 v1.AddArg(ptr) 20491 v2 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20492 v2.AuxInt = 0 20493 v1.AddArg(v2) 20494 v1.AddArg(mem) 20495 v.AddArg(v1) 20496 return true 20497 } 20498 // match: (Zero [4] ptr mem) 20499 // result: (MOVBstore [3] ptr (MOVWconst [0]) (MOVBstore [2] ptr (MOVWconst [0]) (MOVBstore [1] ptr (MOVWconst [0]) (MOVBstore [0] ptr (MOVWconst [0]) mem)))) 20500 for { 20501 if v.AuxInt != 4 { 20502 break 20503 } 20504 mem := v.Args[1] 20505 ptr := v.Args[0] 20506 v.reset(OpARMMOVBstore) 20507 v.AuxInt = 3 20508 v.AddArg(ptr) 20509 v0 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20510 v0.AuxInt = 0 20511 v.AddArg(v0) 20512 v1 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 20513 v1.AuxInt = 2 20514 v1.AddArg(ptr) 20515 v2 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20516 v2.AuxInt = 0 20517 v1.AddArg(v2) 20518 v3 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 20519 v3.AuxInt = 1 20520 v3.AddArg(ptr) 20521 v4 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20522 v4.AuxInt = 0 20523 v3.AddArg(v4) 20524 v5 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 20525 v5.AuxInt = 0 20526 v5.AddArg(ptr) 20527 v6 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20528 v6.AuxInt = 0 20529 v5.AddArg(v6) 20530 v5.AddArg(mem) 20531 v3.AddArg(v5) 20532 v1.AddArg(v3) 20533 v.AddArg(v1) 20534 return true 20535 } 20536 // match: (Zero [3] ptr mem) 20537 // result: (MOVBstore [2] ptr (MOVWconst [0]) (MOVBstore [1] ptr (MOVWconst [0]) (MOVBstore [0] ptr (MOVWconst [0]) mem))) 20538 for { 20539 if v.AuxInt != 3 { 20540 break 20541 } 20542 mem := v.Args[1] 20543 ptr := v.Args[0] 20544 v.reset(OpARMMOVBstore) 20545 v.AuxInt = 2 20546 v.AddArg(ptr) 20547 v0 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20548 v0.AuxInt = 0 20549 v.AddArg(v0) 20550 v1 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 20551 v1.AuxInt = 1 20552 v1.AddArg(ptr) 20553 v2 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20554 v2.AuxInt = 0 20555 v1.AddArg(v2) 20556 v3 := b.NewValue0(v.Pos, OpARMMOVBstore, types.TypeMem) 20557 v3.AuxInt = 0 20558 v3.AddArg(ptr) 20559 v4 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20560 v4.AuxInt = 0 20561 v3.AddArg(v4) 20562 v3.AddArg(mem) 20563 v1.AddArg(v3) 20564 v.AddArg(v1) 20565 return true 20566 } 20567 // match: (Zero [s] {t} ptr mem) 20568 // cond: s%4 == 0 && s > 4 && s <= 512 && t.(*types.Type).Alignment()%4 == 0 && !config.noDuffDevice 20569 // result: (DUFFZERO [4 * (128 - s/4)] ptr (MOVWconst [0]) mem) 20570 for { 20571 s := v.AuxInt 20572 t := v.Aux 20573 mem := v.Args[1] 20574 ptr := v.Args[0] 20575 if !(s%4 == 0 && s > 4 && s <= 512 && t.(*types.Type).Alignment()%4 == 0 && !config.noDuffDevice) { 20576 break 20577 } 20578 v.reset(OpARMDUFFZERO) 20579 v.AuxInt = 4 * (128 - s/4) 20580 v.AddArg(ptr) 20581 v0 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20582 v0.AuxInt = 0 20583 v.AddArg(v0) 20584 v.AddArg(mem) 20585 return true 20586 } 20587 // match: (Zero [s] {t} ptr mem) 20588 // cond: (s > 512 || config.noDuffDevice) || t.(*types.Type).Alignment()%4 != 0 20589 // result: (LoweredZero [t.(*types.Type).Alignment()] ptr (ADDconst <ptr.Type> ptr [s-moveSize(t.(*types.Type).Alignment(), config)]) (MOVWconst [0]) mem) 20590 for { 20591 s := v.AuxInt 20592 t := v.Aux 20593 mem := v.Args[1] 20594 ptr := v.Args[0] 20595 if !((s > 512 || config.noDuffDevice) || t.(*types.Type).Alignment()%4 != 0) { 20596 break 20597 } 20598 v.reset(OpARMLoweredZero) 20599 v.AuxInt = t.(*types.Type).Alignment() 20600 v.AddArg(ptr) 20601 v0 := b.NewValue0(v.Pos, OpARMADDconst, ptr.Type) 20602 v0.AuxInt = s - moveSize(t.(*types.Type).Alignment(), config) 20603 v0.AddArg(ptr) 20604 v.AddArg(v0) 20605 v1 := b.NewValue0(v.Pos, OpARMMOVWconst, typ.UInt32) 20606 v1.AuxInt = 0 20607 v.AddArg(v1) 20608 v.AddArg(mem) 20609 return true 20610 } 20611 return false 20612 } 20613 func rewriteValueARM_OpZeroExt16to32_0(v *Value) bool { 20614 // match: (ZeroExt16to32 x) 20615 // result: (MOVHUreg x) 20616 for { 20617 x := v.Args[0] 20618 v.reset(OpARMMOVHUreg) 20619 v.AddArg(x) 20620 return true 20621 } 20622 } 20623 func rewriteValueARM_OpZeroExt8to16_0(v *Value) bool { 20624 // match: (ZeroExt8to16 x) 20625 // result: (MOVBUreg x) 20626 for { 20627 x := v.Args[0] 20628 v.reset(OpARMMOVBUreg) 20629 v.AddArg(x) 20630 return true 20631 } 20632 } 20633 func rewriteValueARM_OpZeroExt8to32_0(v *Value) bool { 20634 // match: (ZeroExt8to32 x) 20635 // result: (MOVBUreg x) 20636 for { 20637 x := v.Args[0] 20638 v.reset(OpARMMOVBUreg) 20639 v.AddArg(x) 20640 return true 20641 } 20642 } 20643 func rewriteValueARM_OpZeromask_0(v *Value) bool { 20644 b := v.Block 20645 typ := &b.Func.Config.Types 20646 // match: (Zeromask x) 20647 // result: (SRAconst (RSBshiftRL <typ.Int32> x x [1]) [31]) 20648 for { 20649 x := v.Args[0] 20650 v.reset(OpARMSRAconst) 20651 v.AuxInt = 31 20652 v0 := b.NewValue0(v.Pos, OpARMRSBshiftRL, typ.Int32) 20653 v0.AuxInt = 1 20654 v0.AddArg(x) 20655 v0.AddArg(x) 20656 v.AddArg(v0) 20657 return true 20658 } 20659 } 20660 func rewriteBlockARM(b *Block) bool { 20661 switch b.Kind { 20662 case BlockARMEQ: 20663 // match: (EQ (FlagEQ) yes no) 20664 // result: (First yes no) 20665 for b.Controls[0].Op == OpARMFlagEQ { 20666 b.Reset(BlockFirst) 20667 return true 20668 } 20669 // match: (EQ (FlagLT_ULT) yes no) 20670 // result: (First no yes) 20671 for b.Controls[0].Op == OpARMFlagLT_ULT { 20672 b.Reset(BlockFirst) 20673 b.swapSuccessors() 20674 return true 20675 } 20676 // match: (EQ (FlagLT_UGT) yes no) 20677 // result: (First no yes) 20678 for b.Controls[0].Op == OpARMFlagLT_UGT { 20679 b.Reset(BlockFirst) 20680 b.swapSuccessors() 20681 return true 20682 } 20683 // match: (EQ (FlagGT_ULT) yes no) 20684 // result: (First no yes) 20685 for b.Controls[0].Op == OpARMFlagGT_ULT { 20686 b.Reset(BlockFirst) 20687 b.swapSuccessors() 20688 return true 20689 } 20690 // match: (EQ (FlagGT_UGT) yes no) 20691 // result: (First no yes) 20692 for b.Controls[0].Op == OpARMFlagGT_UGT { 20693 b.Reset(BlockFirst) 20694 b.swapSuccessors() 20695 return true 20696 } 20697 // match: (EQ (InvertFlags cmp) yes no) 20698 // result: (EQ cmp yes no) 20699 for b.Controls[0].Op == OpARMInvertFlags { 20700 v_0 := b.Controls[0] 20701 cmp := v_0.Args[0] 20702 b.Reset(BlockARMEQ) 20703 b.AddControl(cmp) 20704 return true 20705 } 20706 // match: (EQ (CMPconst [0] l:(SUB x y)) yes no) 20707 // cond: l.Uses==1 20708 // result: (EQ (CMP x y) yes no) 20709 for b.Controls[0].Op == OpARMCMPconst { 20710 v_0 := b.Controls[0] 20711 if v_0.AuxInt != 0 { 20712 break 20713 } 20714 l := v_0.Args[0] 20715 if l.Op != OpARMSUB { 20716 break 20717 } 20718 y := l.Args[1] 20719 x := l.Args[0] 20720 if !(l.Uses == 1) { 20721 break 20722 } 20723 b.Reset(BlockARMEQ) 20724 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 20725 v0.AddArg(x) 20726 v0.AddArg(y) 20727 b.AddControl(v0) 20728 return true 20729 } 20730 // match: (EQ (CMPconst [0] l:(MULS x y a)) yes no) 20731 // cond: l.Uses==1 20732 // result: (EQ (CMP a (MUL <x.Type> x y)) yes no) 20733 for b.Controls[0].Op == OpARMCMPconst { 20734 v_0 := b.Controls[0] 20735 if v_0.AuxInt != 0 { 20736 break 20737 } 20738 l := v_0.Args[0] 20739 if l.Op != OpARMMULS { 20740 break 20741 } 20742 a := l.Args[2] 20743 x := l.Args[0] 20744 y := l.Args[1] 20745 if !(l.Uses == 1) { 20746 break 20747 } 20748 b.Reset(BlockARMEQ) 20749 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 20750 v0.AddArg(a) 20751 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 20752 v1.AddArg(x) 20753 v1.AddArg(y) 20754 v0.AddArg(v1) 20755 b.AddControl(v0) 20756 return true 20757 } 20758 // match: (EQ (CMPconst [0] l:(SUBconst [c] x)) yes no) 20759 // cond: l.Uses==1 20760 // result: (EQ (CMPconst [c] x) yes no) 20761 for b.Controls[0].Op == OpARMCMPconst { 20762 v_0 := b.Controls[0] 20763 if v_0.AuxInt != 0 { 20764 break 20765 } 20766 l := v_0.Args[0] 20767 if l.Op != OpARMSUBconst { 20768 break 20769 } 20770 c := l.AuxInt 20771 x := l.Args[0] 20772 if !(l.Uses == 1) { 20773 break 20774 } 20775 b.Reset(BlockARMEQ) 20776 v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags) 20777 v0.AuxInt = c 20778 v0.AddArg(x) 20779 b.AddControl(v0) 20780 return true 20781 } 20782 // match: (EQ (CMPconst [0] l:(SUBshiftLL x y [c])) yes no) 20783 // cond: l.Uses==1 20784 // result: (EQ (CMPshiftLL x y [c]) yes no) 20785 for b.Controls[0].Op == OpARMCMPconst { 20786 v_0 := b.Controls[0] 20787 if v_0.AuxInt != 0 { 20788 break 20789 } 20790 l := v_0.Args[0] 20791 if l.Op != OpARMSUBshiftLL { 20792 break 20793 } 20794 c := l.AuxInt 20795 y := l.Args[1] 20796 x := l.Args[0] 20797 if !(l.Uses == 1) { 20798 break 20799 } 20800 b.Reset(BlockARMEQ) 20801 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags) 20802 v0.AuxInt = c 20803 v0.AddArg(x) 20804 v0.AddArg(y) 20805 b.AddControl(v0) 20806 return true 20807 } 20808 // match: (EQ (CMPconst [0] l:(SUBshiftRL x y [c])) yes no) 20809 // cond: l.Uses==1 20810 // result: (EQ (CMPshiftRL x y [c]) yes no) 20811 for b.Controls[0].Op == OpARMCMPconst { 20812 v_0 := b.Controls[0] 20813 if v_0.AuxInt != 0 { 20814 break 20815 } 20816 l := v_0.Args[0] 20817 if l.Op != OpARMSUBshiftRL { 20818 break 20819 } 20820 c := l.AuxInt 20821 y := l.Args[1] 20822 x := l.Args[0] 20823 if !(l.Uses == 1) { 20824 break 20825 } 20826 b.Reset(BlockARMEQ) 20827 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags) 20828 v0.AuxInt = c 20829 v0.AddArg(x) 20830 v0.AddArg(y) 20831 b.AddControl(v0) 20832 return true 20833 } 20834 // match: (EQ (CMPconst [0] l:(SUBshiftRA x y [c])) yes no) 20835 // cond: l.Uses==1 20836 // result: (EQ (CMPshiftRA x y [c]) yes no) 20837 for b.Controls[0].Op == OpARMCMPconst { 20838 v_0 := b.Controls[0] 20839 if v_0.AuxInt != 0 { 20840 break 20841 } 20842 l := v_0.Args[0] 20843 if l.Op != OpARMSUBshiftRA { 20844 break 20845 } 20846 c := l.AuxInt 20847 y := l.Args[1] 20848 x := l.Args[0] 20849 if !(l.Uses == 1) { 20850 break 20851 } 20852 b.Reset(BlockARMEQ) 20853 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags) 20854 v0.AuxInt = c 20855 v0.AddArg(x) 20856 v0.AddArg(y) 20857 b.AddControl(v0) 20858 return true 20859 } 20860 // match: (EQ (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no) 20861 // cond: l.Uses==1 20862 // result: (EQ (CMPshiftLLreg x y z) yes no) 20863 for b.Controls[0].Op == OpARMCMPconst { 20864 v_0 := b.Controls[0] 20865 if v_0.AuxInt != 0 { 20866 break 20867 } 20868 l := v_0.Args[0] 20869 if l.Op != OpARMSUBshiftLLreg { 20870 break 20871 } 20872 z := l.Args[2] 20873 x := l.Args[0] 20874 y := l.Args[1] 20875 if !(l.Uses == 1) { 20876 break 20877 } 20878 b.Reset(BlockARMEQ) 20879 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags) 20880 v0.AddArg(x) 20881 v0.AddArg(y) 20882 v0.AddArg(z) 20883 b.AddControl(v0) 20884 return true 20885 } 20886 // match: (EQ (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no) 20887 // cond: l.Uses==1 20888 // result: (EQ (CMPshiftRLreg x y z) yes no) 20889 for b.Controls[0].Op == OpARMCMPconst { 20890 v_0 := b.Controls[0] 20891 if v_0.AuxInt != 0 { 20892 break 20893 } 20894 l := v_0.Args[0] 20895 if l.Op != OpARMSUBshiftRLreg { 20896 break 20897 } 20898 z := l.Args[2] 20899 x := l.Args[0] 20900 y := l.Args[1] 20901 if !(l.Uses == 1) { 20902 break 20903 } 20904 b.Reset(BlockARMEQ) 20905 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags) 20906 v0.AddArg(x) 20907 v0.AddArg(y) 20908 v0.AddArg(z) 20909 b.AddControl(v0) 20910 return true 20911 } 20912 // match: (EQ (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no) 20913 // cond: l.Uses==1 20914 // result: (EQ (CMPshiftRAreg x y z) yes no) 20915 for b.Controls[0].Op == OpARMCMPconst { 20916 v_0 := b.Controls[0] 20917 if v_0.AuxInt != 0 { 20918 break 20919 } 20920 l := v_0.Args[0] 20921 if l.Op != OpARMSUBshiftRAreg { 20922 break 20923 } 20924 z := l.Args[2] 20925 x := l.Args[0] 20926 y := l.Args[1] 20927 if !(l.Uses == 1) { 20928 break 20929 } 20930 b.Reset(BlockARMEQ) 20931 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags) 20932 v0.AddArg(x) 20933 v0.AddArg(y) 20934 v0.AddArg(z) 20935 b.AddControl(v0) 20936 return true 20937 } 20938 // match: (EQ (CMPconst [0] l:(ADD x y)) yes no) 20939 // cond: l.Uses==1 20940 // result: (EQ (CMN x y) yes no) 20941 for b.Controls[0].Op == OpARMCMPconst { 20942 v_0 := b.Controls[0] 20943 if v_0.AuxInt != 0 { 20944 break 20945 } 20946 l := v_0.Args[0] 20947 if l.Op != OpARMADD { 20948 break 20949 } 20950 y := l.Args[1] 20951 x := l.Args[0] 20952 if !(l.Uses == 1) { 20953 break 20954 } 20955 b.Reset(BlockARMEQ) 20956 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 20957 v0.AddArg(x) 20958 v0.AddArg(y) 20959 b.AddControl(v0) 20960 return true 20961 } 20962 // match: (EQ (CMPconst [0] l:(MULA x y a)) yes no) 20963 // cond: l.Uses==1 20964 // result: (EQ (CMN a (MUL <x.Type> x y)) yes no) 20965 for b.Controls[0].Op == OpARMCMPconst { 20966 v_0 := b.Controls[0] 20967 if v_0.AuxInt != 0 { 20968 break 20969 } 20970 l := v_0.Args[0] 20971 if l.Op != OpARMMULA { 20972 break 20973 } 20974 a := l.Args[2] 20975 x := l.Args[0] 20976 y := l.Args[1] 20977 if !(l.Uses == 1) { 20978 break 20979 } 20980 b.Reset(BlockARMEQ) 20981 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 20982 v0.AddArg(a) 20983 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 20984 v1.AddArg(x) 20985 v1.AddArg(y) 20986 v0.AddArg(v1) 20987 b.AddControl(v0) 20988 return true 20989 } 20990 // match: (EQ (CMPconst [0] l:(ADDconst [c] x)) yes no) 20991 // cond: l.Uses==1 20992 // result: (EQ (CMNconst [c] x) yes no) 20993 for b.Controls[0].Op == OpARMCMPconst { 20994 v_0 := b.Controls[0] 20995 if v_0.AuxInt != 0 { 20996 break 20997 } 20998 l := v_0.Args[0] 20999 if l.Op != OpARMADDconst { 21000 break 21001 } 21002 c := l.AuxInt 21003 x := l.Args[0] 21004 if !(l.Uses == 1) { 21005 break 21006 } 21007 b.Reset(BlockARMEQ) 21008 v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags) 21009 v0.AuxInt = c 21010 v0.AddArg(x) 21011 b.AddControl(v0) 21012 return true 21013 } 21014 // match: (EQ (CMPconst [0] l:(ADDshiftLL x y [c])) yes no) 21015 // cond: l.Uses==1 21016 // result: (EQ (CMNshiftLL x y [c]) yes no) 21017 for b.Controls[0].Op == OpARMCMPconst { 21018 v_0 := b.Controls[0] 21019 if v_0.AuxInt != 0 { 21020 break 21021 } 21022 l := v_0.Args[0] 21023 if l.Op != OpARMADDshiftLL { 21024 break 21025 } 21026 c := l.AuxInt 21027 y := l.Args[1] 21028 x := l.Args[0] 21029 if !(l.Uses == 1) { 21030 break 21031 } 21032 b.Reset(BlockARMEQ) 21033 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags) 21034 v0.AuxInt = c 21035 v0.AddArg(x) 21036 v0.AddArg(y) 21037 b.AddControl(v0) 21038 return true 21039 } 21040 // match: (EQ (CMPconst [0] l:(ADDshiftRL x y [c])) yes no) 21041 // cond: l.Uses==1 21042 // result: (EQ (CMNshiftRL x y [c]) yes no) 21043 for b.Controls[0].Op == OpARMCMPconst { 21044 v_0 := b.Controls[0] 21045 if v_0.AuxInt != 0 { 21046 break 21047 } 21048 l := v_0.Args[0] 21049 if l.Op != OpARMADDshiftRL { 21050 break 21051 } 21052 c := l.AuxInt 21053 y := l.Args[1] 21054 x := l.Args[0] 21055 if !(l.Uses == 1) { 21056 break 21057 } 21058 b.Reset(BlockARMEQ) 21059 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags) 21060 v0.AuxInt = c 21061 v0.AddArg(x) 21062 v0.AddArg(y) 21063 b.AddControl(v0) 21064 return true 21065 } 21066 // match: (EQ (CMPconst [0] l:(ADDshiftRA x y [c])) yes no) 21067 // cond: l.Uses==1 21068 // result: (EQ (CMNshiftRA x y [c]) yes no) 21069 for b.Controls[0].Op == OpARMCMPconst { 21070 v_0 := b.Controls[0] 21071 if v_0.AuxInt != 0 { 21072 break 21073 } 21074 l := v_0.Args[0] 21075 if l.Op != OpARMADDshiftRA { 21076 break 21077 } 21078 c := l.AuxInt 21079 y := l.Args[1] 21080 x := l.Args[0] 21081 if !(l.Uses == 1) { 21082 break 21083 } 21084 b.Reset(BlockARMEQ) 21085 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags) 21086 v0.AuxInt = c 21087 v0.AddArg(x) 21088 v0.AddArg(y) 21089 b.AddControl(v0) 21090 return true 21091 } 21092 // match: (EQ (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no) 21093 // cond: l.Uses==1 21094 // result: (EQ (CMNshiftLLreg x y z) yes no) 21095 for b.Controls[0].Op == OpARMCMPconst { 21096 v_0 := b.Controls[0] 21097 if v_0.AuxInt != 0 { 21098 break 21099 } 21100 l := v_0.Args[0] 21101 if l.Op != OpARMADDshiftLLreg { 21102 break 21103 } 21104 z := l.Args[2] 21105 x := l.Args[0] 21106 y := l.Args[1] 21107 if !(l.Uses == 1) { 21108 break 21109 } 21110 b.Reset(BlockARMEQ) 21111 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags) 21112 v0.AddArg(x) 21113 v0.AddArg(y) 21114 v0.AddArg(z) 21115 b.AddControl(v0) 21116 return true 21117 } 21118 // match: (EQ (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no) 21119 // cond: l.Uses==1 21120 // result: (EQ (CMNshiftRLreg x y z) yes no) 21121 for b.Controls[0].Op == OpARMCMPconst { 21122 v_0 := b.Controls[0] 21123 if v_0.AuxInt != 0 { 21124 break 21125 } 21126 l := v_0.Args[0] 21127 if l.Op != OpARMADDshiftRLreg { 21128 break 21129 } 21130 z := l.Args[2] 21131 x := l.Args[0] 21132 y := l.Args[1] 21133 if !(l.Uses == 1) { 21134 break 21135 } 21136 b.Reset(BlockARMEQ) 21137 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags) 21138 v0.AddArg(x) 21139 v0.AddArg(y) 21140 v0.AddArg(z) 21141 b.AddControl(v0) 21142 return true 21143 } 21144 // match: (EQ (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no) 21145 // cond: l.Uses==1 21146 // result: (EQ (CMNshiftRAreg x y z) yes no) 21147 for b.Controls[0].Op == OpARMCMPconst { 21148 v_0 := b.Controls[0] 21149 if v_0.AuxInt != 0 { 21150 break 21151 } 21152 l := v_0.Args[0] 21153 if l.Op != OpARMADDshiftRAreg { 21154 break 21155 } 21156 z := l.Args[2] 21157 x := l.Args[0] 21158 y := l.Args[1] 21159 if !(l.Uses == 1) { 21160 break 21161 } 21162 b.Reset(BlockARMEQ) 21163 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags) 21164 v0.AddArg(x) 21165 v0.AddArg(y) 21166 v0.AddArg(z) 21167 b.AddControl(v0) 21168 return true 21169 } 21170 // match: (EQ (CMPconst [0] l:(AND x y)) yes no) 21171 // cond: l.Uses==1 21172 // result: (EQ (TST x y) yes no) 21173 for b.Controls[0].Op == OpARMCMPconst { 21174 v_0 := b.Controls[0] 21175 if v_0.AuxInt != 0 { 21176 break 21177 } 21178 l := v_0.Args[0] 21179 if l.Op != OpARMAND { 21180 break 21181 } 21182 y := l.Args[1] 21183 x := l.Args[0] 21184 if !(l.Uses == 1) { 21185 break 21186 } 21187 b.Reset(BlockARMEQ) 21188 v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags) 21189 v0.AddArg(x) 21190 v0.AddArg(y) 21191 b.AddControl(v0) 21192 return true 21193 } 21194 // match: (EQ (CMPconst [0] l:(ANDconst [c] x)) yes no) 21195 // cond: l.Uses==1 21196 // result: (EQ (TSTconst [c] x) yes no) 21197 for b.Controls[0].Op == OpARMCMPconst { 21198 v_0 := b.Controls[0] 21199 if v_0.AuxInt != 0 { 21200 break 21201 } 21202 l := v_0.Args[0] 21203 if l.Op != OpARMANDconst { 21204 break 21205 } 21206 c := l.AuxInt 21207 x := l.Args[0] 21208 if !(l.Uses == 1) { 21209 break 21210 } 21211 b.Reset(BlockARMEQ) 21212 v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags) 21213 v0.AuxInt = c 21214 v0.AddArg(x) 21215 b.AddControl(v0) 21216 return true 21217 } 21218 // match: (EQ (CMPconst [0] l:(ANDshiftLL x y [c])) yes no) 21219 // cond: l.Uses==1 21220 // result: (EQ (TSTshiftLL x y [c]) yes no) 21221 for b.Controls[0].Op == OpARMCMPconst { 21222 v_0 := b.Controls[0] 21223 if v_0.AuxInt != 0 { 21224 break 21225 } 21226 l := v_0.Args[0] 21227 if l.Op != OpARMANDshiftLL { 21228 break 21229 } 21230 c := l.AuxInt 21231 y := l.Args[1] 21232 x := l.Args[0] 21233 if !(l.Uses == 1) { 21234 break 21235 } 21236 b.Reset(BlockARMEQ) 21237 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags) 21238 v0.AuxInt = c 21239 v0.AddArg(x) 21240 v0.AddArg(y) 21241 b.AddControl(v0) 21242 return true 21243 } 21244 // match: (EQ (CMPconst [0] l:(ANDshiftRL x y [c])) yes no) 21245 // cond: l.Uses==1 21246 // result: (EQ (TSTshiftRL x y [c]) yes no) 21247 for b.Controls[0].Op == OpARMCMPconst { 21248 v_0 := b.Controls[0] 21249 if v_0.AuxInt != 0 { 21250 break 21251 } 21252 l := v_0.Args[0] 21253 if l.Op != OpARMANDshiftRL { 21254 break 21255 } 21256 c := l.AuxInt 21257 y := l.Args[1] 21258 x := l.Args[0] 21259 if !(l.Uses == 1) { 21260 break 21261 } 21262 b.Reset(BlockARMEQ) 21263 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags) 21264 v0.AuxInt = c 21265 v0.AddArg(x) 21266 v0.AddArg(y) 21267 b.AddControl(v0) 21268 return true 21269 } 21270 // match: (EQ (CMPconst [0] l:(ANDshiftRA x y [c])) yes no) 21271 // cond: l.Uses==1 21272 // result: (EQ (TSTshiftRA x y [c]) yes no) 21273 for b.Controls[0].Op == OpARMCMPconst { 21274 v_0 := b.Controls[0] 21275 if v_0.AuxInt != 0 { 21276 break 21277 } 21278 l := v_0.Args[0] 21279 if l.Op != OpARMANDshiftRA { 21280 break 21281 } 21282 c := l.AuxInt 21283 y := l.Args[1] 21284 x := l.Args[0] 21285 if !(l.Uses == 1) { 21286 break 21287 } 21288 b.Reset(BlockARMEQ) 21289 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags) 21290 v0.AuxInt = c 21291 v0.AddArg(x) 21292 v0.AddArg(y) 21293 b.AddControl(v0) 21294 return true 21295 } 21296 // match: (EQ (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no) 21297 // cond: l.Uses==1 21298 // result: (EQ (TSTshiftLLreg x y z) yes no) 21299 for b.Controls[0].Op == OpARMCMPconst { 21300 v_0 := b.Controls[0] 21301 if v_0.AuxInt != 0 { 21302 break 21303 } 21304 l := v_0.Args[0] 21305 if l.Op != OpARMANDshiftLLreg { 21306 break 21307 } 21308 z := l.Args[2] 21309 x := l.Args[0] 21310 y := l.Args[1] 21311 if !(l.Uses == 1) { 21312 break 21313 } 21314 b.Reset(BlockARMEQ) 21315 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags) 21316 v0.AddArg(x) 21317 v0.AddArg(y) 21318 v0.AddArg(z) 21319 b.AddControl(v0) 21320 return true 21321 } 21322 // match: (EQ (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no) 21323 // cond: l.Uses==1 21324 // result: (EQ (TSTshiftRLreg x y z) yes no) 21325 for b.Controls[0].Op == OpARMCMPconst { 21326 v_0 := b.Controls[0] 21327 if v_0.AuxInt != 0 { 21328 break 21329 } 21330 l := v_0.Args[0] 21331 if l.Op != OpARMANDshiftRLreg { 21332 break 21333 } 21334 z := l.Args[2] 21335 x := l.Args[0] 21336 y := l.Args[1] 21337 if !(l.Uses == 1) { 21338 break 21339 } 21340 b.Reset(BlockARMEQ) 21341 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags) 21342 v0.AddArg(x) 21343 v0.AddArg(y) 21344 v0.AddArg(z) 21345 b.AddControl(v0) 21346 return true 21347 } 21348 // match: (EQ (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no) 21349 // cond: l.Uses==1 21350 // result: (EQ (TSTshiftRAreg x y z) yes no) 21351 for b.Controls[0].Op == OpARMCMPconst { 21352 v_0 := b.Controls[0] 21353 if v_0.AuxInt != 0 { 21354 break 21355 } 21356 l := v_0.Args[0] 21357 if l.Op != OpARMANDshiftRAreg { 21358 break 21359 } 21360 z := l.Args[2] 21361 x := l.Args[0] 21362 y := l.Args[1] 21363 if !(l.Uses == 1) { 21364 break 21365 } 21366 b.Reset(BlockARMEQ) 21367 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags) 21368 v0.AddArg(x) 21369 v0.AddArg(y) 21370 v0.AddArg(z) 21371 b.AddControl(v0) 21372 return true 21373 } 21374 // match: (EQ (CMPconst [0] l:(XOR x y)) yes no) 21375 // cond: l.Uses==1 21376 // result: (EQ (TEQ x y) yes no) 21377 for b.Controls[0].Op == OpARMCMPconst { 21378 v_0 := b.Controls[0] 21379 if v_0.AuxInt != 0 { 21380 break 21381 } 21382 l := v_0.Args[0] 21383 if l.Op != OpARMXOR { 21384 break 21385 } 21386 y := l.Args[1] 21387 x := l.Args[0] 21388 if !(l.Uses == 1) { 21389 break 21390 } 21391 b.Reset(BlockARMEQ) 21392 v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags) 21393 v0.AddArg(x) 21394 v0.AddArg(y) 21395 b.AddControl(v0) 21396 return true 21397 } 21398 // match: (EQ (CMPconst [0] l:(XORconst [c] x)) yes no) 21399 // cond: l.Uses==1 21400 // result: (EQ (TEQconst [c] x) yes no) 21401 for b.Controls[0].Op == OpARMCMPconst { 21402 v_0 := b.Controls[0] 21403 if v_0.AuxInt != 0 { 21404 break 21405 } 21406 l := v_0.Args[0] 21407 if l.Op != OpARMXORconst { 21408 break 21409 } 21410 c := l.AuxInt 21411 x := l.Args[0] 21412 if !(l.Uses == 1) { 21413 break 21414 } 21415 b.Reset(BlockARMEQ) 21416 v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags) 21417 v0.AuxInt = c 21418 v0.AddArg(x) 21419 b.AddControl(v0) 21420 return true 21421 } 21422 // match: (EQ (CMPconst [0] l:(XORshiftLL x y [c])) yes no) 21423 // cond: l.Uses==1 21424 // result: (EQ (TEQshiftLL x y [c]) yes no) 21425 for b.Controls[0].Op == OpARMCMPconst { 21426 v_0 := b.Controls[0] 21427 if v_0.AuxInt != 0 { 21428 break 21429 } 21430 l := v_0.Args[0] 21431 if l.Op != OpARMXORshiftLL { 21432 break 21433 } 21434 c := l.AuxInt 21435 y := l.Args[1] 21436 x := l.Args[0] 21437 if !(l.Uses == 1) { 21438 break 21439 } 21440 b.Reset(BlockARMEQ) 21441 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags) 21442 v0.AuxInt = c 21443 v0.AddArg(x) 21444 v0.AddArg(y) 21445 b.AddControl(v0) 21446 return true 21447 } 21448 // match: (EQ (CMPconst [0] l:(XORshiftRL x y [c])) yes no) 21449 // cond: l.Uses==1 21450 // result: (EQ (TEQshiftRL x y [c]) yes no) 21451 for b.Controls[0].Op == OpARMCMPconst { 21452 v_0 := b.Controls[0] 21453 if v_0.AuxInt != 0 { 21454 break 21455 } 21456 l := v_0.Args[0] 21457 if l.Op != OpARMXORshiftRL { 21458 break 21459 } 21460 c := l.AuxInt 21461 y := l.Args[1] 21462 x := l.Args[0] 21463 if !(l.Uses == 1) { 21464 break 21465 } 21466 b.Reset(BlockARMEQ) 21467 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags) 21468 v0.AuxInt = c 21469 v0.AddArg(x) 21470 v0.AddArg(y) 21471 b.AddControl(v0) 21472 return true 21473 } 21474 // match: (EQ (CMPconst [0] l:(XORshiftRA x y [c])) yes no) 21475 // cond: l.Uses==1 21476 // result: (EQ (TEQshiftRA x y [c]) yes no) 21477 for b.Controls[0].Op == OpARMCMPconst { 21478 v_0 := b.Controls[0] 21479 if v_0.AuxInt != 0 { 21480 break 21481 } 21482 l := v_0.Args[0] 21483 if l.Op != OpARMXORshiftRA { 21484 break 21485 } 21486 c := l.AuxInt 21487 y := l.Args[1] 21488 x := l.Args[0] 21489 if !(l.Uses == 1) { 21490 break 21491 } 21492 b.Reset(BlockARMEQ) 21493 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags) 21494 v0.AuxInt = c 21495 v0.AddArg(x) 21496 v0.AddArg(y) 21497 b.AddControl(v0) 21498 return true 21499 } 21500 // match: (EQ (CMPconst [0] l:(XORshiftLLreg x y z)) yes no) 21501 // cond: l.Uses==1 21502 // result: (EQ (TEQshiftLLreg x y z) yes no) 21503 for b.Controls[0].Op == OpARMCMPconst { 21504 v_0 := b.Controls[0] 21505 if v_0.AuxInt != 0 { 21506 break 21507 } 21508 l := v_0.Args[0] 21509 if l.Op != OpARMXORshiftLLreg { 21510 break 21511 } 21512 z := l.Args[2] 21513 x := l.Args[0] 21514 y := l.Args[1] 21515 if !(l.Uses == 1) { 21516 break 21517 } 21518 b.Reset(BlockARMEQ) 21519 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags) 21520 v0.AddArg(x) 21521 v0.AddArg(y) 21522 v0.AddArg(z) 21523 b.AddControl(v0) 21524 return true 21525 } 21526 // match: (EQ (CMPconst [0] l:(XORshiftRLreg x y z)) yes no) 21527 // cond: l.Uses==1 21528 // result: (EQ (TEQshiftRLreg x y z) yes no) 21529 for b.Controls[0].Op == OpARMCMPconst { 21530 v_0 := b.Controls[0] 21531 if v_0.AuxInt != 0 { 21532 break 21533 } 21534 l := v_0.Args[0] 21535 if l.Op != OpARMXORshiftRLreg { 21536 break 21537 } 21538 z := l.Args[2] 21539 x := l.Args[0] 21540 y := l.Args[1] 21541 if !(l.Uses == 1) { 21542 break 21543 } 21544 b.Reset(BlockARMEQ) 21545 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags) 21546 v0.AddArg(x) 21547 v0.AddArg(y) 21548 v0.AddArg(z) 21549 b.AddControl(v0) 21550 return true 21551 } 21552 // match: (EQ (CMPconst [0] l:(XORshiftRAreg x y z)) yes no) 21553 // cond: l.Uses==1 21554 // result: (EQ (TEQshiftRAreg x y z) yes no) 21555 for b.Controls[0].Op == OpARMCMPconst { 21556 v_0 := b.Controls[0] 21557 if v_0.AuxInt != 0 { 21558 break 21559 } 21560 l := v_0.Args[0] 21561 if l.Op != OpARMXORshiftRAreg { 21562 break 21563 } 21564 z := l.Args[2] 21565 x := l.Args[0] 21566 y := l.Args[1] 21567 if !(l.Uses == 1) { 21568 break 21569 } 21570 b.Reset(BlockARMEQ) 21571 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags) 21572 v0.AddArg(x) 21573 v0.AddArg(y) 21574 v0.AddArg(z) 21575 b.AddControl(v0) 21576 return true 21577 } 21578 case BlockARMGE: 21579 // match: (GE (FlagEQ) yes no) 21580 // result: (First yes no) 21581 for b.Controls[0].Op == OpARMFlagEQ { 21582 b.Reset(BlockFirst) 21583 return true 21584 } 21585 // match: (GE (FlagLT_ULT) yes no) 21586 // result: (First no yes) 21587 for b.Controls[0].Op == OpARMFlagLT_ULT { 21588 b.Reset(BlockFirst) 21589 b.swapSuccessors() 21590 return true 21591 } 21592 // match: (GE (FlagLT_UGT) yes no) 21593 // result: (First no yes) 21594 for b.Controls[0].Op == OpARMFlagLT_UGT { 21595 b.Reset(BlockFirst) 21596 b.swapSuccessors() 21597 return true 21598 } 21599 // match: (GE (FlagGT_ULT) yes no) 21600 // result: (First yes no) 21601 for b.Controls[0].Op == OpARMFlagGT_ULT { 21602 b.Reset(BlockFirst) 21603 return true 21604 } 21605 // match: (GE (FlagGT_UGT) yes no) 21606 // result: (First yes no) 21607 for b.Controls[0].Op == OpARMFlagGT_UGT { 21608 b.Reset(BlockFirst) 21609 return true 21610 } 21611 // match: (GE (InvertFlags cmp) yes no) 21612 // result: (LE cmp yes no) 21613 for b.Controls[0].Op == OpARMInvertFlags { 21614 v_0 := b.Controls[0] 21615 cmp := v_0.Args[0] 21616 b.Reset(BlockARMLE) 21617 b.AddControl(cmp) 21618 return true 21619 } 21620 // match: (GE (CMPconst [0] l:(SUB x y)) yes no) 21621 // cond: l.Uses==1 21622 // result: (GE (CMP x y) yes no) 21623 for b.Controls[0].Op == OpARMCMPconst { 21624 v_0 := b.Controls[0] 21625 if v_0.AuxInt != 0 { 21626 break 21627 } 21628 l := v_0.Args[0] 21629 if l.Op != OpARMSUB { 21630 break 21631 } 21632 y := l.Args[1] 21633 x := l.Args[0] 21634 if !(l.Uses == 1) { 21635 break 21636 } 21637 b.Reset(BlockARMGE) 21638 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 21639 v0.AddArg(x) 21640 v0.AddArg(y) 21641 b.AddControl(v0) 21642 return true 21643 } 21644 // match: (GE (CMPconst [0] l:(MULS x y a)) yes no) 21645 // cond: l.Uses==1 21646 // result: (GE (CMP a (MUL <x.Type> x y)) yes no) 21647 for b.Controls[0].Op == OpARMCMPconst { 21648 v_0 := b.Controls[0] 21649 if v_0.AuxInt != 0 { 21650 break 21651 } 21652 l := v_0.Args[0] 21653 if l.Op != OpARMMULS { 21654 break 21655 } 21656 a := l.Args[2] 21657 x := l.Args[0] 21658 y := l.Args[1] 21659 if !(l.Uses == 1) { 21660 break 21661 } 21662 b.Reset(BlockARMGE) 21663 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 21664 v0.AddArg(a) 21665 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 21666 v1.AddArg(x) 21667 v1.AddArg(y) 21668 v0.AddArg(v1) 21669 b.AddControl(v0) 21670 return true 21671 } 21672 // match: (GE (CMPconst [0] l:(SUBconst [c] x)) yes no) 21673 // cond: l.Uses==1 21674 // result: (GE (CMPconst [c] x) yes no) 21675 for b.Controls[0].Op == OpARMCMPconst { 21676 v_0 := b.Controls[0] 21677 if v_0.AuxInt != 0 { 21678 break 21679 } 21680 l := v_0.Args[0] 21681 if l.Op != OpARMSUBconst { 21682 break 21683 } 21684 c := l.AuxInt 21685 x := l.Args[0] 21686 if !(l.Uses == 1) { 21687 break 21688 } 21689 b.Reset(BlockARMGE) 21690 v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags) 21691 v0.AuxInt = c 21692 v0.AddArg(x) 21693 b.AddControl(v0) 21694 return true 21695 } 21696 // match: (GE (CMPconst [0] l:(SUBshiftLL x y [c])) yes no) 21697 // cond: l.Uses==1 21698 // result: (GE (CMPshiftLL x y [c]) yes no) 21699 for b.Controls[0].Op == OpARMCMPconst { 21700 v_0 := b.Controls[0] 21701 if v_0.AuxInt != 0 { 21702 break 21703 } 21704 l := v_0.Args[0] 21705 if l.Op != OpARMSUBshiftLL { 21706 break 21707 } 21708 c := l.AuxInt 21709 y := l.Args[1] 21710 x := l.Args[0] 21711 if !(l.Uses == 1) { 21712 break 21713 } 21714 b.Reset(BlockARMGE) 21715 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags) 21716 v0.AuxInt = c 21717 v0.AddArg(x) 21718 v0.AddArg(y) 21719 b.AddControl(v0) 21720 return true 21721 } 21722 // match: (GE (CMPconst [0] l:(SUBshiftRL x y [c])) yes no) 21723 // cond: l.Uses==1 21724 // result: (GE (CMPshiftRL x y [c]) yes no) 21725 for b.Controls[0].Op == OpARMCMPconst { 21726 v_0 := b.Controls[0] 21727 if v_0.AuxInt != 0 { 21728 break 21729 } 21730 l := v_0.Args[0] 21731 if l.Op != OpARMSUBshiftRL { 21732 break 21733 } 21734 c := l.AuxInt 21735 y := l.Args[1] 21736 x := l.Args[0] 21737 if !(l.Uses == 1) { 21738 break 21739 } 21740 b.Reset(BlockARMGE) 21741 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags) 21742 v0.AuxInt = c 21743 v0.AddArg(x) 21744 v0.AddArg(y) 21745 b.AddControl(v0) 21746 return true 21747 } 21748 // match: (GE (CMPconst [0] l:(SUBshiftRA x y [c])) yes no) 21749 // cond: l.Uses==1 21750 // result: (GE (CMPshiftRA x y [c]) yes no) 21751 for b.Controls[0].Op == OpARMCMPconst { 21752 v_0 := b.Controls[0] 21753 if v_0.AuxInt != 0 { 21754 break 21755 } 21756 l := v_0.Args[0] 21757 if l.Op != OpARMSUBshiftRA { 21758 break 21759 } 21760 c := l.AuxInt 21761 y := l.Args[1] 21762 x := l.Args[0] 21763 if !(l.Uses == 1) { 21764 break 21765 } 21766 b.Reset(BlockARMGE) 21767 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags) 21768 v0.AuxInt = c 21769 v0.AddArg(x) 21770 v0.AddArg(y) 21771 b.AddControl(v0) 21772 return true 21773 } 21774 // match: (GE (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no) 21775 // cond: l.Uses==1 21776 // result: (GE (CMPshiftLLreg x y z) yes no) 21777 for b.Controls[0].Op == OpARMCMPconst { 21778 v_0 := b.Controls[0] 21779 if v_0.AuxInt != 0 { 21780 break 21781 } 21782 l := v_0.Args[0] 21783 if l.Op != OpARMSUBshiftLLreg { 21784 break 21785 } 21786 z := l.Args[2] 21787 x := l.Args[0] 21788 y := l.Args[1] 21789 if !(l.Uses == 1) { 21790 break 21791 } 21792 b.Reset(BlockARMGE) 21793 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags) 21794 v0.AddArg(x) 21795 v0.AddArg(y) 21796 v0.AddArg(z) 21797 b.AddControl(v0) 21798 return true 21799 } 21800 // match: (GE (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no) 21801 // cond: l.Uses==1 21802 // result: (GE (CMPshiftRLreg x y z) yes no) 21803 for b.Controls[0].Op == OpARMCMPconst { 21804 v_0 := b.Controls[0] 21805 if v_0.AuxInt != 0 { 21806 break 21807 } 21808 l := v_0.Args[0] 21809 if l.Op != OpARMSUBshiftRLreg { 21810 break 21811 } 21812 z := l.Args[2] 21813 x := l.Args[0] 21814 y := l.Args[1] 21815 if !(l.Uses == 1) { 21816 break 21817 } 21818 b.Reset(BlockARMGE) 21819 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags) 21820 v0.AddArg(x) 21821 v0.AddArg(y) 21822 v0.AddArg(z) 21823 b.AddControl(v0) 21824 return true 21825 } 21826 // match: (GE (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no) 21827 // cond: l.Uses==1 21828 // result: (GE (CMPshiftRAreg x y z) yes no) 21829 for b.Controls[0].Op == OpARMCMPconst { 21830 v_0 := b.Controls[0] 21831 if v_0.AuxInt != 0 { 21832 break 21833 } 21834 l := v_0.Args[0] 21835 if l.Op != OpARMSUBshiftRAreg { 21836 break 21837 } 21838 z := l.Args[2] 21839 x := l.Args[0] 21840 y := l.Args[1] 21841 if !(l.Uses == 1) { 21842 break 21843 } 21844 b.Reset(BlockARMGE) 21845 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags) 21846 v0.AddArg(x) 21847 v0.AddArg(y) 21848 v0.AddArg(z) 21849 b.AddControl(v0) 21850 return true 21851 } 21852 // match: (GE (CMPconst [0] l:(ADD x y)) yes no) 21853 // cond: l.Uses==1 21854 // result: (GE (CMN x y) yes no) 21855 for b.Controls[0].Op == OpARMCMPconst { 21856 v_0 := b.Controls[0] 21857 if v_0.AuxInt != 0 { 21858 break 21859 } 21860 l := v_0.Args[0] 21861 if l.Op != OpARMADD { 21862 break 21863 } 21864 y := l.Args[1] 21865 x := l.Args[0] 21866 if !(l.Uses == 1) { 21867 break 21868 } 21869 b.Reset(BlockARMGE) 21870 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 21871 v0.AddArg(x) 21872 v0.AddArg(y) 21873 b.AddControl(v0) 21874 return true 21875 } 21876 // match: (GE (CMPconst [0] l:(MULA x y a)) yes no) 21877 // cond: l.Uses==1 21878 // result: (GE (CMN a (MUL <x.Type> x y)) yes no) 21879 for b.Controls[0].Op == OpARMCMPconst { 21880 v_0 := b.Controls[0] 21881 if v_0.AuxInt != 0 { 21882 break 21883 } 21884 l := v_0.Args[0] 21885 if l.Op != OpARMMULA { 21886 break 21887 } 21888 a := l.Args[2] 21889 x := l.Args[0] 21890 y := l.Args[1] 21891 if !(l.Uses == 1) { 21892 break 21893 } 21894 b.Reset(BlockARMGE) 21895 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 21896 v0.AddArg(a) 21897 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 21898 v1.AddArg(x) 21899 v1.AddArg(y) 21900 v0.AddArg(v1) 21901 b.AddControl(v0) 21902 return true 21903 } 21904 // match: (GE (CMPconst [0] l:(ADDconst [c] x)) yes no) 21905 // cond: l.Uses==1 21906 // result: (GE (CMNconst [c] x) yes no) 21907 for b.Controls[0].Op == OpARMCMPconst { 21908 v_0 := b.Controls[0] 21909 if v_0.AuxInt != 0 { 21910 break 21911 } 21912 l := v_0.Args[0] 21913 if l.Op != OpARMADDconst { 21914 break 21915 } 21916 c := l.AuxInt 21917 x := l.Args[0] 21918 if !(l.Uses == 1) { 21919 break 21920 } 21921 b.Reset(BlockARMGE) 21922 v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags) 21923 v0.AuxInt = c 21924 v0.AddArg(x) 21925 b.AddControl(v0) 21926 return true 21927 } 21928 // match: (GE (CMPconst [0] l:(ADDshiftLL x y [c])) yes no) 21929 // cond: l.Uses==1 21930 // result: (GE (CMNshiftLL x y [c]) yes no) 21931 for b.Controls[0].Op == OpARMCMPconst { 21932 v_0 := b.Controls[0] 21933 if v_0.AuxInt != 0 { 21934 break 21935 } 21936 l := v_0.Args[0] 21937 if l.Op != OpARMADDshiftLL { 21938 break 21939 } 21940 c := l.AuxInt 21941 y := l.Args[1] 21942 x := l.Args[0] 21943 if !(l.Uses == 1) { 21944 break 21945 } 21946 b.Reset(BlockARMGE) 21947 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags) 21948 v0.AuxInt = c 21949 v0.AddArg(x) 21950 v0.AddArg(y) 21951 b.AddControl(v0) 21952 return true 21953 } 21954 // match: (GE (CMPconst [0] l:(ADDshiftRL x y [c])) yes no) 21955 // cond: l.Uses==1 21956 // result: (GE (CMNshiftRL x y [c]) yes no) 21957 for b.Controls[0].Op == OpARMCMPconst { 21958 v_0 := b.Controls[0] 21959 if v_0.AuxInt != 0 { 21960 break 21961 } 21962 l := v_0.Args[0] 21963 if l.Op != OpARMADDshiftRL { 21964 break 21965 } 21966 c := l.AuxInt 21967 y := l.Args[1] 21968 x := l.Args[0] 21969 if !(l.Uses == 1) { 21970 break 21971 } 21972 b.Reset(BlockARMGE) 21973 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags) 21974 v0.AuxInt = c 21975 v0.AddArg(x) 21976 v0.AddArg(y) 21977 b.AddControl(v0) 21978 return true 21979 } 21980 // match: (GE (CMPconst [0] l:(ADDshiftRA x y [c])) yes no) 21981 // cond: l.Uses==1 21982 // result: (GE (CMNshiftRA x y [c]) yes no) 21983 for b.Controls[0].Op == OpARMCMPconst { 21984 v_0 := b.Controls[0] 21985 if v_0.AuxInt != 0 { 21986 break 21987 } 21988 l := v_0.Args[0] 21989 if l.Op != OpARMADDshiftRA { 21990 break 21991 } 21992 c := l.AuxInt 21993 y := l.Args[1] 21994 x := l.Args[0] 21995 if !(l.Uses == 1) { 21996 break 21997 } 21998 b.Reset(BlockARMGE) 21999 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags) 22000 v0.AuxInt = c 22001 v0.AddArg(x) 22002 v0.AddArg(y) 22003 b.AddControl(v0) 22004 return true 22005 } 22006 // match: (GE (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no) 22007 // cond: l.Uses==1 22008 // result: (GE (CMNshiftLLreg x y z) yes no) 22009 for b.Controls[0].Op == OpARMCMPconst { 22010 v_0 := b.Controls[0] 22011 if v_0.AuxInt != 0 { 22012 break 22013 } 22014 l := v_0.Args[0] 22015 if l.Op != OpARMADDshiftLLreg { 22016 break 22017 } 22018 z := l.Args[2] 22019 x := l.Args[0] 22020 y := l.Args[1] 22021 if !(l.Uses == 1) { 22022 break 22023 } 22024 b.Reset(BlockARMGE) 22025 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags) 22026 v0.AddArg(x) 22027 v0.AddArg(y) 22028 v0.AddArg(z) 22029 b.AddControl(v0) 22030 return true 22031 } 22032 // match: (GE (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no) 22033 // cond: l.Uses==1 22034 // result: (GE (CMNshiftRLreg x y z) yes no) 22035 for b.Controls[0].Op == OpARMCMPconst { 22036 v_0 := b.Controls[0] 22037 if v_0.AuxInt != 0 { 22038 break 22039 } 22040 l := v_0.Args[0] 22041 if l.Op != OpARMADDshiftRLreg { 22042 break 22043 } 22044 z := l.Args[2] 22045 x := l.Args[0] 22046 y := l.Args[1] 22047 if !(l.Uses == 1) { 22048 break 22049 } 22050 b.Reset(BlockARMGE) 22051 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags) 22052 v0.AddArg(x) 22053 v0.AddArg(y) 22054 v0.AddArg(z) 22055 b.AddControl(v0) 22056 return true 22057 } 22058 // match: (GE (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no) 22059 // cond: l.Uses==1 22060 // result: (GE (CMNshiftRAreg x y z) yes no) 22061 for b.Controls[0].Op == OpARMCMPconst { 22062 v_0 := b.Controls[0] 22063 if v_0.AuxInt != 0 { 22064 break 22065 } 22066 l := v_0.Args[0] 22067 if l.Op != OpARMADDshiftRAreg { 22068 break 22069 } 22070 z := l.Args[2] 22071 x := l.Args[0] 22072 y := l.Args[1] 22073 if !(l.Uses == 1) { 22074 break 22075 } 22076 b.Reset(BlockARMGE) 22077 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags) 22078 v0.AddArg(x) 22079 v0.AddArg(y) 22080 v0.AddArg(z) 22081 b.AddControl(v0) 22082 return true 22083 } 22084 // match: (GE (CMPconst [0] l:(AND x y)) yes no) 22085 // cond: l.Uses==1 22086 // result: (GE (TST x y) yes no) 22087 for b.Controls[0].Op == OpARMCMPconst { 22088 v_0 := b.Controls[0] 22089 if v_0.AuxInt != 0 { 22090 break 22091 } 22092 l := v_0.Args[0] 22093 if l.Op != OpARMAND { 22094 break 22095 } 22096 y := l.Args[1] 22097 x := l.Args[0] 22098 if !(l.Uses == 1) { 22099 break 22100 } 22101 b.Reset(BlockARMGE) 22102 v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags) 22103 v0.AddArg(x) 22104 v0.AddArg(y) 22105 b.AddControl(v0) 22106 return true 22107 } 22108 // match: (GE (CMPconst [0] l:(ANDconst [c] x)) yes no) 22109 // cond: l.Uses==1 22110 // result: (GE (TSTconst [c] x) yes no) 22111 for b.Controls[0].Op == OpARMCMPconst { 22112 v_0 := b.Controls[0] 22113 if v_0.AuxInt != 0 { 22114 break 22115 } 22116 l := v_0.Args[0] 22117 if l.Op != OpARMANDconst { 22118 break 22119 } 22120 c := l.AuxInt 22121 x := l.Args[0] 22122 if !(l.Uses == 1) { 22123 break 22124 } 22125 b.Reset(BlockARMGE) 22126 v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags) 22127 v0.AuxInt = c 22128 v0.AddArg(x) 22129 b.AddControl(v0) 22130 return true 22131 } 22132 // match: (GE (CMPconst [0] l:(ANDshiftLL x y [c])) yes no) 22133 // cond: l.Uses==1 22134 // result: (GE (TSTshiftLL x y [c]) yes no) 22135 for b.Controls[0].Op == OpARMCMPconst { 22136 v_0 := b.Controls[0] 22137 if v_0.AuxInt != 0 { 22138 break 22139 } 22140 l := v_0.Args[0] 22141 if l.Op != OpARMANDshiftLL { 22142 break 22143 } 22144 c := l.AuxInt 22145 y := l.Args[1] 22146 x := l.Args[0] 22147 if !(l.Uses == 1) { 22148 break 22149 } 22150 b.Reset(BlockARMGE) 22151 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags) 22152 v0.AuxInt = c 22153 v0.AddArg(x) 22154 v0.AddArg(y) 22155 b.AddControl(v0) 22156 return true 22157 } 22158 // match: (GE (CMPconst [0] l:(ANDshiftRL x y [c])) yes no) 22159 // cond: l.Uses==1 22160 // result: (GE (TSTshiftRL x y [c]) yes no) 22161 for b.Controls[0].Op == OpARMCMPconst { 22162 v_0 := b.Controls[0] 22163 if v_0.AuxInt != 0 { 22164 break 22165 } 22166 l := v_0.Args[0] 22167 if l.Op != OpARMANDshiftRL { 22168 break 22169 } 22170 c := l.AuxInt 22171 y := l.Args[1] 22172 x := l.Args[0] 22173 if !(l.Uses == 1) { 22174 break 22175 } 22176 b.Reset(BlockARMGE) 22177 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags) 22178 v0.AuxInt = c 22179 v0.AddArg(x) 22180 v0.AddArg(y) 22181 b.AddControl(v0) 22182 return true 22183 } 22184 // match: (GE (CMPconst [0] l:(ANDshiftRA x y [c])) yes no) 22185 // cond: l.Uses==1 22186 // result: (GE (TSTshiftRA x y [c]) yes no) 22187 for b.Controls[0].Op == OpARMCMPconst { 22188 v_0 := b.Controls[0] 22189 if v_0.AuxInt != 0 { 22190 break 22191 } 22192 l := v_0.Args[0] 22193 if l.Op != OpARMANDshiftRA { 22194 break 22195 } 22196 c := l.AuxInt 22197 y := l.Args[1] 22198 x := l.Args[0] 22199 if !(l.Uses == 1) { 22200 break 22201 } 22202 b.Reset(BlockARMGE) 22203 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags) 22204 v0.AuxInt = c 22205 v0.AddArg(x) 22206 v0.AddArg(y) 22207 b.AddControl(v0) 22208 return true 22209 } 22210 // match: (GE (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no) 22211 // cond: l.Uses==1 22212 // result: (GE (TSTshiftLLreg x y z) yes no) 22213 for b.Controls[0].Op == OpARMCMPconst { 22214 v_0 := b.Controls[0] 22215 if v_0.AuxInt != 0 { 22216 break 22217 } 22218 l := v_0.Args[0] 22219 if l.Op != OpARMANDshiftLLreg { 22220 break 22221 } 22222 z := l.Args[2] 22223 x := l.Args[0] 22224 y := l.Args[1] 22225 if !(l.Uses == 1) { 22226 break 22227 } 22228 b.Reset(BlockARMGE) 22229 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags) 22230 v0.AddArg(x) 22231 v0.AddArg(y) 22232 v0.AddArg(z) 22233 b.AddControl(v0) 22234 return true 22235 } 22236 // match: (GE (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no) 22237 // cond: l.Uses==1 22238 // result: (GE (TSTshiftRLreg x y z) yes no) 22239 for b.Controls[0].Op == OpARMCMPconst { 22240 v_0 := b.Controls[0] 22241 if v_0.AuxInt != 0 { 22242 break 22243 } 22244 l := v_0.Args[0] 22245 if l.Op != OpARMANDshiftRLreg { 22246 break 22247 } 22248 z := l.Args[2] 22249 x := l.Args[0] 22250 y := l.Args[1] 22251 if !(l.Uses == 1) { 22252 break 22253 } 22254 b.Reset(BlockARMGE) 22255 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags) 22256 v0.AddArg(x) 22257 v0.AddArg(y) 22258 v0.AddArg(z) 22259 b.AddControl(v0) 22260 return true 22261 } 22262 // match: (GE (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no) 22263 // cond: l.Uses==1 22264 // result: (GE (TSTshiftRAreg x y z) yes no) 22265 for b.Controls[0].Op == OpARMCMPconst { 22266 v_0 := b.Controls[0] 22267 if v_0.AuxInt != 0 { 22268 break 22269 } 22270 l := v_0.Args[0] 22271 if l.Op != OpARMANDshiftRAreg { 22272 break 22273 } 22274 z := l.Args[2] 22275 x := l.Args[0] 22276 y := l.Args[1] 22277 if !(l.Uses == 1) { 22278 break 22279 } 22280 b.Reset(BlockARMGE) 22281 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags) 22282 v0.AddArg(x) 22283 v0.AddArg(y) 22284 v0.AddArg(z) 22285 b.AddControl(v0) 22286 return true 22287 } 22288 // match: (GE (CMPconst [0] l:(XOR x y)) yes no) 22289 // cond: l.Uses==1 22290 // result: (GE (TEQ x y) yes no) 22291 for b.Controls[0].Op == OpARMCMPconst { 22292 v_0 := b.Controls[0] 22293 if v_0.AuxInt != 0 { 22294 break 22295 } 22296 l := v_0.Args[0] 22297 if l.Op != OpARMXOR { 22298 break 22299 } 22300 y := l.Args[1] 22301 x := l.Args[0] 22302 if !(l.Uses == 1) { 22303 break 22304 } 22305 b.Reset(BlockARMGE) 22306 v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags) 22307 v0.AddArg(x) 22308 v0.AddArg(y) 22309 b.AddControl(v0) 22310 return true 22311 } 22312 // match: (GE (CMPconst [0] l:(XORconst [c] x)) yes no) 22313 // cond: l.Uses==1 22314 // result: (GE (TEQconst [c] x) yes no) 22315 for b.Controls[0].Op == OpARMCMPconst { 22316 v_0 := b.Controls[0] 22317 if v_0.AuxInt != 0 { 22318 break 22319 } 22320 l := v_0.Args[0] 22321 if l.Op != OpARMXORconst { 22322 break 22323 } 22324 c := l.AuxInt 22325 x := l.Args[0] 22326 if !(l.Uses == 1) { 22327 break 22328 } 22329 b.Reset(BlockARMGE) 22330 v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags) 22331 v0.AuxInt = c 22332 v0.AddArg(x) 22333 b.AddControl(v0) 22334 return true 22335 } 22336 // match: (GE (CMPconst [0] l:(XORshiftLL x y [c])) yes no) 22337 // cond: l.Uses==1 22338 // result: (GE (TEQshiftLL x y [c]) yes no) 22339 for b.Controls[0].Op == OpARMCMPconst { 22340 v_0 := b.Controls[0] 22341 if v_0.AuxInt != 0 { 22342 break 22343 } 22344 l := v_0.Args[0] 22345 if l.Op != OpARMXORshiftLL { 22346 break 22347 } 22348 c := l.AuxInt 22349 y := l.Args[1] 22350 x := l.Args[0] 22351 if !(l.Uses == 1) { 22352 break 22353 } 22354 b.Reset(BlockARMGE) 22355 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags) 22356 v0.AuxInt = c 22357 v0.AddArg(x) 22358 v0.AddArg(y) 22359 b.AddControl(v0) 22360 return true 22361 } 22362 // match: (GE (CMPconst [0] l:(XORshiftRL x y [c])) yes no) 22363 // cond: l.Uses==1 22364 // result: (GE (TEQshiftRL x y [c]) yes no) 22365 for b.Controls[0].Op == OpARMCMPconst { 22366 v_0 := b.Controls[0] 22367 if v_0.AuxInt != 0 { 22368 break 22369 } 22370 l := v_0.Args[0] 22371 if l.Op != OpARMXORshiftRL { 22372 break 22373 } 22374 c := l.AuxInt 22375 y := l.Args[1] 22376 x := l.Args[0] 22377 if !(l.Uses == 1) { 22378 break 22379 } 22380 b.Reset(BlockARMGE) 22381 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags) 22382 v0.AuxInt = c 22383 v0.AddArg(x) 22384 v0.AddArg(y) 22385 b.AddControl(v0) 22386 return true 22387 } 22388 // match: (GE (CMPconst [0] l:(XORshiftRA x y [c])) yes no) 22389 // cond: l.Uses==1 22390 // result: (GE (TEQshiftRA x y [c]) yes no) 22391 for b.Controls[0].Op == OpARMCMPconst { 22392 v_0 := b.Controls[0] 22393 if v_0.AuxInt != 0 { 22394 break 22395 } 22396 l := v_0.Args[0] 22397 if l.Op != OpARMXORshiftRA { 22398 break 22399 } 22400 c := l.AuxInt 22401 y := l.Args[1] 22402 x := l.Args[0] 22403 if !(l.Uses == 1) { 22404 break 22405 } 22406 b.Reset(BlockARMGE) 22407 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags) 22408 v0.AuxInt = c 22409 v0.AddArg(x) 22410 v0.AddArg(y) 22411 b.AddControl(v0) 22412 return true 22413 } 22414 // match: (GE (CMPconst [0] l:(XORshiftLLreg x y z)) yes no) 22415 // cond: l.Uses==1 22416 // result: (GE (TEQshiftLLreg x y z) yes no) 22417 for b.Controls[0].Op == OpARMCMPconst { 22418 v_0 := b.Controls[0] 22419 if v_0.AuxInt != 0 { 22420 break 22421 } 22422 l := v_0.Args[0] 22423 if l.Op != OpARMXORshiftLLreg { 22424 break 22425 } 22426 z := l.Args[2] 22427 x := l.Args[0] 22428 y := l.Args[1] 22429 if !(l.Uses == 1) { 22430 break 22431 } 22432 b.Reset(BlockARMGE) 22433 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags) 22434 v0.AddArg(x) 22435 v0.AddArg(y) 22436 v0.AddArg(z) 22437 b.AddControl(v0) 22438 return true 22439 } 22440 // match: (GE (CMPconst [0] l:(XORshiftRLreg x y z)) yes no) 22441 // cond: l.Uses==1 22442 // result: (GE (TEQshiftRLreg x y z) yes no) 22443 for b.Controls[0].Op == OpARMCMPconst { 22444 v_0 := b.Controls[0] 22445 if v_0.AuxInt != 0 { 22446 break 22447 } 22448 l := v_0.Args[0] 22449 if l.Op != OpARMXORshiftRLreg { 22450 break 22451 } 22452 z := l.Args[2] 22453 x := l.Args[0] 22454 y := l.Args[1] 22455 if !(l.Uses == 1) { 22456 break 22457 } 22458 b.Reset(BlockARMGE) 22459 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags) 22460 v0.AddArg(x) 22461 v0.AddArg(y) 22462 v0.AddArg(z) 22463 b.AddControl(v0) 22464 return true 22465 } 22466 // match: (GE (CMPconst [0] l:(XORshiftRAreg x y z)) yes no) 22467 // cond: l.Uses==1 22468 // result: (GE (TEQshiftRAreg x y z) yes no) 22469 for b.Controls[0].Op == OpARMCMPconst { 22470 v_0 := b.Controls[0] 22471 if v_0.AuxInt != 0 { 22472 break 22473 } 22474 l := v_0.Args[0] 22475 if l.Op != OpARMXORshiftRAreg { 22476 break 22477 } 22478 z := l.Args[2] 22479 x := l.Args[0] 22480 y := l.Args[1] 22481 if !(l.Uses == 1) { 22482 break 22483 } 22484 b.Reset(BlockARMGE) 22485 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags) 22486 v0.AddArg(x) 22487 v0.AddArg(y) 22488 v0.AddArg(z) 22489 b.AddControl(v0) 22490 return true 22491 } 22492 case BlockARMGT: 22493 // match: (GT (FlagEQ) yes no) 22494 // result: (First no yes) 22495 for b.Controls[0].Op == OpARMFlagEQ { 22496 b.Reset(BlockFirst) 22497 b.swapSuccessors() 22498 return true 22499 } 22500 // match: (GT (FlagLT_ULT) yes no) 22501 // result: (First no yes) 22502 for b.Controls[0].Op == OpARMFlagLT_ULT { 22503 b.Reset(BlockFirst) 22504 b.swapSuccessors() 22505 return true 22506 } 22507 // match: (GT (FlagLT_UGT) yes no) 22508 // result: (First no yes) 22509 for b.Controls[0].Op == OpARMFlagLT_UGT { 22510 b.Reset(BlockFirst) 22511 b.swapSuccessors() 22512 return true 22513 } 22514 // match: (GT (FlagGT_ULT) yes no) 22515 // result: (First yes no) 22516 for b.Controls[0].Op == OpARMFlagGT_ULT { 22517 b.Reset(BlockFirst) 22518 return true 22519 } 22520 // match: (GT (FlagGT_UGT) yes no) 22521 // result: (First yes no) 22522 for b.Controls[0].Op == OpARMFlagGT_UGT { 22523 b.Reset(BlockFirst) 22524 return true 22525 } 22526 // match: (GT (InvertFlags cmp) yes no) 22527 // result: (LT cmp yes no) 22528 for b.Controls[0].Op == OpARMInvertFlags { 22529 v_0 := b.Controls[0] 22530 cmp := v_0.Args[0] 22531 b.Reset(BlockARMLT) 22532 b.AddControl(cmp) 22533 return true 22534 } 22535 // match: (GT (CMPconst [0] l:(SUB x y)) yes no) 22536 // cond: l.Uses==1 22537 // result: (GT (CMP x y) yes no) 22538 for b.Controls[0].Op == OpARMCMPconst { 22539 v_0 := b.Controls[0] 22540 if v_0.AuxInt != 0 { 22541 break 22542 } 22543 l := v_0.Args[0] 22544 if l.Op != OpARMSUB { 22545 break 22546 } 22547 y := l.Args[1] 22548 x := l.Args[0] 22549 if !(l.Uses == 1) { 22550 break 22551 } 22552 b.Reset(BlockARMGT) 22553 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 22554 v0.AddArg(x) 22555 v0.AddArg(y) 22556 b.AddControl(v0) 22557 return true 22558 } 22559 // match: (GT (CMPconst [0] l:(MULS x y a)) yes no) 22560 // cond: l.Uses==1 22561 // result: (GT (CMP a (MUL <x.Type> x y)) yes no) 22562 for b.Controls[0].Op == OpARMCMPconst { 22563 v_0 := b.Controls[0] 22564 if v_0.AuxInt != 0 { 22565 break 22566 } 22567 l := v_0.Args[0] 22568 if l.Op != OpARMMULS { 22569 break 22570 } 22571 a := l.Args[2] 22572 x := l.Args[0] 22573 y := l.Args[1] 22574 if !(l.Uses == 1) { 22575 break 22576 } 22577 b.Reset(BlockARMGT) 22578 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 22579 v0.AddArg(a) 22580 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 22581 v1.AddArg(x) 22582 v1.AddArg(y) 22583 v0.AddArg(v1) 22584 b.AddControl(v0) 22585 return true 22586 } 22587 // match: (GT (CMPconst [0] l:(SUBconst [c] x)) yes no) 22588 // cond: l.Uses==1 22589 // result: (GT (CMPconst [c] x) yes no) 22590 for b.Controls[0].Op == OpARMCMPconst { 22591 v_0 := b.Controls[0] 22592 if v_0.AuxInt != 0 { 22593 break 22594 } 22595 l := v_0.Args[0] 22596 if l.Op != OpARMSUBconst { 22597 break 22598 } 22599 c := l.AuxInt 22600 x := l.Args[0] 22601 if !(l.Uses == 1) { 22602 break 22603 } 22604 b.Reset(BlockARMGT) 22605 v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags) 22606 v0.AuxInt = c 22607 v0.AddArg(x) 22608 b.AddControl(v0) 22609 return true 22610 } 22611 // match: (GT (CMPconst [0] l:(SUBshiftLL x y [c])) yes no) 22612 // cond: l.Uses==1 22613 // result: (GT (CMPshiftLL x y [c]) yes no) 22614 for b.Controls[0].Op == OpARMCMPconst { 22615 v_0 := b.Controls[0] 22616 if v_0.AuxInt != 0 { 22617 break 22618 } 22619 l := v_0.Args[0] 22620 if l.Op != OpARMSUBshiftLL { 22621 break 22622 } 22623 c := l.AuxInt 22624 y := l.Args[1] 22625 x := l.Args[0] 22626 if !(l.Uses == 1) { 22627 break 22628 } 22629 b.Reset(BlockARMGT) 22630 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags) 22631 v0.AuxInt = c 22632 v0.AddArg(x) 22633 v0.AddArg(y) 22634 b.AddControl(v0) 22635 return true 22636 } 22637 // match: (GT (CMPconst [0] l:(SUBshiftRL x y [c])) yes no) 22638 // cond: l.Uses==1 22639 // result: (GT (CMPshiftRL x y [c]) yes no) 22640 for b.Controls[0].Op == OpARMCMPconst { 22641 v_0 := b.Controls[0] 22642 if v_0.AuxInt != 0 { 22643 break 22644 } 22645 l := v_0.Args[0] 22646 if l.Op != OpARMSUBshiftRL { 22647 break 22648 } 22649 c := l.AuxInt 22650 y := l.Args[1] 22651 x := l.Args[0] 22652 if !(l.Uses == 1) { 22653 break 22654 } 22655 b.Reset(BlockARMGT) 22656 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags) 22657 v0.AuxInt = c 22658 v0.AddArg(x) 22659 v0.AddArg(y) 22660 b.AddControl(v0) 22661 return true 22662 } 22663 // match: (GT (CMPconst [0] l:(SUBshiftRA x y [c])) yes no) 22664 // cond: l.Uses==1 22665 // result: (GT (CMPshiftRA x y [c]) yes no) 22666 for b.Controls[0].Op == OpARMCMPconst { 22667 v_0 := b.Controls[0] 22668 if v_0.AuxInt != 0 { 22669 break 22670 } 22671 l := v_0.Args[0] 22672 if l.Op != OpARMSUBshiftRA { 22673 break 22674 } 22675 c := l.AuxInt 22676 y := l.Args[1] 22677 x := l.Args[0] 22678 if !(l.Uses == 1) { 22679 break 22680 } 22681 b.Reset(BlockARMGT) 22682 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags) 22683 v0.AuxInt = c 22684 v0.AddArg(x) 22685 v0.AddArg(y) 22686 b.AddControl(v0) 22687 return true 22688 } 22689 // match: (GT (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no) 22690 // cond: l.Uses==1 22691 // result: (GT (CMPshiftLLreg x y z) yes no) 22692 for b.Controls[0].Op == OpARMCMPconst { 22693 v_0 := b.Controls[0] 22694 if v_0.AuxInt != 0 { 22695 break 22696 } 22697 l := v_0.Args[0] 22698 if l.Op != OpARMSUBshiftLLreg { 22699 break 22700 } 22701 z := l.Args[2] 22702 x := l.Args[0] 22703 y := l.Args[1] 22704 if !(l.Uses == 1) { 22705 break 22706 } 22707 b.Reset(BlockARMGT) 22708 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags) 22709 v0.AddArg(x) 22710 v0.AddArg(y) 22711 v0.AddArg(z) 22712 b.AddControl(v0) 22713 return true 22714 } 22715 // match: (GT (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no) 22716 // cond: l.Uses==1 22717 // result: (GT (CMPshiftRLreg x y z) yes no) 22718 for b.Controls[0].Op == OpARMCMPconst { 22719 v_0 := b.Controls[0] 22720 if v_0.AuxInt != 0 { 22721 break 22722 } 22723 l := v_0.Args[0] 22724 if l.Op != OpARMSUBshiftRLreg { 22725 break 22726 } 22727 z := l.Args[2] 22728 x := l.Args[0] 22729 y := l.Args[1] 22730 if !(l.Uses == 1) { 22731 break 22732 } 22733 b.Reset(BlockARMGT) 22734 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags) 22735 v0.AddArg(x) 22736 v0.AddArg(y) 22737 v0.AddArg(z) 22738 b.AddControl(v0) 22739 return true 22740 } 22741 // match: (GT (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no) 22742 // cond: l.Uses==1 22743 // result: (GT (CMPshiftRAreg x y z) yes no) 22744 for b.Controls[0].Op == OpARMCMPconst { 22745 v_0 := b.Controls[0] 22746 if v_0.AuxInt != 0 { 22747 break 22748 } 22749 l := v_0.Args[0] 22750 if l.Op != OpARMSUBshiftRAreg { 22751 break 22752 } 22753 z := l.Args[2] 22754 x := l.Args[0] 22755 y := l.Args[1] 22756 if !(l.Uses == 1) { 22757 break 22758 } 22759 b.Reset(BlockARMGT) 22760 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags) 22761 v0.AddArg(x) 22762 v0.AddArg(y) 22763 v0.AddArg(z) 22764 b.AddControl(v0) 22765 return true 22766 } 22767 // match: (GT (CMPconst [0] l:(ADD x y)) yes no) 22768 // cond: l.Uses==1 22769 // result: (GT (CMN x y) yes no) 22770 for b.Controls[0].Op == OpARMCMPconst { 22771 v_0 := b.Controls[0] 22772 if v_0.AuxInt != 0 { 22773 break 22774 } 22775 l := v_0.Args[0] 22776 if l.Op != OpARMADD { 22777 break 22778 } 22779 y := l.Args[1] 22780 x := l.Args[0] 22781 if !(l.Uses == 1) { 22782 break 22783 } 22784 b.Reset(BlockARMGT) 22785 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 22786 v0.AddArg(x) 22787 v0.AddArg(y) 22788 b.AddControl(v0) 22789 return true 22790 } 22791 // match: (GT (CMPconst [0] l:(ADDconst [c] x)) yes no) 22792 // cond: l.Uses==1 22793 // result: (GT (CMNconst [c] x) yes no) 22794 for b.Controls[0].Op == OpARMCMPconst { 22795 v_0 := b.Controls[0] 22796 if v_0.AuxInt != 0 { 22797 break 22798 } 22799 l := v_0.Args[0] 22800 if l.Op != OpARMADDconst { 22801 break 22802 } 22803 c := l.AuxInt 22804 x := l.Args[0] 22805 if !(l.Uses == 1) { 22806 break 22807 } 22808 b.Reset(BlockARMGT) 22809 v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags) 22810 v0.AuxInt = c 22811 v0.AddArg(x) 22812 b.AddControl(v0) 22813 return true 22814 } 22815 // match: (GT (CMPconst [0] l:(ADDshiftLL x y [c])) yes no) 22816 // cond: l.Uses==1 22817 // result: (GT (CMNshiftLL x y [c]) yes no) 22818 for b.Controls[0].Op == OpARMCMPconst { 22819 v_0 := b.Controls[0] 22820 if v_0.AuxInt != 0 { 22821 break 22822 } 22823 l := v_0.Args[0] 22824 if l.Op != OpARMADDshiftLL { 22825 break 22826 } 22827 c := l.AuxInt 22828 y := l.Args[1] 22829 x := l.Args[0] 22830 if !(l.Uses == 1) { 22831 break 22832 } 22833 b.Reset(BlockARMGT) 22834 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags) 22835 v0.AuxInt = c 22836 v0.AddArg(x) 22837 v0.AddArg(y) 22838 b.AddControl(v0) 22839 return true 22840 } 22841 // match: (GT (CMPconst [0] l:(ADDshiftRL x y [c])) yes no) 22842 // cond: l.Uses==1 22843 // result: (GT (CMNshiftRL x y [c]) yes no) 22844 for b.Controls[0].Op == OpARMCMPconst { 22845 v_0 := b.Controls[0] 22846 if v_0.AuxInt != 0 { 22847 break 22848 } 22849 l := v_0.Args[0] 22850 if l.Op != OpARMADDshiftRL { 22851 break 22852 } 22853 c := l.AuxInt 22854 y := l.Args[1] 22855 x := l.Args[0] 22856 if !(l.Uses == 1) { 22857 break 22858 } 22859 b.Reset(BlockARMGT) 22860 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags) 22861 v0.AuxInt = c 22862 v0.AddArg(x) 22863 v0.AddArg(y) 22864 b.AddControl(v0) 22865 return true 22866 } 22867 // match: (GT (CMPconst [0] l:(ADDshiftRA x y [c])) yes no) 22868 // cond: l.Uses==1 22869 // result: (GT (CMNshiftRA x y [c]) yes no) 22870 for b.Controls[0].Op == OpARMCMPconst { 22871 v_0 := b.Controls[0] 22872 if v_0.AuxInt != 0 { 22873 break 22874 } 22875 l := v_0.Args[0] 22876 if l.Op != OpARMADDshiftRA { 22877 break 22878 } 22879 c := l.AuxInt 22880 y := l.Args[1] 22881 x := l.Args[0] 22882 if !(l.Uses == 1) { 22883 break 22884 } 22885 b.Reset(BlockARMGT) 22886 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags) 22887 v0.AuxInt = c 22888 v0.AddArg(x) 22889 v0.AddArg(y) 22890 b.AddControl(v0) 22891 return true 22892 } 22893 // match: (GT (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no) 22894 // cond: l.Uses==1 22895 // result: (GT (CMNshiftLLreg x y z) yes no) 22896 for b.Controls[0].Op == OpARMCMPconst { 22897 v_0 := b.Controls[0] 22898 if v_0.AuxInt != 0 { 22899 break 22900 } 22901 l := v_0.Args[0] 22902 if l.Op != OpARMADDshiftLLreg { 22903 break 22904 } 22905 z := l.Args[2] 22906 x := l.Args[0] 22907 y := l.Args[1] 22908 if !(l.Uses == 1) { 22909 break 22910 } 22911 b.Reset(BlockARMGT) 22912 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags) 22913 v0.AddArg(x) 22914 v0.AddArg(y) 22915 v0.AddArg(z) 22916 b.AddControl(v0) 22917 return true 22918 } 22919 // match: (GT (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no) 22920 // cond: l.Uses==1 22921 // result: (GT (CMNshiftRLreg x y z) yes no) 22922 for b.Controls[0].Op == OpARMCMPconst { 22923 v_0 := b.Controls[0] 22924 if v_0.AuxInt != 0 { 22925 break 22926 } 22927 l := v_0.Args[0] 22928 if l.Op != OpARMADDshiftRLreg { 22929 break 22930 } 22931 z := l.Args[2] 22932 x := l.Args[0] 22933 y := l.Args[1] 22934 if !(l.Uses == 1) { 22935 break 22936 } 22937 b.Reset(BlockARMGT) 22938 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags) 22939 v0.AddArg(x) 22940 v0.AddArg(y) 22941 v0.AddArg(z) 22942 b.AddControl(v0) 22943 return true 22944 } 22945 // match: (GT (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no) 22946 // cond: l.Uses==1 22947 // result: (GT (CMNshiftRAreg x y z) yes no) 22948 for b.Controls[0].Op == OpARMCMPconst { 22949 v_0 := b.Controls[0] 22950 if v_0.AuxInt != 0 { 22951 break 22952 } 22953 l := v_0.Args[0] 22954 if l.Op != OpARMADDshiftRAreg { 22955 break 22956 } 22957 z := l.Args[2] 22958 x := l.Args[0] 22959 y := l.Args[1] 22960 if !(l.Uses == 1) { 22961 break 22962 } 22963 b.Reset(BlockARMGT) 22964 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags) 22965 v0.AddArg(x) 22966 v0.AddArg(y) 22967 v0.AddArg(z) 22968 b.AddControl(v0) 22969 return true 22970 } 22971 // match: (GT (CMPconst [0] l:(AND x y)) yes no) 22972 // cond: l.Uses==1 22973 // result: (GT (TST x y) yes no) 22974 for b.Controls[0].Op == OpARMCMPconst { 22975 v_0 := b.Controls[0] 22976 if v_0.AuxInt != 0 { 22977 break 22978 } 22979 l := v_0.Args[0] 22980 if l.Op != OpARMAND { 22981 break 22982 } 22983 y := l.Args[1] 22984 x := l.Args[0] 22985 if !(l.Uses == 1) { 22986 break 22987 } 22988 b.Reset(BlockARMGT) 22989 v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags) 22990 v0.AddArg(x) 22991 v0.AddArg(y) 22992 b.AddControl(v0) 22993 return true 22994 } 22995 // match: (GT (CMPconst [0] l:(MULA x y a)) yes no) 22996 // cond: l.Uses==1 22997 // result: (GT (CMN a (MUL <x.Type> x y)) yes no) 22998 for b.Controls[0].Op == OpARMCMPconst { 22999 v_0 := b.Controls[0] 23000 if v_0.AuxInt != 0 { 23001 break 23002 } 23003 l := v_0.Args[0] 23004 if l.Op != OpARMMULA { 23005 break 23006 } 23007 a := l.Args[2] 23008 x := l.Args[0] 23009 y := l.Args[1] 23010 if !(l.Uses == 1) { 23011 break 23012 } 23013 b.Reset(BlockARMGT) 23014 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 23015 v0.AddArg(a) 23016 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 23017 v1.AddArg(x) 23018 v1.AddArg(y) 23019 v0.AddArg(v1) 23020 b.AddControl(v0) 23021 return true 23022 } 23023 // match: (GT (CMPconst [0] l:(ANDconst [c] x)) yes no) 23024 // cond: l.Uses==1 23025 // result: (GT (TSTconst [c] x) yes no) 23026 for b.Controls[0].Op == OpARMCMPconst { 23027 v_0 := b.Controls[0] 23028 if v_0.AuxInt != 0 { 23029 break 23030 } 23031 l := v_0.Args[0] 23032 if l.Op != OpARMANDconst { 23033 break 23034 } 23035 c := l.AuxInt 23036 x := l.Args[0] 23037 if !(l.Uses == 1) { 23038 break 23039 } 23040 b.Reset(BlockARMGT) 23041 v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags) 23042 v0.AuxInt = c 23043 v0.AddArg(x) 23044 b.AddControl(v0) 23045 return true 23046 } 23047 // match: (GT (CMPconst [0] l:(ANDshiftLL x y [c])) yes no) 23048 // cond: l.Uses==1 23049 // result: (GT (TSTshiftLL x y [c]) yes no) 23050 for b.Controls[0].Op == OpARMCMPconst { 23051 v_0 := b.Controls[0] 23052 if v_0.AuxInt != 0 { 23053 break 23054 } 23055 l := v_0.Args[0] 23056 if l.Op != OpARMANDshiftLL { 23057 break 23058 } 23059 c := l.AuxInt 23060 y := l.Args[1] 23061 x := l.Args[0] 23062 if !(l.Uses == 1) { 23063 break 23064 } 23065 b.Reset(BlockARMGT) 23066 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags) 23067 v0.AuxInt = c 23068 v0.AddArg(x) 23069 v0.AddArg(y) 23070 b.AddControl(v0) 23071 return true 23072 } 23073 // match: (GT (CMPconst [0] l:(ANDshiftRL x y [c])) yes no) 23074 // cond: l.Uses==1 23075 // result: (GT (TSTshiftRL x y [c]) yes no) 23076 for b.Controls[0].Op == OpARMCMPconst { 23077 v_0 := b.Controls[0] 23078 if v_0.AuxInt != 0 { 23079 break 23080 } 23081 l := v_0.Args[0] 23082 if l.Op != OpARMANDshiftRL { 23083 break 23084 } 23085 c := l.AuxInt 23086 y := l.Args[1] 23087 x := l.Args[0] 23088 if !(l.Uses == 1) { 23089 break 23090 } 23091 b.Reset(BlockARMGT) 23092 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags) 23093 v0.AuxInt = c 23094 v0.AddArg(x) 23095 v0.AddArg(y) 23096 b.AddControl(v0) 23097 return true 23098 } 23099 // match: (GT (CMPconst [0] l:(ANDshiftRA x y [c])) yes no) 23100 // cond: l.Uses==1 23101 // result: (GT (TSTshiftRA x y [c]) yes no) 23102 for b.Controls[0].Op == OpARMCMPconst { 23103 v_0 := b.Controls[0] 23104 if v_0.AuxInt != 0 { 23105 break 23106 } 23107 l := v_0.Args[0] 23108 if l.Op != OpARMANDshiftRA { 23109 break 23110 } 23111 c := l.AuxInt 23112 y := l.Args[1] 23113 x := l.Args[0] 23114 if !(l.Uses == 1) { 23115 break 23116 } 23117 b.Reset(BlockARMGT) 23118 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags) 23119 v0.AuxInt = c 23120 v0.AddArg(x) 23121 v0.AddArg(y) 23122 b.AddControl(v0) 23123 return true 23124 } 23125 // match: (GT (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no) 23126 // cond: l.Uses==1 23127 // result: (GT (TSTshiftLLreg x y z) yes no) 23128 for b.Controls[0].Op == OpARMCMPconst { 23129 v_0 := b.Controls[0] 23130 if v_0.AuxInt != 0 { 23131 break 23132 } 23133 l := v_0.Args[0] 23134 if l.Op != OpARMANDshiftLLreg { 23135 break 23136 } 23137 z := l.Args[2] 23138 x := l.Args[0] 23139 y := l.Args[1] 23140 if !(l.Uses == 1) { 23141 break 23142 } 23143 b.Reset(BlockARMGT) 23144 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags) 23145 v0.AddArg(x) 23146 v0.AddArg(y) 23147 v0.AddArg(z) 23148 b.AddControl(v0) 23149 return true 23150 } 23151 // match: (GT (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no) 23152 // cond: l.Uses==1 23153 // result: (GT (TSTshiftRLreg x y z) yes no) 23154 for b.Controls[0].Op == OpARMCMPconst { 23155 v_0 := b.Controls[0] 23156 if v_0.AuxInt != 0 { 23157 break 23158 } 23159 l := v_0.Args[0] 23160 if l.Op != OpARMANDshiftRLreg { 23161 break 23162 } 23163 z := l.Args[2] 23164 x := l.Args[0] 23165 y := l.Args[1] 23166 if !(l.Uses == 1) { 23167 break 23168 } 23169 b.Reset(BlockARMGT) 23170 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags) 23171 v0.AddArg(x) 23172 v0.AddArg(y) 23173 v0.AddArg(z) 23174 b.AddControl(v0) 23175 return true 23176 } 23177 // match: (GT (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no) 23178 // cond: l.Uses==1 23179 // result: (GT (TSTshiftRAreg x y z) yes no) 23180 for b.Controls[0].Op == OpARMCMPconst { 23181 v_0 := b.Controls[0] 23182 if v_0.AuxInt != 0 { 23183 break 23184 } 23185 l := v_0.Args[0] 23186 if l.Op != OpARMANDshiftRAreg { 23187 break 23188 } 23189 z := l.Args[2] 23190 x := l.Args[0] 23191 y := l.Args[1] 23192 if !(l.Uses == 1) { 23193 break 23194 } 23195 b.Reset(BlockARMGT) 23196 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags) 23197 v0.AddArg(x) 23198 v0.AddArg(y) 23199 v0.AddArg(z) 23200 b.AddControl(v0) 23201 return true 23202 } 23203 // match: (GT (CMPconst [0] l:(XOR x y)) yes no) 23204 // cond: l.Uses==1 23205 // result: (GT (TEQ x y) yes no) 23206 for b.Controls[0].Op == OpARMCMPconst { 23207 v_0 := b.Controls[0] 23208 if v_0.AuxInt != 0 { 23209 break 23210 } 23211 l := v_0.Args[0] 23212 if l.Op != OpARMXOR { 23213 break 23214 } 23215 y := l.Args[1] 23216 x := l.Args[0] 23217 if !(l.Uses == 1) { 23218 break 23219 } 23220 b.Reset(BlockARMGT) 23221 v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags) 23222 v0.AddArg(x) 23223 v0.AddArg(y) 23224 b.AddControl(v0) 23225 return true 23226 } 23227 // match: (GT (CMPconst [0] l:(XORconst [c] x)) yes no) 23228 // cond: l.Uses==1 23229 // result: (GT (TEQconst [c] x) yes no) 23230 for b.Controls[0].Op == OpARMCMPconst { 23231 v_0 := b.Controls[0] 23232 if v_0.AuxInt != 0 { 23233 break 23234 } 23235 l := v_0.Args[0] 23236 if l.Op != OpARMXORconst { 23237 break 23238 } 23239 c := l.AuxInt 23240 x := l.Args[0] 23241 if !(l.Uses == 1) { 23242 break 23243 } 23244 b.Reset(BlockARMGT) 23245 v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags) 23246 v0.AuxInt = c 23247 v0.AddArg(x) 23248 b.AddControl(v0) 23249 return true 23250 } 23251 // match: (GT (CMPconst [0] l:(XORshiftLL x y [c])) yes no) 23252 // cond: l.Uses==1 23253 // result: (GT (TEQshiftLL x y [c]) yes no) 23254 for b.Controls[0].Op == OpARMCMPconst { 23255 v_0 := b.Controls[0] 23256 if v_0.AuxInt != 0 { 23257 break 23258 } 23259 l := v_0.Args[0] 23260 if l.Op != OpARMXORshiftLL { 23261 break 23262 } 23263 c := l.AuxInt 23264 y := l.Args[1] 23265 x := l.Args[0] 23266 if !(l.Uses == 1) { 23267 break 23268 } 23269 b.Reset(BlockARMGT) 23270 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags) 23271 v0.AuxInt = c 23272 v0.AddArg(x) 23273 v0.AddArg(y) 23274 b.AddControl(v0) 23275 return true 23276 } 23277 // match: (GT (CMPconst [0] l:(XORshiftRL x y [c])) yes no) 23278 // cond: l.Uses==1 23279 // result: (GT (TEQshiftRL x y [c]) yes no) 23280 for b.Controls[0].Op == OpARMCMPconst { 23281 v_0 := b.Controls[0] 23282 if v_0.AuxInt != 0 { 23283 break 23284 } 23285 l := v_0.Args[0] 23286 if l.Op != OpARMXORshiftRL { 23287 break 23288 } 23289 c := l.AuxInt 23290 y := l.Args[1] 23291 x := l.Args[0] 23292 if !(l.Uses == 1) { 23293 break 23294 } 23295 b.Reset(BlockARMGT) 23296 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags) 23297 v0.AuxInt = c 23298 v0.AddArg(x) 23299 v0.AddArg(y) 23300 b.AddControl(v0) 23301 return true 23302 } 23303 // match: (GT (CMPconst [0] l:(XORshiftRA x y [c])) yes no) 23304 // cond: l.Uses==1 23305 // result: (GT (TEQshiftRA x y [c]) yes no) 23306 for b.Controls[0].Op == OpARMCMPconst { 23307 v_0 := b.Controls[0] 23308 if v_0.AuxInt != 0 { 23309 break 23310 } 23311 l := v_0.Args[0] 23312 if l.Op != OpARMXORshiftRA { 23313 break 23314 } 23315 c := l.AuxInt 23316 y := l.Args[1] 23317 x := l.Args[0] 23318 if !(l.Uses == 1) { 23319 break 23320 } 23321 b.Reset(BlockARMGT) 23322 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags) 23323 v0.AuxInt = c 23324 v0.AddArg(x) 23325 v0.AddArg(y) 23326 b.AddControl(v0) 23327 return true 23328 } 23329 // match: (GT (CMPconst [0] l:(XORshiftLLreg x y z)) yes no) 23330 // cond: l.Uses==1 23331 // result: (GT (TEQshiftLLreg x y z) yes no) 23332 for b.Controls[0].Op == OpARMCMPconst { 23333 v_0 := b.Controls[0] 23334 if v_0.AuxInt != 0 { 23335 break 23336 } 23337 l := v_0.Args[0] 23338 if l.Op != OpARMXORshiftLLreg { 23339 break 23340 } 23341 z := l.Args[2] 23342 x := l.Args[0] 23343 y := l.Args[1] 23344 if !(l.Uses == 1) { 23345 break 23346 } 23347 b.Reset(BlockARMGT) 23348 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags) 23349 v0.AddArg(x) 23350 v0.AddArg(y) 23351 v0.AddArg(z) 23352 b.AddControl(v0) 23353 return true 23354 } 23355 // match: (GT (CMPconst [0] l:(XORshiftRLreg x y z)) yes no) 23356 // cond: l.Uses==1 23357 // result: (GT (TEQshiftRLreg x y z) yes no) 23358 for b.Controls[0].Op == OpARMCMPconst { 23359 v_0 := b.Controls[0] 23360 if v_0.AuxInt != 0 { 23361 break 23362 } 23363 l := v_0.Args[0] 23364 if l.Op != OpARMXORshiftRLreg { 23365 break 23366 } 23367 z := l.Args[2] 23368 x := l.Args[0] 23369 y := l.Args[1] 23370 if !(l.Uses == 1) { 23371 break 23372 } 23373 b.Reset(BlockARMGT) 23374 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags) 23375 v0.AddArg(x) 23376 v0.AddArg(y) 23377 v0.AddArg(z) 23378 b.AddControl(v0) 23379 return true 23380 } 23381 // match: (GT (CMPconst [0] l:(XORshiftRAreg x y z)) yes no) 23382 // cond: l.Uses==1 23383 // result: (GT (TEQshiftRAreg x y z) yes no) 23384 for b.Controls[0].Op == OpARMCMPconst { 23385 v_0 := b.Controls[0] 23386 if v_0.AuxInt != 0 { 23387 break 23388 } 23389 l := v_0.Args[0] 23390 if l.Op != OpARMXORshiftRAreg { 23391 break 23392 } 23393 z := l.Args[2] 23394 x := l.Args[0] 23395 y := l.Args[1] 23396 if !(l.Uses == 1) { 23397 break 23398 } 23399 b.Reset(BlockARMGT) 23400 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags) 23401 v0.AddArg(x) 23402 v0.AddArg(y) 23403 v0.AddArg(z) 23404 b.AddControl(v0) 23405 return true 23406 } 23407 case BlockIf: 23408 // match: (If (Equal cc) yes no) 23409 // result: (EQ cc yes no) 23410 for b.Controls[0].Op == OpARMEqual { 23411 v_0 := b.Controls[0] 23412 cc := v_0.Args[0] 23413 b.Reset(BlockARMEQ) 23414 b.AddControl(cc) 23415 return true 23416 } 23417 // match: (If (NotEqual cc) yes no) 23418 // result: (NE cc yes no) 23419 for b.Controls[0].Op == OpARMNotEqual { 23420 v_0 := b.Controls[0] 23421 cc := v_0.Args[0] 23422 b.Reset(BlockARMNE) 23423 b.AddControl(cc) 23424 return true 23425 } 23426 // match: (If (LessThan cc) yes no) 23427 // result: (LT cc yes no) 23428 for b.Controls[0].Op == OpARMLessThan { 23429 v_0 := b.Controls[0] 23430 cc := v_0.Args[0] 23431 b.Reset(BlockARMLT) 23432 b.AddControl(cc) 23433 return true 23434 } 23435 // match: (If (LessThanU cc) yes no) 23436 // result: (ULT cc yes no) 23437 for b.Controls[0].Op == OpARMLessThanU { 23438 v_0 := b.Controls[0] 23439 cc := v_0.Args[0] 23440 b.Reset(BlockARMULT) 23441 b.AddControl(cc) 23442 return true 23443 } 23444 // match: (If (LessEqual cc) yes no) 23445 // result: (LE cc yes no) 23446 for b.Controls[0].Op == OpARMLessEqual { 23447 v_0 := b.Controls[0] 23448 cc := v_0.Args[0] 23449 b.Reset(BlockARMLE) 23450 b.AddControl(cc) 23451 return true 23452 } 23453 // match: (If (LessEqualU cc) yes no) 23454 // result: (ULE cc yes no) 23455 for b.Controls[0].Op == OpARMLessEqualU { 23456 v_0 := b.Controls[0] 23457 cc := v_0.Args[0] 23458 b.Reset(BlockARMULE) 23459 b.AddControl(cc) 23460 return true 23461 } 23462 // match: (If (GreaterThan cc) yes no) 23463 // result: (GT cc yes no) 23464 for b.Controls[0].Op == OpARMGreaterThan { 23465 v_0 := b.Controls[0] 23466 cc := v_0.Args[0] 23467 b.Reset(BlockARMGT) 23468 b.AddControl(cc) 23469 return true 23470 } 23471 // match: (If (GreaterThanU cc) yes no) 23472 // result: (UGT cc yes no) 23473 for b.Controls[0].Op == OpARMGreaterThanU { 23474 v_0 := b.Controls[0] 23475 cc := v_0.Args[0] 23476 b.Reset(BlockARMUGT) 23477 b.AddControl(cc) 23478 return true 23479 } 23480 // match: (If (GreaterEqual cc) yes no) 23481 // result: (GE cc yes no) 23482 for b.Controls[0].Op == OpARMGreaterEqual { 23483 v_0 := b.Controls[0] 23484 cc := v_0.Args[0] 23485 b.Reset(BlockARMGE) 23486 b.AddControl(cc) 23487 return true 23488 } 23489 // match: (If (GreaterEqualU cc) yes no) 23490 // result: (UGE cc yes no) 23491 for b.Controls[0].Op == OpARMGreaterEqualU { 23492 v_0 := b.Controls[0] 23493 cc := v_0.Args[0] 23494 b.Reset(BlockARMUGE) 23495 b.AddControl(cc) 23496 return true 23497 } 23498 // match: (If cond yes no) 23499 // result: (NE (CMPconst [0] cond) yes no) 23500 for { 23501 cond := b.Controls[0] 23502 b.Reset(BlockARMNE) 23503 v0 := b.NewValue0(cond.Pos, OpARMCMPconst, types.TypeFlags) 23504 v0.AuxInt = 0 23505 v0.AddArg(cond) 23506 b.AddControl(v0) 23507 return true 23508 } 23509 case BlockARMLE: 23510 // match: (LE (FlagEQ) yes no) 23511 // result: (First yes no) 23512 for b.Controls[0].Op == OpARMFlagEQ { 23513 b.Reset(BlockFirst) 23514 return true 23515 } 23516 // match: (LE (FlagLT_ULT) yes no) 23517 // result: (First yes no) 23518 for b.Controls[0].Op == OpARMFlagLT_ULT { 23519 b.Reset(BlockFirst) 23520 return true 23521 } 23522 // match: (LE (FlagLT_UGT) yes no) 23523 // result: (First yes no) 23524 for b.Controls[0].Op == OpARMFlagLT_UGT { 23525 b.Reset(BlockFirst) 23526 return true 23527 } 23528 // match: (LE (FlagGT_ULT) yes no) 23529 // result: (First no yes) 23530 for b.Controls[0].Op == OpARMFlagGT_ULT { 23531 b.Reset(BlockFirst) 23532 b.swapSuccessors() 23533 return true 23534 } 23535 // match: (LE (FlagGT_UGT) yes no) 23536 // result: (First no yes) 23537 for b.Controls[0].Op == OpARMFlagGT_UGT { 23538 b.Reset(BlockFirst) 23539 b.swapSuccessors() 23540 return true 23541 } 23542 // match: (LE (InvertFlags cmp) yes no) 23543 // result: (GE cmp yes no) 23544 for b.Controls[0].Op == OpARMInvertFlags { 23545 v_0 := b.Controls[0] 23546 cmp := v_0.Args[0] 23547 b.Reset(BlockARMGE) 23548 b.AddControl(cmp) 23549 return true 23550 } 23551 // match: (LE (CMPconst [0] l:(SUB x y)) yes no) 23552 // cond: l.Uses==1 23553 // result: (LE (CMP x y) yes no) 23554 for b.Controls[0].Op == OpARMCMPconst { 23555 v_0 := b.Controls[0] 23556 if v_0.AuxInt != 0 { 23557 break 23558 } 23559 l := v_0.Args[0] 23560 if l.Op != OpARMSUB { 23561 break 23562 } 23563 y := l.Args[1] 23564 x := l.Args[0] 23565 if !(l.Uses == 1) { 23566 break 23567 } 23568 b.Reset(BlockARMLE) 23569 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 23570 v0.AddArg(x) 23571 v0.AddArg(y) 23572 b.AddControl(v0) 23573 return true 23574 } 23575 // match: (LE (CMPconst [0] l:(MULS x y a)) yes no) 23576 // cond: l.Uses==1 23577 // result: (LE (CMP a (MUL <x.Type> x y)) yes no) 23578 for b.Controls[0].Op == OpARMCMPconst { 23579 v_0 := b.Controls[0] 23580 if v_0.AuxInt != 0 { 23581 break 23582 } 23583 l := v_0.Args[0] 23584 if l.Op != OpARMMULS { 23585 break 23586 } 23587 a := l.Args[2] 23588 x := l.Args[0] 23589 y := l.Args[1] 23590 if !(l.Uses == 1) { 23591 break 23592 } 23593 b.Reset(BlockARMLE) 23594 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 23595 v0.AddArg(a) 23596 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 23597 v1.AddArg(x) 23598 v1.AddArg(y) 23599 v0.AddArg(v1) 23600 b.AddControl(v0) 23601 return true 23602 } 23603 // match: (LE (CMPconst [0] l:(SUBconst [c] x)) yes no) 23604 // cond: l.Uses==1 23605 // result: (LE (CMPconst [c] x) yes no) 23606 for b.Controls[0].Op == OpARMCMPconst { 23607 v_0 := b.Controls[0] 23608 if v_0.AuxInt != 0 { 23609 break 23610 } 23611 l := v_0.Args[0] 23612 if l.Op != OpARMSUBconst { 23613 break 23614 } 23615 c := l.AuxInt 23616 x := l.Args[0] 23617 if !(l.Uses == 1) { 23618 break 23619 } 23620 b.Reset(BlockARMLE) 23621 v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags) 23622 v0.AuxInt = c 23623 v0.AddArg(x) 23624 b.AddControl(v0) 23625 return true 23626 } 23627 // match: (LE (CMPconst [0] l:(SUBshiftLL x y [c])) yes no) 23628 // cond: l.Uses==1 23629 // result: (LE (CMPshiftLL x y [c]) yes no) 23630 for b.Controls[0].Op == OpARMCMPconst { 23631 v_0 := b.Controls[0] 23632 if v_0.AuxInt != 0 { 23633 break 23634 } 23635 l := v_0.Args[0] 23636 if l.Op != OpARMSUBshiftLL { 23637 break 23638 } 23639 c := l.AuxInt 23640 y := l.Args[1] 23641 x := l.Args[0] 23642 if !(l.Uses == 1) { 23643 break 23644 } 23645 b.Reset(BlockARMLE) 23646 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags) 23647 v0.AuxInt = c 23648 v0.AddArg(x) 23649 v0.AddArg(y) 23650 b.AddControl(v0) 23651 return true 23652 } 23653 // match: (LE (CMPconst [0] l:(SUBshiftRL x y [c])) yes no) 23654 // cond: l.Uses==1 23655 // result: (LE (CMPshiftRL x y [c]) yes no) 23656 for b.Controls[0].Op == OpARMCMPconst { 23657 v_0 := b.Controls[0] 23658 if v_0.AuxInt != 0 { 23659 break 23660 } 23661 l := v_0.Args[0] 23662 if l.Op != OpARMSUBshiftRL { 23663 break 23664 } 23665 c := l.AuxInt 23666 y := l.Args[1] 23667 x := l.Args[0] 23668 if !(l.Uses == 1) { 23669 break 23670 } 23671 b.Reset(BlockARMLE) 23672 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags) 23673 v0.AuxInt = c 23674 v0.AddArg(x) 23675 v0.AddArg(y) 23676 b.AddControl(v0) 23677 return true 23678 } 23679 // match: (LE (CMPconst [0] l:(SUBshiftRA x y [c])) yes no) 23680 // cond: l.Uses==1 23681 // result: (LE (CMPshiftRA x y [c]) yes no) 23682 for b.Controls[0].Op == OpARMCMPconst { 23683 v_0 := b.Controls[0] 23684 if v_0.AuxInt != 0 { 23685 break 23686 } 23687 l := v_0.Args[0] 23688 if l.Op != OpARMSUBshiftRA { 23689 break 23690 } 23691 c := l.AuxInt 23692 y := l.Args[1] 23693 x := l.Args[0] 23694 if !(l.Uses == 1) { 23695 break 23696 } 23697 b.Reset(BlockARMLE) 23698 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags) 23699 v0.AuxInt = c 23700 v0.AddArg(x) 23701 v0.AddArg(y) 23702 b.AddControl(v0) 23703 return true 23704 } 23705 // match: (LE (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no) 23706 // cond: l.Uses==1 23707 // result: (LE (CMPshiftLLreg x y z) yes no) 23708 for b.Controls[0].Op == OpARMCMPconst { 23709 v_0 := b.Controls[0] 23710 if v_0.AuxInt != 0 { 23711 break 23712 } 23713 l := v_0.Args[0] 23714 if l.Op != OpARMSUBshiftLLreg { 23715 break 23716 } 23717 z := l.Args[2] 23718 x := l.Args[0] 23719 y := l.Args[1] 23720 if !(l.Uses == 1) { 23721 break 23722 } 23723 b.Reset(BlockARMLE) 23724 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags) 23725 v0.AddArg(x) 23726 v0.AddArg(y) 23727 v0.AddArg(z) 23728 b.AddControl(v0) 23729 return true 23730 } 23731 // match: (LE (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no) 23732 // cond: l.Uses==1 23733 // result: (LE (CMPshiftRLreg x y z) yes no) 23734 for b.Controls[0].Op == OpARMCMPconst { 23735 v_0 := b.Controls[0] 23736 if v_0.AuxInt != 0 { 23737 break 23738 } 23739 l := v_0.Args[0] 23740 if l.Op != OpARMSUBshiftRLreg { 23741 break 23742 } 23743 z := l.Args[2] 23744 x := l.Args[0] 23745 y := l.Args[1] 23746 if !(l.Uses == 1) { 23747 break 23748 } 23749 b.Reset(BlockARMLE) 23750 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags) 23751 v0.AddArg(x) 23752 v0.AddArg(y) 23753 v0.AddArg(z) 23754 b.AddControl(v0) 23755 return true 23756 } 23757 // match: (LE (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no) 23758 // cond: l.Uses==1 23759 // result: (LE (CMPshiftRAreg x y z) yes no) 23760 for b.Controls[0].Op == OpARMCMPconst { 23761 v_0 := b.Controls[0] 23762 if v_0.AuxInt != 0 { 23763 break 23764 } 23765 l := v_0.Args[0] 23766 if l.Op != OpARMSUBshiftRAreg { 23767 break 23768 } 23769 z := l.Args[2] 23770 x := l.Args[0] 23771 y := l.Args[1] 23772 if !(l.Uses == 1) { 23773 break 23774 } 23775 b.Reset(BlockARMLE) 23776 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags) 23777 v0.AddArg(x) 23778 v0.AddArg(y) 23779 v0.AddArg(z) 23780 b.AddControl(v0) 23781 return true 23782 } 23783 // match: (LE (CMPconst [0] l:(ADD x y)) yes no) 23784 // cond: l.Uses==1 23785 // result: (LE (CMN x y) yes no) 23786 for b.Controls[0].Op == OpARMCMPconst { 23787 v_0 := b.Controls[0] 23788 if v_0.AuxInt != 0 { 23789 break 23790 } 23791 l := v_0.Args[0] 23792 if l.Op != OpARMADD { 23793 break 23794 } 23795 y := l.Args[1] 23796 x := l.Args[0] 23797 if !(l.Uses == 1) { 23798 break 23799 } 23800 b.Reset(BlockARMLE) 23801 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 23802 v0.AddArg(x) 23803 v0.AddArg(y) 23804 b.AddControl(v0) 23805 return true 23806 } 23807 // match: (LE (CMPconst [0] l:(MULA x y a)) yes no) 23808 // cond: l.Uses==1 23809 // result: (LE (CMN a (MUL <x.Type> x y)) yes no) 23810 for b.Controls[0].Op == OpARMCMPconst { 23811 v_0 := b.Controls[0] 23812 if v_0.AuxInt != 0 { 23813 break 23814 } 23815 l := v_0.Args[0] 23816 if l.Op != OpARMMULA { 23817 break 23818 } 23819 a := l.Args[2] 23820 x := l.Args[0] 23821 y := l.Args[1] 23822 if !(l.Uses == 1) { 23823 break 23824 } 23825 b.Reset(BlockARMLE) 23826 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 23827 v0.AddArg(a) 23828 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 23829 v1.AddArg(x) 23830 v1.AddArg(y) 23831 v0.AddArg(v1) 23832 b.AddControl(v0) 23833 return true 23834 } 23835 // match: (LE (CMPconst [0] l:(ADDconst [c] x)) yes no) 23836 // cond: l.Uses==1 23837 // result: (LE (CMNconst [c] x) yes no) 23838 for b.Controls[0].Op == OpARMCMPconst { 23839 v_0 := b.Controls[0] 23840 if v_0.AuxInt != 0 { 23841 break 23842 } 23843 l := v_0.Args[0] 23844 if l.Op != OpARMADDconst { 23845 break 23846 } 23847 c := l.AuxInt 23848 x := l.Args[0] 23849 if !(l.Uses == 1) { 23850 break 23851 } 23852 b.Reset(BlockARMLE) 23853 v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags) 23854 v0.AuxInt = c 23855 v0.AddArg(x) 23856 b.AddControl(v0) 23857 return true 23858 } 23859 // match: (LE (CMPconst [0] l:(ADDshiftLL x y [c])) yes no) 23860 // cond: l.Uses==1 23861 // result: (LE (CMNshiftLL x y [c]) yes no) 23862 for b.Controls[0].Op == OpARMCMPconst { 23863 v_0 := b.Controls[0] 23864 if v_0.AuxInt != 0 { 23865 break 23866 } 23867 l := v_0.Args[0] 23868 if l.Op != OpARMADDshiftLL { 23869 break 23870 } 23871 c := l.AuxInt 23872 y := l.Args[1] 23873 x := l.Args[0] 23874 if !(l.Uses == 1) { 23875 break 23876 } 23877 b.Reset(BlockARMLE) 23878 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags) 23879 v0.AuxInt = c 23880 v0.AddArg(x) 23881 v0.AddArg(y) 23882 b.AddControl(v0) 23883 return true 23884 } 23885 // match: (LE (CMPconst [0] l:(ADDshiftRL x y [c])) yes no) 23886 // cond: l.Uses==1 23887 // result: (LE (CMNshiftRL x y [c]) yes no) 23888 for b.Controls[0].Op == OpARMCMPconst { 23889 v_0 := b.Controls[0] 23890 if v_0.AuxInt != 0 { 23891 break 23892 } 23893 l := v_0.Args[0] 23894 if l.Op != OpARMADDshiftRL { 23895 break 23896 } 23897 c := l.AuxInt 23898 y := l.Args[1] 23899 x := l.Args[0] 23900 if !(l.Uses == 1) { 23901 break 23902 } 23903 b.Reset(BlockARMLE) 23904 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags) 23905 v0.AuxInt = c 23906 v0.AddArg(x) 23907 v0.AddArg(y) 23908 b.AddControl(v0) 23909 return true 23910 } 23911 // match: (LE (CMPconst [0] l:(ADDshiftRA x y [c])) yes no) 23912 // cond: l.Uses==1 23913 // result: (LE (CMNshiftRA x y [c]) yes no) 23914 for b.Controls[0].Op == OpARMCMPconst { 23915 v_0 := b.Controls[0] 23916 if v_0.AuxInt != 0 { 23917 break 23918 } 23919 l := v_0.Args[0] 23920 if l.Op != OpARMADDshiftRA { 23921 break 23922 } 23923 c := l.AuxInt 23924 y := l.Args[1] 23925 x := l.Args[0] 23926 if !(l.Uses == 1) { 23927 break 23928 } 23929 b.Reset(BlockARMLE) 23930 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags) 23931 v0.AuxInt = c 23932 v0.AddArg(x) 23933 v0.AddArg(y) 23934 b.AddControl(v0) 23935 return true 23936 } 23937 // match: (LE (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no) 23938 // cond: l.Uses==1 23939 // result: (LE (CMNshiftLLreg x y z) yes no) 23940 for b.Controls[0].Op == OpARMCMPconst { 23941 v_0 := b.Controls[0] 23942 if v_0.AuxInt != 0 { 23943 break 23944 } 23945 l := v_0.Args[0] 23946 if l.Op != OpARMADDshiftLLreg { 23947 break 23948 } 23949 z := l.Args[2] 23950 x := l.Args[0] 23951 y := l.Args[1] 23952 if !(l.Uses == 1) { 23953 break 23954 } 23955 b.Reset(BlockARMLE) 23956 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags) 23957 v0.AddArg(x) 23958 v0.AddArg(y) 23959 v0.AddArg(z) 23960 b.AddControl(v0) 23961 return true 23962 } 23963 // match: (LE (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no) 23964 // cond: l.Uses==1 23965 // result: (LE (CMNshiftRLreg x y z) yes no) 23966 for b.Controls[0].Op == OpARMCMPconst { 23967 v_0 := b.Controls[0] 23968 if v_0.AuxInt != 0 { 23969 break 23970 } 23971 l := v_0.Args[0] 23972 if l.Op != OpARMADDshiftRLreg { 23973 break 23974 } 23975 z := l.Args[2] 23976 x := l.Args[0] 23977 y := l.Args[1] 23978 if !(l.Uses == 1) { 23979 break 23980 } 23981 b.Reset(BlockARMLE) 23982 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags) 23983 v0.AddArg(x) 23984 v0.AddArg(y) 23985 v0.AddArg(z) 23986 b.AddControl(v0) 23987 return true 23988 } 23989 // match: (LE (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no) 23990 // cond: l.Uses==1 23991 // result: (LE (CMNshiftRAreg x y z) yes no) 23992 for b.Controls[0].Op == OpARMCMPconst { 23993 v_0 := b.Controls[0] 23994 if v_0.AuxInt != 0 { 23995 break 23996 } 23997 l := v_0.Args[0] 23998 if l.Op != OpARMADDshiftRAreg { 23999 break 24000 } 24001 z := l.Args[2] 24002 x := l.Args[0] 24003 y := l.Args[1] 24004 if !(l.Uses == 1) { 24005 break 24006 } 24007 b.Reset(BlockARMLE) 24008 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags) 24009 v0.AddArg(x) 24010 v0.AddArg(y) 24011 v0.AddArg(z) 24012 b.AddControl(v0) 24013 return true 24014 } 24015 // match: (LE (CMPconst [0] l:(AND x y)) yes no) 24016 // cond: l.Uses==1 24017 // result: (LE (TST x y) yes no) 24018 for b.Controls[0].Op == OpARMCMPconst { 24019 v_0 := b.Controls[0] 24020 if v_0.AuxInt != 0 { 24021 break 24022 } 24023 l := v_0.Args[0] 24024 if l.Op != OpARMAND { 24025 break 24026 } 24027 y := l.Args[1] 24028 x := l.Args[0] 24029 if !(l.Uses == 1) { 24030 break 24031 } 24032 b.Reset(BlockARMLE) 24033 v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags) 24034 v0.AddArg(x) 24035 v0.AddArg(y) 24036 b.AddControl(v0) 24037 return true 24038 } 24039 // match: (LE (CMPconst [0] l:(ANDconst [c] x)) yes no) 24040 // cond: l.Uses==1 24041 // result: (LE (TSTconst [c] x) yes no) 24042 for b.Controls[0].Op == OpARMCMPconst { 24043 v_0 := b.Controls[0] 24044 if v_0.AuxInt != 0 { 24045 break 24046 } 24047 l := v_0.Args[0] 24048 if l.Op != OpARMANDconst { 24049 break 24050 } 24051 c := l.AuxInt 24052 x := l.Args[0] 24053 if !(l.Uses == 1) { 24054 break 24055 } 24056 b.Reset(BlockARMLE) 24057 v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags) 24058 v0.AuxInt = c 24059 v0.AddArg(x) 24060 b.AddControl(v0) 24061 return true 24062 } 24063 // match: (LE (CMPconst [0] l:(ANDshiftLL x y [c])) yes no) 24064 // cond: l.Uses==1 24065 // result: (LE (TSTshiftLL x y [c]) yes no) 24066 for b.Controls[0].Op == OpARMCMPconst { 24067 v_0 := b.Controls[0] 24068 if v_0.AuxInt != 0 { 24069 break 24070 } 24071 l := v_0.Args[0] 24072 if l.Op != OpARMANDshiftLL { 24073 break 24074 } 24075 c := l.AuxInt 24076 y := l.Args[1] 24077 x := l.Args[0] 24078 if !(l.Uses == 1) { 24079 break 24080 } 24081 b.Reset(BlockARMLE) 24082 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags) 24083 v0.AuxInt = c 24084 v0.AddArg(x) 24085 v0.AddArg(y) 24086 b.AddControl(v0) 24087 return true 24088 } 24089 // match: (LE (CMPconst [0] l:(ANDshiftRL x y [c])) yes no) 24090 // cond: l.Uses==1 24091 // result: (LE (TSTshiftRL x y [c]) yes no) 24092 for b.Controls[0].Op == OpARMCMPconst { 24093 v_0 := b.Controls[0] 24094 if v_0.AuxInt != 0 { 24095 break 24096 } 24097 l := v_0.Args[0] 24098 if l.Op != OpARMANDshiftRL { 24099 break 24100 } 24101 c := l.AuxInt 24102 y := l.Args[1] 24103 x := l.Args[0] 24104 if !(l.Uses == 1) { 24105 break 24106 } 24107 b.Reset(BlockARMLE) 24108 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags) 24109 v0.AuxInt = c 24110 v0.AddArg(x) 24111 v0.AddArg(y) 24112 b.AddControl(v0) 24113 return true 24114 } 24115 // match: (LE (CMPconst [0] l:(ANDshiftRA x y [c])) yes no) 24116 // cond: l.Uses==1 24117 // result: (LE (TSTshiftRA x y [c]) yes no) 24118 for b.Controls[0].Op == OpARMCMPconst { 24119 v_0 := b.Controls[0] 24120 if v_0.AuxInt != 0 { 24121 break 24122 } 24123 l := v_0.Args[0] 24124 if l.Op != OpARMANDshiftRA { 24125 break 24126 } 24127 c := l.AuxInt 24128 y := l.Args[1] 24129 x := l.Args[0] 24130 if !(l.Uses == 1) { 24131 break 24132 } 24133 b.Reset(BlockARMLE) 24134 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags) 24135 v0.AuxInt = c 24136 v0.AddArg(x) 24137 v0.AddArg(y) 24138 b.AddControl(v0) 24139 return true 24140 } 24141 // match: (LE (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no) 24142 // cond: l.Uses==1 24143 // result: (LE (TSTshiftLLreg x y z) yes no) 24144 for b.Controls[0].Op == OpARMCMPconst { 24145 v_0 := b.Controls[0] 24146 if v_0.AuxInt != 0 { 24147 break 24148 } 24149 l := v_0.Args[0] 24150 if l.Op != OpARMANDshiftLLreg { 24151 break 24152 } 24153 z := l.Args[2] 24154 x := l.Args[0] 24155 y := l.Args[1] 24156 if !(l.Uses == 1) { 24157 break 24158 } 24159 b.Reset(BlockARMLE) 24160 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags) 24161 v0.AddArg(x) 24162 v0.AddArg(y) 24163 v0.AddArg(z) 24164 b.AddControl(v0) 24165 return true 24166 } 24167 // match: (LE (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no) 24168 // cond: l.Uses==1 24169 // result: (LE (TSTshiftRLreg x y z) yes no) 24170 for b.Controls[0].Op == OpARMCMPconst { 24171 v_0 := b.Controls[0] 24172 if v_0.AuxInt != 0 { 24173 break 24174 } 24175 l := v_0.Args[0] 24176 if l.Op != OpARMANDshiftRLreg { 24177 break 24178 } 24179 z := l.Args[2] 24180 x := l.Args[0] 24181 y := l.Args[1] 24182 if !(l.Uses == 1) { 24183 break 24184 } 24185 b.Reset(BlockARMLE) 24186 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags) 24187 v0.AddArg(x) 24188 v0.AddArg(y) 24189 v0.AddArg(z) 24190 b.AddControl(v0) 24191 return true 24192 } 24193 // match: (LE (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no) 24194 // cond: l.Uses==1 24195 // result: (LE (TSTshiftRAreg x y z) yes no) 24196 for b.Controls[0].Op == OpARMCMPconst { 24197 v_0 := b.Controls[0] 24198 if v_0.AuxInt != 0 { 24199 break 24200 } 24201 l := v_0.Args[0] 24202 if l.Op != OpARMANDshiftRAreg { 24203 break 24204 } 24205 z := l.Args[2] 24206 x := l.Args[0] 24207 y := l.Args[1] 24208 if !(l.Uses == 1) { 24209 break 24210 } 24211 b.Reset(BlockARMLE) 24212 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags) 24213 v0.AddArg(x) 24214 v0.AddArg(y) 24215 v0.AddArg(z) 24216 b.AddControl(v0) 24217 return true 24218 } 24219 // match: (LE (CMPconst [0] l:(XOR x y)) yes no) 24220 // cond: l.Uses==1 24221 // result: (LE (TEQ x y) yes no) 24222 for b.Controls[0].Op == OpARMCMPconst { 24223 v_0 := b.Controls[0] 24224 if v_0.AuxInt != 0 { 24225 break 24226 } 24227 l := v_0.Args[0] 24228 if l.Op != OpARMXOR { 24229 break 24230 } 24231 y := l.Args[1] 24232 x := l.Args[0] 24233 if !(l.Uses == 1) { 24234 break 24235 } 24236 b.Reset(BlockARMLE) 24237 v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags) 24238 v0.AddArg(x) 24239 v0.AddArg(y) 24240 b.AddControl(v0) 24241 return true 24242 } 24243 // match: (LE (CMPconst [0] l:(XORconst [c] x)) yes no) 24244 // cond: l.Uses==1 24245 // result: (LE (TEQconst [c] x) yes no) 24246 for b.Controls[0].Op == OpARMCMPconst { 24247 v_0 := b.Controls[0] 24248 if v_0.AuxInt != 0 { 24249 break 24250 } 24251 l := v_0.Args[0] 24252 if l.Op != OpARMXORconst { 24253 break 24254 } 24255 c := l.AuxInt 24256 x := l.Args[0] 24257 if !(l.Uses == 1) { 24258 break 24259 } 24260 b.Reset(BlockARMLE) 24261 v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags) 24262 v0.AuxInt = c 24263 v0.AddArg(x) 24264 b.AddControl(v0) 24265 return true 24266 } 24267 // match: (LE (CMPconst [0] l:(XORshiftLL x y [c])) yes no) 24268 // cond: l.Uses==1 24269 // result: (LE (TEQshiftLL x y [c]) yes no) 24270 for b.Controls[0].Op == OpARMCMPconst { 24271 v_0 := b.Controls[0] 24272 if v_0.AuxInt != 0 { 24273 break 24274 } 24275 l := v_0.Args[0] 24276 if l.Op != OpARMXORshiftLL { 24277 break 24278 } 24279 c := l.AuxInt 24280 y := l.Args[1] 24281 x := l.Args[0] 24282 if !(l.Uses == 1) { 24283 break 24284 } 24285 b.Reset(BlockARMLE) 24286 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags) 24287 v0.AuxInt = c 24288 v0.AddArg(x) 24289 v0.AddArg(y) 24290 b.AddControl(v0) 24291 return true 24292 } 24293 // match: (LE (CMPconst [0] l:(XORshiftRL x y [c])) yes no) 24294 // cond: l.Uses==1 24295 // result: (LE (TEQshiftRL x y [c]) yes no) 24296 for b.Controls[0].Op == OpARMCMPconst { 24297 v_0 := b.Controls[0] 24298 if v_0.AuxInt != 0 { 24299 break 24300 } 24301 l := v_0.Args[0] 24302 if l.Op != OpARMXORshiftRL { 24303 break 24304 } 24305 c := l.AuxInt 24306 y := l.Args[1] 24307 x := l.Args[0] 24308 if !(l.Uses == 1) { 24309 break 24310 } 24311 b.Reset(BlockARMLE) 24312 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags) 24313 v0.AuxInt = c 24314 v0.AddArg(x) 24315 v0.AddArg(y) 24316 b.AddControl(v0) 24317 return true 24318 } 24319 // match: (LE (CMPconst [0] l:(XORshiftRA x y [c])) yes no) 24320 // cond: l.Uses==1 24321 // result: (LE (TEQshiftRA x y [c]) yes no) 24322 for b.Controls[0].Op == OpARMCMPconst { 24323 v_0 := b.Controls[0] 24324 if v_0.AuxInt != 0 { 24325 break 24326 } 24327 l := v_0.Args[0] 24328 if l.Op != OpARMXORshiftRA { 24329 break 24330 } 24331 c := l.AuxInt 24332 y := l.Args[1] 24333 x := l.Args[0] 24334 if !(l.Uses == 1) { 24335 break 24336 } 24337 b.Reset(BlockARMLE) 24338 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags) 24339 v0.AuxInt = c 24340 v0.AddArg(x) 24341 v0.AddArg(y) 24342 b.AddControl(v0) 24343 return true 24344 } 24345 // match: (LE (CMPconst [0] l:(XORshiftLLreg x y z)) yes no) 24346 // cond: l.Uses==1 24347 // result: (LE (TEQshiftLLreg x y z) yes no) 24348 for b.Controls[0].Op == OpARMCMPconst { 24349 v_0 := b.Controls[0] 24350 if v_0.AuxInt != 0 { 24351 break 24352 } 24353 l := v_0.Args[0] 24354 if l.Op != OpARMXORshiftLLreg { 24355 break 24356 } 24357 z := l.Args[2] 24358 x := l.Args[0] 24359 y := l.Args[1] 24360 if !(l.Uses == 1) { 24361 break 24362 } 24363 b.Reset(BlockARMLE) 24364 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags) 24365 v0.AddArg(x) 24366 v0.AddArg(y) 24367 v0.AddArg(z) 24368 b.AddControl(v0) 24369 return true 24370 } 24371 // match: (LE (CMPconst [0] l:(XORshiftRLreg x y z)) yes no) 24372 // cond: l.Uses==1 24373 // result: (LE (TEQshiftRLreg x y z) yes no) 24374 for b.Controls[0].Op == OpARMCMPconst { 24375 v_0 := b.Controls[0] 24376 if v_0.AuxInt != 0 { 24377 break 24378 } 24379 l := v_0.Args[0] 24380 if l.Op != OpARMXORshiftRLreg { 24381 break 24382 } 24383 z := l.Args[2] 24384 x := l.Args[0] 24385 y := l.Args[1] 24386 if !(l.Uses == 1) { 24387 break 24388 } 24389 b.Reset(BlockARMLE) 24390 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags) 24391 v0.AddArg(x) 24392 v0.AddArg(y) 24393 v0.AddArg(z) 24394 b.AddControl(v0) 24395 return true 24396 } 24397 // match: (LE (CMPconst [0] l:(XORshiftRAreg x y z)) yes no) 24398 // cond: l.Uses==1 24399 // result: (LE (TEQshiftRAreg x y z) yes no) 24400 for b.Controls[0].Op == OpARMCMPconst { 24401 v_0 := b.Controls[0] 24402 if v_0.AuxInt != 0 { 24403 break 24404 } 24405 l := v_0.Args[0] 24406 if l.Op != OpARMXORshiftRAreg { 24407 break 24408 } 24409 z := l.Args[2] 24410 x := l.Args[0] 24411 y := l.Args[1] 24412 if !(l.Uses == 1) { 24413 break 24414 } 24415 b.Reset(BlockARMLE) 24416 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags) 24417 v0.AddArg(x) 24418 v0.AddArg(y) 24419 v0.AddArg(z) 24420 b.AddControl(v0) 24421 return true 24422 } 24423 case BlockARMLT: 24424 // match: (LT (FlagEQ) yes no) 24425 // result: (First no yes) 24426 for b.Controls[0].Op == OpARMFlagEQ { 24427 b.Reset(BlockFirst) 24428 b.swapSuccessors() 24429 return true 24430 } 24431 // match: (LT (FlagLT_ULT) yes no) 24432 // result: (First yes no) 24433 for b.Controls[0].Op == OpARMFlagLT_ULT { 24434 b.Reset(BlockFirst) 24435 return true 24436 } 24437 // match: (LT (FlagLT_UGT) yes no) 24438 // result: (First yes no) 24439 for b.Controls[0].Op == OpARMFlagLT_UGT { 24440 b.Reset(BlockFirst) 24441 return true 24442 } 24443 // match: (LT (FlagGT_ULT) yes no) 24444 // result: (First no yes) 24445 for b.Controls[0].Op == OpARMFlagGT_ULT { 24446 b.Reset(BlockFirst) 24447 b.swapSuccessors() 24448 return true 24449 } 24450 // match: (LT (FlagGT_UGT) yes no) 24451 // result: (First no yes) 24452 for b.Controls[0].Op == OpARMFlagGT_UGT { 24453 b.Reset(BlockFirst) 24454 b.swapSuccessors() 24455 return true 24456 } 24457 // match: (LT (InvertFlags cmp) yes no) 24458 // result: (GT cmp yes no) 24459 for b.Controls[0].Op == OpARMInvertFlags { 24460 v_0 := b.Controls[0] 24461 cmp := v_0.Args[0] 24462 b.Reset(BlockARMGT) 24463 b.AddControl(cmp) 24464 return true 24465 } 24466 // match: (LT (CMPconst [0] l:(SUB x y)) yes no) 24467 // cond: l.Uses==1 24468 // result: (LT (CMP x y) yes no) 24469 for b.Controls[0].Op == OpARMCMPconst { 24470 v_0 := b.Controls[0] 24471 if v_0.AuxInt != 0 { 24472 break 24473 } 24474 l := v_0.Args[0] 24475 if l.Op != OpARMSUB { 24476 break 24477 } 24478 y := l.Args[1] 24479 x := l.Args[0] 24480 if !(l.Uses == 1) { 24481 break 24482 } 24483 b.Reset(BlockARMLT) 24484 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 24485 v0.AddArg(x) 24486 v0.AddArg(y) 24487 b.AddControl(v0) 24488 return true 24489 } 24490 // match: (LT (CMPconst [0] l:(MULS x y a)) yes no) 24491 // cond: l.Uses==1 24492 // result: (LT (CMP a (MUL <x.Type> x y)) yes no) 24493 for b.Controls[0].Op == OpARMCMPconst { 24494 v_0 := b.Controls[0] 24495 if v_0.AuxInt != 0 { 24496 break 24497 } 24498 l := v_0.Args[0] 24499 if l.Op != OpARMMULS { 24500 break 24501 } 24502 a := l.Args[2] 24503 x := l.Args[0] 24504 y := l.Args[1] 24505 if !(l.Uses == 1) { 24506 break 24507 } 24508 b.Reset(BlockARMLT) 24509 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 24510 v0.AddArg(a) 24511 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 24512 v1.AddArg(x) 24513 v1.AddArg(y) 24514 v0.AddArg(v1) 24515 b.AddControl(v0) 24516 return true 24517 } 24518 // match: (LT (CMPconst [0] l:(SUBconst [c] x)) yes no) 24519 // cond: l.Uses==1 24520 // result: (LT (CMPconst [c] x) yes no) 24521 for b.Controls[0].Op == OpARMCMPconst { 24522 v_0 := b.Controls[0] 24523 if v_0.AuxInt != 0 { 24524 break 24525 } 24526 l := v_0.Args[0] 24527 if l.Op != OpARMSUBconst { 24528 break 24529 } 24530 c := l.AuxInt 24531 x := l.Args[0] 24532 if !(l.Uses == 1) { 24533 break 24534 } 24535 b.Reset(BlockARMLT) 24536 v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags) 24537 v0.AuxInt = c 24538 v0.AddArg(x) 24539 b.AddControl(v0) 24540 return true 24541 } 24542 // match: (LT (CMPconst [0] l:(SUBshiftLL x y [c])) yes no) 24543 // cond: l.Uses==1 24544 // result: (LT (CMPshiftLL x y [c]) yes no) 24545 for b.Controls[0].Op == OpARMCMPconst { 24546 v_0 := b.Controls[0] 24547 if v_0.AuxInt != 0 { 24548 break 24549 } 24550 l := v_0.Args[0] 24551 if l.Op != OpARMSUBshiftLL { 24552 break 24553 } 24554 c := l.AuxInt 24555 y := l.Args[1] 24556 x := l.Args[0] 24557 if !(l.Uses == 1) { 24558 break 24559 } 24560 b.Reset(BlockARMLT) 24561 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags) 24562 v0.AuxInt = c 24563 v0.AddArg(x) 24564 v0.AddArg(y) 24565 b.AddControl(v0) 24566 return true 24567 } 24568 // match: (LT (CMPconst [0] l:(SUBshiftRL x y [c])) yes no) 24569 // cond: l.Uses==1 24570 // result: (LT (CMPshiftRL x y [c]) yes no) 24571 for b.Controls[0].Op == OpARMCMPconst { 24572 v_0 := b.Controls[0] 24573 if v_0.AuxInt != 0 { 24574 break 24575 } 24576 l := v_0.Args[0] 24577 if l.Op != OpARMSUBshiftRL { 24578 break 24579 } 24580 c := l.AuxInt 24581 y := l.Args[1] 24582 x := l.Args[0] 24583 if !(l.Uses == 1) { 24584 break 24585 } 24586 b.Reset(BlockARMLT) 24587 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags) 24588 v0.AuxInt = c 24589 v0.AddArg(x) 24590 v0.AddArg(y) 24591 b.AddControl(v0) 24592 return true 24593 } 24594 // match: (LT (CMPconst [0] l:(SUBshiftRA x y [c])) yes no) 24595 // cond: l.Uses==1 24596 // result: (LT (CMPshiftRA x y [c]) yes no) 24597 for b.Controls[0].Op == OpARMCMPconst { 24598 v_0 := b.Controls[0] 24599 if v_0.AuxInt != 0 { 24600 break 24601 } 24602 l := v_0.Args[0] 24603 if l.Op != OpARMSUBshiftRA { 24604 break 24605 } 24606 c := l.AuxInt 24607 y := l.Args[1] 24608 x := l.Args[0] 24609 if !(l.Uses == 1) { 24610 break 24611 } 24612 b.Reset(BlockARMLT) 24613 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags) 24614 v0.AuxInt = c 24615 v0.AddArg(x) 24616 v0.AddArg(y) 24617 b.AddControl(v0) 24618 return true 24619 } 24620 // match: (LT (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no) 24621 // cond: l.Uses==1 24622 // result: (LT (CMPshiftLLreg x y z) yes no) 24623 for b.Controls[0].Op == OpARMCMPconst { 24624 v_0 := b.Controls[0] 24625 if v_0.AuxInt != 0 { 24626 break 24627 } 24628 l := v_0.Args[0] 24629 if l.Op != OpARMSUBshiftLLreg { 24630 break 24631 } 24632 z := l.Args[2] 24633 x := l.Args[0] 24634 y := l.Args[1] 24635 if !(l.Uses == 1) { 24636 break 24637 } 24638 b.Reset(BlockARMLT) 24639 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags) 24640 v0.AddArg(x) 24641 v0.AddArg(y) 24642 v0.AddArg(z) 24643 b.AddControl(v0) 24644 return true 24645 } 24646 // match: (LT (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no) 24647 // cond: l.Uses==1 24648 // result: (LT (CMPshiftRLreg x y z) yes no) 24649 for b.Controls[0].Op == OpARMCMPconst { 24650 v_0 := b.Controls[0] 24651 if v_0.AuxInt != 0 { 24652 break 24653 } 24654 l := v_0.Args[0] 24655 if l.Op != OpARMSUBshiftRLreg { 24656 break 24657 } 24658 z := l.Args[2] 24659 x := l.Args[0] 24660 y := l.Args[1] 24661 if !(l.Uses == 1) { 24662 break 24663 } 24664 b.Reset(BlockARMLT) 24665 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags) 24666 v0.AddArg(x) 24667 v0.AddArg(y) 24668 v0.AddArg(z) 24669 b.AddControl(v0) 24670 return true 24671 } 24672 // match: (LT (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no) 24673 // cond: l.Uses==1 24674 // result: (LT (CMPshiftRAreg x y z) yes no) 24675 for b.Controls[0].Op == OpARMCMPconst { 24676 v_0 := b.Controls[0] 24677 if v_0.AuxInt != 0 { 24678 break 24679 } 24680 l := v_0.Args[0] 24681 if l.Op != OpARMSUBshiftRAreg { 24682 break 24683 } 24684 z := l.Args[2] 24685 x := l.Args[0] 24686 y := l.Args[1] 24687 if !(l.Uses == 1) { 24688 break 24689 } 24690 b.Reset(BlockARMLT) 24691 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags) 24692 v0.AddArg(x) 24693 v0.AddArg(y) 24694 v0.AddArg(z) 24695 b.AddControl(v0) 24696 return true 24697 } 24698 // match: (LT (CMPconst [0] l:(ADD x y)) yes no) 24699 // cond: l.Uses==1 24700 // result: (LT (CMN x y) yes no) 24701 for b.Controls[0].Op == OpARMCMPconst { 24702 v_0 := b.Controls[0] 24703 if v_0.AuxInt != 0 { 24704 break 24705 } 24706 l := v_0.Args[0] 24707 if l.Op != OpARMADD { 24708 break 24709 } 24710 y := l.Args[1] 24711 x := l.Args[0] 24712 if !(l.Uses == 1) { 24713 break 24714 } 24715 b.Reset(BlockARMLT) 24716 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 24717 v0.AddArg(x) 24718 v0.AddArg(y) 24719 b.AddControl(v0) 24720 return true 24721 } 24722 // match: (LT (CMPconst [0] l:(MULA x y a)) yes no) 24723 // cond: l.Uses==1 24724 // result: (LT (CMN a (MUL <x.Type> x y)) yes no) 24725 for b.Controls[0].Op == OpARMCMPconst { 24726 v_0 := b.Controls[0] 24727 if v_0.AuxInt != 0 { 24728 break 24729 } 24730 l := v_0.Args[0] 24731 if l.Op != OpARMMULA { 24732 break 24733 } 24734 a := l.Args[2] 24735 x := l.Args[0] 24736 y := l.Args[1] 24737 if !(l.Uses == 1) { 24738 break 24739 } 24740 b.Reset(BlockARMLT) 24741 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 24742 v0.AddArg(a) 24743 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 24744 v1.AddArg(x) 24745 v1.AddArg(y) 24746 v0.AddArg(v1) 24747 b.AddControl(v0) 24748 return true 24749 } 24750 // match: (LT (CMPconst [0] l:(ADDconst [c] x)) yes no) 24751 // cond: l.Uses==1 24752 // result: (LT (CMNconst [c] x) yes no) 24753 for b.Controls[0].Op == OpARMCMPconst { 24754 v_0 := b.Controls[0] 24755 if v_0.AuxInt != 0 { 24756 break 24757 } 24758 l := v_0.Args[0] 24759 if l.Op != OpARMADDconst { 24760 break 24761 } 24762 c := l.AuxInt 24763 x := l.Args[0] 24764 if !(l.Uses == 1) { 24765 break 24766 } 24767 b.Reset(BlockARMLT) 24768 v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags) 24769 v0.AuxInt = c 24770 v0.AddArg(x) 24771 b.AddControl(v0) 24772 return true 24773 } 24774 // match: (LT (CMPconst [0] l:(ADDshiftLL x y [c])) yes no) 24775 // cond: l.Uses==1 24776 // result: (LT (CMNshiftLL x y [c]) yes no) 24777 for b.Controls[0].Op == OpARMCMPconst { 24778 v_0 := b.Controls[0] 24779 if v_0.AuxInt != 0 { 24780 break 24781 } 24782 l := v_0.Args[0] 24783 if l.Op != OpARMADDshiftLL { 24784 break 24785 } 24786 c := l.AuxInt 24787 y := l.Args[1] 24788 x := l.Args[0] 24789 if !(l.Uses == 1) { 24790 break 24791 } 24792 b.Reset(BlockARMLT) 24793 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags) 24794 v0.AuxInt = c 24795 v0.AddArg(x) 24796 v0.AddArg(y) 24797 b.AddControl(v0) 24798 return true 24799 } 24800 // match: (LT (CMPconst [0] l:(ADDshiftRL x y [c])) yes no) 24801 // cond: l.Uses==1 24802 // result: (LT (CMNshiftRL x y [c]) yes no) 24803 for b.Controls[0].Op == OpARMCMPconst { 24804 v_0 := b.Controls[0] 24805 if v_0.AuxInt != 0 { 24806 break 24807 } 24808 l := v_0.Args[0] 24809 if l.Op != OpARMADDshiftRL { 24810 break 24811 } 24812 c := l.AuxInt 24813 y := l.Args[1] 24814 x := l.Args[0] 24815 if !(l.Uses == 1) { 24816 break 24817 } 24818 b.Reset(BlockARMLT) 24819 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags) 24820 v0.AuxInt = c 24821 v0.AddArg(x) 24822 v0.AddArg(y) 24823 b.AddControl(v0) 24824 return true 24825 } 24826 // match: (LT (CMPconst [0] l:(ADDshiftRA x y [c])) yes no) 24827 // cond: l.Uses==1 24828 // result: (LT (CMNshiftRA x y [c]) yes no) 24829 for b.Controls[0].Op == OpARMCMPconst { 24830 v_0 := b.Controls[0] 24831 if v_0.AuxInt != 0 { 24832 break 24833 } 24834 l := v_0.Args[0] 24835 if l.Op != OpARMADDshiftRA { 24836 break 24837 } 24838 c := l.AuxInt 24839 y := l.Args[1] 24840 x := l.Args[0] 24841 if !(l.Uses == 1) { 24842 break 24843 } 24844 b.Reset(BlockARMLT) 24845 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags) 24846 v0.AuxInt = c 24847 v0.AddArg(x) 24848 v0.AddArg(y) 24849 b.AddControl(v0) 24850 return true 24851 } 24852 // match: (LT (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no) 24853 // cond: l.Uses==1 24854 // result: (LT (CMNshiftLLreg x y z) yes no) 24855 for b.Controls[0].Op == OpARMCMPconst { 24856 v_0 := b.Controls[0] 24857 if v_0.AuxInt != 0 { 24858 break 24859 } 24860 l := v_0.Args[0] 24861 if l.Op != OpARMADDshiftLLreg { 24862 break 24863 } 24864 z := l.Args[2] 24865 x := l.Args[0] 24866 y := l.Args[1] 24867 if !(l.Uses == 1) { 24868 break 24869 } 24870 b.Reset(BlockARMLT) 24871 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags) 24872 v0.AddArg(x) 24873 v0.AddArg(y) 24874 v0.AddArg(z) 24875 b.AddControl(v0) 24876 return true 24877 } 24878 // match: (LT (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no) 24879 // cond: l.Uses==1 24880 // result: (LT (CMNshiftRLreg x y z) yes no) 24881 for b.Controls[0].Op == OpARMCMPconst { 24882 v_0 := b.Controls[0] 24883 if v_0.AuxInt != 0 { 24884 break 24885 } 24886 l := v_0.Args[0] 24887 if l.Op != OpARMADDshiftRLreg { 24888 break 24889 } 24890 z := l.Args[2] 24891 x := l.Args[0] 24892 y := l.Args[1] 24893 if !(l.Uses == 1) { 24894 break 24895 } 24896 b.Reset(BlockARMLT) 24897 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags) 24898 v0.AddArg(x) 24899 v0.AddArg(y) 24900 v0.AddArg(z) 24901 b.AddControl(v0) 24902 return true 24903 } 24904 // match: (LT (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no) 24905 // cond: l.Uses==1 24906 // result: (LT (CMNshiftRAreg x y z) yes no) 24907 for b.Controls[0].Op == OpARMCMPconst { 24908 v_0 := b.Controls[0] 24909 if v_0.AuxInt != 0 { 24910 break 24911 } 24912 l := v_0.Args[0] 24913 if l.Op != OpARMADDshiftRAreg { 24914 break 24915 } 24916 z := l.Args[2] 24917 x := l.Args[0] 24918 y := l.Args[1] 24919 if !(l.Uses == 1) { 24920 break 24921 } 24922 b.Reset(BlockARMLT) 24923 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags) 24924 v0.AddArg(x) 24925 v0.AddArg(y) 24926 v0.AddArg(z) 24927 b.AddControl(v0) 24928 return true 24929 } 24930 // match: (LT (CMPconst [0] l:(AND x y)) yes no) 24931 // cond: l.Uses==1 24932 // result: (LT (TST x y) yes no) 24933 for b.Controls[0].Op == OpARMCMPconst { 24934 v_0 := b.Controls[0] 24935 if v_0.AuxInt != 0 { 24936 break 24937 } 24938 l := v_0.Args[0] 24939 if l.Op != OpARMAND { 24940 break 24941 } 24942 y := l.Args[1] 24943 x := l.Args[0] 24944 if !(l.Uses == 1) { 24945 break 24946 } 24947 b.Reset(BlockARMLT) 24948 v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags) 24949 v0.AddArg(x) 24950 v0.AddArg(y) 24951 b.AddControl(v0) 24952 return true 24953 } 24954 // match: (LT (CMPconst [0] l:(ANDconst [c] x)) yes no) 24955 // cond: l.Uses==1 24956 // result: (LT (TSTconst [c] x) yes no) 24957 for b.Controls[0].Op == OpARMCMPconst { 24958 v_0 := b.Controls[0] 24959 if v_0.AuxInt != 0 { 24960 break 24961 } 24962 l := v_0.Args[0] 24963 if l.Op != OpARMANDconst { 24964 break 24965 } 24966 c := l.AuxInt 24967 x := l.Args[0] 24968 if !(l.Uses == 1) { 24969 break 24970 } 24971 b.Reset(BlockARMLT) 24972 v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags) 24973 v0.AuxInt = c 24974 v0.AddArg(x) 24975 b.AddControl(v0) 24976 return true 24977 } 24978 // match: (LT (CMPconst [0] l:(ANDshiftLL x y [c])) yes no) 24979 // cond: l.Uses==1 24980 // result: (LT (TSTshiftLL x y [c]) yes no) 24981 for b.Controls[0].Op == OpARMCMPconst { 24982 v_0 := b.Controls[0] 24983 if v_0.AuxInt != 0 { 24984 break 24985 } 24986 l := v_0.Args[0] 24987 if l.Op != OpARMANDshiftLL { 24988 break 24989 } 24990 c := l.AuxInt 24991 y := l.Args[1] 24992 x := l.Args[0] 24993 if !(l.Uses == 1) { 24994 break 24995 } 24996 b.Reset(BlockARMLT) 24997 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags) 24998 v0.AuxInt = c 24999 v0.AddArg(x) 25000 v0.AddArg(y) 25001 b.AddControl(v0) 25002 return true 25003 } 25004 // match: (LT (CMPconst [0] l:(ANDshiftRL x y [c])) yes no) 25005 // cond: l.Uses==1 25006 // result: (LT (TSTshiftRL x y [c]) yes no) 25007 for b.Controls[0].Op == OpARMCMPconst { 25008 v_0 := b.Controls[0] 25009 if v_0.AuxInt != 0 { 25010 break 25011 } 25012 l := v_0.Args[0] 25013 if l.Op != OpARMANDshiftRL { 25014 break 25015 } 25016 c := l.AuxInt 25017 y := l.Args[1] 25018 x := l.Args[0] 25019 if !(l.Uses == 1) { 25020 break 25021 } 25022 b.Reset(BlockARMLT) 25023 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags) 25024 v0.AuxInt = c 25025 v0.AddArg(x) 25026 v0.AddArg(y) 25027 b.AddControl(v0) 25028 return true 25029 } 25030 // match: (LT (CMPconst [0] l:(ANDshiftRA x y [c])) yes no) 25031 // cond: l.Uses==1 25032 // result: (LT (TSTshiftRA x y [c]) yes no) 25033 for b.Controls[0].Op == OpARMCMPconst { 25034 v_0 := b.Controls[0] 25035 if v_0.AuxInt != 0 { 25036 break 25037 } 25038 l := v_0.Args[0] 25039 if l.Op != OpARMANDshiftRA { 25040 break 25041 } 25042 c := l.AuxInt 25043 y := l.Args[1] 25044 x := l.Args[0] 25045 if !(l.Uses == 1) { 25046 break 25047 } 25048 b.Reset(BlockARMLT) 25049 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags) 25050 v0.AuxInt = c 25051 v0.AddArg(x) 25052 v0.AddArg(y) 25053 b.AddControl(v0) 25054 return true 25055 } 25056 // match: (LT (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no) 25057 // cond: l.Uses==1 25058 // result: (LT (TSTshiftLLreg x y z) yes no) 25059 for b.Controls[0].Op == OpARMCMPconst { 25060 v_0 := b.Controls[0] 25061 if v_0.AuxInt != 0 { 25062 break 25063 } 25064 l := v_0.Args[0] 25065 if l.Op != OpARMANDshiftLLreg { 25066 break 25067 } 25068 z := l.Args[2] 25069 x := l.Args[0] 25070 y := l.Args[1] 25071 if !(l.Uses == 1) { 25072 break 25073 } 25074 b.Reset(BlockARMLT) 25075 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags) 25076 v0.AddArg(x) 25077 v0.AddArg(y) 25078 v0.AddArg(z) 25079 b.AddControl(v0) 25080 return true 25081 } 25082 // match: (LT (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no) 25083 // cond: l.Uses==1 25084 // result: (LT (TSTshiftRLreg x y z) yes no) 25085 for b.Controls[0].Op == OpARMCMPconst { 25086 v_0 := b.Controls[0] 25087 if v_0.AuxInt != 0 { 25088 break 25089 } 25090 l := v_0.Args[0] 25091 if l.Op != OpARMANDshiftRLreg { 25092 break 25093 } 25094 z := l.Args[2] 25095 x := l.Args[0] 25096 y := l.Args[1] 25097 if !(l.Uses == 1) { 25098 break 25099 } 25100 b.Reset(BlockARMLT) 25101 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags) 25102 v0.AddArg(x) 25103 v0.AddArg(y) 25104 v0.AddArg(z) 25105 b.AddControl(v0) 25106 return true 25107 } 25108 // match: (LT (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no) 25109 // cond: l.Uses==1 25110 // result: (LT (TSTshiftRAreg x y z) yes no) 25111 for b.Controls[0].Op == OpARMCMPconst { 25112 v_0 := b.Controls[0] 25113 if v_0.AuxInt != 0 { 25114 break 25115 } 25116 l := v_0.Args[0] 25117 if l.Op != OpARMANDshiftRAreg { 25118 break 25119 } 25120 z := l.Args[2] 25121 x := l.Args[0] 25122 y := l.Args[1] 25123 if !(l.Uses == 1) { 25124 break 25125 } 25126 b.Reset(BlockARMLT) 25127 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags) 25128 v0.AddArg(x) 25129 v0.AddArg(y) 25130 v0.AddArg(z) 25131 b.AddControl(v0) 25132 return true 25133 } 25134 // match: (LT (CMPconst [0] l:(XOR x y)) yes no) 25135 // cond: l.Uses==1 25136 // result: (LT (TEQ x y) yes no) 25137 for b.Controls[0].Op == OpARMCMPconst { 25138 v_0 := b.Controls[0] 25139 if v_0.AuxInt != 0 { 25140 break 25141 } 25142 l := v_0.Args[0] 25143 if l.Op != OpARMXOR { 25144 break 25145 } 25146 y := l.Args[1] 25147 x := l.Args[0] 25148 if !(l.Uses == 1) { 25149 break 25150 } 25151 b.Reset(BlockARMLT) 25152 v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags) 25153 v0.AddArg(x) 25154 v0.AddArg(y) 25155 b.AddControl(v0) 25156 return true 25157 } 25158 // match: (LT (CMPconst [0] l:(XORconst [c] x)) yes no) 25159 // cond: l.Uses==1 25160 // result: (LT (TEQconst [c] x) yes no) 25161 for b.Controls[0].Op == OpARMCMPconst { 25162 v_0 := b.Controls[0] 25163 if v_0.AuxInt != 0 { 25164 break 25165 } 25166 l := v_0.Args[0] 25167 if l.Op != OpARMXORconst { 25168 break 25169 } 25170 c := l.AuxInt 25171 x := l.Args[0] 25172 if !(l.Uses == 1) { 25173 break 25174 } 25175 b.Reset(BlockARMLT) 25176 v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags) 25177 v0.AuxInt = c 25178 v0.AddArg(x) 25179 b.AddControl(v0) 25180 return true 25181 } 25182 // match: (LT (CMPconst [0] l:(XORshiftLL x y [c])) yes no) 25183 // cond: l.Uses==1 25184 // result: (LT (TEQshiftLL x y [c]) yes no) 25185 for b.Controls[0].Op == OpARMCMPconst { 25186 v_0 := b.Controls[0] 25187 if v_0.AuxInt != 0 { 25188 break 25189 } 25190 l := v_0.Args[0] 25191 if l.Op != OpARMXORshiftLL { 25192 break 25193 } 25194 c := l.AuxInt 25195 y := l.Args[1] 25196 x := l.Args[0] 25197 if !(l.Uses == 1) { 25198 break 25199 } 25200 b.Reset(BlockARMLT) 25201 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags) 25202 v0.AuxInt = c 25203 v0.AddArg(x) 25204 v0.AddArg(y) 25205 b.AddControl(v0) 25206 return true 25207 } 25208 // match: (LT (CMPconst [0] l:(XORshiftRL x y [c])) yes no) 25209 // cond: l.Uses==1 25210 // result: (LT (TEQshiftRL x y [c]) yes no) 25211 for b.Controls[0].Op == OpARMCMPconst { 25212 v_0 := b.Controls[0] 25213 if v_0.AuxInt != 0 { 25214 break 25215 } 25216 l := v_0.Args[0] 25217 if l.Op != OpARMXORshiftRL { 25218 break 25219 } 25220 c := l.AuxInt 25221 y := l.Args[1] 25222 x := l.Args[0] 25223 if !(l.Uses == 1) { 25224 break 25225 } 25226 b.Reset(BlockARMLT) 25227 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags) 25228 v0.AuxInt = c 25229 v0.AddArg(x) 25230 v0.AddArg(y) 25231 b.AddControl(v0) 25232 return true 25233 } 25234 // match: (LT (CMPconst [0] l:(XORshiftRA x y [c])) yes no) 25235 // cond: l.Uses==1 25236 // result: (LT (TEQshiftRA x y [c]) yes no) 25237 for b.Controls[0].Op == OpARMCMPconst { 25238 v_0 := b.Controls[0] 25239 if v_0.AuxInt != 0 { 25240 break 25241 } 25242 l := v_0.Args[0] 25243 if l.Op != OpARMXORshiftRA { 25244 break 25245 } 25246 c := l.AuxInt 25247 y := l.Args[1] 25248 x := l.Args[0] 25249 if !(l.Uses == 1) { 25250 break 25251 } 25252 b.Reset(BlockARMLT) 25253 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags) 25254 v0.AuxInt = c 25255 v0.AddArg(x) 25256 v0.AddArg(y) 25257 b.AddControl(v0) 25258 return true 25259 } 25260 // match: (LT (CMPconst [0] l:(XORshiftLLreg x y z)) yes no) 25261 // cond: l.Uses==1 25262 // result: (LT (TEQshiftLLreg x y z) yes no) 25263 for b.Controls[0].Op == OpARMCMPconst { 25264 v_0 := b.Controls[0] 25265 if v_0.AuxInt != 0 { 25266 break 25267 } 25268 l := v_0.Args[0] 25269 if l.Op != OpARMXORshiftLLreg { 25270 break 25271 } 25272 z := l.Args[2] 25273 x := l.Args[0] 25274 y := l.Args[1] 25275 if !(l.Uses == 1) { 25276 break 25277 } 25278 b.Reset(BlockARMLT) 25279 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags) 25280 v0.AddArg(x) 25281 v0.AddArg(y) 25282 v0.AddArg(z) 25283 b.AddControl(v0) 25284 return true 25285 } 25286 // match: (LT (CMPconst [0] l:(XORshiftRLreg x y z)) yes no) 25287 // cond: l.Uses==1 25288 // result: (LT (TEQshiftRLreg x y z) yes no) 25289 for b.Controls[0].Op == OpARMCMPconst { 25290 v_0 := b.Controls[0] 25291 if v_0.AuxInt != 0 { 25292 break 25293 } 25294 l := v_0.Args[0] 25295 if l.Op != OpARMXORshiftRLreg { 25296 break 25297 } 25298 z := l.Args[2] 25299 x := l.Args[0] 25300 y := l.Args[1] 25301 if !(l.Uses == 1) { 25302 break 25303 } 25304 b.Reset(BlockARMLT) 25305 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags) 25306 v0.AddArg(x) 25307 v0.AddArg(y) 25308 v0.AddArg(z) 25309 b.AddControl(v0) 25310 return true 25311 } 25312 // match: (LT (CMPconst [0] l:(XORshiftRAreg x y z)) yes no) 25313 // cond: l.Uses==1 25314 // result: (LT (TEQshiftRAreg x y z) yes no) 25315 for b.Controls[0].Op == OpARMCMPconst { 25316 v_0 := b.Controls[0] 25317 if v_0.AuxInt != 0 { 25318 break 25319 } 25320 l := v_0.Args[0] 25321 if l.Op != OpARMXORshiftRAreg { 25322 break 25323 } 25324 z := l.Args[2] 25325 x := l.Args[0] 25326 y := l.Args[1] 25327 if !(l.Uses == 1) { 25328 break 25329 } 25330 b.Reset(BlockARMLT) 25331 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags) 25332 v0.AddArg(x) 25333 v0.AddArg(y) 25334 v0.AddArg(z) 25335 b.AddControl(v0) 25336 return true 25337 } 25338 case BlockARMNE: 25339 // match: (NE (CMPconst [0] (Equal cc)) yes no) 25340 // result: (EQ cc yes no) 25341 for b.Controls[0].Op == OpARMCMPconst { 25342 v_0 := b.Controls[0] 25343 if v_0.AuxInt != 0 { 25344 break 25345 } 25346 v_0_0 := v_0.Args[0] 25347 if v_0_0.Op != OpARMEqual { 25348 break 25349 } 25350 cc := v_0_0.Args[0] 25351 b.Reset(BlockARMEQ) 25352 b.AddControl(cc) 25353 return true 25354 } 25355 // match: (NE (CMPconst [0] (NotEqual cc)) yes no) 25356 // result: (NE cc yes no) 25357 for b.Controls[0].Op == OpARMCMPconst { 25358 v_0 := b.Controls[0] 25359 if v_0.AuxInt != 0 { 25360 break 25361 } 25362 v_0_0 := v_0.Args[0] 25363 if v_0_0.Op != OpARMNotEqual { 25364 break 25365 } 25366 cc := v_0_0.Args[0] 25367 b.Reset(BlockARMNE) 25368 b.AddControl(cc) 25369 return true 25370 } 25371 // match: (NE (CMPconst [0] (LessThan cc)) yes no) 25372 // result: (LT cc yes no) 25373 for b.Controls[0].Op == OpARMCMPconst { 25374 v_0 := b.Controls[0] 25375 if v_0.AuxInt != 0 { 25376 break 25377 } 25378 v_0_0 := v_0.Args[0] 25379 if v_0_0.Op != OpARMLessThan { 25380 break 25381 } 25382 cc := v_0_0.Args[0] 25383 b.Reset(BlockARMLT) 25384 b.AddControl(cc) 25385 return true 25386 } 25387 // match: (NE (CMPconst [0] (LessThanU cc)) yes no) 25388 // result: (ULT cc yes no) 25389 for b.Controls[0].Op == OpARMCMPconst { 25390 v_0 := b.Controls[0] 25391 if v_0.AuxInt != 0 { 25392 break 25393 } 25394 v_0_0 := v_0.Args[0] 25395 if v_0_0.Op != OpARMLessThanU { 25396 break 25397 } 25398 cc := v_0_0.Args[0] 25399 b.Reset(BlockARMULT) 25400 b.AddControl(cc) 25401 return true 25402 } 25403 // match: (NE (CMPconst [0] (LessEqual cc)) yes no) 25404 // result: (LE cc yes no) 25405 for b.Controls[0].Op == OpARMCMPconst { 25406 v_0 := b.Controls[0] 25407 if v_0.AuxInt != 0 { 25408 break 25409 } 25410 v_0_0 := v_0.Args[0] 25411 if v_0_0.Op != OpARMLessEqual { 25412 break 25413 } 25414 cc := v_0_0.Args[0] 25415 b.Reset(BlockARMLE) 25416 b.AddControl(cc) 25417 return true 25418 } 25419 // match: (NE (CMPconst [0] (LessEqualU cc)) yes no) 25420 // result: (ULE cc yes no) 25421 for b.Controls[0].Op == OpARMCMPconst { 25422 v_0 := b.Controls[0] 25423 if v_0.AuxInt != 0 { 25424 break 25425 } 25426 v_0_0 := v_0.Args[0] 25427 if v_0_0.Op != OpARMLessEqualU { 25428 break 25429 } 25430 cc := v_0_0.Args[0] 25431 b.Reset(BlockARMULE) 25432 b.AddControl(cc) 25433 return true 25434 } 25435 // match: (NE (CMPconst [0] (GreaterThan cc)) yes no) 25436 // result: (GT cc yes no) 25437 for b.Controls[0].Op == OpARMCMPconst { 25438 v_0 := b.Controls[0] 25439 if v_0.AuxInt != 0 { 25440 break 25441 } 25442 v_0_0 := v_0.Args[0] 25443 if v_0_0.Op != OpARMGreaterThan { 25444 break 25445 } 25446 cc := v_0_0.Args[0] 25447 b.Reset(BlockARMGT) 25448 b.AddControl(cc) 25449 return true 25450 } 25451 // match: (NE (CMPconst [0] (GreaterThanU cc)) yes no) 25452 // result: (UGT cc yes no) 25453 for b.Controls[0].Op == OpARMCMPconst { 25454 v_0 := b.Controls[0] 25455 if v_0.AuxInt != 0 { 25456 break 25457 } 25458 v_0_0 := v_0.Args[0] 25459 if v_0_0.Op != OpARMGreaterThanU { 25460 break 25461 } 25462 cc := v_0_0.Args[0] 25463 b.Reset(BlockARMUGT) 25464 b.AddControl(cc) 25465 return true 25466 } 25467 // match: (NE (CMPconst [0] (GreaterEqual cc)) yes no) 25468 // result: (GE cc yes no) 25469 for b.Controls[0].Op == OpARMCMPconst { 25470 v_0 := b.Controls[0] 25471 if v_0.AuxInt != 0 { 25472 break 25473 } 25474 v_0_0 := v_0.Args[0] 25475 if v_0_0.Op != OpARMGreaterEqual { 25476 break 25477 } 25478 cc := v_0_0.Args[0] 25479 b.Reset(BlockARMGE) 25480 b.AddControl(cc) 25481 return true 25482 } 25483 // match: (NE (CMPconst [0] (GreaterEqualU cc)) yes no) 25484 // result: (UGE cc yes no) 25485 for b.Controls[0].Op == OpARMCMPconst { 25486 v_0 := b.Controls[0] 25487 if v_0.AuxInt != 0 { 25488 break 25489 } 25490 v_0_0 := v_0.Args[0] 25491 if v_0_0.Op != OpARMGreaterEqualU { 25492 break 25493 } 25494 cc := v_0_0.Args[0] 25495 b.Reset(BlockARMUGE) 25496 b.AddControl(cc) 25497 return true 25498 } 25499 // match: (NE (FlagEQ) yes no) 25500 // result: (First no yes) 25501 for b.Controls[0].Op == OpARMFlagEQ { 25502 b.Reset(BlockFirst) 25503 b.swapSuccessors() 25504 return true 25505 } 25506 // match: (NE (FlagLT_ULT) yes no) 25507 // result: (First yes no) 25508 for b.Controls[0].Op == OpARMFlagLT_ULT { 25509 b.Reset(BlockFirst) 25510 return true 25511 } 25512 // match: (NE (FlagLT_UGT) yes no) 25513 // result: (First yes no) 25514 for b.Controls[0].Op == OpARMFlagLT_UGT { 25515 b.Reset(BlockFirst) 25516 return true 25517 } 25518 // match: (NE (FlagGT_ULT) yes no) 25519 // result: (First yes no) 25520 for b.Controls[0].Op == OpARMFlagGT_ULT { 25521 b.Reset(BlockFirst) 25522 return true 25523 } 25524 // match: (NE (FlagGT_UGT) yes no) 25525 // result: (First yes no) 25526 for b.Controls[0].Op == OpARMFlagGT_UGT { 25527 b.Reset(BlockFirst) 25528 return true 25529 } 25530 // match: (NE (InvertFlags cmp) yes no) 25531 // result: (NE cmp yes no) 25532 for b.Controls[0].Op == OpARMInvertFlags { 25533 v_0 := b.Controls[0] 25534 cmp := v_0.Args[0] 25535 b.Reset(BlockARMNE) 25536 b.AddControl(cmp) 25537 return true 25538 } 25539 // match: (NE (CMPconst [0] l:(SUB x y)) yes no) 25540 // cond: l.Uses==1 25541 // result: (NE (CMP x y) yes no) 25542 for b.Controls[0].Op == OpARMCMPconst { 25543 v_0 := b.Controls[0] 25544 if v_0.AuxInt != 0 { 25545 break 25546 } 25547 l := v_0.Args[0] 25548 if l.Op != OpARMSUB { 25549 break 25550 } 25551 y := l.Args[1] 25552 x := l.Args[0] 25553 if !(l.Uses == 1) { 25554 break 25555 } 25556 b.Reset(BlockARMNE) 25557 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 25558 v0.AddArg(x) 25559 v0.AddArg(y) 25560 b.AddControl(v0) 25561 return true 25562 } 25563 // match: (NE (CMPconst [0] l:(MULS x y a)) yes no) 25564 // cond: l.Uses==1 25565 // result: (NE (CMP a (MUL <x.Type> x y)) yes no) 25566 for b.Controls[0].Op == OpARMCMPconst { 25567 v_0 := b.Controls[0] 25568 if v_0.AuxInt != 0 { 25569 break 25570 } 25571 l := v_0.Args[0] 25572 if l.Op != OpARMMULS { 25573 break 25574 } 25575 a := l.Args[2] 25576 x := l.Args[0] 25577 y := l.Args[1] 25578 if !(l.Uses == 1) { 25579 break 25580 } 25581 b.Reset(BlockARMNE) 25582 v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags) 25583 v0.AddArg(a) 25584 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 25585 v1.AddArg(x) 25586 v1.AddArg(y) 25587 v0.AddArg(v1) 25588 b.AddControl(v0) 25589 return true 25590 } 25591 // match: (NE (CMPconst [0] l:(SUBconst [c] x)) yes no) 25592 // cond: l.Uses==1 25593 // result: (NE (CMPconst [c] x) yes no) 25594 for b.Controls[0].Op == OpARMCMPconst { 25595 v_0 := b.Controls[0] 25596 if v_0.AuxInt != 0 { 25597 break 25598 } 25599 l := v_0.Args[0] 25600 if l.Op != OpARMSUBconst { 25601 break 25602 } 25603 c := l.AuxInt 25604 x := l.Args[0] 25605 if !(l.Uses == 1) { 25606 break 25607 } 25608 b.Reset(BlockARMNE) 25609 v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags) 25610 v0.AuxInt = c 25611 v0.AddArg(x) 25612 b.AddControl(v0) 25613 return true 25614 } 25615 // match: (NE (CMPconst [0] l:(SUBshiftLL x y [c])) yes no) 25616 // cond: l.Uses==1 25617 // result: (NE (CMPshiftLL x y [c]) yes no) 25618 for b.Controls[0].Op == OpARMCMPconst { 25619 v_0 := b.Controls[0] 25620 if v_0.AuxInt != 0 { 25621 break 25622 } 25623 l := v_0.Args[0] 25624 if l.Op != OpARMSUBshiftLL { 25625 break 25626 } 25627 c := l.AuxInt 25628 y := l.Args[1] 25629 x := l.Args[0] 25630 if !(l.Uses == 1) { 25631 break 25632 } 25633 b.Reset(BlockARMNE) 25634 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags) 25635 v0.AuxInt = c 25636 v0.AddArg(x) 25637 v0.AddArg(y) 25638 b.AddControl(v0) 25639 return true 25640 } 25641 // match: (NE (CMPconst [0] l:(SUBshiftRL x y [c])) yes no) 25642 // cond: l.Uses==1 25643 // result: (NE (CMPshiftRL x y [c]) yes no) 25644 for b.Controls[0].Op == OpARMCMPconst { 25645 v_0 := b.Controls[0] 25646 if v_0.AuxInt != 0 { 25647 break 25648 } 25649 l := v_0.Args[0] 25650 if l.Op != OpARMSUBshiftRL { 25651 break 25652 } 25653 c := l.AuxInt 25654 y := l.Args[1] 25655 x := l.Args[0] 25656 if !(l.Uses == 1) { 25657 break 25658 } 25659 b.Reset(BlockARMNE) 25660 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags) 25661 v0.AuxInt = c 25662 v0.AddArg(x) 25663 v0.AddArg(y) 25664 b.AddControl(v0) 25665 return true 25666 } 25667 // match: (NE (CMPconst [0] l:(SUBshiftRA x y [c])) yes no) 25668 // cond: l.Uses==1 25669 // result: (NE (CMPshiftRA x y [c]) yes no) 25670 for b.Controls[0].Op == OpARMCMPconst { 25671 v_0 := b.Controls[0] 25672 if v_0.AuxInt != 0 { 25673 break 25674 } 25675 l := v_0.Args[0] 25676 if l.Op != OpARMSUBshiftRA { 25677 break 25678 } 25679 c := l.AuxInt 25680 y := l.Args[1] 25681 x := l.Args[0] 25682 if !(l.Uses == 1) { 25683 break 25684 } 25685 b.Reset(BlockARMNE) 25686 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags) 25687 v0.AuxInt = c 25688 v0.AddArg(x) 25689 v0.AddArg(y) 25690 b.AddControl(v0) 25691 return true 25692 } 25693 // match: (NE (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no) 25694 // cond: l.Uses==1 25695 // result: (NE (CMPshiftLLreg x y z) yes no) 25696 for b.Controls[0].Op == OpARMCMPconst { 25697 v_0 := b.Controls[0] 25698 if v_0.AuxInt != 0 { 25699 break 25700 } 25701 l := v_0.Args[0] 25702 if l.Op != OpARMSUBshiftLLreg { 25703 break 25704 } 25705 z := l.Args[2] 25706 x := l.Args[0] 25707 y := l.Args[1] 25708 if !(l.Uses == 1) { 25709 break 25710 } 25711 b.Reset(BlockARMNE) 25712 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags) 25713 v0.AddArg(x) 25714 v0.AddArg(y) 25715 v0.AddArg(z) 25716 b.AddControl(v0) 25717 return true 25718 } 25719 // match: (NE (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no) 25720 // cond: l.Uses==1 25721 // result: (NE (CMPshiftRLreg x y z) yes no) 25722 for b.Controls[0].Op == OpARMCMPconst { 25723 v_0 := b.Controls[0] 25724 if v_0.AuxInt != 0 { 25725 break 25726 } 25727 l := v_0.Args[0] 25728 if l.Op != OpARMSUBshiftRLreg { 25729 break 25730 } 25731 z := l.Args[2] 25732 x := l.Args[0] 25733 y := l.Args[1] 25734 if !(l.Uses == 1) { 25735 break 25736 } 25737 b.Reset(BlockARMNE) 25738 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags) 25739 v0.AddArg(x) 25740 v0.AddArg(y) 25741 v0.AddArg(z) 25742 b.AddControl(v0) 25743 return true 25744 } 25745 // match: (NE (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no) 25746 // cond: l.Uses==1 25747 // result: (NE (CMPshiftRAreg x y z) yes no) 25748 for b.Controls[0].Op == OpARMCMPconst { 25749 v_0 := b.Controls[0] 25750 if v_0.AuxInt != 0 { 25751 break 25752 } 25753 l := v_0.Args[0] 25754 if l.Op != OpARMSUBshiftRAreg { 25755 break 25756 } 25757 z := l.Args[2] 25758 x := l.Args[0] 25759 y := l.Args[1] 25760 if !(l.Uses == 1) { 25761 break 25762 } 25763 b.Reset(BlockARMNE) 25764 v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags) 25765 v0.AddArg(x) 25766 v0.AddArg(y) 25767 v0.AddArg(z) 25768 b.AddControl(v0) 25769 return true 25770 } 25771 // match: (NE (CMPconst [0] l:(ADD x y)) yes no) 25772 // cond: l.Uses==1 25773 // result: (NE (CMN x y) yes no) 25774 for b.Controls[0].Op == OpARMCMPconst { 25775 v_0 := b.Controls[0] 25776 if v_0.AuxInt != 0 { 25777 break 25778 } 25779 l := v_0.Args[0] 25780 if l.Op != OpARMADD { 25781 break 25782 } 25783 y := l.Args[1] 25784 x := l.Args[0] 25785 if !(l.Uses == 1) { 25786 break 25787 } 25788 b.Reset(BlockARMNE) 25789 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 25790 v0.AddArg(x) 25791 v0.AddArg(y) 25792 b.AddControl(v0) 25793 return true 25794 } 25795 // match: (NE (CMPconst [0] l:(MULA x y a)) yes no) 25796 // cond: l.Uses==1 25797 // result: (NE (CMN a (MUL <x.Type> x y)) yes no) 25798 for b.Controls[0].Op == OpARMCMPconst { 25799 v_0 := b.Controls[0] 25800 if v_0.AuxInt != 0 { 25801 break 25802 } 25803 l := v_0.Args[0] 25804 if l.Op != OpARMMULA { 25805 break 25806 } 25807 a := l.Args[2] 25808 x := l.Args[0] 25809 y := l.Args[1] 25810 if !(l.Uses == 1) { 25811 break 25812 } 25813 b.Reset(BlockARMNE) 25814 v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags) 25815 v0.AddArg(a) 25816 v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type) 25817 v1.AddArg(x) 25818 v1.AddArg(y) 25819 v0.AddArg(v1) 25820 b.AddControl(v0) 25821 return true 25822 } 25823 // match: (NE (CMPconst [0] l:(ADDconst [c] x)) yes no) 25824 // cond: l.Uses==1 25825 // result: (NE (CMNconst [c] x) yes no) 25826 for b.Controls[0].Op == OpARMCMPconst { 25827 v_0 := b.Controls[0] 25828 if v_0.AuxInt != 0 { 25829 break 25830 } 25831 l := v_0.Args[0] 25832 if l.Op != OpARMADDconst { 25833 break 25834 } 25835 c := l.AuxInt 25836 x := l.Args[0] 25837 if !(l.Uses == 1) { 25838 break 25839 } 25840 b.Reset(BlockARMNE) 25841 v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags) 25842 v0.AuxInt = c 25843 v0.AddArg(x) 25844 b.AddControl(v0) 25845 return true 25846 } 25847 // match: (NE (CMPconst [0] l:(ADDshiftLL x y [c])) yes no) 25848 // cond: l.Uses==1 25849 // result: (NE (CMNshiftLL x y [c]) yes no) 25850 for b.Controls[0].Op == OpARMCMPconst { 25851 v_0 := b.Controls[0] 25852 if v_0.AuxInt != 0 { 25853 break 25854 } 25855 l := v_0.Args[0] 25856 if l.Op != OpARMADDshiftLL { 25857 break 25858 } 25859 c := l.AuxInt 25860 y := l.Args[1] 25861 x := l.Args[0] 25862 if !(l.Uses == 1) { 25863 break 25864 } 25865 b.Reset(BlockARMNE) 25866 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags) 25867 v0.AuxInt = c 25868 v0.AddArg(x) 25869 v0.AddArg(y) 25870 b.AddControl(v0) 25871 return true 25872 } 25873 // match: (NE (CMPconst [0] l:(ADDshiftRL x y [c])) yes no) 25874 // cond: l.Uses==1 25875 // result: (NE (CMNshiftRL x y [c]) yes no) 25876 for b.Controls[0].Op == OpARMCMPconst { 25877 v_0 := b.Controls[0] 25878 if v_0.AuxInt != 0 { 25879 break 25880 } 25881 l := v_0.Args[0] 25882 if l.Op != OpARMADDshiftRL { 25883 break 25884 } 25885 c := l.AuxInt 25886 y := l.Args[1] 25887 x := l.Args[0] 25888 if !(l.Uses == 1) { 25889 break 25890 } 25891 b.Reset(BlockARMNE) 25892 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags) 25893 v0.AuxInt = c 25894 v0.AddArg(x) 25895 v0.AddArg(y) 25896 b.AddControl(v0) 25897 return true 25898 } 25899 // match: (NE (CMPconst [0] l:(ADDshiftRA x y [c])) yes no) 25900 // cond: l.Uses==1 25901 // result: (NE (CMNshiftRA x y [c]) yes no) 25902 for b.Controls[0].Op == OpARMCMPconst { 25903 v_0 := b.Controls[0] 25904 if v_0.AuxInt != 0 { 25905 break 25906 } 25907 l := v_0.Args[0] 25908 if l.Op != OpARMADDshiftRA { 25909 break 25910 } 25911 c := l.AuxInt 25912 y := l.Args[1] 25913 x := l.Args[0] 25914 if !(l.Uses == 1) { 25915 break 25916 } 25917 b.Reset(BlockARMNE) 25918 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags) 25919 v0.AuxInt = c 25920 v0.AddArg(x) 25921 v0.AddArg(y) 25922 b.AddControl(v0) 25923 return true 25924 } 25925 // match: (NE (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no) 25926 // cond: l.Uses==1 25927 // result: (NE (CMNshiftLLreg x y z) yes no) 25928 for b.Controls[0].Op == OpARMCMPconst { 25929 v_0 := b.Controls[0] 25930 if v_0.AuxInt != 0 { 25931 break 25932 } 25933 l := v_0.Args[0] 25934 if l.Op != OpARMADDshiftLLreg { 25935 break 25936 } 25937 z := l.Args[2] 25938 x := l.Args[0] 25939 y := l.Args[1] 25940 if !(l.Uses == 1) { 25941 break 25942 } 25943 b.Reset(BlockARMNE) 25944 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags) 25945 v0.AddArg(x) 25946 v0.AddArg(y) 25947 v0.AddArg(z) 25948 b.AddControl(v0) 25949 return true 25950 } 25951 // match: (NE (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no) 25952 // cond: l.Uses==1 25953 // result: (NE (CMNshiftRLreg x y z) yes no) 25954 for b.Controls[0].Op == OpARMCMPconst { 25955 v_0 := b.Controls[0] 25956 if v_0.AuxInt != 0 { 25957 break 25958 } 25959 l := v_0.Args[0] 25960 if l.Op != OpARMADDshiftRLreg { 25961 break 25962 } 25963 z := l.Args[2] 25964 x := l.Args[0] 25965 y := l.Args[1] 25966 if !(l.Uses == 1) { 25967 break 25968 } 25969 b.Reset(BlockARMNE) 25970 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags) 25971 v0.AddArg(x) 25972 v0.AddArg(y) 25973 v0.AddArg(z) 25974 b.AddControl(v0) 25975 return true 25976 } 25977 // match: (NE (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no) 25978 // cond: l.Uses==1 25979 // result: (NE (CMNshiftRAreg x y z) yes no) 25980 for b.Controls[0].Op == OpARMCMPconst { 25981 v_0 := b.Controls[0] 25982 if v_0.AuxInt != 0 { 25983 break 25984 } 25985 l := v_0.Args[0] 25986 if l.Op != OpARMADDshiftRAreg { 25987 break 25988 } 25989 z := l.Args[2] 25990 x := l.Args[0] 25991 y := l.Args[1] 25992 if !(l.Uses == 1) { 25993 break 25994 } 25995 b.Reset(BlockARMNE) 25996 v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags) 25997 v0.AddArg(x) 25998 v0.AddArg(y) 25999 v0.AddArg(z) 26000 b.AddControl(v0) 26001 return true 26002 } 26003 // match: (NE (CMPconst [0] l:(AND x y)) yes no) 26004 // cond: l.Uses==1 26005 // result: (NE (TST x y) yes no) 26006 for b.Controls[0].Op == OpARMCMPconst { 26007 v_0 := b.Controls[0] 26008 if v_0.AuxInt != 0 { 26009 break 26010 } 26011 l := v_0.Args[0] 26012 if l.Op != OpARMAND { 26013 break 26014 } 26015 y := l.Args[1] 26016 x := l.Args[0] 26017 if !(l.Uses == 1) { 26018 break 26019 } 26020 b.Reset(BlockARMNE) 26021 v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags) 26022 v0.AddArg(x) 26023 v0.AddArg(y) 26024 b.AddControl(v0) 26025 return true 26026 } 26027 // match: (NE (CMPconst [0] l:(ANDconst [c] x)) yes no) 26028 // cond: l.Uses==1 26029 // result: (NE (TSTconst [c] x) yes no) 26030 for b.Controls[0].Op == OpARMCMPconst { 26031 v_0 := b.Controls[0] 26032 if v_0.AuxInt != 0 { 26033 break 26034 } 26035 l := v_0.Args[0] 26036 if l.Op != OpARMANDconst { 26037 break 26038 } 26039 c := l.AuxInt 26040 x := l.Args[0] 26041 if !(l.Uses == 1) { 26042 break 26043 } 26044 b.Reset(BlockARMNE) 26045 v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags) 26046 v0.AuxInt = c 26047 v0.AddArg(x) 26048 b.AddControl(v0) 26049 return true 26050 } 26051 // match: (NE (CMPconst [0] l:(ANDshiftLL x y [c])) yes no) 26052 // cond: l.Uses==1 26053 // result: (NE (TSTshiftLL x y [c]) yes no) 26054 for b.Controls[0].Op == OpARMCMPconst { 26055 v_0 := b.Controls[0] 26056 if v_0.AuxInt != 0 { 26057 break 26058 } 26059 l := v_0.Args[0] 26060 if l.Op != OpARMANDshiftLL { 26061 break 26062 } 26063 c := l.AuxInt 26064 y := l.Args[1] 26065 x := l.Args[0] 26066 if !(l.Uses == 1) { 26067 break 26068 } 26069 b.Reset(BlockARMNE) 26070 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags) 26071 v0.AuxInt = c 26072 v0.AddArg(x) 26073 v0.AddArg(y) 26074 b.AddControl(v0) 26075 return true 26076 } 26077 // match: (NE (CMPconst [0] l:(ANDshiftRL x y [c])) yes no) 26078 // cond: l.Uses==1 26079 // result: (NE (TSTshiftRL x y [c]) yes no) 26080 for b.Controls[0].Op == OpARMCMPconst { 26081 v_0 := b.Controls[0] 26082 if v_0.AuxInt != 0 { 26083 break 26084 } 26085 l := v_0.Args[0] 26086 if l.Op != OpARMANDshiftRL { 26087 break 26088 } 26089 c := l.AuxInt 26090 y := l.Args[1] 26091 x := l.Args[0] 26092 if !(l.Uses == 1) { 26093 break 26094 } 26095 b.Reset(BlockARMNE) 26096 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags) 26097 v0.AuxInt = c 26098 v0.AddArg(x) 26099 v0.AddArg(y) 26100 b.AddControl(v0) 26101 return true 26102 } 26103 // match: (NE (CMPconst [0] l:(ANDshiftRA x y [c])) yes no) 26104 // cond: l.Uses==1 26105 // result: (NE (TSTshiftRA x y [c]) yes no) 26106 for b.Controls[0].Op == OpARMCMPconst { 26107 v_0 := b.Controls[0] 26108 if v_0.AuxInt != 0 { 26109 break 26110 } 26111 l := v_0.Args[0] 26112 if l.Op != OpARMANDshiftRA { 26113 break 26114 } 26115 c := l.AuxInt 26116 y := l.Args[1] 26117 x := l.Args[0] 26118 if !(l.Uses == 1) { 26119 break 26120 } 26121 b.Reset(BlockARMNE) 26122 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags) 26123 v0.AuxInt = c 26124 v0.AddArg(x) 26125 v0.AddArg(y) 26126 b.AddControl(v0) 26127 return true 26128 } 26129 // match: (NE (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no) 26130 // cond: l.Uses==1 26131 // result: (NE (TSTshiftLLreg x y z) yes no) 26132 for b.Controls[0].Op == OpARMCMPconst { 26133 v_0 := b.Controls[0] 26134 if v_0.AuxInt != 0 { 26135 break 26136 } 26137 l := v_0.Args[0] 26138 if l.Op != OpARMANDshiftLLreg { 26139 break 26140 } 26141 z := l.Args[2] 26142 x := l.Args[0] 26143 y := l.Args[1] 26144 if !(l.Uses == 1) { 26145 break 26146 } 26147 b.Reset(BlockARMNE) 26148 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags) 26149 v0.AddArg(x) 26150 v0.AddArg(y) 26151 v0.AddArg(z) 26152 b.AddControl(v0) 26153 return true 26154 } 26155 // match: (NE (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no) 26156 // cond: l.Uses==1 26157 // result: (NE (TSTshiftRLreg x y z) yes no) 26158 for b.Controls[0].Op == OpARMCMPconst { 26159 v_0 := b.Controls[0] 26160 if v_0.AuxInt != 0 { 26161 break 26162 } 26163 l := v_0.Args[0] 26164 if l.Op != OpARMANDshiftRLreg { 26165 break 26166 } 26167 z := l.Args[2] 26168 x := l.Args[0] 26169 y := l.Args[1] 26170 if !(l.Uses == 1) { 26171 break 26172 } 26173 b.Reset(BlockARMNE) 26174 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags) 26175 v0.AddArg(x) 26176 v0.AddArg(y) 26177 v0.AddArg(z) 26178 b.AddControl(v0) 26179 return true 26180 } 26181 // match: (NE (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no) 26182 // cond: l.Uses==1 26183 // result: (NE (TSTshiftRAreg x y z) yes no) 26184 for b.Controls[0].Op == OpARMCMPconst { 26185 v_0 := b.Controls[0] 26186 if v_0.AuxInt != 0 { 26187 break 26188 } 26189 l := v_0.Args[0] 26190 if l.Op != OpARMANDshiftRAreg { 26191 break 26192 } 26193 z := l.Args[2] 26194 x := l.Args[0] 26195 y := l.Args[1] 26196 if !(l.Uses == 1) { 26197 break 26198 } 26199 b.Reset(BlockARMNE) 26200 v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags) 26201 v0.AddArg(x) 26202 v0.AddArg(y) 26203 v0.AddArg(z) 26204 b.AddControl(v0) 26205 return true 26206 } 26207 // match: (NE (CMPconst [0] l:(XOR x y)) yes no) 26208 // cond: l.Uses==1 26209 // result: (NE (TEQ x y) yes no) 26210 for b.Controls[0].Op == OpARMCMPconst { 26211 v_0 := b.Controls[0] 26212 if v_0.AuxInt != 0 { 26213 break 26214 } 26215 l := v_0.Args[0] 26216 if l.Op != OpARMXOR { 26217 break 26218 } 26219 y := l.Args[1] 26220 x := l.Args[0] 26221 if !(l.Uses == 1) { 26222 break 26223 } 26224 b.Reset(BlockARMNE) 26225 v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags) 26226 v0.AddArg(x) 26227 v0.AddArg(y) 26228 b.AddControl(v0) 26229 return true 26230 } 26231 // match: (NE (CMPconst [0] l:(XORconst [c] x)) yes no) 26232 // cond: l.Uses==1 26233 // result: (NE (TEQconst [c] x) yes no) 26234 for b.Controls[0].Op == OpARMCMPconst { 26235 v_0 := b.Controls[0] 26236 if v_0.AuxInt != 0 { 26237 break 26238 } 26239 l := v_0.Args[0] 26240 if l.Op != OpARMXORconst { 26241 break 26242 } 26243 c := l.AuxInt 26244 x := l.Args[0] 26245 if !(l.Uses == 1) { 26246 break 26247 } 26248 b.Reset(BlockARMNE) 26249 v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags) 26250 v0.AuxInt = c 26251 v0.AddArg(x) 26252 b.AddControl(v0) 26253 return true 26254 } 26255 // match: (NE (CMPconst [0] l:(XORshiftLL x y [c])) yes no) 26256 // cond: l.Uses==1 26257 // result: (NE (TEQshiftLL x y [c]) yes no) 26258 for b.Controls[0].Op == OpARMCMPconst { 26259 v_0 := b.Controls[0] 26260 if v_0.AuxInt != 0 { 26261 break 26262 } 26263 l := v_0.Args[0] 26264 if l.Op != OpARMXORshiftLL { 26265 break 26266 } 26267 c := l.AuxInt 26268 y := l.Args[1] 26269 x := l.Args[0] 26270 if !(l.Uses == 1) { 26271 break 26272 } 26273 b.Reset(BlockARMNE) 26274 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags) 26275 v0.AuxInt = c 26276 v0.AddArg(x) 26277 v0.AddArg(y) 26278 b.AddControl(v0) 26279 return true 26280 } 26281 // match: (NE (CMPconst [0] l:(XORshiftRL x y [c])) yes no) 26282 // cond: l.Uses==1 26283 // result: (NE (TEQshiftRL x y [c]) yes no) 26284 for b.Controls[0].Op == OpARMCMPconst { 26285 v_0 := b.Controls[0] 26286 if v_0.AuxInt != 0 { 26287 break 26288 } 26289 l := v_0.Args[0] 26290 if l.Op != OpARMXORshiftRL { 26291 break 26292 } 26293 c := l.AuxInt 26294 y := l.Args[1] 26295 x := l.Args[0] 26296 if !(l.Uses == 1) { 26297 break 26298 } 26299 b.Reset(BlockARMNE) 26300 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags) 26301 v0.AuxInt = c 26302 v0.AddArg(x) 26303 v0.AddArg(y) 26304 b.AddControl(v0) 26305 return true 26306 } 26307 // match: (NE (CMPconst [0] l:(XORshiftRA x y [c])) yes no) 26308 // cond: l.Uses==1 26309 // result: (NE (TEQshiftRA x y [c]) yes no) 26310 for b.Controls[0].Op == OpARMCMPconst { 26311 v_0 := b.Controls[0] 26312 if v_0.AuxInt != 0 { 26313 break 26314 } 26315 l := v_0.Args[0] 26316 if l.Op != OpARMXORshiftRA { 26317 break 26318 } 26319 c := l.AuxInt 26320 y := l.Args[1] 26321 x := l.Args[0] 26322 if !(l.Uses == 1) { 26323 break 26324 } 26325 b.Reset(BlockARMNE) 26326 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags) 26327 v0.AuxInt = c 26328 v0.AddArg(x) 26329 v0.AddArg(y) 26330 b.AddControl(v0) 26331 return true 26332 } 26333 // match: (NE (CMPconst [0] l:(XORshiftLLreg x y z)) yes no) 26334 // cond: l.Uses==1 26335 // result: (NE (TEQshiftLLreg x y z) yes no) 26336 for b.Controls[0].Op == OpARMCMPconst { 26337 v_0 := b.Controls[0] 26338 if v_0.AuxInt != 0 { 26339 break 26340 } 26341 l := v_0.Args[0] 26342 if l.Op != OpARMXORshiftLLreg { 26343 break 26344 } 26345 z := l.Args[2] 26346 x := l.Args[0] 26347 y := l.Args[1] 26348 if !(l.Uses == 1) { 26349 break 26350 } 26351 b.Reset(BlockARMNE) 26352 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags) 26353 v0.AddArg(x) 26354 v0.AddArg(y) 26355 v0.AddArg(z) 26356 b.AddControl(v0) 26357 return true 26358 } 26359 // match: (NE (CMPconst [0] l:(XORshiftRLreg x y z)) yes no) 26360 // cond: l.Uses==1 26361 // result: (NE (TEQshiftRLreg x y z) yes no) 26362 for b.Controls[0].Op == OpARMCMPconst { 26363 v_0 := b.Controls[0] 26364 if v_0.AuxInt != 0 { 26365 break 26366 } 26367 l := v_0.Args[0] 26368 if l.Op != OpARMXORshiftRLreg { 26369 break 26370 } 26371 z := l.Args[2] 26372 x := l.Args[0] 26373 y := l.Args[1] 26374 if !(l.Uses == 1) { 26375 break 26376 } 26377 b.Reset(BlockARMNE) 26378 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags) 26379 v0.AddArg(x) 26380 v0.AddArg(y) 26381 v0.AddArg(z) 26382 b.AddControl(v0) 26383 return true 26384 } 26385 // match: (NE (CMPconst [0] l:(XORshiftRAreg x y z)) yes no) 26386 // cond: l.Uses==1 26387 // result: (NE (TEQshiftRAreg x y z) yes no) 26388 for b.Controls[0].Op == OpARMCMPconst { 26389 v_0 := b.Controls[0] 26390 if v_0.AuxInt != 0 { 26391 break 26392 } 26393 l := v_0.Args[0] 26394 if l.Op != OpARMXORshiftRAreg { 26395 break 26396 } 26397 z := l.Args[2] 26398 x := l.Args[0] 26399 y := l.Args[1] 26400 if !(l.Uses == 1) { 26401 break 26402 } 26403 b.Reset(BlockARMNE) 26404 v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags) 26405 v0.AddArg(x) 26406 v0.AddArg(y) 26407 v0.AddArg(z) 26408 b.AddControl(v0) 26409 return true 26410 } 26411 case BlockARMUGE: 26412 // match: (UGE (FlagEQ) yes no) 26413 // result: (First yes no) 26414 for b.Controls[0].Op == OpARMFlagEQ { 26415 b.Reset(BlockFirst) 26416 return true 26417 } 26418 // match: (UGE (FlagLT_ULT) yes no) 26419 // result: (First no yes) 26420 for b.Controls[0].Op == OpARMFlagLT_ULT { 26421 b.Reset(BlockFirst) 26422 b.swapSuccessors() 26423 return true 26424 } 26425 // match: (UGE (FlagLT_UGT) yes no) 26426 // result: (First yes no) 26427 for b.Controls[0].Op == OpARMFlagLT_UGT { 26428 b.Reset(BlockFirst) 26429 return true 26430 } 26431 // match: (UGE (FlagGT_ULT) yes no) 26432 // result: (First no yes) 26433 for b.Controls[0].Op == OpARMFlagGT_ULT { 26434 b.Reset(BlockFirst) 26435 b.swapSuccessors() 26436 return true 26437 } 26438 // match: (UGE (FlagGT_UGT) yes no) 26439 // result: (First yes no) 26440 for b.Controls[0].Op == OpARMFlagGT_UGT { 26441 b.Reset(BlockFirst) 26442 return true 26443 } 26444 // match: (UGE (InvertFlags cmp) yes no) 26445 // result: (ULE cmp yes no) 26446 for b.Controls[0].Op == OpARMInvertFlags { 26447 v_0 := b.Controls[0] 26448 cmp := v_0.Args[0] 26449 b.Reset(BlockARMULE) 26450 b.AddControl(cmp) 26451 return true 26452 } 26453 case BlockARMUGT: 26454 // match: (UGT (FlagEQ) yes no) 26455 // result: (First no yes) 26456 for b.Controls[0].Op == OpARMFlagEQ { 26457 b.Reset(BlockFirst) 26458 b.swapSuccessors() 26459 return true 26460 } 26461 // match: (UGT (FlagLT_ULT) yes no) 26462 // result: (First no yes) 26463 for b.Controls[0].Op == OpARMFlagLT_ULT { 26464 b.Reset(BlockFirst) 26465 b.swapSuccessors() 26466 return true 26467 } 26468 // match: (UGT (FlagLT_UGT) yes no) 26469 // result: (First yes no) 26470 for b.Controls[0].Op == OpARMFlagLT_UGT { 26471 b.Reset(BlockFirst) 26472 return true 26473 } 26474 // match: (UGT (FlagGT_ULT) yes no) 26475 // result: (First no yes) 26476 for b.Controls[0].Op == OpARMFlagGT_ULT { 26477 b.Reset(BlockFirst) 26478 b.swapSuccessors() 26479 return true 26480 } 26481 // match: (UGT (FlagGT_UGT) yes no) 26482 // result: (First yes no) 26483 for b.Controls[0].Op == OpARMFlagGT_UGT { 26484 b.Reset(BlockFirst) 26485 return true 26486 } 26487 // match: (UGT (InvertFlags cmp) yes no) 26488 // result: (ULT cmp yes no) 26489 for b.Controls[0].Op == OpARMInvertFlags { 26490 v_0 := b.Controls[0] 26491 cmp := v_0.Args[0] 26492 b.Reset(BlockARMULT) 26493 b.AddControl(cmp) 26494 return true 26495 } 26496 case BlockARMULE: 26497 // match: (ULE (FlagEQ) yes no) 26498 // result: (First yes no) 26499 for b.Controls[0].Op == OpARMFlagEQ { 26500 b.Reset(BlockFirst) 26501 return true 26502 } 26503 // match: (ULE (FlagLT_ULT) yes no) 26504 // result: (First yes no) 26505 for b.Controls[0].Op == OpARMFlagLT_ULT { 26506 b.Reset(BlockFirst) 26507 return true 26508 } 26509 // match: (ULE (FlagLT_UGT) yes no) 26510 // result: (First no yes) 26511 for b.Controls[0].Op == OpARMFlagLT_UGT { 26512 b.Reset(BlockFirst) 26513 b.swapSuccessors() 26514 return true 26515 } 26516 // match: (ULE (FlagGT_ULT) yes no) 26517 // result: (First yes no) 26518 for b.Controls[0].Op == OpARMFlagGT_ULT { 26519 b.Reset(BlockFirst) 26520 return true 26521 } 26522 // match: (ULE (FlagGT_UGT) yes no) 26523 // result: (First no yes) 26524 for b.Controls[0].Op == OpARMFlagGT_UGT { 26525 b.Reset(BlockFirst) 26526 b.swapSuccessors() 26527 return true 26528 } 26529 // match: (ULE (InvertFlags cmp) yes no) 26530 // result: (UGE cmp yes no) 26531 for b.Controls[0].Op == OpARMInvertFlags { 26532 v_0 := b.Controls[0] 26533 cmp := v_0.Args[0] 26534 b.Reset(BlockARMUGE) 26535 b.AddControl(cmp) 26536 return true 26537 } 26538 case BlockARMULT: 26539 // match: (ULT (FlagEQ) yes no) 26540 // result: (First no yes) 26541 for b.Controls[0].Op == OpARMFlagEQ { 26542 b.Reset(BlockFirst) 26543 b.swapSuccessors() 26544 return true 26545 } 26546 // match: (ULT (FlagLT_ULT) yes no) 26547 // result: (First yes no) 26548 for b.Controls[0].Op == OpARMFlagLT_ULT { 26549 b.Reset(BlockFirst) 26550 return true 26551 } 26552 // match: (ULT (FlagLT_UGT) yes no) 26553 // result: (First no yes) 26554 for b.Controls[0].Op == OpARMFlagLT_UGT { 26555 b.Reset(BlockFirst) 26556 b.swapSuccessors() 26557 return true 26558 } 26559 // match: (ULT (FlagGT_ULT) yes no) 26560 // result: (First yes no) 26561 for b.Controls[0].Op == OpARMFlagGT_ULT { 26562 b.Reset(BlockFirst) 26563 return true 26564 } 26565 // match: (ULT (FlagGT_UGT) yes no) 26566 // result: (First no yes) 26567 for b.Controls[0].Op == OpARMFlagGT_UGT { 26568 b.Reset(BlockFirst) 26569 b.swapSuccessors() 26570 return true 26571 } 26572 // match: (ULT (InvertFlags cmp) yes no) 26573 // result: (UGT cmp yes no) 26574 for b.Controls[0].Op == OpARMInvertFlags { 26575 v_0 := b.Controls[0] 26576 cmp := v_0.Args[0] 26577 b.Reset(BlockARMUGT) 26578 b.AddControl(cmp) 26579 return true 26580 } 26581 } 26582 return false 26583 }