Recent

Author Topic: [CLOSED] SizeOf Extended  (Read 1428 times)

julkas

  • Guest
[CLOSED] SizeOf Extended
« on: June 07, 2020, 08:16:27 pm »
Why on Win10 64b,  FPC 3.0.4 SizeOf(extended) is 8?
« Last Edit: June 07, 2020, 09:26:06 pm by julkas »

Josh

  • Hero Member
  • *****
  • Posts: 1270
Re: SizeOf Extended
« Reply #1 on: June 07, 2020, 08:36:24 pm »
The best way to get accurate information on the forum is to post something wrong and wait for corrections.


lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: SizeOf Extended
« Reply #3 on: June 07, 2020, 09:14:58 pm »
Ok. But it must be 10 -

No, in Windows 64 bits Extended is the same as Double. Something to do with Microsoft having deprecated "extended" :o
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5444
  • Compiler Developer
Re: SizeOf Extended
« Reply #4 on: June 07, 2020, 09:15:05 pm »
Why on Win10 64b,  FPC 3.0.4 SizeOf(extended) is 8?

On Win64 (and any non-x86) target the Extended type is an alias to Double, because the 80-bit floating point type is not available. Microsoft has deemed the x87 FPU as deprecated with Windows 64-bit, thus applications shouldn't make use of it and FPC adheres to that.

julkas

  • Guest
Re: SizeOf Extended
« Reply #5 on: June 07, 2020, 09:24:58 pm »
We must update documentation.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: [CLOSED] SizeOf Extended
« Reply #6 on: August 04, 2020, 03:58:17 pm »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: [CLOSED] SizeOf Extended
« Reply #7 on: August 04, 2020, 04:34:31 pm »
Someone who is good in English, please update these pages:
https://wiki.freepascal.org/Variables_and_Data_Types
https://wiki.freepascal.org/IEEE_754_formats

Done for the former; the later already had a note about platforms which don't support Extended.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Kays

  • Hero Member
  • *****
  • Posts: 569
  • Whasup!?
    • KaiBurghardt.de
Re: [CLOSED] SizeOf Extended
« Reply #8 on: August 04, 2020, 05:13:44 pm »
[…] Done for the former; the later already had a note about platforms which don't support Extended.
Well, I just added it. The important thing is, though, that the programmer’s guide correctly documents the FP types.
Yours Sincerely
Kai Burghardt

Thaddy

  • Hero Member
  • *****
  • Posts: 14158
  • Probably until I exterminate Putin.
Re: [CLOSED] SizeOf Extended
« Reply #9 on: August 04, 2020, 05:15:43 pm »
Couple of remarks:
1. FPC can actually support 10 bits extended on win64, but it is non-standard (in the sense of non-abi compliant)  and requires a recompile of the compiler and rtl. Not recommended unless you really need it. Florian explained somewhere how to do that. (can't find it soon enough, but the info is there)
2. The issue at hand is the same for (48 bit) real, which is aliased to double, but has a support unit to be able to read/write and to some extend calculate with 48 bit real values. (unit real48, which is in reality the real real and not a double   8-) )
« Last Edit: August 04, 2020, 05:19:32 pm by Thaddy »
Specialize a type, not a var.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5444
  • Compiler Developer
Re: SizeOf Extended
« Reply #10 on: August 05, 2020, 09:44:09 am »
We must update documentation.

Well, it is (partially) mentioned in the Programmer's Guide (as Kays already wrote) as any non-x86 has Extended = Double as well, but the oddity that is Win64 is not mentioned and it should also be mentioned in the Language Reference Guide. Thus I've filed a bug report for this. :)

 

TinyPortal © 2005-2018