Seems nobody cares about --std-c99 and _Bool speed before, so I made a test
my self, using the following function:
BOOLEAN TestBoolean(BOOLEAN b1)
{
USHORT s;
BOOLEAN b2;
BOOLEAN b3;
b3 = IsHighSpeed();
for (s = 0; s < 30000; s ++)
{
b2 = b1 ? b3 : FALSE;
}
return b2;
}
When BOOLEAN as unsigned char, the running time of this function on my Z80
is 137ms, and code generated is less by 4 bytes.
When BOOLEAN as _Bool, using bit related instructions, this function need
167ms to run.
Woody
http://palmmicro.com/woody/
----- Original Message -----
From: "Lin Rongrong" <[email protected]>
To: <[email protected]>; <[email protected]>
Sent: Monday, December 06, 2010 8:30 AM
Subject: Z80 --std-c99 and _Bool
>I have noticed that Philipp used _Bool in his own project, so I tried it
>with my own. To my surprise, after I added --std-c99 option, change BOOLEAN
>from "unsigned char" to "_Bool", I found code size generally get larger as
>below:
>
> code0 data code1 code2 code3 code4 code5 code6 code7 code
> 1D5B 19C4 456D 4F9C 4742 50AD 53F1 4354 5571 1B64 // gp2266 sip
> 0.49.022, without --std-c99, or BOOLEAN as "unsigned char" with --std-c99,
> they generated the same result
> 1D76 19C4 4610 4FD4 47A7 50B9 542D 4354 55A6 1B67 // gp2266 sip
> 0.49.023, with --std-c99 and BOOLEAN as "_Bool"
>
> I am willing to get faster speed with more code size, should I
> keep --std-c99 option and use BOOLEAN as _Bool?
>
> Woody
>
> http://palmmicro.com/woody/
>
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user