From 1a27522615276224fb32f46e9627eef0a9ea30d0 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 29 Jan 2002 05:10:13 +0000 Subject: [PATCH] h8300-protos.h: Update the prototype of output_a_shift. * config/h8300/h8300-protos.h: Update the prototype of output_a_shift. * config/h8300/h8300.c (output_a_shift): Remove an unused argument 'insn'. Remove redundant code. * config/h8300/h8300.md: Adust to the new prototype of output_a_shift. From-SVN: r49310 --- gcc/ChangeLog | 9 ++++++++ gcc/config/h8300/h8300-protos.h | 2 +- gcc/config/h8300/h8300.c | 37 +++++++++++++-------------------- gcc/config/h8300/h8300.md | 6 +++--- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ece5c2d7f08..73370c32e8d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-01-29 Kazu Hirata + + * config/h8300/h8300-protos.h: Update the prototype of + output_a_shift. + * config/h8300/h8300.c (output_a_shift): Remove an unused + argument 'insn'. Remove redundant code. + * config/h8300/h8300.md: Adust to the new prototype of + output_a_shift. + 2002-01-29 Kazu Hirata * config/h8300/h8300-protos.h: Update the prototypes of diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h index 94f94faed91..67f0ed9bf86 100644 --- a/gcc/config/h8300/h8300-protos.h +++ b/gcc/config/h8300/h8300-protos.h @@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */ /* Declarations for functions used in insn-output.c. */ #ifdef RTX_CODE -extern const char *output_a_shift PARAMS ((rtx, rtx *)); +extern const char *output_a_shift PARAMS ((rtx *)); extern const char *emit_a_rotate PARAMS ((enum rtx_code, rtx *)); extern const char *output_simode_bld PARAMS ((int, rtx[])); extern void print_operand_address PARAMS ((FILE *, rtx)); diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 603074b594a..e9962092b62 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -2431,8 +2431,7 @@ get_shift_alg (shift_type, shift_mode, count, info) /* Emit the assembler code for doing shifts. */ const char * -output_a_shift (insn, operands) - rtx insn ATTRIBUTE_UNUSED; +output_a_shift (operands) rtx *operands; { static int loopend_lab; @@ -2517,18 +2516,15 @@ output_a_shift (insn, operands) n = info.remainder; /* Emit two bit shifts first. */ - while (n > 1 && info.shift2 != NULL) + if (info.shift2 != NULL) { - output_asm_insn (info.shift2, operands); - n -= 2; + for (; n > 1; n -= 2) + output_asm_insn (info.shift2, operands); } /* Now emit one bit shifts for any residual. */ - while (n > 0) - { - output_asm_insn (info.shift1, operands); - n -= 1; - } + for (; n > 0; n--) + output_asm_insn (info.shift1, operands); /* Keep track of CC. */ if (info.cc_valid_p) @@ -2542,8 +2538,8 @@ output_a_shift (insn, operands) { int m = GET_MODE_BITSIZE (mode) - n; int mask = (shift_type == SHIFT_ASHIFT - ? ((1 << (GET_MODE_BITSIZE (mode) - n)) - 1) << n - : (1 << (GET_MODE_BITSIZE (mode) - n)) - 1); + ? ((1 << m) - 1) << n + : (1 << m) - 1); char insn_buf[200]; /* Not all possibilities of rotate are supported. They shouldn't @@ -2552,18 +2548,15 @@ output_a_shift (insn, operands) abort (); /* Emit two bit rotates first. */ - while (m > 1 && info.shift2 != NULL) + if (info.shift2 != NULL) { - output_asm_insn (info.shift2, operands); - m -= 2; + for (; m > 1; m -= 2) + output_asm_insn (info.shift2, operands); } /* Now single bit rotates for any residual. */ - while (m > 0) - { - output_asm_insn (info.shift1, operands); - m -= 1; - } + for (; m > 0; m--) + output_asm_insn (info.shift1, operands); /* Now mask off the high bits. */ if (TARGET_H8300) @@ -2579,10 +2572,8 @@ output_a_shift (insn, operands) sprintf (insn_buf, "and\t#%d,%%s0\n\tand\t#%d,%%t0", mask & 255, mask >> 8); break; - case SImode: - abort (); default: - break; + abort (); } } else diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 4e862131962..f67e22e303a 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -1837,7 +1837,7 @@ (match_operand:QI 2 "nonmemory_operand" "KM,rn")])) (clobber (match_scratch:QI 4 "=X,&r"))] "" - "* return output_a_shift (insn, operands);" + "* return output_a_shift (operands);" [(set_attr "length" "20") (set_attr "cc" "clobber")]) @@ -1871,7 +1871,7 @@ (match_operand:QI 2 "nonmemory_operand" "KM,rn")])) (clobber (match_scratch:QI 4 "=X,&r"))] "" - "* return output_a_shift (insn, operands);" + "* return output_a_shift (operands);" [(set_attr "length" "20") (set_attr "cc" "clobber")]) @@ -1908,7 +1908,7 @@ (match_operand:QI 2 "nonmemory_operand" "K,rn")])) (clobber (match_scratch:QI 4 "=X,&r"))] "" - "* return output_a_shift (insn, operands);" + "* return output_a_shift (operands);" [(set_attr "length" "20") (set_attr "cc" "clobber")])