2010-08-27 Paul Brook gcc/ * config/arm/thumb2.md (thumb_andsi_not_shiftsi_si, thumb2_notsi_shiftsi, thumb2_notsi_shiftsi_compare0, thumb2_not_shiftsi_compare0_scratch, thumb2_cmpsi_shiftsi, thumb2_cmpsi_shiftsi_swp, thumb2_cmpsi_neg_shiftsi, thumb2_arith_shiftsi, thumb2_arith_shiftsi_compare0, thumb2_arith_shiftsi_compare0_scratch, thumb2_sub_shiftsi, thumb2_sub_shiftsi_compare0, thumb2_sub_shiftsi_compare0_scratch): Use const_shift_count predicate for "M" constraints. * config/arm/predicates.md (const_shift_operand): Remove. (const_shift_count): New. gcc/testsuite/ * gcc.dg/long-long-shift-1.c: New test. 2010-08-26 Paul Brook Merge from Sourcery G++ 4.3/4.4: === modified file 'gcc/config/arm/predicates.md' --- old/gcc/config/arm/predicates.md 2010-08-12 13:35:39 +0000 +++ new/gcc/config/arm/predicates.md 2010-08-31 09:40:16 +0000 @@ -318,10 +318,9 @@ (and (match_code "reg,subreg,mem") (match_operand 0 "nonimmediate_soft_df_operand")))) -(define_predicate "const_shift_operand" +(define_predicate "const_shift_count" (and (match_code "const_int") - (ior (match_operand 0 "power_of_two_operand") - (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)) < 32")))) + (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)) < 32"))) (define_special_predicate "load_multiple_operation" === modified file 'gcc/config/arm/thumb2.md' --- old/gcc/config/arm/thumb2.md 2010-08-13 16:00:58 +0000 +++ new/gcc/config/arm/thumb2.md 2010-08-31 09:40:16 +0000 @@ -55,7 +55,7 @@ [(set (match_operand:SI 0 "s_register_operand" "=r") (and:SI (not:SI (match_operator:SI 4 "shift_operator" [(match_operand:SI 2 "s_register_operand" "r") - (match_operand:SI 3 "const_int_operand" "M")])) + (match_operand:SI 3 "const_shift_count" "M")])) (match_operand:SI 1 "s_register_operand" "r")))] "TARGET_THUMB2" "bic%?\\t%0, %1, %2%S4" @@ -124,7 +124,7 @@ [(set (match_operand:SI 0 "s_register_operand" "=r") (not:SI (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r") - (match_operand:SI 2 "const_int_operand" "M")])))] + (match_operand:SI 2 "const_shift_count" "M")])))] "TARGET_THUMB2" "mvn%?\\t%0, %1%S3" [(set_attr "predicable" "yes") @@ -136,7 +136,7 @@ [(set (reg:CC_NOOV CC_REGNUM) (compare:CC_NOOV (not:SI (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r") - (match_operand:SI 2 "const_int_operand" "M")])) + (match_operand:SI 2 "const_shift_count" "M")])) (const_int 0))) (set (match_operand:SI 0 "s_register_operand" "=r") (not:SI (match_op_dup 3 [(match_dup 1) (match_dup 2)])))] @@ -151,7 +151,7 @@ [(set (reg:CC_NOOV CC_REGNUM) (compare:CC_NOOV (not:SI (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r") - (match_operand:SI 2 "const_int_operand" "M")])) + (match_operand:SI 2 "const_shift_count" "M")])) (const_int 0))) (clobber (match_scratch:SI 0 "=r"))] "TARGET_THUMB2" @@ -328,7 +328,7 @@ (compare:CC (match_operand:SI 0 "s_register_operand" "r") (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r") - (match_operand:SI 2 "const_int_operand" "M")])))] + (match_operand:SI 2 "const_shift_count" "M")])))] "TARGET_THUMB2" "cmp%?\\t%0, %1%S3" [(set_attr "conds" "set") @@ -340,7 +340,7 @@ [(set (reg:CC_SWP CC_REGNUM) (compare:CC_SWP (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r") - (match_operand:SI 2 "const_int_operand" "M")]) + (match_operand:SI 2 "const_shift_count" "M")]) (match_operand:SI 0 "s_register_operand" "r")))] "TARGET_THUMB2" "cmp%?\\t%0, %1%S3" @@ -354,7 +354,7 @@ (compare:CC (match_operand:SI 0 "s_register_operand" "r") (neg:SI (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r") - (match_operand:SI 2 "const_int_operand" "M")]))))] + (match_operand:SI 2 "const_shift_count" "M")]))))] "TARGET_THUMB2" "cmn%?\\t%0, %1%S3" [(set_attr "conds" "set") @@ -466,7 +466,7 @@ (match_operator:SI 1 "shiftable_operator" [(match_operator:SI 3 "shift_operator" [(match_operand:SI 4 "s_register_operand" "r") - (match_operand:SI 5 "const_int_operand" "M")]) + (match_operand:SI 5 "const_shift_count" "M")]) (match_operand:SI 2 "s_register_operand" "r")]))] "TARGET_THUMB2" "%i1%?\\t%0, %2, %4%S3" @@ -499,7 +499,7 @@ (compare:CC_NOOV (match_operator:SI 1 "shiftable_operator" [(match_operator:SI 3 "shift_operator" [(match_operand:SI 4 "s_register_operand" "r") - (match_operand:SI 5 "const_int_operand" "M")]) + (match_operand:SI 5 "const_shift_count" "M")]) (match_operand:SI 2 "s_register_operand" "r")]) (const_int 0))) (set (match_operand:SI 0 "s_register_operand" "=r") @@ -517,7 +517,7 @@ (compare:CC_NOOV (match_operator:SI 1 "shiftable_operator" [(match_operator:SI 3 "shift_operator" [(match_operand:SI 4 "s_register_operand" "r") - (match_operand:SI 5 "const_int_operand" "M")]) + (match_operand:SI 5 "const_shift_count" "M")]) (match_operand:SI 2 "s_register_operand" "r")]) (const_int 0))) (clobber (match_scratch:SI 0 "=r"))] @@ -533,7 +533,7 @@ (minus:SI (match_operand:SI 1 "s_register_operand" "r") (match_operator:SI 2 "shift_operator" [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_int_operand" "M")])))] + (match_operand:SI 4 "const_shift_count" "M")])))] "TARGET_THUMB2" "sub%?\\t%0, %1, %3%S2" [(set_attr "predicable" "yes") @@ -547,7 +547,7 @@ (minus:SI (match_operand:SI 1 "s_register_operand" "r") (match_operator:SI 2 "shift_operator" [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_int_operand" "M")])) + (match_operand:SI 4 "const_shift_count" "M")])) (const_int 0))) (set (match_operand:SI 0 "s_register_operand" "=r") (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) @@ -565,7 +565,7 @@ (minus:SI (match_operand:SI 1 "s_register_operand" "r") (match_operator:SI 2 "shift_operator" [(match_operand:SI 3 "s_register_operand" "r") - (match_operand:SI 4 "const_int_operand" "M")])) + (match_operand:SI 4 "const_shift_count" "M")])) (const_int 0))) (clobber (match_scratch:SI 0 "=r"))] "TARGET_THUMB2"