diff mbox

[AVR] : Clean-up printing bits

Message ID 4F4E0102.3030507@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay Feb. 29, 2012, 10:42 a.m. UTC
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.

Comments

Denis Chertykov Feb. 29, 2012, 11:46 a.m. UTC | #1
2012/2/29 Georg-Johann Lay <avr@gjlay.de>:
> 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.

Ok.

Denis.
diff mbox

Patch

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 */