This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] h8300: Remove a redundant operand character.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 10 Jun 2003 23:21:07 -0400 (EDT)
- Subject: [patch] h8300: Remove a redundant operand character.
Hi,
Attached is a patch to remove a redundant operand character. 'b'
outputs one of "bor", "bxor", or "band" depending on an operand. 'c'
outputs "or" or "xor", so "%b0" can be replaced with "b%c0".
Tested on h8300 port.
Kazu Hirata
2003-06-10 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (print_operand): Remove support for
operand character 'b'.
Add the AND case to operand character 'c'.
* config/h8300/h8300.md (two anonymous patterns): Replace
operand character 'b' with 'c'.
Index: h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.232
diff -u -r1.232 h8300.c
--- h8300.c 11 Jun 2003 01:48:54 -0000 1.232
+++ h8300.c 11 Jun 2003 01:55:02 -0000
@@ -1235,7 +1235,6 @@
'Y' print either l or h depending on whether last 'Z' operand < 8 or >= 8.
If this operand isn't a register, fall back to 'R' handling.
'Z' print int & 7.
- 'b' print the bit opcode
'c' print the opcode corresponding to rtl
'e' first word of 32 bit value - if reg, then least reg. if mem
then least. if const then most sig word
@@ -1373,22 +1372,6 @@
bitint = INTVAL (x);
fprintf (file, "#%d", bitint & 7);
break;
- case 'b':
- switch (GET_CODE (x))
- {
- case IOR:
- fprintf (file, "bor");
- break;
- case XOR:
- fprintf (file, "bxor");
- break;
- case AND:
- fprintf (file, "band");
- break;
- default:
- break;
- }
- break;
case 'c':
switch (GET_CODE (x))
{
@@ -1397,6 +1380,9 @@
break;
case XOR:
fprintf (file, "xor");
+ break;
+ case AND:
+ fprintf (file, "and");
break;
default:
break;
Index: h8300.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.md,v
retrieving revision 1.217
diff -u -r1.217 h8300.md
--- h8300.md 6 Jun 2003 05:28:07 -0000 1.217
+++ h8300.md 11 Jun 2003 01:55:03 -0000
@@ -2621,7 +2621,7 @@
(match_operand:HI 2 "immediate_operand" "n"))
(match_operand:HI 3 "bit_operand" "0")]))]
""
- "bld %Z2,%Y1\;%b4 #0,%R0\;bst #0,%R0; bl1"
+ "bld %Z2,%Y1\;b%c4 #0,%R0\;bst #0,%R0; bl1"
[(set_attr "cc" "clobber")
(set_attr "length" "6")
(set_attr "adjust_length" "no")])
@@ -2636,7 +2636,7 @@
(const_int 1)
(match_operand:HI 4 "immediate_operand" "n"))]))]
""
- "bld %Z2,%Y1\;%b5 %Z4,%Y3\;bst #0,%R0; bl3"
+ "bld %Z2,%Y1\;b%c5 %Z4,%Y3\;bst #0,%R0; bl3"
[(set_attr "cc" "clobber")
(set_attr "length" "6")
(set_attr "adjust_length" "no")])