|
423 | 423 |
|
424 | 424 | (define_attr "type" "abs, adcl, add, addhl, addl, and, andl, asl,
|
425 | 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" |
| 426 | +branch, brcc, branchcc, brk, bset, bsetl, btst, bxor, bxorl, cmp, |
| 427 | +dbnz, dmb, dmpywh, ex, div, divl, ext, fadd, fcmp, fsub, fmul, fdiv, |
| 428 | +fh2s, fmin, fmax, fsgnj, fsgnjx, fsgnjn, fmadd, fmov, fmsub, fnmadd, |
| 429 | +fnmsub, fsqrt, frnd, fs2d, fs2h, fd2s, int2fp, uint2fp, fp2int, |
| 430 | +fp2uint, ffs, fls, flag, jl, jump, ld, llock, lsr, lsrl, lr, max, |
| 431 | +maxl, min, minl, move, movecc, mod, modl, neg, nop, norm, normh, |
| 432 | +norml, mac, mpy, mpyl, not, notl, or, orl, return, ror, rol, sbcl, |
| 433 | +scond, setcc, sex, sr, st, sub, subl, swap, swapl, swape, swapel, |
| 434 | +sync, tst, trap, qmach, qmpyh, udiv, udivl, umod, umodl, unknown, |
| 435 | +vadd, vsub, vmac2h, vmpy2h, vfadd, vfext, vfins, vfsub, vfmul, vfdiv, |
| 436 | +vfrep, vpack, xbfu, xor, xorl" |
436 | 437 | (const_string "unknown"))
|
437 | 438 |
|
438 | 439 | (define_attr "iscompact" "yes,no,maybe" (const_string "no"))
|
@@ -1410,6 +1411,47 @@ vfext, vfins, vfsub, vfmul, vfdiv, vfrep, vpack, xbfu, xor, xorl"
|
1410 | 1411 | (const_int 4)
|
1411 | 1412 | (const_int 8)))])
|
1412 | 1413 |
|
| 1414 | +;; combiner patterns for BRcc instructions. We consider all BRcc |
| 1415 | +;; supported comparisons but compare with zero. The positive range |
| 1416 | +;; needs to take into account the limm size, and the pcl rounding. |
| 1417 | +;; This pattern is under an option as it may prohibit further |
| 1418 | +;; optimizations like if-conversion. |
| 1419 | +(define_insn "*brcc" |
| 1420 | + [(set (pc) |
| 1421 | + (if_then_else |
| 1422 | + (match_operator 3 "brcc_comparison_operator" |
| 1423 | + [(match_operand:GPI 1 "register_operand" "r,r") |
| 1424 | + (match_operand:GPI 2 "brcc_2ndoperand" "U06S0r,U32S0")]) |
| 1425 | + (label_ref (match_operand 0 "" "")) |
| 1426 | + (pc))) |
| 1427 | + (clobber (reg:CC_ZN CC_REGNUM))] |
| 1428 | + "!CROSSING_JUMP_P (insn) && TARGET_BRCC" |
| 1429 | + { |
| 1430 | + switch (get_attr_length (insn)) |
| 1431 | + { |
| 1432 | + case 4: |
| 1433 | + case 8: |
| 1434 | + return \"br%m3<sfxtab>\\t%1,%2,%l0\"; |
| 1435 | + default: |
| 1436 | + return \"cmp<sfxtab>\\t%1,%2\\n\\tb%m3\\t%l0\"; |
| 1437 | + } |
| 1438 | + } |
| 1439 | + [(set_attr "type" "brcc") |
| 1440 | + (set (attr "length") |
| 1441 | + (cond [(and (ge (minus (match_dup 0) (pc)) (const_int -254)) |
| 1442 | + (le (minus (match_dup 0) (pc)) (const_int 248)) |
| 1443 | + (eq (symbol_ref "which_alternative") (const_int 0))) |
| 1444 | + (const_int 4) |
| 1445 | + (and (ge (minus (match_dup 0) (pc)) (const_int -254)) |
| 1446 | + (le (minus (match_dup 0) (pc)) (const_int 244)) |
| 1447 | + (eq (symbol_ref "which_alternative") (const_int 1))) |
| 1448 | + (const_int 8) |
| 1449 | + ;; This should be variable as well... |
| 1450 | + (eq (symbol_ref "which_alternative") (const_int 0)) |
| 1451 | + (const_int 12)] |
| 1452 | + (const_int 12))) |
| 1453 | + ]) |
| 1454 | + |
1413 | 1455 | ;; -------------------------------------------------------------------
|
1414 | 1456 | ;; Sign/Zero extension
|
1415 | 1457 | ;; -------------------------------------------------------------------
|
|
0 commit comments