Overview Features Coding ApolloOS Performance Forum Downloads Products Order Contact

Welcome to the Apollo Forum

This forum is for people interested in the APOLLO CPU.
Please read the forum usage manual.
Please visit our Apollo-Discord Server for support.



All TopicsNewsPerformanceGamesDemosApolloVampireAROSWorkbenchATARIReleases
Information about the Apollo CPU and FPU.

GCC Improvement for 68080page  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 

Grom 68k

Posts 61
22 Aug 2019 16:53


Commit "use shorter FP constants if possible"

I think it is better to try value as Single before as Long. It's the same instruction length but with one cycle less.


Grom 68k

Posts 61
24 Aug 2019 23:23


Grom 68k wrote:

      Commit "use shorter FP constants if possible"
       
        I think it is better to try value as Single before as Long. It's the same instruction length but with one cycle less.
     

     
Hi,
     
To be cross-compilling safe, it will be better to replace "i - (short)i == 0" by "IN_RANGE (i, -0x80, 0x7f)", no ?
It wiil be the same for (int) with "IN_RANGE (i, -0x8000, 0x7fff)"
     
Function real_to_decimal_for_mode should be better than real_to_decimal, doubles will be smaller.
     
     
Function print_fp_const uses double when is not needed  EXTERNAL LINK       
     
  if (exact_real_truncate (SFmode, r))
          p[0] = 's';
        else
        if (exact_real_truncate (DFmode, r))
          p[0] = 'd';
        else
          p[0] = prec[0];{

     
Regards


Samuel Devulder

Posts 248
25 Aug 2019 22:09


Grom 68k wrote:

 
  Function print_fp_const uses double when is not needed  EXTERNAL LINK 

This gives:

_f:
        fdmul.d #0e1.04000000000000003552713678800500929355621337890625e+1,fp0
        fsmove.x fp0,fp0
        rts

What is the strange "fsmove.x fp0,fp0" for ?
 
My guess: enforce float to double conversion. But this is totally useless with -ffast-math option. The asm should only be one instruction IMHO for that C code.


Samuel Crow

Posts 424
26 Aug 2019 06:48


Gerardo González-Trejo wrote:
  I think we are talking about GCC because someone started to improve GCC. I think too that Clang + LLVM would be a better longer term option, in case the team want to invest a huge effort, because, at least, has a much more cleaner code than GCC.
 
  If there is not a mid-size team of several people to perform this task, it is much better talking again about other compilers listed here: VBCC, ICC, TCC... Despite being old, many of them are C99 compatible, enough for now, and they have much more simple and compact source code. Easy to modify by one person or an small team.
 
  Yes, GCC, Clang (+ LLVM) are theoretically better and compatible with "recent" cpu achitectures but, again, the effort needed to adapt and maintain these compilers would be soo huge, and a simpler compiler with optimizations in assembler could give same or better results. For example, few years ago we used Angular.js for frontend web development. Is it great? Yes it is, but sometimes you do not have the control and you start to need a bigger team to maintain code. We changed to Vue.js and much better and simpler and on latest projects, Mithril.js that is much, much smaller and simpler, but you have all under control with an small team. Is the most advanced option? No. Is the right one for an small dev team? Definetly, yes.
 
  I would never say that GCC is better as well as I would never say that X86 or ARM are better too. ¿Better for what kind of scenario?
 
  I think it is important to ask what is the target here: Bring to Amiga the same applications from the Windows PC or Linux and run them dozens of times slower or create lightweight applications optimized for the Amiga, compatible with the 68K, that make use of the extra power that does the 68K80 offer? ¿Are there teams of hundred of people working on Amiga apps or small teams of 1 to less than 10 people?
 
  As ever, it is only my opinion :) Please, hope nobody feels bad because this :P

A Debian 68k Linux dev made a 68k backend for LLVM.  I don't know what sub-architectures it supports but development has stalled.  Combined with Bebbo's C runtimes for Amiga, it might be possible to do.  It compiles its own source slower than GCC compiles its own source due to extensive C++ template usage but has the distinct advantage of being more modular than GCC.  Hopefully with a replacement pass-manager only the code needed for the current pass will need to be kept in RAM at once.


Grom 68k

Posts 61
26 Aug 2019 07:25


Samuel Devulder wrote:

 
Grom 68k wrote:

   
    Function print_fp_const uses double when is not needed  EXTERNAL LINK   

  This gives:
 

  _f:
          fdmul.d #0e1.04000000000000003552713678800500929355621337890625e+1,fp0
          fsmove.x fp0,fp0
          rts
 

  What is the strange "fsmove.x fp0,fp0" for ?
   
  My guess: enforce float to double conversion. But this is totally useless with -ffast-math option. The asm should only be one instruction IMHO for that C code.
 

 
print_fp_const increases precision in that case. "prec[0] == 's'" condition should be added.
 
 
  if ((prec[0] == 's') || exact_real_truncate (SFmode, r))
    p[0] = 's';
  else
  if ((prec[0] == 'd') || exact_real_truncate (DFmode, r))
    p[0] = 'd';
  else
    p[0] = prec[0];

 
 
It will be simplified as is if we don't care about extended precision.
 
  if ((prec[0] == 's') || exact_real_truncate (SFmode, r))
    p[0] = 's';
  else
    p[0] = 'd';



Chastanier Cclecle

Posts 19
09 Oct 2020 11:12


Hi !

A quick "UP" on this very very interesting topic.
Are you still working on improving GCC ASM code generation targeting 68080 ?
Is it usable ? maintained ?

Thx

Clément


Thierry Atheist

Posts 644
04 May 2021 09:56


Gunnar von Boehn wrote:
We should also discuss a very important topic.
The register ABI.
On 68K the old ABI has 8 Data register, plus 7 Address Register, plus 8 FPU Register. With 2 register each being scratch.

2 scratch register is not enough for many routines.
We have seen this in our FPU examples that we constantly need more scratch registers.

APOLLO 68080 provides a lot more registers.
32 DATA, 16 ADDRESS and 32 FPU registers.


Hi GUNNAR!!!!

The V4SA has a FPU and AMMX?

Does that mean that the Vampire 4 standalone has:

16 Address registers
32 Data registers
32 FPU registers

AND

E0 to E23= 24 AMMX registers AS WELL???

posts 367page  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19