English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 26 July 2018, 12:45   #61
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,162
There are certainly bugs in several mathieee#?.library versions, but I don't want to exclude a problem with vbcc or vasm at this point. There may be strange side-effects from both sides.

When compiling the examples for Kickstart 1.3 (using the provided config file or the default kick13 one) I can reproduce the issue on a Kickstart 1.3 Amiga (mathieeedoubbas.library 34.46). I was unable to reproduce it on other configurations, as I have mostly V40 setups.

While trying to isolate the problem it disappeared, after I recompiled vfprintf.c with my current development versions of vbccm68k and vasm. There were only minor changes in the m68k backend during the last months. In my list for the next release I found this:
Code:
- m68k: use asr-sequence for signed div with power-of-two
- m68k: fixed peephole bug
- m68k: New attribute __fp0ret, to force float-return in fp0, disregarding a -no-fp-return option.
- m68k: Fixed bug with unsigned short array indexes > 32767.
The biggest change concerns vasm's peephole optimizer. We finally started to eliminate the last bits of PhxAss-specific directives from the source and completely switched to vasm-native. Which means the output uses the vasm-native OPT directive now, to enable optimizations.

Anyway, this strange issue certainly needs further analyzation, but the recompiled update of m13.lib works for me. Please try that.

Probably I also have to recompile mieee.lib for 2.0+, but it is difficult to verify, as I cannot reproduce any bug there at the moment.
Attached Files
File Type: lha m13update.lha (27.3 KB, 10 views)
phx is offline  
Old 26 July 2018, 13:08   #62
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 82
I've copied those files into my lib directory and rebuilt my code...

It works!

Thanks!

I should be able to verify the 2.0 libs if you'd like.

Quote:
Originally Posted by phx View Post
There are certainly bugs in several mathieee#?.library versions, but I don't want to exclude a problem with vbcc or vasm at this point. There may be strange side-effects from both sides.

When compiling the examples for Kickstart 1.3 (using the provided config file or the default kick13 one) I can reproduce the issue on a Kickstart 1.3 Amiga (mathieeedoubbas.library 34.46). I was unable to reproduce it on other configurations, as I have mostly V40 setups.

While trying to isolate the problem it disappeared, after I recompiled vfprintf.c with my current development versions of vbccm68k and vasm. There were only minor changes in the m68k backend during the last months. In my list for the next release I found this:
Code:
- m68k: use asr-sequence for signed div with power-of-two
- m68k: fixed peephole bug
- m68k: New attribute __fp0ret, to force float-return in fp0, disregarding a -no-fp-return option.
- m68k: Fixed bug with unsigned short array indexes > 32767.
The biggest change concerns vasm's peephole optimizer. We finally started to eliminate the last bits of PhxAss-specific directives from the source and completely switched to vasm-native. Which means the output uses the vasm-native OPT directive now, to enable optimizations.

Anyway, this strange issue certainly needs further analyzation, but the recompiled update of m13.lib works for me. Please try that.

Probably I also have to recompile mieee.lib for 2.0+, but it is difficult to verify, as I cannot reproduce any bug there at the moment.
deimos is offline  
Old 26 July 2018, 14:31   #63
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,550
Quote:
Originally Posted by deimos View Post
Printing enough decimal places also makes the problem go away.

Code:
printf("%0.13f\n%0.13f\n%0.13f\n%0.13f\n%0.13f\n\n", neg_one, zero, one, two, three); // good
printf("%0.12f\n%0.12f\n%0.12f\n%0.12f\n%0.12f\n\n", neg_one, zero, one, two, three); // bad
Aren't the 2.0 libs verified by this? I.e. result OK but destroyed later.
Photon is offline  
Old 26 July 2018, 15:35   #64
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 82
No, it doesn't say anything about the 2.0 libs. This, and the other recent tests point to the problem being in printf, and it seems that phx has shown that it's not a bug in printf, but some optimisations gone wrong when building printf. A new version of m13.lib has fixed the problem, and new versions of the 2.0+ equivalents will probably fix the problem there too.

Quote:
Originally Posted by Photon View Post
Aren't the 2.0 libs verified by this? I.e. result OK but destroyed later.
deimos is offline  
Old 26 July 2018, 15:53   #65
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,162
Quote:
Originally Posted by deimos View Post
It works!
Great! Thanks for the confirmation.


Quote:
I should be able to verify the 2.0 libs if you'd like.
Ok. I will rebuild the m68k-amigaos target libs as soon as possible. Probably I will also consider an official patch release.


In the meantime, in case you have a lot of time, you might want to test with the mieee.lib from older vbcc releases. I wonder if this is a problem which appeared recently, with the last release.
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha
(Just take the mieee.lib from the target archives.)
phx is offline  
Old 26 July 2018, 17:04   #66
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 82
Well... of the three links you give, only the 2011-08-05 is free of the problem.

Rather than copy files over my installation I edited my vc.vfg to point to each version. Since the result is surprising I'm going to now go and copy the maths libs over instead, just in case.


Quote:
Originally Posted by phx View Post
Great! Thanks for the confirmation.


Ok. I will rebuild the m68k-amigaos target libs as soon as possible. Probably I will also consider an official patch release.


In the meantime, in case you have a lot of time, you might want to test with the mieee.lib from older vbcc releases. I wonder if this is a problem which appeared recently, with the last release.
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha
(Just take the mieee.lib from the target archives.)
deimos is offline  
Old 26 July 2018, 17:13   #67
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 82
Yup, 2011-08-05 is good, 2014-12-30 and 2016-03-23 are bad.

Sorry.

Quote:
Originally Posted by phx View Post
Great! Thanks for the confirmation.


Ok. I will rebuild the m68k-amigaos target libs as soon as possible. Probably I will also consider an official patch release.


In the meantime, in case you have a lot of time, you might want to test with the mieee.lib from older vbcc releases. I wonder if this is a problem which appeared recently, with the last release.
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha
http://server.owl.de/~frank/vbcc/201...8k-amigaos.lha
(Just take the mieee.lib from the target archives.)
Quote:
Originally Posted by deimos View Post
Well... of the three links you give, only the 2011-08-05 is free of the problem.

Rather than copy files over my installation I edited my vc.vfg to point to each version. Since the result is surprising I'm going to now go and copy the maths libs over instead, just in case.
deimos is offline  
Old 26 July 2018, 21:52   #68
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,162
Quote:
Originally Posted by deimos View Post
Yup, 2011-08-05 is good, 2014-12-30 and 2016-03-23 are bad.
Wow... the problem is older than I thought. But as it only became visible with old mathieeedoubbas.libraries it was not noticed until now. Thanks for your tests!

Attached you find a recompilation of all m68k-amigaos and m68k-kick13 math linker libraries.
Attached Files
File Type: lha mlib_update.lha (237.3 KB, 11 views)
phx is offline  
Old 27 July 2018, 11:35   #69
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 82
Thanks. I can confirm that both the 1.3 and 2.0 libs in that archive work for me.
deimos is offline  
Old 28 July 2018, 16:14   #70
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,162
Great! Thanks for testing.
phx is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
vbcc 0.9f released phx News 49 01 April 2018 11:33
vbcc V0.9e released phx News 17 31 October 2016 21:18
VBCC and #include majikeyric Coders. C/C++ 3 03 March 2016 15:07
vbcc 0.9d phx News 43 13 July 2015 19:41
VBCC 0.8j for Windows hitchhikr Coders. General 11 09 October 2008 00:58

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.07371 seconds with 14 queries