[fpc-devel] Compiler limitations

2008-05-09 Thread Miklos Cserzo


Hi Folks,

according the documentation "Arrays are limited to 2 GBytes in size in 
the default processor mode." Is there another mode allowing bigger arrays?


Cheers,

miklos

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compiler limitations

2008-05-09 Thread ik
What about iterators, linked lists ? You can use them some of them.
You can also create a temporary file that built in a way that you
understand it as an "array". there are many ways to do work around
over this issues.
I yet found a good reason to have such a big data for array. It's bed
practice. you should use either iterators or linked list (while many
times iterators are better).

Ido

On Fri, May 9, 2008 at 11:21 AM, Miklos Cserzo <[EMAIL PROTECTED]> wrote:
>
> Hi Folks,
>
> according the documentation "Arrays are limited to 2 GBytes in size in the
> default processor mode." Is there another mode allowing bigger arrays?
>
> Cheers,
>
> miklos
>
> ___
> fpc-devel maillist  -  fpc-devel@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>



-- 
http://ik.homelinux.org/
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compiler limitations

2008-05-09 Thread Florian Klaempfl

Miklos Cserzo schrieb:


Hi Folks,

according the documentation "Arrays are limited to 2 GBytes in size in 
the default processor mode." Is there another mode allowing bigger arrays?


64 Bit mode/compiler.



Cheers,

miklos

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compiler limitations

2008-05-09 Thread Vincent Snijders

Florian Klaempfl schreef:

Miklos Cserzo schrieb:


Hi Folks,

according the documentation "Arrays are limited to 2 GBytes in size in 
the default processor mode." Is there another mode allowing bigger 
arrays?


64 Bit mode/compiler.



Except for darwin.

Except it doesn't work:
http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=21737&testfileid=2417

Vincent
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compiler limitations

2008-05-09 Thread Jonas Maebe


On 09 May 2008, at 22:43, Vincent Snijders wrote:


Florian Klaempfl schreef:

Miklos Cserzo schrieb:


Hi Folks,

according the documentation "Arrays are limited to 2 GBytes in  
size in the default processor mode." Is there another mode  
allowing bigger arrays?

64 Bit mode/compiler.


Except for darwin.

Except it doesn't work:
http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=21737&testfileid=2417


Maybe Win64 doesn't support it either.

And note that this test (and the darwin remark) about statically  
allocated arrays. Dynamically allocated arrays don't have such  
limitations.



Jonas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compiler limitations

2008-05-09 Thread Florian Klaempfl

Vincent Snijders schrieb:

Florian Klaempfl schreef:

Miklos Cserzo schrieb:


Hi Folks,

according the documentation "Arrays are limited to 2 GBytes in size 
in the default processor mode." Is there another mode allowing bigger 
arrays?


64 Bit mode/compiler.



Except for darwin.

Except it doesn't work:
http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=21737&testfileid=2417 


This is operation system dependent also if you can declare static data 
structures of this size. Things like


type
  ta = array[0..$f] of byte;
var
  p : ^ta;

begin
  new(p);
end.

should work e.g. on linux.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compiler limitations

2008-05-09 Thread Vincent Snijders

Jonas Maebe schreef:


On 09 May 2008, at 22:43, Vincent Snijders wrote:


Florian Klaempfl schreef:

Miklos Cserzo schrieb:


Hi Folks,

according the documentation "Arrays are limited to 2 GBytes in size 
in the default processor mode." Is there another mode allowing 
bigger arrays?

64 Bit mode/compiler.


Except for darwin.

Except it doesn't work:
http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=21737&testfileid=2417 



Maybe Win64 doesn't support it either.


Linux either:
http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=21719&testfileid=2417



And note that this test (and the darwin remark) about statically 
allocated arrays. Dynamically allocated arrays don't have such limitations.


Good point.

Vincent
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compiler limitations

2008-05-09 Thread Marco van de Voort
> Vincent Snijders schrieb:
> > 
> > Except it doesn't work:
> > http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=21737&testfileid=2417
> >  
> 
> This is operation system dependent also if you can declare static data 
> structures of this size. Things like
> 
> type
>ta = array[0..$f] of byte;
> var
>p : ^ta;
> 
> begin
>new(p);
> end.
> 
> should work e.g. on linux.

Has sb meanwhile crafted an executable on win64 that actually uses >2GB ?

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compiler limitations

2008-05-09 Thread Daniël Mantione



Op Fri, 9 May 2008, schreef Florian Klaempfl:


Vincent Snijders schrieb:

Florian Klaempfl schreef:

Miklos Cserzo schrieb:


Hi Folks,

according the documentation "Arrays are limited to 2 GBytes in size in 
the default processor mode." Is there another mode allowing bigger 
arrays?


64 Bit mode/compiler.



Except for darwin.

Except it doesn't work:
http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=21737&testfileid=2417 


This is operation system dependent also if you can declare static data 
structures of this size. Things like


type
 ta = array[0..$f] of byte;
var
 p : ^ta;

begin
 new(p);
end.

should work e.g. on linux.


Yes, this would work, but wrapping it in a record and adding a field to it 
might not work. The reason is that the x86_64 still uses singed 32-bit 
displacements in its operands. To support this, a different code 
generation is needed, which we don't have.


Many compilers have an mcmodel switch. FPC's x86_64 code generation 
compares to mcmodel=small.


Daniël___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compiler limitations

2008-05-09 Thread Florian Klaempfl

Daniël Mantione schrieb:



Op Fri, 9 May 2008, schreef Florian Klaempfl:


Vincent Snijders schrieb:

Florian Klaempfl schreef:

Miklos Cserzo schrieb:


Hi Folks,

according the documentation "Arrays are limited to 2 GBytes in size 
in the default processor mode." Is there another mode allowing 
bigger arrays?


64 Bit mode/compiler.



Except for darwin.

Except it doesn't work:
http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=21737&testfileid=2417 



This is operation system dependent also if you can declare static data 
structures of this size. Things like


type
 ta = array[0..$f] of byte;
var
 p : ^ta;

begin
 new(p);
end.

should work e.g. on linux.


Yes, this would work, but wrapping it in a record and adding a field to 
it might not work. The reason is that the x86_64 still uses singed 
32-bit displacements in its operands. 


This is only important for static data which requires relocation. For 
heap/stack the compiler simply generates the constants.


To support this, a different code 
generation is needed, which we don't have.


Many compilers have an mcmodel switch. FPC's x86_64 code generation 
compares to mcmodel=small.


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel