[patch] h8300 port: Clean up output_a_shift.
Kazu Hirata
kazu@hxi.com
Mon Jan 28 21:53:00 GMT 2002
Hi,
Attached is a patch to fix comment formatting. Committed as obvious.
Kazu Hirata
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.
Index: h8300-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300-protos.h,v
retrieving revision 1.18
diff -c -r1.18 h8300-protos.h
*** h8300-protos.h 2002/01/29 05:02:41 1.18
--- h8300-protos.h 2002/01/29 05:05:39
***************
*** 26,32 ****
/* Declarations for functions used in insn-output.c. */
#ifdef RTX_CODE
! extern const char *output_a_shift PARAMS ((rtx, 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));
--- 26,32 ----
/* Declarations for functions used in insn-output.c. */
#ifdef RTX_CODE
! 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));
Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.104
diff -c -r1.104 h8300.c
*** h8300.c 2002/01/29 05:02:40 1.104
--- h8300.c 2002/01/29 05:05:40
***************
*** 2431,2438 ****
/* Emit the assembler code for doing shifts. */
const char *
! output_a_shift (insn, operands)
! rtx insn ATTRIBUTE_UNUSED;
rtx *operands;
{
static int loopend_lab;
--- 2431,2437 ----
/* Emit the assembler code for doing shifts. */
const char *
! output_a_shift (operands)
rtx *operands;
{
static int loopend_lab;
***************
*** 2517,2534 ****
n = info.remainder;
/* Emit two bit shifts first. */
! while (n > 1 && info.shift2 != NULL)
{
! output_asm_insn (info.shift2, operands);
! n -= 2;
}
/* Now emit one bit shifts for any residual. */
! while (n > 0)
! {
! output_asm_insn (info.shift1, operands);
! n -= 1;
! }
/* Keep track of CC. */
if (info.cc_valid_p)
--- 2516,2530 ----
n = info.remainder;
/* Emit two bit shifts first. */
! if (info.shift2 != NULL)
{
! for (; n > 1; n -= 2)
! output_asm_insn (info.shift2, operands);
}
/* Now emit one bit shifts for any residual. */
! for (; n > 0; n--)
! output_asm_insn (info.shift1, operands);
/* Keep track of CC. */
if (info.cc_valid_p)
***************
*** 2542,2549 ****
{
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);
char insn_buf[200];
/* Not all possibilities of rotate are supported. They shouldn't
--- 2538,2545 ----
{
int m = GET_MODE_BITSIZE (mode) - n;
int mask = (shift_type == SHIFT_ASHIFT
! ? ((1 << m) - 1) << n
! : (1 << m) - 1);
char insn_buf[200];
/* Not all possibilities of rotate are supported. They shouldn't
***************
*** 2552,2569 ****
abort ();
/* Emit two bit rotates first. */
! while (m > 1 && info.shift2 != NULL)
{
! output_asm_insn (info.shift2, operands);
! m -= 2;
}
/* Now single bit rotates for any residual. */
! while (m > 0)
! {
! output_asm_insn (info.shift1, operands);
! m -= 1;
! }
/* Now mask off the high bits. */
if (TARGET_H8300)
--- 2548,2562 ----
abort ();
/* Emit two bit rotates first. */
! if (info.shift2 != NULL)
{
! for (; m > 1; m -= 2)
! output_asm_insn (info.shift2, operands);
}
/* Now single bit rotates for any residual. */
! for (; m > 0; m--)
! output_asm_insn (info.shift1, operands);
/* Now mask off the high bits. */
if (TARGET_H8300)
***************
*** 2579,2588 ****
sprintf (insn_buf, "and\t#%d,%%s0\n\tand\t#%d,%%t0",
mask & 255, mask >> 8);
break;
- case SImode:
- abort ();
default:
! break;
}
}
else
--- 2572,2579 ----
sprintf (insn_buf, "and\t#%d,%%s0\n\tand\t#%d,%%t0",
mask & 255, mask >> 8);
break;
default:
! abort ();
}
}
else
Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.65
diff -c -r1.65 h8300.md
*** h8300.md 2002/01/29 04:54:39 1.65
--- h8300.md 2002/01/29 05:05:41
***************
*** 1837,1843 ****
(match_operand:QI 2 "nonmemory_operand" "KM,rn")]))
(clobber (match_scratch:QI 4 "=X,&r"))]
""
! "* return output_a_shift (insn, operands);"
[(set_attr "length" "20")
(set_attr "cc" "clobber")])
--- 1837,1843 ----
(match_operand:QI 2 "nonmemory_operand" "KM,rn")]))
(clobber (match_scratch:QI 4 "=X,&r"))]
""
! "* return output_a_shift (operands);"
[(set_attr "length" "20")
(set_attr "cc" "clobber")])
***************
*** 1871,1877 ****
(match_operand:QI 2 "nonmemory_operand" "KM,rn")]))
(clobber (match_scratch:QI 4 "=X,&r"))]
""
! "* return output_a_shift (insn, operands);"
[(set_attr "length" "20")
(set_attr "cc" "clobber")])
--- 1871,1877 ----
(match_operand:QI 2 "nonmemory_operand" "KM,rn")]))
(clobber (match_scratch:QI 4 "=X,&r"))]
""
! "* return output_a_shift (operands);"
[(set_attr "length" "20")
(set_attr "cc" "clobber")])
***************
*** 1908,1914 ****
(match_operand:QI 2 "nonmemory_operand" "K,rn")]))
(clobber (match_scratch:QI 4 "=X,&r"))]
""
! "* return output_a_shift (insn, operands);"
[(set_attr "length" "20")
(set_attr "cc" "clobber")])
--- 1908,1914 ----
(match_operand:QI 2 "nonmemory_operand" "K,rn")]))
(clobber (match_scratch:QI 4 "=X,&r"))]
""
! "* return output_a_shift (operands);"
[(set_attr "length" "20")
(set_attr "cc" "clobber")])
More information about the Gcc-patches
mailing list