From 0cebb05d0b451ca7c314ba7e0a0c756e7a5d6c19 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Fri, 10 Apr 1992 20:04:10 +0000 Subject: [PATCH] *** empty log message *** From-SVN: r719 --- gcc/config/mips/mips.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 821caaf80d1..5d8ce773978 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -1951,6 +1951,7 @@ output_block_move (insn, operands, num_regs) int align = INTVAL (operands[3]); int num = 0; int offset = 0; + int use_lwl_lwr = FALSE; int i; rtx xoperands[10]; @@ -2013,6 +2014,23 @@ output_block_move (insn, operands, num_regs) bytes -= UNITS_PER_WORD; } + else if (bytes >= UNITS_PER_WORD && TARGET_GAS) + { +#if BYTES_BIG_ENDIAN + load_store[num].load = "lwl\t%0,%1\n\tlwr\t%0,%2"; + load_store[num].load_nop = "lwl\t%0,%1\n\tlwr\t%0,%2%#"; + load_store[num].store = "swl\t%0,%1\n\tswr\t%0,%2"; +#else + load_store[num].load = "lwl\t%0,%2\n\tlwr\t%0,%1"; + load_store[num].load_nop = "lwl\t%0,%2\n\tlwr\t%0,%1%#"; + load_store[num].store = "swl\t%0,%2\n\tswr\t%0,%1"; +#endif + load_store[num].mode = SImode; + offset += UNITS_PER_WORD; + bytes -= UNITS_PER_WORD; + use_lwl_lwr = TRUE; + } + else if (bytes >= UNITS_PER_WORD) { load_store[num].load = "ulw\t%0,%1"; @@ -2067,27 +2085,43 @@ output_block_move (insn, operands, num_regs) for (i = 0; i < num; i++) { + int offset; + if (!operands[i+4]) abort (); if (GET_MODE (operands[i+4]) != load_store[i].mode) operands[i+4] = gen_rtx (REG, load_store[i].mode, REGNO (operands[i+4])); + offset = load_store[i].offset; xoperands[0] = operands[i+4]; xoperands[1] = gen_rtx (MEM, load_store[i].mode, - plus_constant (src_reg, load_store[i].offset)); + plus_constant (src_reg, offset)); + + if (use_lwl_lwr) + xoperands[2] = gen_rtx (MEM, load_store[i].mode, + plus_constant (src_reg, UNITS_PER_WORD-1+offset)); + output_asm_insn (load_store[i].load, xoperands); } for (i = 0; i < num; i++) { + int offset = load_store[i].offset; xoperands[0] = operands[i+4]; xoperands[1] = gen_rtx (MEM, load_store[i].mode, - plus_constant (dest_reg, load_store[i].offset)); + plus_constant (dest_reg, offset)); + + + if (use_lwl_lwr) + xoperands[2] = gen_rtx (MEM, load_store[i].mode, + plus_constant (dest_reg, UNITS_PER_WORD-1+offset)); + output_asm_insn (load_store[i].store, xoperands); } num = 0; /* reset load_store */ + use_lwl_lwr = FALSE; /* reset whether or not we used lwl/lwr */ } } -- 2.30.2