This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Variable sized i386 string operations


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~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]