diff options
-rw-r--r-- | ChangeLog.csl | 9 | ||||
-rw-r--r-- | gcc/config/arm/arm-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 21 | ||||
-rw-r--r-- | gcc/config/arm/arm.md | 6 | ||||
-rw-r--r-- | gcc/config/arm/thumb2.md | 2 |
5 files changed, 26 insertions, 14 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl index 3c0e97498d1..0e152a8019f 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,12 @@ +2006-03-30 Paul Brook <paul@codesourcery.com> + + * gcc/config/arm/arm.c (arm_output_shift): Change set_flags to + tristate option. Use modified shift value. + * gcc/config/arm/thumb2.md (thumb2_shiftsi3_short): Use + arm_output_shift. + * gcc/config/arm/arm.md (arm_shiftsi3, shiftsi3_compare0, + shiftsi3_compare0_scratch): Adjust arguments to arm_output_shift. + 2006-03-29 Paul Brook <paul@codesourcery.com> * gcc/config/arm/vfp.md (movsf_vfp): Disparage w<->r alternatives. diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index cc4c8388037..ab30847dc0e 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -125,7 +125,7 @@ extern const char * arm_output_load_gr (rtx *); extern const char *vfp_output_fstmx (rtx *); extern void arm_set_return_address (rtx, rtx); extern int arm_eliminable_register (rtx); -extern const char *arm_output_shift(rtx *, bool); +extern const char *arm_output_shift(rtx *, int); extern bool arm_output_addr_const_extra (FILE *, rtx); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index fdf1bf2bb68..7536c635045 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -16193,26 +16193,29 @@ arm_output_addr_const_extra (FILE *fp, rtx x) return FALSE; } -/* Output assembly for a shift instruction. SET_FLAGS is TRUE if the - instruction modifies the condition codes. */ +/* Output assembly for a shift instruction. + SET_FLAGS determines how the instruction modifies the condition codes. + 0 - Do not set conditiona codes. + 1 - Set condition codes. + 2 - Use smallest instruction. */ const char * -arm_output_shift(rtx * operands, bool set_flags) +arm_output_shift(rtx * operands, int set_flags) { char pattern[100]; + static const char flag_chars[3] = {'.', '?', '!'}; const char *shift; HOST_WIDE_INT val; char c; - if (set_flags) - c = '.'; - else - c = '?'; - + c = flag_chars[set_flags]; if (TARGET_UNIFIED_ASM) { shift = shift_op(operands[3], &val); if (shift) - sprintf (pattern, "%s%%%c\t%%0, %%1, %%2", shift, c); + { + operands[2] = GEN_INT(val); + sprintf (pattern, "%s%%%c\t%%0, %%1, %%2", shift, c); + } else sprintf (pattern, "mov%%%c\t%%0, %%1", c); } diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index bbbc7e0362f..9ea76e5fe4d 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -2903,7 +2903,7 @@ [(match_operand:SI 1 "s_register_operand" "r") (match_operand:SI 2 "reg_or_int_operand" "rM")]))] "TARGET_32BIT" - "* return arm_output_shift(operands, false);" + "* return arm_output_shift(operands, 0);" [(set_attr "predicable" "yes") (set_attr "shift" "1") (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") @@ -2920,7 +2920,7 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (match_op_dup 3 [(match_dup 1) (match_dup 2)]))] "TARGET_32BIT" - "* return arm_output_shift(operands, true);" + "* return arm_output_shift(operands, 1);" [(set_attr "conds" "set") (set_attr "shift" "1") (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") @@ -2936,7 +2936,7 @@ (const_int 0))) (clobber (match_scratch:SI 0 "=r"))] "TARGET_32BIT" - "* return arm_output_shift(operands, true);" + "* return arm_output_shift(operands, 1);" [(set_attr "conds" "set") (set_attr "shift" "1")] ) diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md index 5199216faa7..5299b8d8f68 100644 --- a/gcc/config/arm/thumb2.md +++ b/gcc/config/arm/thumb2.md @@ -1020,7 +1020,7 @@ (match_operand:SI 2 "low_reg_or_int_operand" "lM")])) (clobber (reg:CC CC_REGNUM))] "TARGET_THUMB2 && reload_completed" - "%I3%!\\t%0, %1, %2" + "* return arm_output_shift(operands, 2);" [(set_attr "predicable" "yes") (set_attr "shift" "1") (set_attr "length" "2") |