This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Improved signed integer remainder by power of two
- From: Falk Hueffner <hueffner at informatik dot uni-tuebingen dot de>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org,Steven Bosscher <stevenb at suse dot de>
- Date: Tue, 29 Jun 2004 01:06:49 +0200
- Subject: Re: [PATCH] Improved signed integer remainder by power of two
- References: <Pine.LNX.firstname.lastname@example.org>
Roger Sayle <email@example.com> writes:
> FYI, here's the patch with the above change that I intend to commit
> to mainline CVS shortly.
Interestingly, it makes x % 16 be one cycle longer and slower on Alpha:
old: sra a0,0x3f,t0
new: sra a0,0x3f,t0
The DEC compiler simply uses a branch. Actually, I can very much see
that; nobody wants the silly semantics of % for negative operands, you
only use it on operands that will always be positive, so the branch
will always be predicted perfectly.