[kaffe] XScale jthreads code

Peter Naulls peter at chocky.org
Sat Sep 18 02:52:02 PDT 2004


In message <20040918113234.4ed6d19c at moose> you wrote:

> On Sat, 18 Sep 2004 10:09:59 +0100
> Peter Naulls <peter at chocky.org> wrote:
> 
> > No, this is still misleading.  The presense or otherwise of an FPU is
> > irrelevant on ARM with respect to the code. My first recommendation
> > remains to find out the exact cause of the differences that lead to this
> > incorrect conclusion being made.    I also suggest making any comparison
> > to i386 might just cloud the issue.
> 
> The unix-jthreads threads system uses setjmp/longjmp to switch between
> different (java) threads. To do this, it has to extract the value of the
> SP from a jmp_buf. On linux, the offset of the SP inside a jmp_buf depends
> on the presence of an fpu (unless I misread the glibc sources). Therefore,
> kaffe has to know whether an fpu is available, because otherwise it can't
> get this offset right.

I think you are still confused, and perhaps haven't read my original
explanation properly.  Let's restate:

On almost _all_ ARM systems there is an FPU (some very small embedded
systems might forego any FP support) - whether it is emulated or not
simply doesn't matter for code generation (apart from speed
considerations), and setjmp et al will certainly need to save FPU
registers if they're being used.

Whether or not FP registers are being used will depend upon two things -
the function in question using FP registers, and code generation options
set in GCC.  As I said earlier, the tendency these days is to avoid
using FP instructions at all.  I suspect that is why there are two
different versions of setjmp for ARM in glibc.

Whether or not kaffe will need to save FP registers will depend upon the
compiler setup (for kaffe and any libraries), but I suspect it will need
to save FP registers pretty much all the time just in case.  Again, the
correct response is to find out why the change in question was thought
to be needed.


-- 
Peter Naulls - peter at chocky.org        | http://www.chocky.org/
----------------------------------------------------------------------------
Unix Programs on RISC OS               | http://www.chocky.org/unix/




More information about the kaffe mailing list