- To: gcc-help <gcc-help@xxxxxxxxxxx>
- Subject: shift instruction
- From: naga raj <gnuuser.raj@xxxxxxxxx>
- Date: Thu, 7 Jun 2012 12:01:05 +0530
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hi all,
I am working on a soft-processor which has barrel-shifter as
optional i.e if barrel-shifter hardware is included then my compiler
can generate shift instructions with immediate operand if
barrel-shifter is not included than it can shift only one bit.
Ex: If I want to shift a register right for 24 times
case 1: If barrel-shifter is present then it generates as below
SHL r0,r0,#24
case 2: Without barrel-shifter
SHL r0,r0,#1
SHL r0,r0,#1
SHL r0,r0,#1
-----
-----
SHL r0,r0,#1
Compiler will generate SHL instruction for 24 times.
Is there any chance to optimize generated code when barrel-shifter
is not used because as the immediate operand number increases it is
genereating that huge code.
Thanks in Advance,
Nagaraju
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]