Commit e5bde68a by Richard Henderson Committed by Richard Henderson

ia64.c (predicate_operator): New.

        * config/ia64/ia64.c (predicate_operator): New.
        (ia64_print_operand): Handle 'J'.
        (rtx_needs_barrier): Handle COND_EXEC.
        * config/ia64/ia64.h (BRANCH_COST): Define.
        (PREDICATE_CODES): Update.
        * config/ia64/ia64.md: Docuement used unspec values.
        (attr predicable): New.
        (movxf, movxf_internal): New.
        (extendsfdf2): Don't comment out nop.
        (floatdidf2): Remove.
        (truncxfsf2, truncxfdf2, floatdixf2): New.
        (abssi2, absdi2): Put the neg in the "true" slot.
        (conditional branch instructions): Mark not predicable.
        (cmov*_internal): Use predicate_operator.  Split to cond_exec.
        (abs*_internal): Likewise.
        (alloc, set_bsp): Mark not predicable.
        (barrier, insn_group_barrier, flush_cache): Likewise.
        (define_cond_exec): New.

From-SVN: r33754
parent fd7c34b0
2000-05-06 Richard Henderson <rth@cygnus.com> 2000-05-06 Richard Henderson <rth@cygnus.com>
* config/ia64/ia64.c (predicate_operator): New.
(ia64_print_operand): Handle 'J'.
(rtx_needs_barrier): Handle COND_EXEC.
* config/ia64/ia64.h (BRANCH_COST): Define.
(PREDICATE_CODES): Update.
* config/ia64/ia64.md: Docuement used unspec values.
(attr predicable): New.
(movxf, movxf_internal): New.
(extendsfdf2): Don't comment out nop.
(floatdidf2): Remove.
(truncxfsf2, truncxfdf2, floatdixf2): New.
(abssi2, absdi2): Put the neg in the "true" slot.
(conditional branch instructions): Mark not predicable.
(cmov*_internal): Use predicate_operator. Split to cond_exec.
(abs*_internal): Likewise.
(alloc, set_bsp): Mark not predicable.
(barrier, insn_group_barrier, flush_cache): Likewise.
(define_cond_exec): New.
2000-05-06 Richard Henderson <rth@cygnus.com>
* c-decl.c: Include "tm_p.h". * c-decl.c: Include "tm_p.h".
* config/ia64/ia64-protos.h: Rearrange decls to reduce ifdef madness. * config/ia64/ia64-protos.h: Rearrange decls to reduce ifdef madness.
......
...@@ -468,6 +468,17 @@ call_multiple_values_operation (op, mode) ...@@ -468,6 +468,17 @@ call_multiple_values_operation (op, mode)
return 1; return 1;
} }
/* Return 1 if this operator is valid for predication. */
int
predicate_operator (op, mode)
register rtx op;
enum machine_mode mode;
{
enum rtx_code code = GET_CODE (op);
return ((GET_MODE (op) == mode || mode == VOIDmode)
&& (code == EQ || code == NE));
}
/* Structure to be filled in by ia64_compute_frame_size with register /* Structure to be filled in by ia64_compute_frame_size with register
save masks and offsets for the current function. */ save masks and offsets for the current function. */
...@@ -1683,6 +1694,7 @@ ia64_print_operand_address (stream, address) ...@@ -1683,6 +1694,7 @@ ia64_print_operand_address (stream, address)
F A floating point constant 0.0 emitted as f0, or 1.0 emitted as f1, or F A floating point constant 0.0 emitted as f0, or 1.0 emitted as f1, or
a floating point register emitted normally. a floating point register emitted normally.
I Invert a predicate register by adding 1. I Invert a predicate register by adding 1.
J Select the proper predicate register for a condition.
O Append .acq for volatile load. O Append .acq for volatile load.
P Postincrement of a MEM. P Postincrement of a MEM.
Q Append .rel for volatile store. Q Append .rel for volatile store.
...@@ -1742,6 +1754,10 @@ ia64_print_operand (file, x, code) ...@@ -1742,6 +1754,10 @@ ia64_print_operand (file, x, code)
fputs (reg_names [REGNO (x) + 1], file); fputs (reg_names [REGNO (x) + 1], file);
return; return;
case 'J':
fputs (reg_names [REGNO (XEXP (x, 0)) + (GET_CODE (x) == EQ)], file);
return;
case 'O': case 'O':
if (MEM_VOLATILE_P (x)) if (MEM_VOLATILE_P (x))
fputs(".acq", file); fputs(".acq", file);
...@@ -2382,6 +2398,27 @@ rtx_needs_barrier (x, flags, pred) ...@@ -2382,6 +2398,27 @@ rtx_needs_barrier (x, flags, pred)
} }
break; break;
case COND_EXEC:
/* X is a predicated instruction. */
cond = COND_EXEC_TEST (x);
if (pred)
abort ();
need_barrier = rtx_needs_barrier (cond, flags, 0);
if (GET_CODE (cond) == EQ)
is_complemented = 1;
cond = XEXP (cond, 0);
if (GET_CODE (cond) != REG
&& REGNO_REG_CLASS (REGNO (cond)) != PR_REGS)
abort ();
pred = REGNO (cond);
if (is_complemented)
++pred;
need_barrier |= rtx_needs_barrier (COND_EXEC_CODE (x), flags, pred);
return need_barrier;
case CLOBBER: case CLOBBER:
#if 0 #if 0
case USE: case USE:
......
...@@ -1922,9 +1922,13 @@ do { \ ...@@ -1922,9 +1922,13 @@ do { \
/* #define MEMORY_MOVE_COST(M,C,I) */ /* #define MEMORY_MOVE_COST(M,C,I) */
/* A C expression for the cost of a branch instruction. A value of 1 is the /* A C expression for the cost of a branch instruction. A value of 1 is the
default; other values are interpreted relative to that. */ default; other values are interpreted relative to that. Used by the
/* ??? Investigate. Might get better code by defining this. */ if-conversion code as max instruction count. */
/* #define BRANCH_COST */ /* ??? This requires investigation. The primary effect might be how
many additional insn groups we run into, vs how good the dynamic
branch predictor is. */
#define BRANCH_COST 6
/* Define this macro as a C expression which is nonzero if accessing less than /* Define this macro as a C expression which is nonzero if accessing less than
a word of memory (i.e. a `char' or a `short') is no faster than accessing a a word of memory (i.e. a `char' or a `short') is no faster than accessing a
...@@ -2726,7 +2730,8 @@ do { \ ...@@ -2726,7 +2730,8 @@ do { \
{ "reg_or_fp01_operand", {SUBREG, REG, CONST_DOUBLE, CONSTANT_P_RTX}}, \ { "reg_or_fp01_operand", {SUBREG, REG, CONST_DOUBLE, CONSTANT_P_RTX}}, \
{ "normal_comparison_operator", {EQ, NE, GT, LE, GTU, LEU}}, \ { "normal_comparison_operator", {EQ, NE, GT, LE, GTU, LEU}}, \
{ "adjusted_comparison_operator", {LT, GE, LTU, GEU}}, \ { "adjusted_comparison_operator", {LT, GE, LTU, GEU}}, \
{ "call_multiple_values_operation", {PARALLEL}}, { "call_multiple_values_operation", {PARALLEL}}, \
{ "predicate_operator", {NE, EQ}},
/* An alias for a machine mode name. This is the machine mode that elements of /* An alias for a machine mode name. This is the machine mode that elements of
a jump-table should have. */ a jump-table should have. */
......
...@@ -48,6 +48,33 @@ ...@@ -48,6 +48,33 @@
;; ??? Add function unit scheduling info for Itanium (TM) processor. ;; ??? Add function unit scheduling info for Itanium (TM) processor.
;; Unspec usage:
;;
;; unspec:
;; 1 gr_spill
;; 2 gr_restore
;; 3 fr_spill
;; 4 fr_restore
;; 5 pr_spill
;; 8 popcnt
;; 9 unat_spill
;; 10 unat_restore
;; 13 cmpxchg_acq
;; 14 val_compare_and_swap
;; 16 lock_test_and_set
;; 17 op_and_fetch
;; 18 fetch_and_op
;; 19 fetchadd_acq
;; 20 bsp_value
;;
;; unspec_volatile:
;; 0 alloc
;; 1 blockage
;; 2 insn_group_barrier
;; 3 flush_cache
;; 4 pfs_restore
;; 5 set_bsp
;; 6 pr_restore
;; :::::::::::::::::::: ;; ::::::::::::::::::::
;; :: ;; ::
...@@ -73,6 +100,10 @@ ...@@ -73,6 +100,10 @@
(define_attr "type" "unknown,A,I,M,F,B,L,S" (const_string "unknown")) (define_attr "type" "unknown,A,I,M,F,B,L,S" (const_string "unknown"))
;; Predication. True iff this instruction can be predicated.
(define_attr "predicable" "no,yes" (const_string "yes"))
;; :::::::::::::::::::: ;; ::::::::::::::::::::
;; :: ;; ::
...@@ -402,6 +433,29 @@ ...@@ -402,6 +433,29 @@
mov %0 = %1" mov %0 = %1"
[(set_attr "type" "F,M,M,M,M,A")]) [(set_attr "type" "F,M,M,M,M,A")])
(define_expand "movxf"
[(set (match_operand:XF 0 "general_operand" "")
(match_operand:XF 1 "general_operand" ""))]
""
"
{
if (! reload_in_progress && ! reload_completed
&& GET_CODE (operands[0]) == MEM
&& GET_CODE (operands[1]) == MEM)
operands[1] = copy_to_mode_reg (XFmode, operands[1]);
}")
(define_insn "*movxf_internal"
[(set (match_operand:XF 0 "nonimmediate_operand" "=f,f,m")
(match_operand:XF 1 "general_operand" "fG,m,fG"))]
"! memory_operand (operands[0], XFmode)
|| ! memory_operand (operands[1], XFmode)"
"@
mov %0 = %F1
ldf %0 = %1%P1
stf %0 = %F1%P0"
[(set_attr "type" "F,M,M")])
;; :::::::::::::::::::: ;; ::::::::::::::::::::
;; :: ;; ::
...@@ -473,8 +527,8 @@ ...@@ -473,8 +527,8 @@
(float_extend:DF (match_operand:SF 1 "register_operand" "0,f")))] (float_extend:DF (match_operand:SF 1 "register_operand" "0,f")))]
"" ""
"@ "@
//nop nop 0
mov %0 = %1" mov %0 = %1"
[(set_attr "type" "unknown,F")]) [(set_attr "type" "unknown,F")])
(define_insn "truncdfsf2" (define_insn "truncdfsf2"
...@@ -484,17 +538,28 @@ ...@@ -484,17 +538,28 @@
"fnorm.s %0 = %1%B0" "fnorm.s %0 = %1%B0"
[(set_attr "type" "F")]) [(set_attr "type" "F")])
;; Convert between signed integer types and floating point. (define_insn "truncxfsf2"
[(set (match_operand:SF 0 "register_operand" "=f")
;; ??? Instead of having floatdidf2, we should have a floatditf2 pattern, (float_truncate:SF (match_operand:XF 1 "register_operand" "f")))]
;; and then add conversions from tf to df and sf. ""
"fnorm.s %0 = %1%B0"
[(set_attr "type" "F")])
(define_insn "floatdidf2" (define_insn "truncxfdf2"
[(set (match_operand:DF 0 "register_operand" "=f") [(set (match_operand:DF 0 "register_operand" "=f")
(float:DF (match_operand:DI 1 "register_operand" "e")))] (float_truncate:DF (match_operand:XF 1 "register_operand" "f")))]
"" ""
"fcvt.xf %0 = %1\;;;\;fnorm.d %0 = %0%B0" "fnorm.d %0 = %1%B0"
[(set_attr "type" "unknown")]) [(set_attr "type" "F")])
;; Convert between signed integer types and floating point.
(define_insn "floatdixf2"
[(set (match_operand:XF 0 "register_operand" "=f")
(float:XF (match_operand:DI 1 "register_operand" "e")))]
""
"fcvt.xf %0 = %1"
[(set_attr "type" "F")])
(define_insn "fix_truncsfdi2" (define_insn "fix_truncsfdi2"
[(set (match_operand:DI 0 "register_operand" "=e") [(set (match_operand:DI 0 "register_operand" "=e")
...@@ -871,9 +936,9 @@ ...@@ -871,9 +936,9 @@
[(set (match_dup 2) [(set (match_dup 2)
(ge:CC (match_operand:SI 1 "register_operand" "") (const_int 0))) (ge:CC (match_operand:SI 1 "register_operand" "") (const_int 0)))
(set (match_operand:SI 0 "register_operand" "") (set (match_operand:SI 0 "register_operand" "")
(if_then_else:SI (ne:CC (match_dup 2) (const_int 0)) (if_then_else:SI (eq:CC (match_dup 2) (const_int 0))
(match_dup 1) (neg:SI (match_dup 1))
(neg:SI (match_dup 1))))] (match_dup 1)))]
"" ""
" "
{ {
...@@ -1079,9 +1144,9 @@ ...@@ -1079,9 +1144,9 @@
[(set (match_dup 2) [(set (match_dup 2)
(ge:CC (match_operand:DI 1 "register_operand" "") (const_int 0))) (ge:CC (match_operand:DI 1 "register_operand" "") (const_int 0)))
(set (match_operand:DI 0 "register_operand" "") (set (match_operand:DI 0 "register_operand" "")
(if_then_else:DI (ne:CC (match_dup 2) (const_int 0)) (if_then_else:DI (eq:CC (match_dup 2) (const_int 0))
(match_dup 1) (neg:DI (match_dup 1))
(neg:DI (match_dup 1))))] (match_dup 1)))]
"" ""
" "
{ {
...@@ -2076,7 +2141,8 @@ ...@@ -2076,7 +2141,8 @@
(pc)))] (pc)))]
"" ""
"(%I0) br.cond.dpnt %l1" "(%I0) br.cond.dpnt %l1"
[(set_attr "type" "B")]) [(set_attr "type" "B")
(set_attr "predicable" "no")])
(define_insn "*beq_false" (define_insn "*beq_false"
[(set (pc) [(set (pc)
...@@ -2086,7 +2152,8 @@ ...@@ -2086,7 +2152,8 @@
(label_ref (match_operand 1 "" ""))))] (label_ref (match_operand 1 "" ""))))]
"" ""
"(%0) br.cond.dptk %l1" "(%0) br.cond.dptk %l1"
[(set_attr "type" "B")]) [(set_attr "type" "B")
(set_attr "predicable" "no")])
(define_insn "*bne_true" (define_insn "*bne_true"
[(set (pc) [(set (pc)
...@@ -2096,7 +2163,8 @@ ...@@ -2096,7 +2163,8 @@
(pc)))] (pc)))]
"" ""
"(%0) br.cond.dptk %l1" "(%0) br.cond.dptk %l1"
[(set_attr "type" "B")]) [(set_attr "type" "B")
(set_attr "predicable" "no")])
(define_insn "*bne_false" (define_insn "*bne_false"
[(set (pc) [(set (pc)
...@@ -2106,7 +2174,8 @@ ...@@ -2106,7 +2174,8 @@
(label_ref (match_operand 1 "" ""))))] (label_ref (match_operand 1 "" ""))))]
"" ""
"(%I0) br.cond.dpnt %l1" "(%I0) br.cond.dpnt %l1"
[(set_attr "type" "B")]) [(set_attr "type" "B")
(set_attr "predicable" "no")])
;; :::::::::::::::::::: ;; ::::::::::::::::::::
...@@ -2326,195 +2395,222 @@ ...@@ -2326,195 +2395,222 @@
;; DImode if_then_else patterns. ;; DImode if_then_else patterns.
;; ;;
(define_insn "*cmovne_internal" (define_insn "*cmovdi_internal"
[(set (match_operand:DI 0 "register_operand" "=r,r,m,r,r,m,r") [(set (match_operand:DI 0 "register_operand" "=r,r,m,r,r,m,r")
(if_then_else:DI (ne:CC (match_operand:CC 1 "register_operand" "c,c,c,c,c,c,c") (if_then_else:DI
(const_int 0)) (match_operator:CC 4 "predicate_operator"
(match_operand:DI 2 "reg_or_22bit_operand" "0,0,0,rI,m,r,rI") [(match_operand:CC 1 "register_operand" "c,c,c,c,c,c,c")
(match_operand:DI 3 "reg_or_22bit_operand" "rI,m,r,0,0,0,rI")))] (const_int 0)])
(match_operand:DI 2 "reg_or_22bit_operand" "0,0,0,rI,m,r,rI")
(match_operand:DI 3 "reg_or_22bit_operand" "rI,m,r,0,0,0,rI")))]
"" ""
"@ "#"
(%I1) mov %0 = %3
(%I1) ld8%O3 %0 = %3
(%I1) st8%Q0 %0 = %3
(%1) mov %0 = %2
(%1) ld8%O2 %0 = %2
(%1) st8%Q0 %0 = %2
#"
[(set_attr "type" "A,M,M,A,M,M,unknown")]) [(set_attr "type" "A,M,M,A,M,M,unknown")])
(define_split (define_split
[(set (match_operand:DI 0 "register_operand" "") [(set (match_operand:DI 0 "register_operand" "")
(if_then_else:DI (ne:CC (match_operand:CC 1 "register_operand" "") (if_then_else:DI
(const_int 0)) (match_operator:CC 4 "predicate_operator"
(match_operand:DI 2 "reg_or_22bit_operand" "") [(match_operand:CC 1 "register_operand" "")
(match_operand:DI 3 "reg_or_22bit_operand" "")))] (const_int 0)])
(match_operand:DI 2 "reg_or_22bit_operand" "")
(match_operand:DI 3 "reg_or_22bit_operand" "")))]
"(reload_completed "(reload_completed
&& ! rtx_equal_p (operands[0], operands[2]) && (rtx_equal_p (operands[0], operands[2])
&& ! rtx_equal_p (operands[0], operands[3]))" || rtx_equal_p (operands[0], operands[3])))"
[(set (match_dup 0) [(cond_exec
(if_then_else:DI (ne:CC (match_dup 1) (const_int 0)) (match_dup 4)
(match_dup 2) (set (match_dup 0) (match_dup 2)))]
(match_dup 0))) "
(set (match_dup 0) {
(if_then_else:DI (ne:CC (match_dup 1) (const_int 0)) if (rtx_equal_p (operands[0], operands[2]))
(match_dup 0) {
(match_dup 3)))] operands[2] = operands[3];
"") operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[4]) == NE ? EQ : NE,
CCmode, operands[1], const0_rtx);
;; ??? Unknown if this can be matched. }
}")
(define_insn "*cmoveq_internal"
[(set (match_operand:DI 0 "register_operand" "=r,r,m,r,r,m,r")
(if_then_else:DI (eq:CC (match_operand:CC 1 "register_operand" "c,c,c,c,c,c,c")
(const_int 0))
(match_operand:DI 2 "reg_or_22bit_operand" "0,0,0,rI,m,r,rI")
(match_operand:DI 3 "reg_or_22bit_operand" "rI,m,r,0,0,0,rI")))]
""
"@
(%1) mov %0 = %3
(%1) ld8%O3 %0 = %3
(%1) st8%Q0 %0 = %3
(%I1) mov %0 = %2
(%I1) ld8%O2 %0 = %2
(%I1) st8%Q0 %0 = %2
#"
[(set_attr "type" "A,M,M,A,M,M,unknown")])
;; ??? Unknown if this can be matched.
(define_split (define_split
[(set (match_operand:DI 0 "register_operand" "") [(set (match_operand:DI 0 "register_operand" "")
(if_then_else:DI (eq:CC (match_operand:CC 1 "register_operand" "") (if_then_else:DI
(const_int 0)) (match_operator:CC 4 "predicate_operator"
(match_operand:DI 2 "reg_or_22bit_operand" "") [(match_operand:CC 1 "register_operand" "")
(match_operand:DI 3 "reg_or_22bit_operand" "")))] (const_int 0)])
"(reload_completed (match_operand:DI 2 "reg_or_22bit_operand" "")
&& ! rtx_equal_p (operands[0], operands[2]) (match_operand:DI 3 "reg_or_22bit_operand" "")))]
&& ! rtx_equal_p (operands[0], operands[3]))" "reload_completed"
[(set (match_dup 0) [(cond_exec
(if_then_else:DI (eq:CC (match_dup 1) (const_int 0)) (match_dup 4)
(match_dup 2) (set (match_dup 0) (match_dup 2)))
(match_dup 0))) (cond_exec
(set (match_dup 0) (match_dup 5)
(if_then_else:DI (eq:CC (match_dup 1) (const_int 0)) (set (match_dup 0) (match_dup 3)))]
(match_dup 0) "
(match_dup 3)))] {
"") operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[4]) == NE ? EQ : NE,
CCmode, operands[1], const0_rtx);
}")
;; Absolute value pattern. ;; Absolute value pattern.
(define_insn "*absdi2_internal" (define_insn "*absdi2_internal"
[(set (match_operand:DI 0 "register_operand" "=r,r") [(set (match_operand:DI 0 "register_operand" "=r,r")
(if_then_else:DI (ne:CC (match_operand:CC 1 "register_operand" "c,c") (if_then_else:DI
(const_int 0)) (match_operator:CC 4 "predicate_operator"
(match_operand:DI 2 "reg_or_22bit_operand" "0,rI") [(match_operand:CC 1 "register_operand" "c,c")
(neg:DI (match_operand:DI 3 "reg_or_22bit_operand" "rI,rI"))))] (const_int 0)])
(neg:DI (match_operand:DI 2 "reg_or_22bit_operand" "rI,rI"))
(match_operand:DI 3 "reg_or_22bit_operand" "0,rI")))]
"" ""
"@ "#"
(%I1) sub %0 = r0, %3
#"
[(set_attr "type" "A,unknown")]) [(set_attr "type" "A,unknown")])
(define_split (define_split
[(set (match_operand:DI 0 "register_operand" "") [(set (match_operand:DI 0 "register_operand" "")
(if_then_else:DI (ne:CC (match_operand:CC 1 "register_operand" "") (if_then_else:DI
(const_int 0)) (match_operator:CC 4 "predicate_operator"
(match_operand:DI 2 "reg_or_22bit_operand" "") [(match_operand:CC 1 "register_operand" "c,c")
(neg:DI (match_operand:DI 3 "reg_or_22bit_operand" ""))))] (const_int 0)])
"reload_completed && ! rtx_equal_p (operands[0], operands[2])" (neg:DI (match_operand:DI 2 "reg_or_22bit_operand" ""))
[(set (match_dup 0) (match_operand:DI 3 "reg_or_22bit_operand" "")))]
(if_then_else:DI (ne:CC (match_dup 1) (const_int 0)) "reload_completed && rtx_equal_p (operands[0], operands[3])"
(match_dup 2) [(cond_exec
(match_dup 0))) (match_dup 4)
(set (match_dup 0) (set (match_dup 0)
(if_then_else:DI (ne:CC (match_dup 1) (const_int 0)) (neg:DI (match_dup 2))))]
(match_dup 0)
(neg:DI (match_dup 3))))]
"") "")
;; ??? Unknown if this can be generated. If so, then add a define_split as (define_split
;; above. [(set (match_operand:DI 0 "register_operand" "")
(if_then_else:DI
(define_insn "*absdi2_not_internal" (match_operator:CC 4 "predicate_operator"
[(set (match_operand:DI 0 "register_operand" "=r,r") [(match_operand:CC 1 "register_operand" "c,c")
(if_then_else:DI (ne:CC (match_operand:CC 1 "register_operand" "c,c") (const_int 0)])
(const_int 0)) (neg:DI (match_operand:DI 2 "reg_or_22bit_operand" ""))
(neg:DI (match_operand:DI 2 "reg_or_22bit_operand" "rI,rI")) (match_operand:DI 3 "reg_or_22bit_operand" "")))]
(match_operand:DI 3 "reg_or_22bit_operand" "0,rI")))] "reload_completed"
"" [(cond_exec
"*abort ();" (match_dup 4)
[(set_attr "type" "unknown")]) (set (match_dup 0) (neg:DI (match_dup 2))))
(cond_exec
(match_dup 5)
(set (match_dup 0) (match_dup 3)))]
"
{
operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[4]) == NE ? EQ : NE,
CCmode, operands[1], const0_rtx);
}")
;; ;;
;; SImode if_then_else patterns. ;; SImode if_then_else patterns.
;; ;;
(define_insn "*cmovnesi_internal" (define_insn "*cmovsi_internal"
[(set (match_operand:SI 0 "register_operand" "=r,r,m,r,r,m,r") [(set (match_operand:SI 0 "register_operand" "=r,r,m,r,r,m,r")
(if_then_else:SI (ne:CC (match_operand:CC 1 "register_operand" "c,c,c,c,c,c,c") (if_then_else:SI
(const_int 0)) (match_operator:CC 4 "predicate_operator"
(match_operand:SI 2 "reg_or_22bit_operand" "0,0,0,rI,m,r,rI") [(match_operand:CC 1 "register_operand" "c,c,c,c,c,c,c")
(match_operand:SI 3 "reg_or_22bit_operand" "rI,m,r,0,0,0,rI")))] (const_int 0)])
(match_operand:SI 2 "reg_or_22bit_operand" "0,0,0,rI,m,r,rI")
(match_operand:SI 3 "reg_or_22bit_operand" "rI,m,r,0,0,0,rI")))]
"" ""
"@ "#"
(%I1) mov %0 = %3
(%I1) ld4%O3 %0 = %3
(%I1) st4%Q0 %0 = %3
(%1) mov %0 = %2
(%1) ld4%O2 %0 = %2
(%1) st4%Q0 %0 = %2
#"
[(set_attr "type" "A,M,M,A,M,M,unknown")]) [(set_attr "type" "A,M,M,A,M,M,unknown")])
(define_split (define_split
[(set (match_operand:SI 0 "register_operand" "") [(set (match_operand:SI 0 "register_operand" "")
(if_then_else:SI (ne:CC (match_operand:CC 1 "register_operand" "") (if_then_else:SI
(const_int 0)) (match_operator:CC 4 "predicate_operator"
(match_operand:SI 2 "reg_or_22bit_operand" "") [(match_operand:CC 1 "register_operand" "")
(match_operand:SI 3 "reg_or_22bit_operand" "")))] (const_int 0)])
(match_operand:SI 2 "reg_or_22bit_operand" "")
(match_operand:SI 3 "reg_or_22bit_operand" "")))]
"(reload_completed "(reload_completed
&& ! rtx_equal_p (operands[0], operands[2]) && (rtx_equal_p (operands[0], operands[2])
&& ! rtx_equal_p (operands[0], operands[3]))" || rtx_equal_p (operands[0], operands[3])))"
[(set (match_dup 0) [(cond_exec
(if_then_else:SI (ne:CC (match_dup 1) (const_int 0)) (match_dup 4)
(match_dup 2) (set (match_dup 0) (match_dup 2)))]
(match_dup 0))) "
(set (match_dup 0) {
(if_then_else:SI (ne:CC (match_dup 1) (const_int 0)) if (rtx_equal_p (operands[0], operands[2]))
(match_dup 0) {
(match_dup 3)))] operands[2] = operands[3];
"") operands[4] = gen_rtx_fmt_ee (GET_CODE (operands[4]) == NE ? EQ : NE,
CCmode, operands[1], const0_rtx);
}
}")
(define_split
[(set (match_operand:SI 0 "register_operand" "")
(if_then_else:SI
(match_operator:CC 4 "predicate_operator"
[(match_operand:CC 1 "register_operand" "")
(const_int 0)])
(match_operand:SI 2 "reg_or_22bit_operand" "")
(match_operand:SI 3 "reg_or_22bit_operand" "")))]
"reload_completed"
[(cond_exec
(match_dup 4)
(set (match_dup 0) (match_dup 2)))
(cond_exec
(match_dup 5)
(set (match_dup 0) (match_dup 3)))]
"
{
operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[4]) == NE ? EQ : NE,
CCmode, operands[1], const0_rtx);
}")
(define_insn "*abssi2_internal" (define_insn "*abssi2_internal"
[(set (match_operand:SI 0 "register_operand" "=r,r") [(set (match_operand:SI 0 "register_operand" "=r,r")
(if_then_else:SI (ne:CC (match_operand:CC 1 "register_operand" "c,c") (if_then_else:SI
(const_int 0)) (match_operator:CC 4 "predicate_operator"
(match_operand:SI 2 "reg_or_22bit_operand" "0,rI") [(match_operand:CC 1 "register_operand" "c,c")
(neg:SI (match_operand:SI 3 "reg_or_22bit_operand" "rI,rI"))))] (const_int 0)])
(neg:SI (match_operand:SI 3 "reg_or_22bit_operand" "rI,rI"))
(match_operand:SI 2 "reg_or_22bit_operand" "0,rI")))]
"" ""
"@ "#"
(%I1) sub %0 = r0, %3
#"
[(set_attr "type" "A,unknown")]) [(set_attr "type" "A,unknown")])
(define_split (define_split
[(set (match_operand:SI 0 "register_operand" "") [(set (match_operand:SI 0 "register_operand" "")
(if_then_else:SI (ne:CC (match_operand:CC 1 "register_operand" "") (if_then_else:SI
(const_int 0)) (match_operator:CC 4 "predicate_operator"
(match_operand:SI 2 "reg_or_22bit_operand" "") [(match_operand:CC 1 "register_operand" "c,c")
(neg:SI (match_operand:SI 3 "reg_or_22bit_operand" ""))))] (const_int 0)])
"reload_completed && ! rtx_equal_p (operands[0], operands[2])" (neg:SI (match_operand:SI 2 "reg_or_22bit_operand" ""))
[(set (match_dup 0) (match_operand:SI 3 "reg_or_22bit_operand" "")))]
(if_then_else:SI (ne:CC (match_dup 1) (const_int 0)) "reload_completed && rtx_equal_p (operands[0], operands[3])"
(match_dup 2) [(cond_exec
(match_dup 0))) (match_dup 4)
(set (match_dup 0) (set (match_dup 0)
(if_then_else:SI (ne:CC (match_dup 1) (const_int 0)) (neg:SI (match_dup 2))))]
(match_dup 0)
(neg:SI (match_dup 3))))]
"") "")
(define_split
[(set (match_operand:SI 0 "register_operand" "")
(if_then_else:SI
(match_operator:CC 4 "predicate_operator"
[(match_operand:CC 1 "register_operand" "c,c")
(const_int 0)])
(neg:SI (match_operand:SI 2 "reg_or_22bit_operand" ""))
(match_operand:SI 3 "reg_or_22bit_operand" "")))]
"reload_completed"
[(cond_exec
(match_dup 4)
(set (match_dup 0) (neg:SI (match_dup 2))))
(cond_exec
(match_dup 5)
(set (match_dup 0) (match_dup 3)))]
"
{
operands[5] = gen_rtx_fmt_ee (GET_CODE (operands[4]) == NE ? EQ : NE,
CCmode, operands[1], const0_rtx);
}")
;; :::::::::::::::::::: ;; ::::::::::::::::::::
;; :: ;; ::
...@@ -2912,7 +3008,8 @@ ...@@ -2912,7 +3008,8 @@
(pc)))] (pc)))]
"ia64_direct_return ()" "ia64_direct_return ()"
"(%I0) br.ret.sptk.many rp" "(%I0) br.ret.sptk.many rp"
[(set_attr "type" "B")]) [(set_attr "type" "B")
(set_attr "predicable" "no")])
(define_insn "*eq_not_return" (define_insn "*eq_not_return"
[(set (pc) [(set (pc)
...@@ -2922,7 +3019,8 @@ ...@@ -2922,7 +3019,8 @@
(return)))] (return)))]
"ia64_direct_return ()" "ia64_direct_return ()"
"(%0) br.ret.sptk.many rp" "(%0) br.ret.sptk.many rp"
[(set_attr "type" "B")]) [(set_attr "type" "B")
(set_attr "predicable" "no")])
(define_insn "*ne_return" (define_insn "*ne_return"
[(set (pc) [(set (pc)
...@@ -2932,7 +3030,8 @@ ...@@ -2932,7 +3030,8 @@
(pc)))] (pc)))]
"ia64_direct_return ()" "ia64_direct_return ()"
"(%0) br.ret.sptk.many rp" "(%0) br.ret.sptk.many rp"
[(set_attr "type" "B")]) [(set_attr "type" "B")
(set_attr "predicable" "no")])
(define_insn "*ne_not_return" (define_insn "*ne_not_return"
[(set (pc) [(set (pc)
...@@ -2942,7 +3041,8 @@ ...@@ -2942,7 +3041,8 @@
(return)))] (return)))]
"ia64_direct_return ()" "ia64_direct_return ()"
"(%I0) br.ret.sptk.many rp" "(%I0) br.ret.sptk.many rp"
[(set_attr "type" "B")]) [(set_attr "type" "B")
(set_attr "predicable" "no")])
(define_insn "jump" (define_insn "jump"
[(set (pc) (label_ref (match_operand 0 "" "")))] [(set (pc) (label_ref (match_operand 0 "" "")))]
...@@ -3041,7 +3141,8 @@ ...@@ -3041,7 +3141,8 @@
(use (match_operand:DI 4 "const_int_operand" "i"))] (use (match_operand:DI 4 "const_int_operand" "i"))]
"" ""
"alloc %0 = ar.pfs, %1, %2, %3, %4" "alloc %0 = ar.pfs, %1, %2, %3, %4"
[(set_attr "type" "M")]) [(set_attr "type" "M")
(set_attr "predicable" "no")])
(define_insn "gr_spill" (define_insn "gr_spill"
[(set (match_operand:DI 0 "memory_operand" "=m") [(set (match_operand:DI 0 "memory_operand" "=m")
...@@ -3138,7 +3239,8 @@ ...@@ -3138,7 +3239,8 @@
invala\; \ invala\; \
;;\; \ ;;\; \
mov ar.rsc=r19\;" mov ar.rsc=r19\;"
[(set_attr "type" "I")]) [(set_attr "type" "unknown")
(set_attr "predicable" "no")])
;; :::::::::::::::::::: ;; ::::::::::::::::::::
;; :: ;; ::
...@@ -3162,13 +3264,15 @@ ...@@ -3162,13 +3264,15 @@
[(unspec_volatile [(const_int 0)] 1)] [(unspec_volatile [(const_int 0)] 1)]
"" ""
"" ""
[(set_attr "type" "unknown")]) [(set_attr "type" "unknown")
(set_attr "predicable" "no")])
(define_insn "insn_group_barrier" (define_insn "insn_group_barrier"
[(unspec_volatile [(const_int 0)] 2)] [(unspec_volatile [(const_int 0)] 2)]
"" ""
";;" ";;"
[(set_attr "type" "S")]) [(set_attr "type" "S")
(set_attr "predicable" "no")])
;; Non-local goto support. ;; Non-local goto support.
...@@ -3259,7 +3363,8 @@ ...@@ -3259,7 +3363,8 @@
[(unspec_volatile [(match_operand:DI 0 "register_operand" "=&r")] 3)] [(unspec_volatile [(match_operand:DI 0 "register_operand" "=&r")] 3)]
"" ""
"fc %0\;;;\;adds %0=31,%0\;;;\;fc %0\;;;\;sync.i\;srlz.i" "fc %0\;;;\;adds %0=31,%0\;;;\;fc %0\;;;\;sync.i\;srlz.i"
[(set_attr "type" "unknown")]) [(set_attr "type" "unknown")
(set_attr "predicable" "no")])
;; Builtin apply support. ;; Builtin apply support.
...@@ -3694,3 +3799,12 @@ ...@@ -3694,3 +3799,12 @@
ia64_expand_op_and_fetch (IA64_NAND_OP, SImode, operands); ia64_expand_op_and_fetch (IA64_NAND_OP, SImode, operands);
DONE; DONE;
}") }")
;; Predication.
(define_cond_exec
[(match_operator 0 "predicate_operator"
[(match_operand:CC 1 "register_operand" "c")
(const_int 0)])]
""
"(%J0)")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment