First of all - Both examples are deadly coded. Anyway... That's true... In first case __mulhisi3 routine being called. This routine extends int to long, then calls __mulsi3 (but you cannot see it).
Another example introduces even more dead code actually, but anyway... As long as int already cast to long and constant is long. So, no 'in-insn' conversion required. therefore __mulsi3 being called only. ~d On Fri, 09 Aug 2002 10:06:53 +0700 Kittiphan Techakittiroj <[email protected]> wrote: > I find some strange behavior when I try to calculate the equation with > the casting of long interger. By using the casting to long integer in > the calculation, sometime it give me the wrong result. While I am assign > the integer variable to the long variable first and then using that variable > in the calculation give me the correct result. I try some simple example > and look inside the list file. It seems to be that compiler calling the > different > multiplication routine. I am using the lastest win32 compiler. > Following is the example > > void main() { > int j,a; > j=5; > a=((long)j*4059L)/20; > } > > and > > void main() { > int j,a; > long k; > j=5; > k=j; > a=(k*4059L)/20; > } > > Regards, > Kittiphan Techakittiroj > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Mspgcc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > /******************************************************************** ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ `6_ 6 ) `-. ( ).`-.__.`) Enterprise Information Sys (_Y_.)' ._ ) `._ `. ``-..-' Nevsky prospekt, 20 / 44 _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia (il),-'' (li),' ((!.-' +7 (812) 3468202, 5585314 ********************************************************************/
