+2014-01-27 Christian Bruel <christian.bruel@st.com>
+
+ * config/sh/sh-mem.cc (sh_expand_cmpnstr): Fix remaining bytes after
+ words comparisons.
+
2014-01-26 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.md (call): Generate indirect long calls to non-local
2014-01-25 Walter Lee <walt@tilera.com>
- * config/tilegx/tilegx-c.c (tilegx_cpu_cpp_builtins):
+ * config/tilegx/tilegx-c.c (tilegx_cpu_cpp_builtins):
Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2}.
- * config/tilegx/tilepro-c.c (tilepro_cpu_cpp_builtins):
+ * config/tilegx/tilepro-c.c (tilepro_cpu_cpp_builtins):
Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2,4,8}.
2014-01-25 Walter Lee <walt@tilera.com>
* config/tilepro/tilepro.c (tilepro_expand_builtin): Ditto.
2014-01-25 Richard Sandiford <rdsandiford@googlemail.com>
-
+
* config/mips/constraints.md (kl): Delete.
* config/mips/mips.md (divmod<mode>4, udivmod<mode>4): Turn into
define expands, using...
rtx L_loop_long = gen_label_rtx ();
rtx L_end_loop_long = gen_label_rtx ();
- rtx L_small = gen_label_rtx ();
int align = INTVAL (operands[4]);
int bytes = INTVAL (operands[3]);
jump = emit_jump_insn (gen_branch_false (L_loop_long));
add_int_reg_note (jump, REG_BR_PROB, prob_likely);
+ int sbytes = bytes % 4;
+
/* end loop. Reached max iterations. */
- if (bytes % 4 == 0)
+ if (! sbytes)
{
- /* Done. */
jump = emit_jump_insn (gen_jump_compact (L_return));
emit_barrier_after (jump);
}
else
{
- /* Remaining bytes to read. */
- jump = emit_jump_insn (gen_jump_compact (L_small));
+ /* Remaining bytes to check. */
+
+ addr1 = adjust_automodify_address (addr1, QImode, s1_addr, 0);
+ addr2 = adjust_automodify_address (addr2, QImode, s2_addr, 0);
+
+ while (sbytes--)
+ {
+ emit_insn (gen_extendqisi2 (tmp1, addr1));
+ emit_insn (gen_extendqisi2 (tmp2, addr2));
+
+ emit_insn (gen_cmpeqsi_t (tmp2, const0_rtx));
+ jump = emit_jump_insn (gen_branch_true (L_end_loop_byte));
+ add_int_reg_note (jump, REG_BR_PROB, prob_unlikely);
+
+ emit_insn (gen_cmpeqsi_t (tmp1, tmp2));
+ if (flag_delayed_branch)
+ emit_insn (gen_zero_extendqisi2 (tmp2,
+ gen_lowpart (QImode,
+ tmp2)));
+ jump = emit_jump_insn (gen_branch_false (L_end_loop_byte));
+ add_int_reg_note (jump, REG_BR_PROB, prob_unlikely);
+
+ addr1 = adjust_address (addr1, QImode,
+ GET_MODE_SIZE (QImode));
+ addr2 = adjust_address (addr2, QImode,
+ GET_MODE_SIZE (QImode));
+ }
+
+ jump = emit_jump_insn (gen_jump_compact( L_end_loop_byte));
emit_barrier_after (jump);
}
emit_label (L_end_loop_long);
/* Found last word. Restart it byte per byte. */
- bytes = 4;
+
emit_move_insn (s1_addr, plus_constant (Pmode, s1_addr,
-GET_MODE_SIZE (SImode)));
emit_move_insn (s2_addr, plus_constant (Pmode, s2_addr,
-GET_MODE_SIZE (SImode)));
- }
- emit_label (L_small);
-
- gcc_assert (bytes <= 7);
+ /* fall thru. */
+ }
addr1 = adjust_automodify_address (addr1, QImode, s1_addr, 0);
addr2 = adjust_automodify_address (addr2, QImode, s2_addr, 0);
emit_insn (gen_cmpeqsi_t (tmp1, tmp2));
if (flag_delayed_branch)
- emit_insn (gen_zero_extendqisi2 (tmp2, gen_lowpart (QImode, tmp2)));
+ emit_insn (gen_zero_extendqisi2 (tmp2,
+ gen_lowpart (QImode, tmp2)));
jump = emit_jump_insn (gen_branch_false (L_end_loop_byte));
add_int_reg_note (jump, REG_BR_PROB, prob_unlikely);