This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/35714] x86 poor code with pmaddwd
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2008 12:55:52 -0000
- Subject: [Bug target/35714] x86 poor code with pmaddwd
- References: <bug-35714-10175@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from ubizjak at gmail dot com 2008-05-06 12:55 -------
This is due to this code snippet from i386.c, ix86_expand_binop_builtin ():
--cut here--
/* ??? Using ix86_fixup_binary_operands is problematic when
we've got mismatched modes. Fake it. */
xops[0] = target;
xops[1] = op0;
xops[2] = op1;
if (tmode == mode0 && tmode == mode1)
{
target = ix86_fixup_binary_operands (UNKNOWN, tmode, xops);
op0 = xops[1];
op1 = xops[2];
}
else if (optimize || !ix86_binary_operator_ok (UNKNOWN, tmode, xops))
{
op0 = force_reg (mode0, op0);
op1 = force_reg (mode1, op1);
target = gen_reg_rtx (tmode);
}
--cut here--
Since UNKNOWN is not commutative operator, this code disables many
optimizations that can be performed by treating builtins individually using
ix86_fixup_binary_operands_no_copy ().
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35714