Author Topic: Bugfixing mparith (Wolfgang Ehrhardt's code) & Extended record enumerators  (Read 890 times)


  • Sr. Member
  • ****
  • Posts: 423
Though the definition of EXT64 could also be improved like this:

Code: Pascal  [Select][+][-]
  1. {$ifndef FPC_HAS_TYPE_EXTENDED}
  2.   {$define EXT64}
  3. {$endif}

After all Extended isn't available for most platforms and also not for Win64.
Certainly true, except that the include files from Wolfgang seems to be a tad more complicated than that to be able to add/include that without care.

Seems that cpu64 define is checked , which in turn defines the bit64 define. the win64 define is checked to take care of defining EXT64.

Depending on the bitxx define (16, 32 or 64) it seems to 'switch' between defining extended as double or a real/simulated extended.

I do believe that inside a similar adjustment is required. Now it reads:
Code: Pascal  [Select][+][-]
  1. {$ifndef MPC_PurePascal}
  2.   {$ifdef BIT64}
  3.     {$define MPC_PurePascal}
  4.   {$endif}
  5.   {$ifdef CPUARM}
  6.     {$define MPC_PurePascal}
  7.   {$endif}
  8. {$endif}


  • Hero Member
  • *****
  • Posts: 1048
    • UVviewsoft
Updated file in all 20+ places to last version which knows AArch64.


  • Hero Member
  • *****
  • Posts: 1048
    • UVviewsoft
Updated too.


  • Full Member
  • ***
  • Posts: 205
I am trying to compile mparith on a number of different computers.
It appears that mparith is still available here
(Wolfgang passed away June 2019)

Hello dieselnutjob,

Not sure where you are heading with your interest in mparith, but i harbour the thought you might work on the library and not only with the library.

In case of working on the library the attached may be of some use - feel free. I did it some time ago, even sent it to Wolfgang Erhardt, but too late unfortunately.

PS - I just re-read my post and think I did not provide enough explanation why I think the attached benchmark utility might be beneficial. mparith defines threshold values for selection of best suited algorithm variants - e.g. schoolbook multiply => Karatsuba multiply => Toom-Cook multiply. These thresholds are static and identical across all plattforms, which is not the best choice. I used the benchmark utility to identify the optimal selection for the thresholds on my PC. With these I could generate speed improvements between 200%-300%.

Kind regards,
« Last Edit: August 02, 2020, 02:58:41 pm by MathMan »


  • Full Member
  • ***
  • Posts: 176
I helped Wolfgang with one very specific and small part of his software about ten years ago.

So basically I am just a user.

I think that his code is an absolute work of art and therefore I would like it to live on and keep using it.

I'm sure I'm not the only one.  Thank you Alextp for your efforts.

Freepascal is already ported to the new 64 bit ARM Macbooks and also I just bought a Pinebook Pro so my interest in ARM is very high at the moment.


TinyPortal © 2005-2018