This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH: libffi: improvements for MIPS o32.
- From: Casey Marshall <csm at gnu dot org>
- To: David Daney <ddaney at avtrex dot com>
- Cc: java-patches at gcc dot gnu dot org
- Date: Wed, 30 Jun 2004 15:42:38 -0700
- Subject: Re: PATCH: libffi: improvements for MIPS o32.
- References: <87hdssn6f3.fsf@gnu.org> <40E33008.4080408@avtrex.com>
>>>>> "David" == David Daney <ddaney@avtrex.com> writes:
David> Casey Marshall wrote:
>> Hi.
>>
>> The attached patch expands on my previous patches to libffi for the
>> MIPS o32 ABI. It adds closure and exception unwinding support for
>> this architecture.
>>
>> I have some questions about this, however:
>>
>> * It's been indicated that the ABI is different for software-only
>> floating point architectures. I don't know how to handle this,
>> though. Is this something an #ifdef can handle?
David> I was thinking something like this (untested):
(Bah... Emacs filled this...)
David> [daney@dl mips]$ diff -u ffitarget.h ~/ffitarget.h ---
David> ffitarget.h 2003-10-22 08:32:13.000000000 -0700 +++
David> /home/daney/ffitarget.h 2004-06-30 14:02:40.000000000 -0700 @@
David> -37,6 +37,9 @@ # define FFI_MIPS_N32 # else # if
David> _MIPS_SIM==_ABIO32 && defined(_ABIO32) +# ifdef
David> __mips_soft_float +# define FFI_MIPS_O32_SF +# endif # define
David> FFI_MIPS_O32 # else -- this is an unsupported platform -- @@
David> -136,16 +139,21 @@ typedef enum ffi_abi { FFI_FIRST_ABI = 0,
David> FFI_O32, + FFI_O32_SF, FFI_N32, FFI_N64,
David> #ifdef FFI_MIPS_O32 +# ifdef FFI_MIPS_O32_SF + FFI_DEFAULT_ABI
David> = FFI_O32_SF, +# else FFI_DEFAULT_ABI = FFI_O32, +# endif #else
David> FFI_DEFAULT_ABI = FFI_N32, #endif
David> - FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 + FFI_LAST_ABI =
David> FFI_DEFAULT_ABI + 1 /* FIXME: What is this all about? */ }
David> ffi_abi;
David> #define FFI_EXTRA_CIF_FIELDS unsigned rstruct_flag
David> Now you have two ABIs for O32. FFI_O32, and FFI_O32_SF The SF
David> version does the "right thing" (ie not pass stuff around in the
David> FPU registers).
Hmm, defining another ABI doesn't sound like the right thing to
do. Are the FP/noFP ABIs similar enough to share code with o32.S?
I'm assuming that a soft-float ABI would use the integer registers for
passing arguments and return values, so would this just mean replacing
FPU stores/loads with normal ones?
>> * I'm using the `cacheflush' system call to flush the I-cache, but
>> have been warned by the man page that that function is only
>> available for MIPS. I don't know if this means "MIPS Linux", or if
>> this system call is available on other OSes.
>>
>> I also see that on Linux this system call is totally inefficient
>> (it flushes the entire cache, not just the region specified).
David> I think that is all you can do for portable operation. The
David> mips32r2 ISA has the synci instruction, but many o32 based
David> systems are not mips32r2, so it would not be portable.
Mine, for one, is only mips2.
David> If you really wanted to hack it up, you could test for the
David> ability to execute synci and call cacheflush if you cannot use
David> it. Install a handler for SIGILL, and execute synci. If you
David> get SIGILL you have to use cacheflush. Then uninstall the
David> handler, and proceed.
Is there a convenient check for mips32r2? Would _MIPS_ARCH check this?
>> Should I post my test results to gcc-testresults? Even though it
>> is a patched version? At any rate, I get the following results for
>> libjava:
>>
>> # of expected passes 2711 # of unexpected failures 24 # of expected
>> failures 14 # of untested testcases 34
>>
>> Comments greatly appreciated.
>>
David> What are the failures?
FAIL: PR9577 output
FAIL: longfield output
FAIL: shortfield output
FAIL: simple output
FAIL: PR15133 run
FAIL: calls run
FAIL: cxxtest run
FAIL: field run
FAIL: final_method run
FAIL: findclass run
FAIL: invoke run
FAIL: jniutf run
FAIL: martin run
FAIL: noclass run
FAIL: overload run
FAIL: pr11951 run
FAIL: register run
FAIL: simple_int run
FAIL: throwit run
FAIL: virtual run
FAIL: err6 output - source compiled test
FAIL: err6 -O3 output - source compiled test
FAIL: /home/rsdio/src/gcc-build/mipsel-unknown-linux-gnu/libjava/testsuite/TestMultiple.exe output - /home/rsdio/src/gcc-build/mipsel-unknown-linux-gnu/libjava/testsuite/TestMultiple.exe
FAIL: /home/rsdio/src/gcc-build/mipsel-unknown-linux-gnu/libjava/testsuite/TestParent.exe output - /home/rsdio/src/gcc-build/mipsel-unknown-linux-gnu/libjava/testsuite/TestParent.exe
I've also run gij on a number of Kaffe's regression tests, which I had
handy, and most of them run fine.
--
Casey Marshall || csm@gnu.org