This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] h8300: Clean up the shift expander.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 23 Dec 2002 09:59:07 -0500 (EST)
- Subject: [patch] h8300: Clean up the shift expander.
Hi,
Attached is a patch to clean up the shift expander.
expand_a_shift() always returns 1. The patch makes its return type
void.
Tested on h8300 port. Committed.
Kazu Hirata
2002-12-23 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300-protos.h: Update the prototype of
expand_a_shift.
* config/h8300/h8300.c (expand_a_shift): Change the return
type to void.
* config/h8300/h8300.md: Update all the uses of
expand_a_shift.
Index: h8300-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300-protos.h,v
retrieving revision 1.36
diff -u -r1.36 h8300-protos.h
--- h8300-protos.h 21 Dec 2002 17:43:14 -0000 1.36
+++ h8300-protos.h 23 Dec 2002 11:46:19 -0000
@@ -42,7 +42,7 @@
extern unsigned int compute_logical_op_length PARAMS ((enum machine_mode,
rtx *));
extern int compute_logical_op_cc PARAMS ((enum machine_mode, rtx *));
-extern int expand_a_shift PARAMS ((enum machine_mode, int, rtx[]));
+extern void expand_a_shift PARAMS ((enum machine_mode, int, rtx[]));
extern int h8300_shift_needs_scratch_p PARAMS ((int, enum machine_mode));
extern int expand_a_rotate PARAMS ((enum rtx_code, rtx[]));
extern int fix_bit_operand PARAMS ((rtx *, int, enum rtx_code));
Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.182
diff -u -r1.182 h8300.c
--- h8300.c 23 Dec 2002 07:46:32 -0000 1.182
+++ h8300.c 23 Dec 2002 11:46:20 -0000
@@ -2250,11 +2250,9 @@
}
}
-/* Called from the .md file to emit code to do shifts.
- Return a boolean indicating success.
- (Currently this is always TRUE). */
+/* Emit code to do shifts. */
-int
+void
expand_a_shift (mode, code, operands)
enum machine_mode mode;
int code;
@@ -2273,8 +2271,6 @@
operands[2])),
gen_rtx_CLOBBER (VOIDmode,
gen_rtx_SCRATCH (QImode)))));
-
- return 1;
}
/* Symbols of the various modes which can be used as indices. */
Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.130
diff -u -r1.130 h8300.md
--- h8300.md 22 Dec 2002 14:45:52 -0000 1.130
+++ h8300.md 23 Dec 2002 11:46:21 -0000
@@ -1983,21 +1983,21 @@
(ashift:QI (match_operand:QI 1 "register_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))]
""
- "if (expand_a_shift (QImode, ASHIFT, operands)) DONE; else FAIL;")
+ "expand_a_shift (QImode, ASHIFT, operands); DONE;")
(define_expand "ashrqi3"
[(set (match_operand:QI 0 "register_operand" "")
(ashiftrt:QI (match_operand:QI 1 "register_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))]
""
- "if (expand_a_shift (QImode, ASHIFTRT, operands)) DONE; else FAIL;")
+ "expand_a_shift (QImode, ASHIFTRT, operands); DONE;")
(define_expand "lshrqi3"
[(set (match_operand:QI 0 "register_operand" "")
(lshiftrt:QI (match_operand:QI 1 "register_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))]
""
- "if (expand_a_shift (QImode, LSHIFTRT, operands)) DONE; else FAIL;")
+ "expand_a_shift (QImode, LSHIFTRT, operands); DONE;")
(define_insn ""
[(set (match_operand:QI 0 "register_operand" "=r,r")
@@ -2018,21 +2018,21 @@
(ashift:HI (match_operand:HI 1 "nonmemory_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))]
""
- "if (expand_a_shift (HImode, ASHIFT, operands)) DONE; else FAIL;")
+ "expand_a_shift (HImode, ASHIFT, operands); DONE;")
(define_expand "lshrhi3"
[(set (match_operand:HI 0 "register_operand" "")
(lshiftrt:HI (match_operand:HI 1 "general_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))]
""
- "if (expand_a_shift (HImode, LSHIFTRT, operands)) DONE; else FAIL;")
+ "expand_a_shift (HImode, LSHIFTRT, operands); DONE;")
(define_expand "ashrhi3"
[(set (match_operand:HI 0 "register_operand" "")
(ashiftrt:HI (match_operand:HI 1 "register_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))]
""
- "if (expand_a_shift (HImode, ASHIFTRT, operands)) DONE; else FAIL;")
+ "expand_a_shift (HImode, ASHIFTRT, operands); DONE;")
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r,r")
@@ -2053,21 +2053,21 @@
(ashift:SI (match_operand:SI 1 "general_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))]
""
- "if (expand_a_shift (SImode, ASHIFT, operands)) DONE; else FAIL;")
+ "expand_a_shift (SImode, ASHIFT, operands); DONE;")
(define_expand "lshrsi3"
[(set (match_operand:SI 0 "register_operand" "")
(lshiftrt:SI (match_operand:SI 1 "general_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))]
""
- "if (expand_a_shift (SImode, LSHIFTRT, operands)) DONE; else FAIL;")
+ "expand_a_shift (SImode, LSHIFTRT, operands); DONE;")
(define_expand "ashrsi3"
[(set (match_operand:SI 0 "register_operand" "")
(ashiftrt:SI (match_operand:SI 1 "general_operand" "")
(match_operand:QI 2 "nonmemory_operand" "")))]
""
- "if (expand_a_shift (SImode, ASHIFTRT, operands)) DONE; else FAIL;")
+ "expand_a_shift (SImode, ASHIFTRT, operands); DONE;")
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r,r")