Commit 1a275226 by Kazu Hirata Committed by Kazu Hirata

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
parent a11d9dfc
2002-01-29 Kazu Hirata <kazu@hxi.com> 2002-01-29 Kazu Hirata <kazu@hxi.com>
* 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 <kazu@hxi.com>
* config/h8300/h8300-protos.h: Update the prototypes of * config/h8300/h8300-protos.h: Update the prototypes of
emit_a_rotate and expand_a_rotate. emit_a_rotate and expand_a_rotate.
* config/h8300/h8300.c (emit_a_rotate): Change the type of the * config/h8300/h8300.c (emit_a_rotate): Change the type of the
......
...@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */
/* Declarations for functions used in insn-output.c. */ /* Declarations for functions used in insn-output.c. */
#ifdef RTX_CODE #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 *emit_a_rotate PARAMS ((enum rtx_code, rtx *));
extern const char *output_simode_bld PARAMS ((int, rtx[])); extern const char *output_simode_bld PARAMS ((int, rtx[]));
extern void print_operand_address PARAMS ((FILE *, rtx)); extern void print_operand_address PARAMS ((FILE *, rtx));
......
...@@ -2431,8 +2431,7 @@ get_shift_alg (shift_type, shift_mode, count, info) ...@@ -2431,8 +2431,7 @@ get_shift_alg (shift_type, shift_mode, count, info)
/* Emit the assembler code for doing shifts. */ /* Emit the assembler code for doing shifts. */
const char * const char *
output_a_shift (insn, operands) output_a_shift (operands)
rtx insn ATTRIBUTE_UNUSED;
rtx *operands; rtx *operands;
{ {
static int loopend_lab; static int loopend_lab;
...@@ -2517,18 +2516,15 @@ output_a_shift (insn, operands) ...@@ -2517,18 +2516,15 @@ output_a_shift (insn, operands)
n = info.remainder; n = info.remainder;
/* Emit two bit shifts first. */ /* Emit two bit shifts first. */
while (n > 1 && info.shift2 != NULL) if (info.shift2 != NULL)
{ {
output_asm_insn (info.shift2, operands); for (; n > 1; n -= 2)
n -= 2; output_asm_insn (info.shift2, operands);
} }
/* Now emit one bit shifts for any residual. */ /* Now emit one bit shifts for any residual. */
while (n > 0) for (; n > 0; n--)
{ output_asm_insn (info.shift1, operands);
output_asm_insn (info.shift1, operands);
n -= 1;
}
/* Keep track of CC. */ /* Keep track of CC. */
if (info.cc_valid_p) if (info.cc_valid_p)
...@@ -2542,8 +2538,8 @@ output_a_shift (insn, operands) ...@@ -2542,8 +2538,8 @@ output_a_shift (insn, operands)
{ {
int m = GET_MODE_BITSIZE (mode) - n; int m = GET_MODE_BITSIZE (mode) - n;
int mask = (shift_type == SHIFT_ASHIFT int mask = (shift_type == SHIFT_ASHIFT
? ((1 << (GET_MODE_BITSIZE (mode) - n)) - 1) << n ? ((1 << m) - 1) << n
: (1 << (GET_MODE_BITSIZE (mode) - n)) - 1); : (1 << m) - 1);
char insn_buf[200]; char insn_buf[200];
/* Not all possibilities of rotate are supported. They shouldn't /* Not all possibilities of rotate are supported. They shouldn't
...@@ -2552,18 +2548,15 @@ output_a_shift (insn, operands) ...@@ -2552,18 +2548,15 @@ output_a_shift (insn, operands)
abort (); abort ();
/* Emit two bit rotates first. */ /* Emit two bit rotates first. */
while (m > 1 && info.shift2 != NULL) if (info.shift2 != NULL)
{ {
output_asm_insn (info.shift2, operands); for (; m > 1; m -= 2)
m -= 2; output_asm_insn (info.shift2, operands);
} }
/* Now single bit rotates for any residual. */ /* Now single bit rotates for any residual. */
while (m > 0) for (; m > 0; m--)
{ output_asm_insn (info.shift1, operands);
output_asm_insn (info.shift1, operands);
m -= 1;
}
/* Now mask off the high bits. */ /* Now mask off the high bits. */
if (TARGET_H8300) if (TARGET_H8300)
...@@ -2579,10 +2572,8 @@ output_a_shift (insn, operands) ...@@ -2579,10 +2572,8 @@ output_a_shift (insn, operands)
sprintf (insn_buf, "and\t#%d,%%s0\n\tand\t#%d,%%t0", sprintf (insn_buf, "and\t#%d,%%s0\n\tand\t#%d,%%t0",
mask & 255, mask >> 8); mask & 255, mask >> 8);
break; break;
case SImode:
abort ();
default: default:
break; abort ();
} }
} }
else else
......
...@@ -1837,7 +1837,7 @@ ...@@ -1837,7 +1837,7 @@
(match_operand:QI 2 "nonmemory_operand" "KM,rn")])) (match_operand:QI 2 "nonmemory_operand" "KM,rn")]))
(clobber (match_scratch:QI 4 "=X,&r"))] (clobber (match_scratch:QI 4 "=X,&r"))]
"" ""
"* return output_a_shift (insn, operands);" "* return output_a_shift (operands);"
[(set_attr "length" "20") [(set_attr "length" "20")
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
...@@ -1871,7 +1871,7 @@ ...@@ -1871,7 +1871,7 @@
(match_operand:QI 2 "nonmemory_operand" "KM,rn")])) (match_operand:QI 2 "nonmemory_operand" "KM,rn")]))
(clobber (match_scratch:QI 4 "=X,&r"))] (clobber (match_scratch:QI 4 "=X,&r"))]
"" ""
"* return output_a_shift (insn, operands);" "* return output_a_shift (operands);"
[(set_attr "length" "20") [(set_attr "length" "20")
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
...@@ -1908,7 +1908,7 @@ ...@@ -1908,7 +1908,7 @@
(match_operand:QI 2 "nonmemory_operand" "K,rn")])) (match_operand:QI 2 "nonmemory_operand" "K,rn")]))
(clobber (match_scratch:QI 4 "=X,&r"))] (clobber (match_scratch:QI 4 "=X,&r"))]
"" ""
"* return output_a_shift (insn, operands);" "* return output_a_shift (operands);"
[(set_attr "length" "20") [(set_attr "length" "20")
(set_attr "cc" "clobber")]) (set_attr "cc" "clobber")])
......
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