diff options
Diffstat (limited to 'gcc/config/mips/mips.c')
| -rw-r--r-- | gcc/config/mips/mips.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index c1cf631..e3100d1 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -3883,6 +3883,33 @@ mips_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length) mips_block_move_straight (dest, src, leftover); } + +/* Expand a loop of synci insns for the address range [BEGIN, END). */ + +void +mips_expand_synci_loop (rtx begin, rtx end) +{ + rtx inc, label, cmp, cmp_result; + + /* Load INC with the cache line size (rdhwr INC,$1). */ + inc = gen_reg_rtx (SImode); + emit_insn (gen_rdhwr (inc, const1_rtx)); + + /* Loop back to here. */ + label = gen_label_rtx (); + emit_label (label); + + emit_insn (gen_synci (begin)); + + cmp = gen_reg_rtx (Pmode); + mips_emit_binary (GTU, cmp, begin, end); + + mips_emit_binary (PLUS, begin, begin, inc); + + cmp_result = gen_rtx_EQ (VOIDmode, cmp, const0_rtx); + emit_jump_insn (gen_condjump (cmp_result, label)); +} + /* Expand a movmemsi instruction. */ bool |
