How "arm_gen_constant" Function In arm.c works?
Ian Lance Taylor
iant@google.com
Wed Mar 3 06:52:00 GMT 2010
Prashant Purohit <prashantpurohit025@gmail.com> writes:
> I mean to say, as we can not generate all the constants from 8 bit
> rotation scheme supported in ARM architecture, I just wanted to know the
> logic behind that function which generates one Mov and one Add/Sub
> instruction if that constant is not being generated by rotation scheme
> alone.
> e:g : suppose, the immediate constant is 1234 then that function will do
> it as
>
> mov r3, #1232
> add r3, r3, #2 (In case of ARM)
> Please tell me, how it splits that constant in to 1232 and 2.
I don't know how to answer except to simply read the function. The
code is right there. In this case I expect it happens in the loop at
the end of the function. If you have any questions about how the
function works, can you be more specific?
Ian
More information about the Gcc-help
mailing list