English Amiga Board


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

 
 
Thread Tools
Old 29 October 2021, 09:42   #1321
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 645
Sure, but I'd rather not have this dependency just to calculate the gamma correction table at startup. I try to require only Kickstart 3.x libraries whenever possible, and make the rest optional. Later I'll replace this table with a precalculated variant.
BSzili is offline  
Old 05 November 2021, 09:42   #1322
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 645
I was wondering, would it be possible to include swapstack.o in libnix20.a? It's already present in libnix13.a so it shouldn't cause any issues, as it doesn't get linked unless __stkinit is referenced.
BSzili is offline  
Old 06 November 2021, 19:08   #1323
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 645
I seem to have a difficult time getting the stackswap code to work. I created a small example that crashes at exit if the stackswap code runs. If I give a large stack before starting the program it exits normally.
stkswaptest.c
Code:
extern void __stkinit(void);
void * __x = __stkinit;
unsigned long __stack = (32*1024);
int main(void)
{
	return 0;
}
I build it with this command:
m68k-amigaos-gcc -noixemul -m68060 -m68881 -ffast-math -O2 -fomit-frame-pointer -o stkswap stkswaptest.c /opt/amiga/m68k-amigaos/libnix/lib/libm020/libm881/swapstack.o


Could this be an issue with libnix?
BSzili is offline  
Old 27 November 2021, 18:44   #1324
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 572
Quote:
Originally Posted by BSzili View Post
I seem to have a difficult time getting the stackswap code to work. I created a small example that crashes at exit if the stackswap code runs. If I give a large stack before starting the program it exits normally.
stkswaptest.c
Code:
extern void __stkinit(void);
void * __x = __stkinit;
unsigned long __stack = (32*1024);
int main(void)
{
    return 0;
}
I build it with this command:
m68k-amigaos-gcc -noixemul -m68060 -m68881 -ffast-math -O2 -fomit-frame-pointer -o stkswap stkswaptest.c /opt/amiga/m68k-amigaos/libnix/lib/libm020/libm881/swapstack.o


Could this be an issue with libnix?

I modified libnix to not use the AmigaOS SwapStack method...
... as for kick 1.3
bebbo is offline  
Old 29 November 2021, 20:52   #1325
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 645
Thanks, I'll test it soon! Do you think it would be possible to include swapstack.o in libnix20.a like it is in libnix13.a?
BSzili is offline  
Old 02 December 2021, 12:51   #1326
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 572
Quote:
Originally Posted by BSzili View Post
I was wondering, would it be possible to include swapstack.o in libnix20.a? It's already present in libnix13.a so it shouldn't cause any issues, as it doesn't get linked unless __stkinit is referenced.

done
bebbo is offline  
Old 04 December 2021, 08:44   #1327
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 645
Thank you! I retested my all-exhaustive test program, and it no longer crashes at exit. stackwap.o also got linked nicely
BSzili is offline  
Old 05 December 2021, 21:16   #1328
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 572
fyi: exceptions and rtti should now work with 68000/68010.
bebbo is offline  
Old 09 December 2021, 08:12   #1329
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 645
Did something change recently regarding the code generation for -m68060? I rebuilt Duke3D to test the recently added control presets, and it now has some graphics glitches, sometimes CON parsing won't work, and the maps won't load. I tried to compare the asm output with -m68040 and it looks like the compiler now emits FPU instructions for certain multiplications. For example what compiles to
muls.l #936,d0
becomes
Code:
	fmove.l d1,fp0
	fmul.l #936,fp0
	fmod.s #0x4f800000,fp0
	fmove.l fp0,d2
This could be a problem, because I change the FPU rounding for the custom 64-bit integer math replacement routines, which probably messes with the ones generated by the compiler. Is it possible to disable this optimization?

Edit: This is a small function that now has FPU instructions with -m68060, but with -m68040 it doesn't:
http://franke.ms/cex/z/T7rj6q

Last edited by BSzili; 09 December 2021 at 08:54.
BSzili is offline  
Old 04 January 2022, 02:23   #1330
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 101
Hi,
I am using latest update from github.

I cannot complie when using ChooserLabels() and FreeChooserLabels() from <clib/reaction_lib_protos.h>. I got a linker error:
undefined reference to `ChooserLabels'

Can I workaroud it somehow?

For now I found Stephan Rupprecht's reaction library replecemnt source in C,
so that functions are just creating standard lists, so I can reimplenet in my code.

But it would be great if standard way could work.. I also got similar problem with other
reaction function, but again I woraround it with another..

Thank You in advance.
mateusz_s is offline  
Old 04 January 2022, 14:28   #1331
mateusz_s
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 101
ok, nevermind.. it can be replaced with: AllocChooserNode()
mateusz_s is offline  
Old 09 January 2022, 14:31   #1332
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 572
Quote:
Originally Posted by BSzili View Post
Did something change recently regarding the code generation for -m68060? I rebuilt Duke3D to test the recently added control presets, and it now has some graphics glitches, sometimes CON parsing won't work, and the maps won't load. I tried to compare the asm output with -m68040 and it looks like the compiler now emits FPU instructions for certain multiplications. For example what compiles to
muls.l #936,d0
becomes
Code:
    fmove.l d1,fp0
    fmul.l #936,fp0
    fmod.s #0x4f800000,fp0
    fmove.l fp0,d2
This could be a problem, because I change the FPU rounding for the custom 64-bit integer math replacement routines, which probably messes with the ones generated by the compiler. Is it possible to disable this optimization?

Edit: This is a small function that now has FPU instructions with -m68060, but with -m68040 it doesn't:
http://franke.ms/cex/z/T7rj6q

I rolled that change back a while ago and now I added another feature:


Quote:
implement direct MathIeeeSingTransBase/MathIeeeDoubTransBase calls

this is triggered for 68040/68060 if -ffast-math gets used.
bebbo is offline  
Old 09 January 2022, 14:36   #1333
bebbo
botcher

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 572
Quote:
Originally Posted by BSzili View Post
Did something change recently regarding the code generation for -m68060? I rebuilt Duke3D to test the recently added control presets, and it now has some graphics glitches, sometimes CON parsing won't work, and the maps won't load. I tried to compare the asm output with -m68040 and it looks like the compiler now emits FPU instructions for certain multiplications. For example what compiles to
muls.l #936,d0
becomes
Code:
    fmove.l d1,fp0
    fmul.l #936,fp0
    fmod.s #0x4f800000,fp0
    fmove.l fp0,d2
This could be a problem, because I change the FPU rounding for the custom 64-bit integer math replacement routines, which probably messes with the ones generated by the compiler. Is it possible to disable this optimization?

Edit: This is a small function that now has FPU instructions with -m68060, but with -m68040 it doesn't:
http://franke.ms/cex/z/T7rj6q

I rolled that change back a while ago and now I added another feature:


Quote:
implement direct MathIeeeSingTransBase/MathIeeeDoubTransBase calls

this is triggered for 68040/68060 if -ffast-math gets used.



https://franke.ms/cex/z/75YoWe
bebbo is offline  
Old 09 January 2022, 19:10   #1334
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 645
I see, thanks now it works fine with the latest version.
BSzili 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
New GCC based dev toolchain for AmigaOS 3.x cla Coders. Releases 8 24 December 2017 11:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 23:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 04:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 22:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 15:45

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 18:14.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Page generated in 0.11910 seconds with 16 queries