[fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-14 Thread andrew.bennett
On Thu, 12 May 2011 20:54:16 +0200 cobines wrote > I have written the following program: > ... > max := 1; > for i := 0 to max do > vd := i / max; A really smart compiler would notice that this in this loop the value of vd is never examined, the loop being equivalent to

Re: [fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-13 Thread Marcos Douglas
On Fri, May 13, 2011 at 11:23 AM, Jonas Maebe wrote: > > On 13 May 2011, at 16:08, Marcos Douglas wrote: > >> So, not to use the option -O in i386? >> When I compile FPC sources, on Win32 XP SP3, using make, the option is >> used. > > It is used because in general it results in faster code. This i

Re: [fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-13 Thread cobines
2011/5/13 Vincent Snijders : > Did you try one of the -Cf options to enable MMX on i386? I was wrong, sorry. The instruction in question is "cvtsi2sd", which is SSE2 not MMX. Maybe on x86_64 SSE2 is default. Indeed if I add -CfSSE2 than those instructions are generated for i386, at least for vari

Re: [fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-13 Thread Marcos Douglas
On Fri, May 13, 2011 at 11:12 AM, Vincent Snijders wrote: > 2011/5/13 Marcos Douglas : >> So, not to use the option -O in i386? >> When I compile FPC sources, on Win32 XP SP3, using make, the option is used. >> >> I'm confusing now... > > Did you try one of the -Cf options to enable MMX on i386?

Re: [fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-13 Thread Jonas Maebe
On 13 May 2011, at 16:08, Marcos Douglas wrote: So, not to use the option -O in i386? When I compile FPC sources, on Win32 XP SP3, using make, the option is used. It is used because in general it results in faster code. This is one particular example where it doesn't. That does not mean t

Re: [fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-13 Thread Vincent Snijders
2011/5/13 Marcos Douglas : > So, not to use the option -O in i386? > When I compile FPC sources, on Win32 XP SP3, using make, the option is used. > > I'm confusing now... Did you try one of the -Cf options to enable MMX on i386? Vincent ___ fpc-pascal m

Re: [fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-13 Thread Marcos Douglas
On Fri, May 13, 2011 at 9:54 AM, cobines wrote: > 2011/5/13 Ben : >> On 12/05/2011 20:54, cobines wrote: >>> >>> I'm running it on Windows XP i386, compiled with FPC 2.5.1 17430. >>> >> >> >> I tried this on my system which runs 64-bit Linux with FPC 2.4.3 (64-bit). >> >> Using -O, -O2 or -O3 comm

Re: [fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-13 Thread cobines
2011/5/13 Ben : > On 12/05/2011 20:54, cobines wrote: >> >> I'm running it on Windows XP i386, compiled with FPC 2.5.1 17430. >> > > > I tried this on my system which runs 64-bit Linux with FPC 2.4.3 (64-bit). > > Using -O, -O2 or -O3 command line parameters. In each case, the > generated executabl

[fpc-pascal] Re: Register variables slowing down floating point operations

2011-05-13 Thread Ben
On 12/05/2011 20:54, cobines wrote: > > I'm running it on Windows XP i386, compiled with FPC 2.5.1 17430. > I tried this on my system which runs 64-bit Linux with FPC 2.4.3 (64-bit). Using -O, -O2 or -O3 command line parameters. In each case, the generated executable runs exactly the same. The