More i386 string ops changes

Jan Hubicka hubicka@atrey.karlin.mff.cuni.cz
Sat Jan 15 08:07:00 GMT 2000


> On Thu, Jan 13, 2000 at 02:09:36PM +0100, Jan Hubicka wrote:
> > 	* i386.md (memstr): Use do not use rep stosb for counts divisible by 4
> > 	when optimize_size.
> 
>   "Use do not use" ?
Oops.. I meand "Do not use rep.."
> 
> > !   /* Use formula that gives nonzero result ifif one of the bytes is zero.
> > !      This saves three branches inside loop and many cycles.  */
> 
>   "This formula yields a non-zero result iff"
> 
> > !       emit_insn (gen_cmpsi_1 (countreg, countreg));
> 
> Are you quite sure this won't get optimized away on you?
The following insn uses flags (using USE), so it can't be removed as dead store.
I've verified that the compare insn appears in resulting .s file.
I believe that even combine or something else can't attempt to be smart
on such insn chain, since the compare insns are optimized only in the context
of comparison operators, but this is not the case.

Perhaps intead of (use (reg:CC 17)) we can use real comparison operation
(use (ne (reg:CC 17) (const_int 0)))
So it can look like other comparisons we emit, but I think it will make
only more failed optimizations attempts.

Honza
> 
> 
> 
> 
> r~


More information about the Gcc-patches mailing list