Recent

Author Topic: cross compile windows 32 to windows 64 extended floating point type gets double  (Read 1052 times)

beepee

  • New member
  • *
  • Posts: 6
The cross compiler
ppcrossx64 -Twin64
does revert the extended real type to double real type.
As far as I know, the extended type *is* available for 64 bits programs on Intel/AMD processors as it is available for 32 bits programs
Is this a known issue?

lucamar

  • Hero Member
  • *****
  • Posts: 4219
It's both known and on purpose. IIRC, it's a gimmick of how Windows itself either uses or sets up the processor (don't remember which) which makes it forego the use of extended in favor of some other feature (SSE? AVX? ???).

The point is that on Windows 64bit you can't use Extended (at least not easily) so by default it's aliased to Double.
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.

beepee

  • New member
  • *
  • Posts: 6
Thanks, and:
Ahh, just found out is the same at Delphi, see this link:
http://docwiki.embarcadero.com/RADStudio/Sydney/en/Delphi_Considerations_for_Multi-Device_Applications#The_Extended_Data_Type_Is_2_Bytes_Smaller_on_64-bit_Windows_Systems

However I am still not amused the type is not available for 64 bits programs

lucamar

  • Hero Member
  • *****
  • Posts: 4219
However I am still not amused the type is not available for 64 bits programs

Why? Do you a explicit, specific need for the 80 bit Extended? Note that Intel has always said that Extended was intended for intermediate, internal calculations and that it shouldn't be generally used unles strictely needed, so it "dissapearance" shouldn't come as a surprise.

Granted, it would be nicer if it were there when absolutely needed, but since it isn't ...
« Last Edit: December 25, 2020, 10:43:05 pm by lucamar »
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: 3490
  • Compiler Developer
As far as I know, the extended type *is* available for 64 bits programs on Intel/AMD processors as it is available for 32 bits programs
Is this a known issue?

This is because Microsoft considers the 80-bit types as deprecated for Win64 and strongly suggests programs not to use it.

For any other x64 platform the 80-bit type is available. However it isn't available for any non-x86 platform anyway.

beepee

  • New member
  • *
  • Posts: 6
Why? Do you a explicit, specific need for the 80 bit Extended? Note that Intel has always said that Extended was intended for intermediate, internal calculations and that it shouldn't be generally used unles strictely needed, so it "dissapearance" shouldn't come as a surprise.
When doing high precision searches, like finding small differences between sums of square-roots, extra bits help for pre-selections
(see e.g. https://topp.openproblem.net/master.pdf problem 33 or search for "Erik D Demaine open problems problem 33')
Puzzle: Which one is bigger:
a) sqrt(13274) +sqrt(26086) +sqrt(37407) + sqrt(95*95)
b) sqrt(24417) +sqrt(35473) +sqrt(48634)
(hint: extended type will not help here)

However, I am rewriting my arbitrary fixed point unit to work with doubles and it seems to run faster, especially on an AMD Ryzen processor, not that much difference on an Intel Core-I7.

 

TinyPortal © 2005-2018