This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15823] optimise >>> style calculation
- From: "ajrobb at bigfoot dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2004 08:39:30 -0000
- Subject: [Bug c/15823] optimise >>> style calculation
- References: <20040604164108.15823.ajrobb@bigfoot.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ajrobb at bigfoot dot com 2004-06-24 08:39 -------
Subject: Re: optimise >>> style calculation
Thanks for getting back to me,
I am not looking for Java's i>>n rather i>>>n (e.g. x86 SAR assembler)
I want to duplicate the most significant bit into the next n most significant
bits. However, I want to avoid assembler and use a C code fragment that
compiles to a single SAR instruction on an x86.
Regards,
Andy Robb.
On Friday 04 June 2004 17:48, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-04
> 16:48 ------- i & ~3 still can be postive. So you still have to do the
> sign check, if you want te equivalent of Java's i >> n the do ((unsigned
> int)i) >> n.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15823