Current version is 1.5.1 and upcoming is version 1.5.2. The user interface is nothing special, basically just a command line interface. The program itself is more interesting. It is inspired by the open source calc: http://www.isthe.com/chongo/tech/com...lc-whatis.html

Calc is published under the GNU Lesser General Public License which makes it hard to modify for the Amiga. For the same reason amath is published under a BSD License.

Any feedback regarding features, bugs or anything else is very welcome.

Confirmed but seems only to occur on A1200 and below. A4000 in FS-UAE does not produce this output.

The other bugs seems to be fixed in 1.5.2

Regarding the LGPL v2.1 (calc license), I do not know if it is possible to modify within the terms of the license and still get it up and running in Amiga OS. I didn't have the courage to do it. The BSD license seemed like a much simpler solution. Also, Calc is heavily geared towards Linux libraries and tools.

Last edited by cla; 12 October 2014 at 23:57.
Reason: Spelling mistakes and bad gramma

I had to discard the custom made code for printing floating numbers. Most errors came from this piece of code. I tested all of the above cases and all passed. Credits go to developer Ryan Juckett for his awesome dragon4 algorithm. He even made a few articles on his website about it:http://www.ryanjuckett.com/programmi...point-numbers/

I also had to make a small note about precision. Some routines does not use scaling and while others do, errors are doomed to build up as expressions grow in size. An estimated accuracy of 11 digits should be enough to cover my ass

Regarding the faulty builds for FPUs and 68000 + 68020 it turned out to be something to do with floating numbers stored in registers and possibly faulty generated optimizations. Nevertheless calculations works again with the new GCC build configuration. Details are provided in the source code.

I still didn't get much feedback about bugs and actually I don't even know if FPU and 68060 versions work. If you have access to such hardware please send feedback.

I also had to make a small note about precision. Some routines does not use scaling and while others do, errors are doomed to build up as expressions grow in size. An estimated accuracy of 11 digits should be enough to cover my ass

Regarding the faulty builds for FPUs and 68000 + 68020 it turned out to be something to do with floating numbers stored in registers and possibly faulty generated optimizations. Nevertheless calculations works again with the new GCC build configuration. Details are provided in the source code.

Most, if not all, older Amiga versions of GCC (3.x and earlier) set the precision in the FPCR to double precision. This would give 53 bits of precision but some instructions and functions are not accurate to the last bits of precision. Using double precision may be more IEEE compliant but both precision and accuracy are lost compared to the 68k FPU extended precision (cumulative errors and lack of floating point associative property can further reduce accuracy). The older GCC 68k FPU code is not the greatest. It's inconsistent and incomplete. For example, trapped 6888x instructions are used on the 68040 and 68060 (slow), the IEEE libraries are opened which is questionable when the IEEE libraries are used (inits the FPU and changes the rounding from the default best precision and accuracy), some of the FPU code is slow and large, etc. I haven't seen common big bugs with the direct 68k FPU support but it's poor quality by GCC standards.

Quote:

Originally Posted by daxb

Can you merge some 68k exe versions into one to haven`t so much different exe`s? 2 or 3 for 68k should be enough.

Target #1 is nice because it should work on all Amiga targets although it's slow compared to direct FPU code with an FPU. Vbcc works very well linking with -lmieee although it's not the most advanced support. GCC will give it's best 68k FPU code for target #2 and it will work on the 68040 and 68060 using slow emulation traps. Compiling for target #3 and target #4 will probably not work on the 6888x when compiled with GCC which uses FSxxx and FDxxx instructions which the 6888x does not have. Compiling for target #3 and #4 with vbcc should work on the 6888x as it avoids these problems. The major difference between the 68040 and 68060 FPU is that the 68040 FPU lack the FINT/FINTRZ instructions. This causes all kinds of problems trying to avoid these instructions which results in greatly reduced accuracy and/or slow and/or bloated code. Where accuracy is more important than speed, compiling for the 68060 to use on the 68040 with OxyPatcher/CyberPatcher/MuRedox is reasonable (blame Motorola for the terrible decision to remove FINT/FINTRZ from the 68040 which they brought back for the 68060). ACalc compiled with GCC could probably get away with targets #2 and #4. Compiling with vbcc could use targets of #1, #2 and #4 for this type of program. A compiler build script for all targets probably doesn't take very long or take up very much space although this is the type of program that speed is not as important as accuracy.

There are newer versions of vbcc and it's math libraries. I have compiled the newer math libraries and includes and placed them at the following link if you want to give vbcc a try.

There may be bugs as there have been significant changes in the direct FPU code in vbcc (please report bugs) but it is more advanced than the old GCC 68k FPU code and it's still supported and updated. There is a new version of vbcc with many updates that is nearly ready to release.

