|
78 | 78 | [(set_attr "iscompact" "maybe,no,no,no,no,no")
|
79 | 79 | (set_attr "predicable" "no,yes,no,no,no,no")
|
80 | 80 | (set_attr "length" "*,4,4,4,8,8")
|
81 |
| - (set_attr "type" "<mntab>")] |
82 |
| - ) |
| 81 | + (set_attr "type" "<mntab>")]) |
| 82 | + |
| 83 | +(define_insn "*<optab><mode>_cmp0" |
| 84 | + [(set (reg:CC_ZN CC_REGNUM) |
| 85 | + (compare:CC_ZN |
| 86 | + (ASHIFT:GPI |
| 87 | + (match_operand:GPI 1 "register_operand" " 0,0") |
| 88 | + (match_operand:GPI 2 "nonmemory_operand" "rU06S0,S32S0")) |
| 89 | + (const_int 0))) |
| 90 | + (set (match_operand:GPI 0 "register_operand" "= r,r") |
| 91 | + (ASHIFT:GPI (match_dup 1) (match_dup 2)))] |
| 92 | + "" |
| 93 | + "<mntab><sfxtab>.f\\t%0,%1,%2" |
| 94 | + [(set_attr "iscompact" "no") |
| 95 | + (set_attr "length" "4,8") |
| 96 | + (set_attr "type" "<mntab>")]) |
| 97 | + |
| 98 | +(define_insn "*<optab><mode>_cmp0_noout" |
| 99 | + [(set (reg:CC_ZN CC_REGNUM) |
| 100 | + (compare:CC_ZN |
| 101 | + (ASHIFT:GPI |
| 102 | + (match_operand:GPI 0 "register_operand" " r,r") |
| 103 | + (match_operand:GPI 1 "nonmemory_operand" "rU06S0,S32S0")) |
| 104 | + (const_int 0)))] |
| 105 | + "" |
| 106 | + "<mntab><sfxtab>.f\\t0,%0,%1" |
| 107 | + [(set_attr "iscompact" "no") |
| 108 | + (set_attr "length" "4,8") |
| 109 | + (set_attr "type" "<mntab>")]) |
| 110 | + |
83 | 111 |
|
84 | 112 | (define_insn "*sub<mode>_insn"
|
85 | 113 | [(set ( match_operand:GPI 0 "register_operand" "=q, q, q, r, r, r, r, r, r, r,r")
|
|
164 | 192 | (set_attr "length" "2,*,*,*,4,4,4,4,4,8")
|
165 | 193 | (set_attr "type" "add")])
|
166 | 194 |
|
| 195 | +;; This pattern is needed because the GT (pnz) is not reversible and I |
| 196 | +;; cannot convert CCmode to CC_ZNmode. |
| 197 | +(define_insn "*<ADDSUB:optab><GPI:mode>3_f" |
| 198 | + [(set (reg:CC CC_REGNUM) |
| 199 | + (compare:CC |
| 200 | + (ADDSUB:GPI |
| 201 | + (match_operand:GPI 1 "arc64_nonmem_operand" "0, 0, 0, r,r,S32S0, r") |
| 202 | + (match_operand:GPI 2 "arc64_nonmem_operand" "r,U06S0,S12S0,U06S0,r, r,S32S0")) |
| 203 | + (const_int 0))) |
| 204 | + (set (match_operand:GPI 0 "register_operand" "=r, r, r, r,r, r, r") |
| 205 | + (ADDSUB:GPI (match_dup 1) (match_dup 2)))] |
| 206 | + "register_operand (operands[1], <MODE>mode) |
| 207 | + || register_operand (operands[2], <MODE>mode)" |
| 208 | + "<ADDSUB:optab><GPI:sfxtab>.f\\t%0,%1,%2" |
| 209 | + [(set_attr "predicable" "yes,yes,no,no,no,no,no") |
| 210 | + (set_attr "length" "4,4,4,4,4,8,8") |
| 211 | + (set_attr "type" "<ADDSUB:optab><GPI:sfxtab>")]) |
| 212 | + |
167 | 213 | ; Conditional execution
|
168 | 214 | (define_insn "*<optab><mode>_ce"
|
169 | 215 | [(cond_exec
|
|
315 | 361 | (set_attr "type" "<mntab>")]
|
316 | 362 | )
|
317 | 363 |
|
| 364 | +;; It may be worth to have a separate pattern for AND to take |
| 365 | +;; advantage of TST_S instruction. |
318 | 366 | (define_insn "*<optab><mode>_cmp0_noout"
|
319 | 367 | [(set (reg:CC_ZN CC_REGNUM)
|
320 | 368 | (compare:CC_ZN
|
|
462 | 510 | (set_attr "type" "<optab><sfxtab>")]
|
463 | 511 | )
|
464 | 512 |
|
| 513 | +(define_insn "*<optab><mode>3_cmp0" |
| 514 | + [(set (reg:CC_ZN CC_REGNUM) |
| 515 | + (compare:CC_ZN |
| 516 | + (DIVREM:GPI |
| 517 | + (match_operand:GPI 1 "arc64_nonmem_operand" " 0,r,S32S0, r") |
| 518 | + (match_operand:GPI 2 "arc64_nonmem_operand" " r,r, r,S32S0")) |
| 519 | + (const_int 0))) |
| 520 | + (set (match_operand:GPI 0 "register_operand" "=r,r, r, r") |
| 521 | + (DIVREM:GPI (match_dup 1) |
| 522 | + (match_dup 2)))] |
| 523 | + "TARGET_ARC64_DIVREM |
| 524 | + && (register_operand (operands[1], <MODE>mode) |
| 525 | + || register_operand (operands[2], <MODE>mode))" |
| 526 | + "<mntab><sfxtab>.f\\t%0,%1,%2" |
| 527 | + [(set_attr "length" "4,4,8,8") |
| 528 | + (set_attr "type" "<optab><sfxtab>")]) |
| 529 | + |
| 530 | +(define_insn "*<optab><mode>3_cmp0_noout" |
| 531 | + [(set (reg:CC_ZN CC_REGNUM) |
| 532 | + (compare:CC_ZN |
| 533 | + (DIVREM:GPI |
| 534 | + (match_operand:GPI 0 "arc64_nonmem_operand" "r,S32S0, r") |
| 535 | + (match_operand:GPI 1 "arc64_nonmem_operand" "r, r,S32S0")) |
| 536 | + (const_int 0)))] |
| 537 | + "TARGET_ARC64_DIVREM |
| 538 | + && (register_operand (operands[0], <MODE>mode) |
| 539 | + || register_operand (operands[1], <MODE>mode))" |
| 540 | + "<mntab><sfxtab>.f\\t0,%0,%1" |
| 541 | + [(set_attr "length" "4,8,8") |
| 542 | + (set_attr "type" "<optab><sfxtab>")]) |
| 543 | + |
465 | 544 | ;; To be merged into adddi3
|
466 | 545 | (define_insn "*add_tls_off"
|
467 | 546 | [(set (match_operand:DI 0 "register_operand" "=r")
|
|
0 commit comments