Re: [algogeeks] Re: How to use asm in spoj

2011-06-18 Thread Terence
CONT1D and D1ONE already defined When compile with -O2, gcc 4.3.2 tries to inline short functions like gcd(). Thus the labels CONT1D and D1ONE get redefined. 1) Try gcc 4.0.3. or 2) use local labels instead. eg. __asm__ __volatile__ ( movl %1, %%eax; 0: cmpl

[algogeeks] Re: How to use asm in spoj

2011-06-18 Thread Dumanshu
Yes SPOJ uses the nasm assembler. On Jun 18, 7:02 am, saurabh singh saurab...@gmail.com wrote: I am using standard gcc 4.3.2 and the code does not requires any flag to be required.I also checked the alias if gcc has been aliased to be used with some option,but that was not the case.My

[algogeeks] Re: How to use asm in spoj

2011-06-18 Thread Dumanshu
It does matter. suppose u write the c code and the compiler generates assembly level code later u get machine code which runs. here in this process many optimizations can be employed which are not done by gcc. So including asm code in ur c code can actually make ur code to run very fast provided u

Re: [algogeeks] Re: How to use asm in spoj

2011-06-18 Thread saurabh singh
@Aditya I have been doing this for sometime now,and it does seem to work mainly because compiler works at a general level,it knows nothing what your code is trying to achieve(It does predicts somethings).So if you have patience enough to write asm codes and u are miser enuf to optimize it you

Re: [algogeeks] Re: How to use asm in spoj

2011-06-18 Thread saurabh singh
Yeah terence was rightThat was the case... On Sat, Jun 18, 2011 at 5:25 PM, saurabh singh saurab...@gmail.com wrote: @Aditya I have been doing this for sometime now,and it does seem to work mainly because compiler works at a general level,it knows nothing what your code is trying to

[algogeeks] Re: How to use asm in spoj

2011-06-17 Thread DK
What compiler are you using? Version, compile options etc. -- DK -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/Wf2PvNNjTikJ. To post to this group, send

Re: [algogeeks] Re: How to use asm in spoj

2011-06-17 Thread saurabh singh
I am using standard gcc 4.3.2 and the code does not requires any flag to be required.I also checked the alias if gcc has been aliased to be used with some option,but that was not the case.My operating system is ubuntu.The error I get is CONT1D and D1ONE already defined. I wonder if spoj has a

[algogeeks] Re: How to use asm in spoj

2011-06-17 Thread Gene
Spoj uses -O2 -fomit-frame-pointer when it compiles. Could that be it? Maybe the %1 and %2 don't work with this option. Just a guess... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit