Re: Loop optimization

2010-05-16 Thread Brad Roberts
On 5/16/2010 4:15 PM, Walter Bright wrote: > bearophile wrote: >> DMD compiler doesn't perform many optimizations, > > This is simply false. DMD does an excellent job with integer and pointer > operations. It does a so-so job with floating point. > > There are probably over a thousand optimizatio

Re: Loop optimization

2010-05-16 Thread bearophile
Walter Bright: > This is simply false. DMD does an excellent job with integer and pointer > operations. It does a so-so job with floating point. > There are probably over a thousand optimizations at all levels that dmd does > with integer and pointer code. You are of course right, I understand y

Re: Loop optimization

2010-05-16 Thread Walter Bright
bearophile wrote: DMD compiler doesn't perform many optimizations, This is simply false. DMD does an excellent job with integer and pointer operations. It does a so-so job with floating point. There are probably over a thousand optimizations at all levels that dmd does with integer and poin

Re: Loop optimization

2010-05-16 Thread Walter Bright
Don wrote: bearophile wrote: kai: Any ideas? Am I somehow not hitting a vital compiler optimization? DMD compiler doesn't perform many optimizations, especially on floating point computations. More precisely: In terms of optimizations performed, DMD isn't too far behind gcc. But it perfor

Re: Different typeof syntax

2010-05-16 Thread Robert Clipsham
On 16/05/10 21:43, bearophile wrote: Do you know if it's possible to replace typeof(f1) with f1.typeof in D (for symmetry with sizeof too)? import std.stdio: writeln; struct Foo { int x; } void main() { Foo f1; int fsize = f1.sizeof; // OK alias typeof(f1) T1; // OK

Re: Loop optimization

2010-05-16 Thread Jérôme M. Berger
div0 wrote: > Jérôme M. Berger wrote: >> div0 wrote: >>> Jérôme M. Berger wrote: That depends. In C/C++, the default value for any global variable is to have all bits set to 0 whatever that means for the actual data type. >>> No it's not, it's always uninitialized. >>> >> Ac

Different typeof syntax

2010-05-16 Thread bearophile
Do you know if it's possible to replace typeof(f1) with f1.typeof in D (for symmetry with sizeof too)? import std.stdio: writeln; struct Foo { int x; } void main() { Foo f1; int fsize = f1.sizeof; // OK alias typeof(f1) T1; // OK alias f1.typeof T2;// ERR } [What I

Re: Loop optimization

2010-05-16 Thread Jouko Koski
"div0" wrote: Jérôme M. Berger wrote: That depends. In C/C++, the default value for any global variable is to have all bits set to 0 whatever that means for the actual data type. Ah, I only do C++, where the standard is to not initialise. No, in C++ all *global or static* variables are zero-

Re: siginfo_t not defined

2010-05-16 Thread negerns
On 5/16/2010 10:46 PM, negerns wrote: Why is the definition of 'siginfo_t' in druntime\import\core\sys\posix\signal.d commented out? BTW, I'm using dmd 2.046 on windows vista 32-bit. - siginfo_t is only for posix/linux; can't use it in windows. - siginfo_t isn't really used by gregorian.d but t

Re: siginfo_t not defined

2010-05-16 Thread negerns
Why is the definition of 'siginfo_t' in druntime\import\core\sys\posix\signal.d commented out? BTW, I'm using dmd 2.046 on windows vista 32-bit.

siginfo_t not defined

2010-05-16 Thread negerns
I got the following error messages. The file test.d is just int main(string[] args) { return 0; } and gregorian.d is from the latest svn trunk. Compile: dmd test.d gregorian.d D:\projects\dmd\dmd2\windows\bin\..\..\src\druntime\import\core\sys\posix\signal.d(25): Error: identifier 'siginf

Re: Loop optimization

2010-05-16 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jérôme M. Berger wrote: > div0 wrote: >> Jérôme M. Berger wrote: >>> That depends. In C/C++, the default value for any global variable >>> is to have all bits set to 0 whatever that means for the actual data >>> type. >> No it's not, it's always u