This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/50661] std::equal should use more efficient version for arrays of pointers
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 08 Oct 2011 10:59:31 +0000
- Subject: [Bug libstdc++/50661] std::equal should use more efficient version for arrays of pointers
- Auto-submitted: auto-generated
- References: <bug-50661-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50661
--- Comment #6 from Marc Glisse <marc.glisse at normalesup dot org> 2011-10-08 10:59:31 UTC ---
(In reply to comment #5)
> The analogy with copying and traits is enticing, but before reading Marc's
> message, I wondered: for pointers, which kind of improvement are we talking
> about? Comparing 64 bits at a time in a tight loop doesn't seem so bad...
glibc uses SSE2 to work with 128 bits (but it is a bit more than a simple
comparison in this case) and the hand-written asm might be a bit better than
what gcc generates.
My suggestion about traits is actually not such a good idea, since comparison
operators are not generated by the compiler for non-builtin types.