Jonas Maebe wrote:
>
> On 7 sep 2006, at 08:59, Daniël Mantione wrote:
>
>>> Afaik only in case of reading a boolean everything <> 0 is true (for
>>> compatibility with other languages). In case of writing, Pascal (and
>>> FPC in
>>> particular) always stores a 1 for true and 0 for false, since b
On 7 sep 2006, at 08:59, Daniël Mantione wrote:
Afaik only in case of reading a boolean everything <> 0 is true (for
compatibility with other languages). In case of writing, Pascal
(and FPC in
particular) always stores a 1 for true and 0 for false, since
boolean is
defined as an enum with
Op Thu, 7 Sep 2006, schreef Jonas Maebe:
>
> On 7 sep 2006, at 07:52, Peter Vreman wrote:
>
> > This is not a generic optimization that will give real benefits. Your
> > code
> > also relies on the fact that (a > garantueed. A boolean is defined as 0=false and everything else is true.
>
> Afa
On 7 sep 2006, at 07:52, Peter Vreman wrote:
This is not a generic optimization that will give real benefits.
Your code
also relies on the fact that (ais not
garantueed. A boolean is defined as 0=false and everything else is
true.
Afaik only in case of reading a boolean everything <> 0 is
> Hello,
>
> I wonder if FPC optimize a code such as:
>
> if a < b then
> c := d
> else
> c := b;
>
> as :
>
> r := b + ((d - b) and -(a < b));
>
> If so, do you check the type of CPU (because as I understand, some CPU
> will not execute as fast as other CPU's.
>
> If not, then why, and how wou
Daniël Mantione schrieb:
Op Wed, 6 Sep 2006, schreef ik:
Hello,
I wonder if FPC optimize a code such as:
if a < b then
c := d
else
c := b;
as :
r := b + ((d - b) and -(a < b));
If so, do you check the type of CPU (because as I understand, some CPU
will not execute as fast as other CPU's.
Op Wed, 6 Sep 2006, schreef ik:
> Hello,
>
> I wonder if FPC optimize a code such as:
>
> if a < b then
> c := d
> else
> c := b;
>
> as :
>
> r := b + ((d - b) and -(a < b));
>
> If so, do you check the type of CPU (because as I understand, some CPU
> will not execute as fast as other CPU
Hello,
I wonder if FPC optimize a code such as:
if a < b then
c := d
else
c := b;
as :
r := b + ((d - b) and -(a < b));
If so, do you check the type of CPU (because as I understand, some CPU
will not execute as fast as other CPU's.
If not, then why, and how would you optimize such code ?