Please use 'gen_cmpeqsi_t (len, const0_rtx)' for comparing a value
against zero instead of the bit test insn.

OK, also then OK to replace the other occurrences of the idiom for coding consistency ? (not sure if I could commit this as obvious ?).

Cheers

Christian




2015-01-08  Christian Bruel  <christian.br...@st.com>

	* config/sh/sh-mem.cc (sh_expand_cmpnstr, sh_expand_setmem):
	 Use gen_cmpeqsi instead of gen_tstsi for comparing against 0.

Index: gcc/config/sh/sh-mem.cc
===================================================================
--- gcc/config/sh/sh-mem.cc	(revision 219257)
+++ gcc/config/sh/sh-mem.cc	(working copy)
@@ -410,7 +410,7 @@
 	  else
 	    {
 	      emit_insn (gen_addsi3 (lenw, lenw, GEN_INT (-1)));
-	      emit_insn (gen_tstsi_t (lenw, lenw));
+             emit_insn (gen_cmpeqsi_t (lenw, const0_rtx));
 	    }
 
 	  jump = emit_jump_insn (gen_branch_false (L_loop_long));
@@ -531,7 +531,7 @@
   else
     {
       emit_insn (gen_addsi3 (len, len, GEN_INT (-1)));
-      emit_insn (gen_tstsi_t (len, len));
+      emit_insn (gen_cmpeqsi_t (len, const0_rtx));
     }
 
   jump = emit_jump_insn (gen_branch_false (L_loop_byte));
@@ -691,7 +691,7 @@
       else
 	{
 	  emit_insn (gen_addsi3 (lenw, lenw, GEN_INT (-1)));
-	  emit_insn (gen_tstsi_t (lenw, lenw));
+         emit_insn (gen_cmpeqsi_t (lenw, const0_rtx));
 	}
 
       emit_move_insn (dest, val);
@@ -728,7 +728,7 @@
   else
     {
       emit_insn (gen_addsi3 (len, len, GEN_INT (-1)));
-      emit_insn (gen_tstsi_t (len, len));
+      emit_insn (gen_cmpeqsi_t (len, const0_rtx));
     }
 
   val = gen_lowpart (QImode, val);

Reply via email to