Recent

Author Topic: Why free pascal suppress the "extended" floating point type on win64 platform?  (Read 9482 times)

photor

  • Jr. Member
  • **
  • Posts: 80
Then how to achieve high precision floating point operation on win64 platform?
« Last Edit: February 09, 2025, 04:30:11 am by photor »

photor

  • Jr. Member
  • **
  • Posts: 80
No one knows?

ccrause

  • Hero Member
  • *****
  • Posts: 1007

runewalsh

  • Jr. Member
  • **
  • Posts: 86
I don’t understand myself. Microsoft proclaimed x87 80-bit extended “deprecated” but it is de-facto fully supported and will be supported for the indefinite future, the 64-bit Windows application could “just” use FPU with its 80-bit types the usual way.

Not that you’ll want to do it, though. 80-bit extendeds have a nice property of fitting signed 64-bit values losslessly but are otherwise more useless than one might think. And you’ve had 11 years to realize it yourself...

DragoRosso

  • Guest
Look this:
  https://forum.lazarus.freepascal.org/index.php/topic,62198.msg470222.html#msg470222

They told that there is a possibility to use extended precision.

But this is not a standard, although that doesn't mind that you cannot use it.

nanobit

  • Full Member
  • ***
  • Posts: 168
The term "deprecated" (for x87) was officially written in context of MSVC,
and has a longer history: MSVC was already without float80 (except in x87 asm) on win32.
For MSVC users, x87 float80 asm has been rare since win32, thus Microsoft can simply say:
The x87 support in MSVC, just needed for float80 in asm (not cross-platform),
is overly expensive, and unrequired in the longer term.

For all compilers, SSE (float32, float64) is preferred,
so float80 needs a separate implementation (x87 FPU or different).

The general plan is that compilers implement float80, float128 to be cross-platform.
With FPC,  this currently means (untested by me): softfpu.pp for basic arithmetic
(overloaded operators in ufloatx80), and external library for other math functions.
« Last Edit: February 09, 2025, 08:02:22 pm by nanobit »

BrunoK

  • Hero Member
  • *****
  • Posts: 687
  • Retired programmer
Look this:
  https://forum.lazarus.freepascal.org/index.php/topic,62198.msg470222.html#msg470222

They told that there is a possibility to use extended precision.

But this is not a standard, although that doesn't mind that you cannot use it.
The link is https://forum.lazarus.freepascal.org/index.php/topic,62198.0.html?PHPSESSID=72q4in752k8q6msk7ncugrsh62

If you need 80 bit extended on X86-64, throw out Microsoft windows and go Linux !

You'll also get functional multiplication with Currency type, quite a bonus.

nanobit

  • Full Member
  • ***
  • Posts: 168
If you need 80 bit extended on X86-64, throw out Microsoft windows and go Linux !

Hmm? https://gs.statcounter.com/os-market-share/desktop/worldwide

dsiders

  • Hero Member
  • *****
  • Posts: 1377
If you need 80 bit extended on X86-64, throw out Microsoft windows and go Linux !

Hmm? https://gs.statcounter.com/os-market-share/desktop/worldwide

That's a bogus number.  When they force you to have a Windows license for every PC sold, even if it is not used, the numbers do not represent actual usage.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

LV

  • Full Member
  • ***
  • Posts: 239
Then how to achieve high precision floating point operation on win64 platform?

Use
https://www.mpfr.org/
MPFR allows you to specify arbitrary precision (e.g. 128 bits).

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10930
  • Debugger - SynEdit - and more
    • wiki
Afaik / IIRC something like
Code: Pascal  [Select][+][-]
  1. uses ufloatx80, sfpux80;
  2. type
  3.   TSoftExtended = floatx80;
  4.  

May or may not require fpc fixes or trunk... Not sure.

dseligo

  • Hero Member
  • *****
  • Posts: 1480
When they force you to have a Windows license for every PC sold

Who forces you?

dsiders

  • Hero Member
  • *****
  • Posts: 1377
When they force you to have a Windows license for every PC sold

Who forces you?

Go buy a laptop.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

dseligo

  • Hero Member
  • *****
  • Posts: 1480
When they force you to have a Windows license for every PC sold

Who forces you?

Go buy a laptop.

In your place you can't buy laptop if there is no MS Windows on it?

https://www.links.hr/hr/laptop-hp-pavilion-15-eh3025nm-9j528ea-ryzen-7-7730u-16gb-512gb-ssd-amd-radeon-graphics-156-fhd-ips-bez-os-srebrni-0101011807

"bez OS" means "no OS".

https://www.mikronis.hr/Proizvod/dell-vostro-3530-n1227-15-6-fullhd-120hz-intel-core-i5-1334u-16gb-512gb-ssd-ubuntu-intel-iris-xe-graphics/46630

This one has Linux.

There are bunch of them without Windows. Sometimes I have to buy Windows separately if store doesn't have model I want with Windows.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10930
  • Debugger - SynEdit - and more
    • wiki
Go buy a laptop.

I did. Several times in the past 1 to 2 decades => always without OS. Yes well, you can opt out from Windows easy enough, but choice gets limited if you want Linux pre installed. Anyway, installing Linux never had been an issue. (runs out of the box)

 

TinyPortal © 2005-2018