This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Variable sized i386 string operations
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Variable sized i386 string operations
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 27 Jan 2000 14:45:41 -0800
- Cc: egcs-patches at egcs dot cygnus dot com, hubicka at atrey dot karlin dot mff dot cuni dot cz
- References: <200001272229.RAA12576@caip.rutgers.edu>
On Thu, Jan 27, 2000 at 05:29:19PM -0500, Kaveh R. Ghazi wrote:
> Yes, -Os means "aim for minimal code size". We also use the
> "optimize_size" flag when deciding whether to do space-vs-speed
> tradeoff optimizations which potentially bloat the code, right?
>
> So, isn't that precisely Jan's issue?
No.
The minimal code sequence for unknown alignment and unknown size
is "rep movsb". A larger, but potentially much faster sequence
would align the address first and then use "rep movsl". But some
ia32 implementations are extremely slow with "rep" and it's better
to use real loops.
Loosely, there's three choices: 4 insns, a dozen insns, or 50 insns.
r~