Recent

Author Topic: how to use 32bit or 64bit pointer?  (Read 6424 times)

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
how to use 32bit or 64bit pointer?
« on: July 06, 2015, 12:18:05 pm »
how to use 32bit or 64bit pointer?
cai i use it like this?
var
p32:pointer32;
p64:pointer64;

but it seems it is not have pointer32 and pointer64.

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: how to use 32bit or 64bit pointer?
« Reply #1 on: July 06, 2015, 03:50:33 pm »
Simply use the Pointer or PtrUInt types.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: how to use 32bit or 64bit pointer?
« Reply #2 on: July 06, 2015, 04:01:10 pm »
how to use 32bit or 64bit pointer?

For 32-bit compilers, use the 32-bit compiler, for 64-bit pointers use the 64-bit compiler.

There is no programming model that has both 32-bit and 64-bit pointers.
 

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: how to use 32bit or 64bit pointer?
« Reply #3 on: July 06, 2015, 08:27:52 pm »
@Marco: Yes, there IS a 32bit compiler model with 64bit pointer extensions in e.g. GCC, but FPC doesn't provide a compiler for that (yet?).
Specialize a type, not a var.

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
Re: how to use 32bit or 64bit pointer?
« Reply #4 on: July 06, 2015, 09:30:42 pm »
For 32-bit compilers, use the 32-bit compiler, for 64-bit pointers use the 64-bit compiler.
;D For 32-bit compilers, use definitely the 32-bit compiler ... of course  ;) Or a Crosscompiler.  8-)

@greenzyzyzy:
What is the reason for your Question, is
Simply use the Pointer or PtrUInt types.
the answer ?

If not tell a little more what you want to do.
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
Re: how to use 32bit or 64bit pointer?
« Reply #5 on: July 07, 2015, 11:52:23 am »
@Marco: Yes, there IS a 32bit compiler model with 64bit pointer extensions in e.g. GCC, but FPC doesn't provide a compiler for that (yet?).

en,i think so,it seems that  Visual Studio is support 32bit pointer and 64bit pointer.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: how to use 32bit or 64bit pointer?
« Reply #6 on: July 07, 2015, 12:55:11 pm »
@Marco: Yes, there IS a 32bit compiler model with 64bit pointer extensions in e.g. GCC, but FPC doesn't provide a compiler for that (yet?).

Please be more clear, do you mean far pointers or x32 ? what do you mean?

x32 is a different architecture, and far pointers are for pointers outside the normal application space. You are welcome to submit a patch. (would be useful for go32v2 especially I guess)

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
Re: how to use 32bit or 64bit pointer?
« Reply #7 on: July 07, 2015, 06:35:54 pm »
en,i think so,it seems that  Visual Studio is support 32bit pointer and 64bit pointer.
Why do you need a 64-bit pointer in a 32-bit system, even it's a subsystem ?
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

greenzyzyzy

  • Full Member
  • ***
  • Posts: 249
Re: how to use 32bit or 64bit pointer?
« Reply #8 on: July 08, 2015, 06:15:43 am »
en,i think so,it seems that  Visual Studio is support 32bit pointer and 64bit pointer.
Why do you need a 64-bit pointer in a 32-bit system, even it's a subsystem ?

ok,it does not matter,it can just use 32bit application instead.thanks all

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: how to use 32bit or 64bit pointer?
« Reply #9 on: July 08, 2015, 08:10:05 am »
@Marco: Yes, there IS a 32bit compiler model with 64bit pointer extensions in e.g. GCC, but FPC doesn't provide a compiler for that (yet?).

Please be more clear, do you mean far pointers or x32 ? what do you mean?

x32 is a different architecture, and far pointers are for pointers outside the normal application space. You are welcome to submit a patch. (would be useful for go32v2 especially I guess)

The ratio behind that particular model is to have the relative compactness of 32 bit code with 64 bit address space. It is well known, but less used. LLVM supports that too, btw.
Specialize a type, not a var.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: how to use 32bit or 64bit pointer?
« Reply #10 on: July 08, 2015, 10:30:59 am »
The ratio behind that particular model is to have the relative compactness of 32 bit code with 64 bit address space. It is well known, but less used. LLVM supports that too, btw.

Is it still relevant? IIRC they mainly benchmarked on the older Atom (with its slow 64-bit imul), which afaik is now resolved in recent ones.

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: how to use 32bit or 64bit pointer?
« Reply #11 on: July 08, 2015, 02:28:53 pm »
Yes, but that was not what you asked. If it is relevant or not is not the case, just that that particular type of compiler really exists. Which it does. And rarely used afaik.
Specialize a type, not a var.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: how to use 32bit or 64bit pointer?
« Reply #12 on: July 08, 2015, 07:28:58 pm »
Yes, but that was not what you asked.

What I asked is if what really about 32-bit and 64-bit pointers or about a different architecture, x32.

That matters a lot, since then it is not about adding a pointer type, but about adding a new architecture port.

Quote
If it is relevant or not is not the case, just that that particular type of compiler really exists. Which it does. And rarely used afaik.

The original question was about pointer types, not architectures. Questions about pointer types in already irrelevant architectures are of course less interesting  >:D

 

TinyPortal © 2005-2018