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: More i386 string ops changes


> 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~

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