Commit 15fe850f by Anatoly Sokolov Committed by Anatoly Sokolov

avr.md (UNSPEC_SWAP): Remove constants.

	* config/avr/avr.md (UNSPEC_SWAP): Remove constants.
	(*swap): Remove.
	(rotlqi3, *rotlqi3_4, rotlhi3, *rotlhi3_8,
	rotlsi3, *rotlsi3_8, *rotlsi3_16, *rotlsi3_24): New patterns.
	(ashlqi3_const4, ashlqi3_const5, ashlqi3_const6, ashlqi3_l_const4,
	ashlqi3_l_const5, ashlqi3_l_const6, lshrqi3_const4, lshrqi3_const5,
	lshrqi3_const6, lshrqi3_l_const4, lshrqi3_l_const4, lshrqi3_l_const6
	peephole2's): Replace unspec with rotate.
	* config/avr/avr.c (avr_rtx_costs): Add ROTATE.

From-SVN: r141533
parent 8495c94f
2008-11-02 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.md (UNSPEC_SWAP): Remove constants.
(*swap): Remove.
(rotlqi3, *rotlqi3_4, rotlhi3, *rotlhi3_8,
rotlsi3, *rotlsi3_8, *rotlsi3_16, *rotlsi3_24): New patterns.
(ashlqi3_const4, ashlqi3_const5, ashlqi3_const6, ashlqi3_l_const4,
ashlqi3_l_const5, ashlqi3_l_const6, lshrqi3_const4, lshrqi3_const5,
lshrqi3_const6, lshrqi3_l_const4, lshrqi3_l_const4, lshrqi3_l_const6
peephole2's): Replace unspec with rotate.
* config/avr/avr.c (avr_rtx_costs): Add ROTATE.
2008-11-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37991
......
......@@ -5193,6 +5193,41 @@ avr_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total,
*total += avr_operand_rtx_cost (XEXP (x, 1), mode, code, speed);
return true;
case ROTATE:
switch (mode)
{
case QImode:
if (CONST_INT_P (XEXP (x, 1)) && INTVAL (XEXP (x, 1)) == 4)
*total = COSTS_N_INSNS (1);
break;
case HImode:
if (CONST_INT_P (XEXP (x, 1)) && INTVAL (XEXP (x, 1)) == 8)
*total = COSTS_N_INSNS (3);
break;
case SImode:
if (CONST_INT_P (XEXP (x, 1)))
switch (INTVAL (XEXP (x, 1)))
{
case 8:
case 24:
*total = COSTS_N_INSNS (5);
break;
case 16:
*total = COSTS_N_INSNS (AVR_HAVE_MOVW ? 4 : 6);
break;
}
break;
default:
return false;
}
*total += avr_operand_rtx_cost (XEXP (x, 0), mode, code, speed);
return true;
case ASHIFT:
switch (mode)
{
......
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