Did you test whether the new libraries work with the last vbcc 0.9b release? I didn't.
At least I know that the recent vbcc no longer works very well with the old 0.9b libraries...

I have tried several combinations of vbcc and libraries in different tests which I believe includes the old version of vbcc with the new math libraries and includes. I have not done thorough testing. There could be issues especially with some old floating point vbcc bugs. I haven't received any reports of problems but that doesn't mean much. I realized there could be issues and I have considered compiling newer beta versions of vbcc for the public if necessary. It would be helpful if there were recent stable beta compiles and/or source of vbcc for download somewhere. Vbcc and vasm have matured so much that the last official release seems like it is from the stone ages. I read your other post here on EAB that you are still waiting to hear back from Volker for some time. I used to tell people there should be a new vbcc release soon but it's like it has the Amiga "two more weeks" curse now .

Calculations in the code are not handled so carefully so it does depend on GCC generated FP code.

Quote:

There may be bugs as there have been significant changes in the direct FPU code in vbcc (please report bugs) but it is more advanced than the old GCC 68k FPU code and it's still supported and updated. There is a new version of vbcc with many updates that is nearly ready to release.

The only reason I choose GCC was because of the support for C++. As far as I have been able to figure out, no other (free) compiler supports both C++ and m68k-amigaos as a target.

Most of the code in amath uses C++ techniques like inheritance and polymorphism.

Maybe it could be an idea to compile fdlibm with vbcc and link it with some GCC output ? I don't know if its possible (resolving symbolic references etc).

The only reason I choose GCC was because of the support for C++. As far as I have been able to figure out, no other (free) compiler supports both C++ and m68k-amigaos as a target.

Most of the code in amath uses C++ techniques like inheritance and polymorphism.

Yea, GCC is easily the best choice for C++ on the Amiga. I am not aware of any plans to add C++ support to vbcc. C99 support has improved in vbcc which gives some advanced features of C++ but it's still a long way from C++.

Quote:

Originally Posted by cla

Maybe it could be an idea to compile fdlibm with vbcc and link it with some GCC output ? I don't know if its possible (resolving symbolic references etc).

It looks like the C++ features are light at least in the LIBM code (.c renamed to .cpp?). I don't know how linking GCC and vbcc code would work out. Frank (phx) could probably tell you being the author of vlink. It's generally not worthwhile to mix compilers for the same executable in my limited experience.

Most, if not all, older Amiga versions of GCC (3.x and earlier) set the precision in the FPCR to double precision. This would give 53 bits of precision but some instructions and functions are not accurate to the last bits of precision. Using double precision may be more IEEE compliant but both precision and accuracy are lost compared to the 68k FPU extended precision (cumulative errors and lack of floating point associative property can further reduce accuracy). The older GCC 68k FPU code is not the greatest. It's inconsistent and incomplete. For example, trapped 6888x instructions are used on the 68040 and 68060 (slow), the IEEE libraries are opened which is questionable when the IEEE libraries are used (inits the FPU and changes the rounding from the default best precision and accuracy), some of the FPU code is slow and large, etc. I haven't seen common big bugs with the direct 68k FPU support but it's poor quality by GCC standards.

Just to clarify: No external IEEE libraries are used in the code. All math is included. The only weak part is GCC FP code generation (emitting FINT/FINTRZ on a 68040 target etc).

Quote:

... A compiler build script for all targets probably doesn't take very long or take up very much space although this is the type of program that speed is not as important as accuracy.

I looked at c99lm68k4 and of course mathieeedoubtrans.library but they are lacking asinh, acosh and cbrt.

The Amiga IEEE fp math libraries (vbcc using -lmieee) lack many c99 math functions. I could create new IEEE fp math libraries with more c99 functions based on the vbcc math libraries. There are several potential advantages to new IEEE libraries with extended IEEE c99 math functions (the old ones have design flaws). I have been planning for such a project but the vbcc fp math libs need more testing first.

The vbcc m881, m040 and m060 fp math libs should have asinh, acosh and cbrt functions. It's mentioned on the page at the link although many functions, especially new ones, need more testing. Did you have trouble using these functions?

Quote:

Originally Posted by cla

Just to clarify: No external IEEE libraries are used in the code. All math is included. The only weak part is GCC FP code generation (emitting FINT/FINTRZ on a 68040 target etc).

Which version of GCC are your using? If the IEEE libraries are not opened then I wonder how (or if) the FPU is initialized? The majority of GCC code I have seen opens the IEEE libraries without the programmer asking for them. They also use the IEEE libraries for some functions with the direct FPU code which is a questionable practice as the IEEE math libraries initialize the FPU and set the FPCR to their own settings. GCC usually uses double precision and round toward zero (extended precision and round toward nearest is the 68k FPU default in the FPCR) as the last double precision IEEE library opened sets it.