This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch,AVR]: Clean-up printing bits
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Eric Weddington <eric dot weddington at atmel dot com>, Denis Chertykov <chertykov at gmail dot com>
- Date: Wed, 29 Feb 2012 11:42:10 +0100
- Subject: [Patch,AVR]: Clean-up printing bits
This is more of code clean-up:
avr_output_bld is unused and can be removed.
To print a bit it is more convenient to use %T than patching a string.
Ok for trunk?
Johann
* config/avr/avr-protos.h (avr_output_bld): Remove unused prototype.
* config/avr/avr.c (avr_output_bld): Remove unused function.
(avr_out_sbxx_branch): Use "%T" to print bit position.
Index: config/avr/avr-protos.h
===================================================================
--- config/avr/avr-protos.h (revision 184618)
+++ config/avr/avr-protos.h (working copy)
@@ -83,7 +83,6 @@ extern bool avr_emit_movmemhi (rtx*);
extern int avr_epilogue_uses (int regno);
extern int avr_starting_frame_offset (void);
-extern void avr_output_bld (rtx operands[], int bit_nr);
extern void avr_output_addr_vec_elt (FILE *stream, int value);
extern const char *avr_out_sbxx_branch (rtx insn, rtx operands[]);
extern const char* avr_out_bitop (rtx, rtx*, int*);
Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c (revision 184618)
+++ config/avr/avr.c (working copy)
@@ -9503,15 +9503,6 @@ avr_out_reload_inpsi (rtx *op, rtx clobb
return "";
}
-void
-avr_output_bld (rtx operands[], int bit_nr)
-{
- static char s[] = "bld %A0,0";
-
- s[5] = 'A' + (bit_nr >> 3);
- s[8] = '0' + (bit_nr & 7);
- output_asm_insn (s, operands);
-}
void
avr_output_addr_vec_elt (FILE *stream, int value)
@@ -9626,23 +9617,10 @@ avr_out_sbxx_branch (rtx insn, rtx opera
case REG:
- if (GET_MODE (operands[1]) == QImode)
- {
- if (comp == EQ)
- output_asm_insn ("sbrs %1,%2", operands);
- else
- output_asm_insn ("sbrc %1,%2", operands);
- }
- else /* HImode, PSImode or SImode */
- {
- static char buf[] = "sbrc %A1,0";
- unsigned int bit_nr = UINTVAL (operands[2]);
-
- buf[3] = (comp == EQ) ? 's' : 'c';
- buf[6] = 'A' + (bit_nr / 8);
- buf[9] = '0' + (bit_nr % 8);
- output_asm_insn (buf, operands);
- }
+ if (comp == EQ)
+ output_asm_insn ("sbrs %T1%T2", operands);
+ else
+ output_asm_insn ("sbrc %T1%T2", operands);
break; /* REG */
} /* switch */