View Single Post
Old 26 June 2023, 16:30   #13
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by Steam Ranger View Post
It seems that with modern optimising compilers and cross-compilation tools noone could write code for the Amiga better than gcc can,
Definitely not for 68k. I can beat gcc anytime, and usually by a factor 2-4 (depending on what the code codes). Losing 50-75% of cpu time (sometimes more, especially for C++) is something that requires a good justification.
And on other cpus i suspect the compilers win mainly because nobody really challenges them.


Quote:
Originally Posted by Steam Ranger View Post
is there any reason to use assembly over C in 2023 for the Amiga (beyond novelty)?
There are many.
Asm is the best coding school. Once you master it, you are a better coder overall because you know how things work.
It provides more coding freedom. You do whatever you want.
Obviously your code will be shorter and faster.
In asm you can call any function located anywhere in the source, without prior declaration. Last time i've looked, in C you had to either pay attention to order, or define same thing several times.
C syntax is simply horrible
In asm you can have nice, aligned, one-comment per code line.
Unlike C, in asm you will not run into undefined behaviours without even knowing it because the spec is so overcomplicated and nobody knows it fully.
Do you want more ?
(now i have the feeling this will end up in a flame war...)



Quote:
Originally Posted by Thomas Richter View Post
Again, write to to gcc folks and get it fixed.
I am afraid they pay little attention to m68k these days.


Quote:
Originally Posted by Thomas Richter View Post
That is, in this generality, outright wrong. A C compiler can optimize for multiple targets, and can create code you find "unexpected" or "unpleasant", but it may also generate code you would probably not write in such a way yourself, though the speed or the size of the code is then nevertheless convincing.
The output of gcc on x64 at least nowadays sometimes really surprises me in the way what the compiler can actually do.
The thread title mentions "Amiga", not "x64".


Quote:
Originally Posted by Thomas Richter View Post
And yet you (and me, in our office) write that with intrinsics in C++, and not in assembler, which is pretty much a point for the flexibility of C, and against the hard-to-handle assembler.
Not applicable to Amiga.


Quote:
Originally Posted by Thomas Richter View Post
In fact, this is how we work these days. Find bottlenecks, isolate them into separate classes, rewrite those classes with intrinsics. Nobody bothers writing in assembler anymore.
While overall true, again this does not apply for Amiga - where quite few people hopefully still write asm.
meynaf is offline  
 
Page generated in 0.07327 seconds with 10 queries