Recent

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

TRon

  • Hero Member
  • *****
  • Posts: 2503
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.


@alextp
I do believe that inside mpconf.inc 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}
  9.  

AlexTP

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

AlexTP

  • Hero Member
  • *****
  • Posts: 2401
    • UVviewsoft
Updated mp_conf.inc too.

MathMan

  • Sr. Member
  • ****
  • Posts: 325
Hi
I am trying to compile mparith on a number of different computers.
It appears that mparith is still available here
https://web.archive.org/web/20190729022124/http://www.wolfgang-ehrhardt.de:80/misc_en.html#mparith
(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,
MathMan
« Last Edit: August 02, 2020, 02:58:41 pm by MathMan »

dieselnutjob

  • Full Member
  • ***
  • Posts: 217
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.

ad1mt

  • Full Member
  • ***
  • Posts: 199
    • Mark Taylor's Home Page
Re: Bugfixing mparith (Wolfgang Ehrhardt's code) & Extended record enumerators
« Reply #20 on: November 16, 2023, 04:25:12 pm »
I know this is an old thread, but...

I'm trying out the MPArith library, and it appears to me that the mp_isodd function is not working.  EDIT - the mp_iseven function is not working either.

I have to use
Code: Pascal  [Select][+][-]
  1. mp_mod_int(v,2,result); if (result = 0)

Surely the MPArith code can't have a bug this obvious?  I checked the code out of Github yesterday, and did not touch it except to copy my test program to the MPArith master folder, and compile it.

Thanks for any suggestions...
« Last Edit: November 18, 2023, 11:57:43 am by ad1mt »

 

TinyPortal © 2005-2018