mirror of git://gcc.gnu.org/git/gcc.git
re PR target/60884 ([SH] improve inlined strlen-like builtin functions)
gcc/ PR target/60884 * config/sh/sh-mem.cc (sh_expand_strlen): Use loop when emitting unrolled byte insns. Emit address increments after move insns. gcc/testsuite/ PR target/60884 * gcc.target/sh/pr53976-1.c (test_02): Remove inappropriate test case. (test_03): Rename to test_02. From-SVN: r210187
This commit is contained in:
parent
9bbf45f692
commit
36dc9ae8cd
|
|
@ -1,3 +1,9 @@
|
|||
2014-05-07 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
PR target/60884
|
||||
* config/sh/sh-mem.cc (sh_expand_strlen): Use loop when emitting
|
||||
unrolled byte insns. Emit address increments after move insns.
|
||||
|
||||
2014-05-07 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* gimple.h (gimple_builtin_call_types_compatible_p): Accept a
|
||||
|
|
|
|||
|
|
@ -589,29 +589,15 @@ sh_expand_strlen (rtx *operands)
|
|||
addr1 = adjust_address (addr1, QImode, 0);
|
||||
|
||||
/* unroll remaining bytes. */
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
emit_insn (gen_extendqisi2 (tmp1, addr1));
|
||||
emit_move_insn (current_addr, plus_constant (Pmode, current_addr, 1));
|
||||
emit_insn (gen_cmpeqsi_t (tmp1, const0_rtx));
|
||||
jump = emit_jump_insn (gen_branch_true (L_return));
|
||||
add_int_reg_note (jump, REG_BR_PROB, prob_likely);
|
||||
}
|
||||
|
||||
emit_move_insn (current_addr, plus_constant (Pmode, current_addr, 1));
|
||||
|
||||
emit_insn (gen_extendqisi2 (tmp1, addr1));
|
||||
emit_insn (gen_cmpeqsi_t (tmp1, const0_rtx));
|
||||
jump = emit_jump_insn (gen_branch_true (L_return));
|
||||
add_int_reg_note (jump, REG_BR_PROB, prob_likely);
|
||||
|
||||
emit_move_insn (current_addr, plus_constant (Pmode, current_addr, 1));
|
||||
|
||||
emit_insn (gen_extendqisi2 (tmp1, addr1));
|
||||
emit_insn (gen_cmpeqsi_t (tmp1, const0_rtx));
|
||||
jump = emit_jump_insn (gen_branch_true (L_return));
|
||||
add_int_reg_note (jump, REG_BR_PROB, prob_likely);
|
||||
|
||||
emit_move_insn (current_addr, plus_constant (Pmode, current_addr, 1));
|
||||
|
||||
emit_insn (gen_extendqisi2 (tmp1, addr1));
|
||||
jump = emit_jump_insn (gen_jump_compact (L_return));
|
||||
emit_barrier_after (jump);
|
||||
|
||||
/* start byte loop. */
|
||||
|
|
@ -626,10 +612,9 @@ sh_expand_strlen (rtx *operands)
|
|||
|
||||
/* end loop. */
|
||||
|
||||
emit_insn (gen_addsi3 (start_addr, start_addr, GEN_INT (1)));
|
||||
|
||||
emit_label (L_return);
|
||||
|
||||
emit_insn (gen_addsi3 (start_addr, start_addr, GEN_INT (1)));
|
||||
emit_insn (gen_subsi3 (operands[0], current_addr, start_addr));
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
2014-05-07 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
PR target/60884
|
||||
* gcc.target/sh/pr53976-1.c (test_02): Remove inappropriate test case.
|
||||
(test_03): Rename to test_02.
|
||||
|
||||
2014-05-07 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/61083
|
||||
|
|
|
|||
|
|
@ -24,14 +24,7 @@ test_01 (long long a, long long b)
|
|||
}
|
||||
|
||||
int
|
||||
test_02 (const char* a)
|
||||
{
|
||||
/* Must not see a sett after the inlined strlen. */
|
||||
return __builtin_strlen (a);
|
||||
}
|
||||
|
||||
int
|
||||
test_03 (int a, int b, int c, int d)
|
||||
test_02 (int a, int b, int c, int d)
|
||||
{
|
||||
/* One of the blocks should have a sett and the other one should not. */
|
||||
if (d > 4)
|
||||
|
|
|
|||
Loading…
Reference in New Issue