|
422 | 422 | (define_attr "cost" "" (const_int 0))
|
423 | 423 |
|
424 | 424 | (define_attr "type" "abs, adcl, add, addhl, addl, and, andl, asl,
|
425 |
| -asll, asr, asrl, atldop, atldlop, bclr, bic, bl, block, bmsk, branch, |
426 |
| -branchcc, brk, bset, bsetl, btst, bxor, bxorl, cmp, dbnz, dmb, dmpywh, |
427 |
| -ex, div, divl, ext, fadd, fcmp, fsub, fmul, fdiv, fh2s, fmin, fmax, |
428 |
| -fsgnj, fsgnjx, fsgnjn, fmadd, fmov, fmsub, fnmadd, fnmsub, fsqrt, |
429 |
| -frnd, fs2d, fs2h, fd2s, int2fp, uint2fp, fp2int, fp2uint, ffs, fls, |
430 |
| -flag, jl, jump, ld, llock, lsr, lsrl, lr, max, maxl, min, minl, move, |
431 |
| -movecc, mod, modl, neg, nop, norm, normh, norml, mac, mpy, mpyl, not, |
432 |
| -notl, or, orl, return, ror, rol, sbcl, scond, setcc, sex, sr, st, sub, |
433 |
| -subl, swap, swapl, swape, swapel, sync, tst, trap, qmach, qmpyh, udiv, |
434 |
| -udivl, umod, umodl, unknown, vadd, vsub, vmac2h, vmpy2h, vfadd, vfext, |
435 |
| -vfins, vfsub, vfmul, vfdiv, vfrep, vpack, xbfu, xor, xorl" |
| 425 | +asll, asr, asrl, atldop, atldlop, bbit, bclr, bic, bl, block, bmsk, |
| 426 | +branch, branchcc, brk, bset, bsetl, btst, bxor, bxorl, cmp, dbnz, dmb, |
| 427 | +dmpywh, ex, div, divl, ext, fadd, fcmp, fsub, fmul, fdiv, fh2s, fmin, |
| 428 | +fmax, fsgnj, fsgnjx, fsgnjn, fmadd, fmov, fmsub, fnmadd, fnmsub, |
| 429 | +fsqrt, frnd, fs2d, fs2h, fd2s, int2fp, uint2fp, fp2int, fp2uint, ffs, |
| 430 | +fls, flag, jl, jump, ld, llock, lsr, lsrl, lr, max, maxl, min, minl, |
| 431 | +move, movecc, mod, modl, neg, nop, norm, normh, norml, mac, mpy, mpyl, |
| 432 | +not, notl, or, orl, return, ror, rol, sbcl, scond, setcc, sex, sr, st, |
| 433 | +sub, subl, swap, swapl, swape, swapel, sync, tst, trap, qmach, qmpyh, |
| 434 | +udiv, udivl, umod, umodl, unknown, vadd, vsub, vmac2h, vmpy2h, vfadd, |
| 435 | +vfext, vfins, vfsub, vfmul, vfdiv, vfrep, vpack, xbfu, xor, xorl" |
436 | 436 | (const_string "unknown"))
|
437 | 437 |
|
438 | 438 | (define_attr "iscompact" "yes,no,maybe" (const_string "no"))
|
@@ -1345,6 +1345,71 @@ vfins, vfsub, vfmul, vfdiv, vfrep, vpack, xbfu, xor, xorl"
|
1345 | 1345 | [(set_attr "type" "jump")
|
1346 | 1346 | (set_attr "length" "2,4")])
|
1347 | 1347 |
|
| 1348 | +;; combiner patterns used to match bbit0/1 instructions. |
| 1349 | +;; Unfortunately, I cannot use splitting for this pattern as the |
| 1350 | +;; insn length is know very late during compilation process. |
| 1351 | +(define_insn "*bbit_and" |
| 1352 | + [(set (pc) |
| 1353 | + (if_then_else |
| 1354 | + (match_operator 3 "equality_comparison_operator" |
| 1355 | + [(and:GPI |
| 1356 | + (match_operand:GPI 1 "register_operand" "r") |
| 1357 | + (match_operand 2 "bbitimm_operand" "")) |
| 1358 | + (const_int 0)]) |
| 1359 | + (label_ref (match_operand 0 "" "")) |
| 1360 | + (pc))) |
| 1361 | + (clobber (reg:CC_ZN CC_REGNUM))] |
| 1362 | + "!CROSSING_JUMP_P (insn)" |
| 1363 | + { |
| 1364 | + operands[2] = GEN_INT (exact_log2 (INTVAL (operands[2]))); |
| 1365 | + switch (get_attr_length (insn)) |
| 1366 | + { |
| 1367 | + case 4: |
| 1368 | + return (GET_CODE (operands[3]) == EQ |
| 1369 | + ? \"bbit0<sfxtab>\\t%1,%2,%l0\" : \"bbit1<sfxtab>\\t%1,%2,%l0\"); |
| 1370 | + default: |
| 1371 | + return \"btst<sfxtab>\\t%1,%2\\n\\tb%m3\\t%l0\"; |
| 1372 | + } |
| 1373 | + } |
| 1374 | + [(set_attr "type" "bbit") |
| 1375 | + (set (attr "length") |
| 1376 | + (if_then_else |
| 1377 | + (and (ge (minus (match_dup 0) (pc)) (const_int -254)) |
| 1378 | + (le (minus (match_dup 0) (pc)) (const_int 250))) |
| 1379 | + (const_int 4) |
| 1380 | + (const_int 8)))]) |
| 1381 | + |
| 1382 | +(define_insn "*bbit_zext" |
| 1383 | + [(set (pc) |
| 1384 | + (if_then_else |
| 1385 | + (match_operator 3 "equality_comparison_operator" |
| 1386 | + [(zero_extract:GPI |
| 1387 | + (match_operand:GPI 1 "register_operand" "r") |
| 1388 | + (const_int 1) |
| 1389 | + (match_operand:GPI 2 "nonmemory_operand" "ir")) |
| 1390 | + (const_int 0)]) |
| 1391 | + (label_ref (match_operand 0 "" "")) |
| 1392 | + (pc))) |
| 1393 | + (clobber (reg:CC_ZN CC_REGNUM))] |
| 1394 | + "!CROSSING_JUMP_P (insn)" |
| 1395 | + { |
| 1396 | + switch (get_attr_length (insn)) |
| 1397 | + { |
| 1398 | + case 4: |
| 1399 | + return (GET_CODE (operands[3]) == EQ |
| 1400 | + ? \"bbit0<sfxtab>\\t%1,%2,%l0\" : \"bbit1<sfxtab>\\t%1,%2,%l0\"); |
| 1401 | + default: |
| 1402 | + return \"btst<sfxtab>\\t%1,%2\\n\\tb%m3\\t%l0\"; |
| 1403 | + } |
| 1404 | + } |
| 1405 | + [(set_attr "type" "bbit") |
| 1406 | + (set (attr "length") |
| 1407 | + (if_then_else |
| 1408 | + (and (ge (minus (match_dup 0) (pc)) (const_int -254)) |
| 1409 | + (le (minus (match_dup 0) (pc)) (const_int 250))) |
| 1410 | + (const_int 4) |
| 1411 | + (const_int 8)))]) |
| 1412 | + |
1348 | 1413 | ;; -------------------------------------------------------------------
|
1349 | 1414 | ;; Sign/Zero extension
|
1350 | 1415 | ;; -------------------------------------------------------------------
|
|
0 commit comments