This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53645] Missed optimization for division of vector types
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Jun 2012 13:34:21 +0000
- Subject: [Bug c/53645] Missed optimization for division of vector types
- Auto-submitted: auto-generated
- References: <bug-53645-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53645
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-06-12
Ever Confirmed|0 |1
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-12 13:34:21 UTC ---
The issue is that no packed integer division exists and that we lower the
vector division to scalar code:
<bb 2>:
D.2165_4 = BIT_FIELD_REF <x_1(D), 32, 0>;
D.2166_5 = D.2165_4 / 3;
D.2167_6 = BIT_FIELD_REF <x_1(D), 32, 32>;
D.2168_7 = D.2167_6 / 3;
D.2169_8 = BIT_FIELD_REF <x_1(D), 32, 64>;
D.2170_9 = D.2169_8 / 3;
D.2171_10 = BIT_FIELD_REF <x_1(D), 32, 96>;
D.2172_11 = D.2171_10 / 3;
D.2159_2 = {D.2166_5, D.2168_7, D.2170_9, D.2172_11};
this lowering should instead try to do the multiplication trick.
Compilable testcase:
typedef int v4si __attribute__((vector_size(16)));
v4si ttt(v4si x)
{
return x / (v4si) {3,3,3,3};
}