From ac8b093b92df7a4f661872c26b6a58f009735c02 Mon Sep 17 00:00:00 2001 From: ian Date: Tue, 14 Oct 2003 02:17:47 +0000 Subject: [PATCH] * config/arm/iwmmxt.md (cond_iwmmxt_movsi_insn): New pattern. * config/arm/arm.md: For splits which rely on conditional moves, remove ! TARGET_IWMMXT condition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72456 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/arm.md | 20 ++++---------------- gcc/config/arm/iwmmxt.md | 31 ++++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 81d9bd9..61ce6a8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-10-13 Ian Lance Taylor + + * config/arm/iwmmxt.md (cond_iwmmxt_movsi_insn): New pattern. + * config/arm/arm.md: For splits which rely on conditional moves, + remove ! TARGET_IWMMXT condition. + 2003-10-13 David S. Miller * ifcvt.c (num_removed_blocks): Rename to num_true_changes. diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 177d54b..7ef928e 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -8522,10 +8522,7 @@ (match_dup 0) (match_operand 4 "" ""))) (clobber (reg:CC CC_REGNUM))] - ;; Note we have to suppress this split for the iwmmxt because it - ;; creates a conditional movsi and the iwmmxt_movsi_insn pattern - ;; is not predicable. This sucks. - "TARGET_ARM && reload_completed && ! TARGET_IWMMXT" + "TARGET_ARM && reload_completed" [(set (match_dup 5) (match_dup 6)) (cond_exec (match_dup 7) (set (match_dup 0) (match_dup 4)))] @@ -8553,10 +8550,7 @@ (match_operand 4 "" "") (match_dup 0))) (clobber (reg:CC CC_REGNUM))] - ;; Note we have to suppress this split for the iwmmxt because it - ;; creates a conditional movsi and the iwmmxt_movsi_insn pattern - ;; is not predicable. This sucks. - "TARGET_ARM && reload_completed && ! TARGET_IWMMXT" + "TARGET_ARM && reload_completed" [(set (match_dup 5) (match_dup 6)) (cond_exec (match_op_dup 1 [(match_dup 5) (const_int 0)]) (set (match_dup 0) (match_dup 4)))] @@ -8577,10 +8571,7 @@ (match_operand 4 "" "") (match_operand 5 "" ""))) (clobber (reg:CC CC_REGNUM))] - ;; Note we have to suppress this split for the iwmmxt because it - ;; creates a conditional movsi and the iwmmxt_movsi_insn pattern - ;; is not predicable. This sucks. - "TARGET_ARM && reload_completed && ! TARGET_IWMMXT" + "TARGET_ARM && reload_completed" [(set (match_dup 6) (match_dup 7)) (cond_exec (match_op_dup 1 [(match_dup 6) (const_int 0)]) (set (match_dup 0) (match_dup 4))) @@ -8612,10 +8603,7 @@ (not:SI (match_operand:SI 5 "s_register_operand" "")))) (clobber (reg:CC CC_REGNUM))] - ;; Note we have to suppress this split for the iwmmxt because it - ;; creates a conditional movsi and the iwmmxt_movsi_insn pattern - ;; is not predicable. This sucks. - "TARGET_ARM && reload_completed && ! TARGET_IWMMXT" + "TARGET_ARM && reload_completed" [(set (match_dup 6) (match_dup 7)) (cond_exec (match_op_dup 1 [(match_dup 6) (const_int 0)]) (set (match_dup 0) (match_dup 4))) diff --git a/gcc/config/arm/iwmmxt.md b/gcc/config/arm/iwmmxt.md index f9ef521..f8070a8 100644 --- a/gcc/config/arm/iwmmxt.md +++ b/gcc/config/arm/iwmmxt.md @@ -116,7 +116,8 @@ (set_attr "neg_pool_range" "*,*,4084, *,*,*, *, 1012,*") ;; Note - the "predicable" attribute is not allowed to have alternatives. ;; Since the wSTRw wCx instruction is not predicable, we cannot support - ;; predicating any of the alternatives in this template. This sucks. + ;; predicating any of the alternatives in this template. Instead, + ;; we do the predication ourselves, in cond_iwmmxt_movsi_insn. (set_attr "predicable" "no") ;; Also - we have to pretend that these insns clobber the condition code ;; bits as otherwise arm_final_prescan_insn() will try to conditionalize @@ -124,6 +125,34 @@ (set_attr "conds" "clob")] ) +;; Because iwmmxt_movsi_insn is not predicable, we provide the +;; cond_exec version explicitly, with appropriate constraints. + +(define_insn "*cond_iwmmxt_movsi_insn" + [(cond_exec + (match_operator 2 "arm_comparison_operator" + [(match_operand 3 "cc_register" "") + (const_int 0)]) + (set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r, m,z,r") + (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,z")))] + "TARGET_REALLY_IWMMXT + && ( register_operand (operands[0], SImode) + || register_operand (operands[1], SImode))" + "* + switch (which_alternative) + { + case 0: return \"mov%?\\t%0, %1\"; + case 1: return \"mvn%?\\t%0, #%B1\"; + case 2: return \"ldr%?\\t%0, %1\"; + case 3: return \"str%?\\t%1, %0\"; + case 4: return \"tmcr%?\\t%0, %1\"; + default: return \"tmrc%?\\t%0, %1\"; + }" + [(set_attr "type" "*,*,load,store1,*,*") + (set_attr "pool_range" "*,*,4096, *,*,*") + (set_attr "neg_pool_range" "*,*,4084, *,*,*")] +) + (define_insn "movv8qi_internal" [(set (match_operand:V8QI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r") (match_operand:V8QI 1 "general_operand" "y,y,m,y,r,i"))] -- 2.7.4