Commit 719938ae by Uros Bizjak

i386.md (extendsidi2 splitter): Also check for DX_REG when generating cltd insn.

	* config/i386/i386.md (extendsidi2 splitter): Also check for DX_REG
	when generating cltd insn.

	(*ashl<mode>3_1): Remove special handling for register operand 2.
	(*ashlsi3_1_zext): Ditto.
	(*ashlhi3_1): Ditto.
	(*ashlhi3_1_lea): Ditto.
	(*ashlqi3_1): Ditto.
	(*ashlqi3_1_lea): Ditto.
	(*<shiftrt_insn><mode>3_1): Ditto.
	(*<shiftrt_insn>si3_1_zext): Ditto.
	(*<shiftrt_insn>qi3_1_slp): Ditto.
	(*<rotate_insn><mode>3_1): Ditto.
	(*<rotate_insn>si3_1_zext): Ditto.
	(*<rotate_insn>qi3_1_slp): Ditto.

From-SVN: r158261
parent 3e8542ca
2010-04-13 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (extendsidi2 splitter): Also check for DX_REG
when generating cltd insn.
(*ashl<mode>3_1): Remove special handling for register operand 2.
(*ashlsi3_1_zext): Ditto.
(*ashlhi3_1): Ditto.
(*ashlhi3_1_lea): Ditto.
(*ashlqi3_1): Ditto.
(*ashlqi3_1_lea): Ditto.
(*<shiftrt_insn><mode>3_1): Ditto.
(*<shiftrt_insn>si3_1_zext): Ditto.
(*<shiftrt_insn>qi3_1_slp): Ditto.
(*<rotate_insn><mode>3_1): Ditto.
(*<rotate_insn>si3_1_zext): Ditto.
(*<rotate_insn>qi3_1_slp): Ditto.
2010-04-13 Richard Guenther <rguenther@suse.de> 2010-04-13 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (callused_id): Remove. * tree-ssa-structalias.c (callused_id): Remove.
...@@ -126,8 +144,7 @@ ...@@ -126,8 +144,7 @@
plugin name. plugin name.
(default_plugin_dir_name): Added new function. (default_plugin_dir_name): Added new function.
* common.opt (iplugindir): New option to set the plugin * common.opt (iplugindir): New option to set the plugin directory.
directory.
2010-04-12 Uros Bizjak <ubizjak@gmail.com> 2010-04-12 Uros Bizjak <ubizjak@gmail.com>
......
...@@ -4228,7 +4228,8 @@ ...@@ -4228,7 +4228,8 @@
/* Generate a cltd if possible and doing so it profitable. */ /* Generate a cltd if possible and doing so it profitable. */
if ((optimize_function_for_size_p (cfun) || TARGET_USE_CLTD) if ((optimize_function_for_size_p (cfun) || TARGET_USE_CLTD)
&& true_regnum (operands[3]) == AX_REG) && true_regnum (operands[3]) == AX_REG
&& true_regnum (operands[4]) == DX_REG)
{ {
emit_insn (gen_ashrsi3_cvt (operands[4], operands[3], GEN_INT (31))); emit_insn (gen_ashrsi3_cvt (operands[4], operands[3], GEN_INT (31)));
DONE; DONE;
...@@ -9702,18 +9703,16 @@ ...@@ -9702,18 +9703,16 @@
{ {
switch (get_attr_type (insn)) switch (get_attr_type (insn))
{ {
case TYPE_LEA:
return "#";
case TYPE_ALU: case TYPE_ALU:
gcc_assert (operands[2] == const1_rtx); gcc_assert (operands[2] == const1_rtx);
gcc_assert (rtx_equal_p (operands[0], operands[1])); gcc_assert (rtx_equal_p (operands[0], operands[1]));
return "add{<imodesuffix>}\t%0, %0"; return "add{<imodesuffix>}\t%0, %0";
case TYPE_LEA:
return "#";
default: default:
if (REG_P (operands[2])) if (operands[2] == const1_rtx
return "sal{<imodesuffix>}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{<imodesuffix>}\t%0"; return "sal{<imodesuffix>}\t%0";
else else
...@@ -9751,17 +9750,15 @@ ...@@ -9751,17 +9750,15 @@
{ {
switch (get_attr_type (insn)) switch (get_attr_type (insn))
{ {
case TYPE_LEA:
return "#";
case TYPE_ALU: case TYPE_ALU:
gcc_assert (operands[2] == const1_rtx); gcc_assert (operands[2] == const1_rtx);
return "add{l}\t%k0, %k0"; return "add{l}\t%k0, %k0";
case TYPE_LEA:
return "#";
default: default:
if (REG_P (operands[2])) if (operands[2] == const1_rtx
return "sal{l}\t{%b2, %k0|%k0, %b2}";
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{l}\t%k0"; return "sal{l}\t%k0";
else else
...@@ -9803,9 +9800,7 @@ ...@@ -9803,9 +9800,7 @@
return "add{w}\t%0, %0"; return "add{w}\t%0, %0";
default: default:
if (REG_P (operands[2])) if (operands[2] == const1_rtx
return "sal{w}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{w}\t%0"; return "sal{w}\t%0";
else else
...@@ -9843,14 +9838,13 @@ ...@@ -9843,14 +9838,13 @@
{ {
case TYPE_LEA: case TYPE_LEA:
return "#"; return "#";
case TYPE_ALU: case TYPE_ALU:
gcc_assert (operands[2] == const1_rtx); gcc_assert (operands[2] == const1_rtx);
return "add{w}\t%0, %0"; return "add{w}\t%0, %0";
default: default:
if (REG_P (operands[2])) if (operands[2] == const1_rtx
return "sal{w}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{w}\t%0"; return "sal{w}\t%0";
else else
...@@ -9896,18 +9890,11 @@ ...@@ -9896,18 +9890,11 @@
return "add{b}\t%0, %0"; return "add{b}\t%0, %0";
default: default:
if (REG_P (operands[2])) if (operands[2] == const1_rtx
{
if (get_attr_mode (insn) == MODE_SI)
return "sal{l}\t{%b2, %k0|%k0, %b2}";
else
return "sal{b}\t{%b2, %0|%0, %b2}";
}
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
{ {
if (get_attr_mode (insn) == MODE_SI) if (get_attr_mode (insn) == MODE_SI)
return "sal{l}\t%0"; return "sal{l}\t%k0";
else else
return "sal{b}\t%0"; return "sal{b}\t%0";
} }
...@@ -9952,6 +9939,7 @@ ...@@ -9952,6 +9939,7 @@
{ {
case TYPE_LEA: case TYPE_LEA:
return "#"; return "#";
case TYPE_ALU: case TYPE_ALU:
gcc_assert (operands[2] == const1_rtx); gcc_assert (operands[2] == const1_rtx);
if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1])) if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1]))
...@@ -9960,18 +9948,11 @@ ...@@ -9960,18 +9948,11 @@
return "add{b}\t%0, %0"; return "add{b}\t%0, %0";
default: default:
if (REG_P (operands[2])) if (operands[2] == const1_rtx
{
if (get_attr_mode (insn) == MODE_SI)
return "sal{l}\t{%b2, %k0|%k0, %b2}";
else
return "sal{b}\t{%b2, %0|%0, %b2}";
}
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
{ {
if (get_attr_mode (insn) == MODE_SI) if (get_attr_mode (insn) == MODE_SI)
return "sal{l}\t%0"; return "sal{l}\t%k0";
else else
return "sal{b}\t%0"; return "sal{b}\t%0";
} }
...@@ -10384,9 +10365,7 @@ ...@@ -10384,9 +10365,7 @@
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)" "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
{ {
if (REG_P (operands[2])) if (operands[2] == const1_rtx
return "<shiftrt>{<imodesuffix>}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "<shiftrt>{<imodesuffix>}\t%0"; return "<shiftrt>{<imodesuffix>}\t%0";
else else
...@@ -10410,9 +10389,7 @@ ...@@ -10410,9 +10389,7 @@
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)" "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
{ {
if (REG_P (operands[2])) if (operands[2] == const1_rtx
return "<shiftrt>{l}\t{%b2, %k0|%k0, %b2}";
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "<shiftrt>{l}\t%k0"; return "<shiftrt>{l}\t%k0";
else else
...@@ -10438,9 +10415,7 @@ ...@@ -10438,9 +10415,7 @@
|| (operands[1] == const1_rtx || (operands[1] == const1_rtx
&& TARGET_SHIFT1))" && TARGET_SHIFT1))"
{ {
if (REG_P (operands[1])) if (operands[1] == const1_rtx
return "<shiftrt>{b}\t{%b1, %0|%0, %b1}";
else if (operands[1] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "<shiftrt>{b}\t%0"; return "<shiftrt>{b}\t%0";
else else
...@@ -10661,9 +10636,7 @@ ...@@ -10661,9 +10636,7 @@
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)" "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
{ {
if (REG_P (operands[2])) if (operands[2] == const1_rtx
return "<rotate>{<imodesuffix>}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "<rotate>{<imodesuffix>}\t%0"; return "<rotate>{<imodesuffix>}\t%0";
else else
...@@ -10687,9 +10660,7 @@ ...@@ -10687,9 +10660,7 @@
(clobber (reg:CC FLAGS_REG))] (clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)" "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
{ {
if (REG_P (operands[2])) if (operands[2] == const1_rtx
return "<rotate>{l}\t{%b2, %k0|%k0, %b2}";
else if (operands[2] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "<rotate>{l}\t%k0"; return "<rotate>{l}\t%k0";
else else
...@@ -10715,9 +10686,7 @@ ...@@ -10715,9 +10686,7 @@
|| (operands[1] == const1_rtx || (operands[1] == const1_rtx
&& TARGET_SHIFT1))" && TARGET_SHIFT1))"
{ {
if (REG_P (operands[1])) if (operands[1] == const1_rtx
return "<rotate>{b}\t{%b1, %0|%0, %b1}";
else if (operands[1] == const1_rtx
&& (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))) && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "<rotate>{b}\t%0"; return "<rotate>{b}\t%0";
else else
......
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