> But when you are using cli/sti is it doing anything?
>
> change it to:
>
> double x = 3.4;
> double y = 5.67;
> double z = 0.0;
> for (long i=1; i<10000; i++) {
> z += x+y;
> }
>
> printf("%lf\n",z);
>
> and test then with and without cli/sti
Rewriting so as to not make the code dependent on how smart the optimizer
is. Sound advice which I ASsumed the original poster had though of. I'd like
to go one step further; The ASM-opcode emits is sure to affect the optimizer
so code like:
<BLOCKQUOTE>
double test(long end) {
double x = 3.4, y = 5.67, z = 0.0;
for ( long i = 1; i < end; i++ )
z += x+y;
return z;
}
main(void) {
puts("***Starts");
/* Is 10000 really enough? */
printf("%lf\n", test(10000));
asm("cli");
printf("%lf\n", test(10000));}
asm("sti");
}
</BLOCKQUOTE>
would be good. Compile without automatic inlining and clock this with
manually. It would be nice with some feedback on how this goes. I'll ask
someone to verify your Singh's findings on one of our old SC410 card thats
lying around here somewhere.
//Bj�rnen.
--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.