Commit 903a5059 by Roger Sayle Committed by Roger Sayle

i386.c (ix86_split_long_move): When optimizing for size...


	* config/i386/i386.c (ix86_split_long_move): When optimizing for
	size, and the low and high parts of a DImode constant are equal,
	copy one register to another instead of loading the same immediate
	value twice.

From-SVN: r87270
parent 469c26f1
2004-09-09 Roger Sayle <roger@eyesopen.com>
* config/i386/i386.c (ix86_split_long_move): When optimizing for
size, and the low and high parts of a DImode constant are equal,
copy one register to another instead of loading the same immediate
value twice.
2004-09-09 Richard Henderson <rth@redhat.com>
PR middle-end/17367
......
......@@ -9938,6 +9938,33 @@ ix86_split_long_move (rtx operands[])
operands[6] = part[1][1];
}
}
/* If optimizing for size, attempt to locally unCSE non-zero constants. */
if (optimize_size)
{
if (GET_CODE (operands[5]) == CONST_INT
&& operands[5] != const0_rtx
&& REG_P (operands[2]))
{
if (GET_CODE (operands[6]) == CONST_INT
&& INTVAL (operands[6]) == INTVAL (operands[5]))
operands[6] = operands[2];
if (nparts == 3
&& GET_CODE (operands[7]) == CONST_INT
&& INTVAL (operands[7]) == INTVAL (operands[5]))
operands[7] = operands[2];
}
if (nparts == 3
&& GET_CODE (operands[6]) == CONST_INT
&& operands[6] != const0_rtx
&& REG_P (operands[3])
&& GET_CODE (operands[7]) == CONST_INT
&& INTVAL (operands[7]) == INTVAL (operands[6]))
operands[7] = operands[3];
}
emit_move_insn (operands[2], operands[5]);
emit_move_insn (operands[3], operands[6]);
if (nparts == 3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment