Port-amiga archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Question about GCC



On Mon, 19 Oct 1998, Bo Najdrovsky wrote:

> Just a curiosity question... Why is it that GCC will sometimes choke on
> me when I try to compile code for the 68040?  The kernel is one of the 
> most notable examples of this... when I modified the default -m68020 to
> -m68040, the build process chokes about 2/3 ways through the build, 
> because the assembler doesn't understand the assembly.  I have gotten
> around this by either doing -m68020-40 or by using -m68040 -Wa,-m68030.
> I find this second option even more interesting, that telling the assembler
> the code is for the 030 it will take the 040 code. Why is this?
> 
> Also, I removed -msoft-float from the default compiler flags.  Is there 
> a reason why I should leave this option in there since I have a hardware
> floating point unit inside the 040?  What I'm trying to do here is 
> squeeze out every possible inch of performance from this A3000, so I'm
> trying to generate the fastest possible kernel. Can anyone suggest some
> other things I could to to make things faster than the default ditribution?

        You should not remove -msoft-float from the kernel compile
        flags.

        When a process makes a system call the kernel needs to save the
        processor state, so that it can later switch back to the
        process.  Floating point registers tend to be large and
        relatively plentiful, making saving and restoring them an
        expensive operation. If the FPU is in the middle of an
        operation the CPU will additionally be forced to sit and wait
        for it to finish before it can then copy the registers.

        Avoiding floating point registers in the kernel gives a
        significant performance win for system calls. Some processors,
        such as sparc, can also use lazy FP context switching to
        sometimes avoid having to save and restore FP registers even
        when switching between processes.

        On some architectures the compiler can use floating point
        registers to speed up certain operations (such as block memory
        copies), breaking the above, so '-msoft-float' is required.

        Hmmm... I think I might just add the above to the FAQ :)

                David/absolute

          -=-  "Give me one last video, just dressed in black"  -=-




Home | Main Index | Thread Index | Old Index