[kaffe] CVS kaffe (guilhem): m68k floating point fixes + fdlibm compilation fix.
Kaffe CVS
cvs-commits at kaffe.org
Mon Jun 27 00:32:16 PDT 2005
PatchSet 6665
Date: 2005/06/27 07:27:19
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
m68k floating point fixes + fdlibm compilation fix.
* config/m68k/linux/md.h
(sysdepCallMethod): Inlined function instead of a macro. Fixed the
return of a float.
* config/m68k/jit3-m68k.def
(div_float): Fixed a misallocation of the destination register
because of a wrong assert.
* libraries/clib/fdlibm/ieeefp.h: Removed all preprocessor magic and
replaced by the checking of the definition of WORDS_BIGENDIAN by
configure.
Members:
ChangeLog:1.4190->1.4191
config/m68k/jit3-m68k.def:1.14->1.15
config/m68k/linux/md.h:INITIAL->1.13
libraries/clib/fdlibm/ieeefp.h:1.2->1.3
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4190 kaffe/ChangeLog:1.4191
--- kaffe/ChangeLog:1.4190 Sun Jun 26 01:21:50 2005
+++ kaffe/ChangeLog Mon Jun 27 07:27:19 2005
@@ -1,3 +1,17 @@
+2005-06-27 Guilhem Lavaux <guilhem at kaffe.org>
+
+ * config/m68k/linux/md.h
+ (sysdepCallMethod): Inlined function instead of a macro. Fixed the
+ return of a float.
+
+ * config/m68k/jit3-m68k.def
+ (div_float): Fixed a misallocation of the destination register
+ because of a wrong assert.
+
+ * libraries/clib/fdlibm/ieeefp.h: Removed all preprocessor magic and
+ replaced by the checking of the definition of WORDS_BIGENDIAN by
+ configure.
+
2005-06-26 Ito Kazumitsu <kaz at maczuka.gcd.org>
* libraries/javalib/kaffe/tools/jar/Jar.java
Index: kaffe/config/m68k/jit3-m68k.def
diff -u kaffe/config/m68k/jit3-m68k.def:1.14 kaffe/config/m68k/jit3-m68k.def:1.15
--- kaffe/config/m68k/jit3-m68k.def:1.14 Mon May 9 23:35:58 2005
+++ kaffe/config/m68k/jit3-m68k.def Mon Jun 27 07:27:22 2005
@@ -1739,7 +1739,7 @@
int r = rreg_float(2);
int w = rwreg_float(0);
- assert(rreg_double(1) == w);
+ assert(rreg_float(1) == w);
op_fsdivx_ff(r, w);
}
===================================================================
Checking out kaffe/config/m68k/linux/md.h
RCS: /home/cvs/kaffe/kaffe/config/m68k/linux/md.h,v
VERS: 1.13
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/config/m68k/linux/md.h Mon Jun 27 07:32:15 2005
@@ -0,0 +1,115 @@
+/*
+ * m68k/linux/md.h
+ * Linux/m68k configuration information.
+ *
+ * Copyright (c) 1996, 1997
+ * Transvirtual Technologies, Inc. All rights reserved.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file.
+ */
+
+#ifndef __m68k_linux_md_h
+#define __m68k_linux_md_h
+
+#include "m68k/common.h"
+#include "m68k/threads.h"
+#include "support.h"
+#if defined(HAVE_SYS_TIME_H)
+#include <sys/time.h>
+#endif
+#if defined(HAVE_SYS_RESOURCE_H)
+#include <sys/resource.h>
+#endif
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+/*
+ * Alignment in structure is 2 bytes packed.
+ */
+#define ALIGNMENT_OF_SIZE(S) (((S>1)?2:1))
+
+/*
+ * Stack offset.
+ * This is the offset into the setjmp buffer where the stack pointer is
+ * stored.
+ */
+#define SP_OFFSET 14
+
+/**/
+/* Extra exception handling information. */
+/**/
+#include <signal.h>
+
+#include "sigcontextinfo.h"
+
+#define SIGNAL_ARGS(sig, sc) int sig, int code, struct sigcontext *sc
+#define SIGNAL_CONTEXT_POINTER(scp) struct sigcontext *scp
+#define GET_SIGNAL_CONTEXT_POINTER(scp) (scp)
+#define SIGNAL_PC(scp) (GET_PC(scp))
+#define STACK_POINTER(scp) (GET_STACK(scp))
+
+#if defined(TRANSLATOR)
+#include "jit-md.h"
+#endif
+
+/* Linux requires a little initialisation */
+extern void init_md(void);
+#define INIT_MD() init_md()
+
+#include "kaffe-unix-stack.h"
+
+/*
+ * sysdepCallMethod supports:
+ *
+ * Linux version
+ */
+static inline void sysdepCallMethod(callMethodInfo *call) ALWAYS_INLINE;
+
+static inline void sysdepCallMethod(callMethodInfo *call)
+{
+ int extraargs[call->nrargs];
+ register int d0 asm ("d0");
+ register int d1 asm ("d1");
+ register double f0d asm ("fp0");
+ register float f0f asm ("fp0");
+ int *res;
+ int *args = extraargs;
+ int argidx;
+
+ for(argidx = 0; argidx < call->nrargs; ++argidx) {
+ if (call->callsize[argidx])
+ *args++ = call->args[argidx].i;
+ else
+ *args++ = call->args[argidx-1].j;
+ }
+
+ asm volatile ("jsr %2@\n"
+ : "=r" (d0), "=r" (d1)
+ : "a" (call->function)
+ : "cc", "memory");
+
+ if (call->retsize != 0) {
+ res = (int *)call->ret;
+
+ switch(call->retsize) {
+ case 2:
+ if ((CALL)->rettype == 'D')
+ *(double*)res = f0d;
+ else {
+ res[1] = d1;
+ res[0] = d0;
+ }
+ break;
+ case 1:
+ if ((CALL)->rettype == 'F')
+ *(float*)res = f0f;
+ else
+ res[0] = d0;
+ break;
+ }
+ }
+}
+
+#endif /* __m68k_linux_md_h */
Index: kaffe/libraries/clib/fdlibm/ieeefp.h
diff -u kaffe/libraries/clib/fdlibm/ieeefp.h:1.2 kaffe/libraries/clib/fdlibm/ieeefp.h:1.3
--- kaffe/libraries/clib/fdlibm/ieeefp.h:1.2 Sat May 14 22:47:40 2005
+++ kaffe/libraries/clib/fdlibm/ieeefp.h Mon Jun 27 07:27:22 2005
@@ -4,162 +4,13 @@
#ifndef __IEEE_BIG_ENDIAN
#ifndef __IEEE_LITTLE_ENDIAN
-#ifdef __alpha__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#if defined(__arm__) || defined(__thumb__)
-/* ARM traditionally used big-endian words; and within those words the
- byte ordering was big or little endian depending upon the target.
- Modern floating-point formats are naturally ordered; in this case
- __VFP_FP__ will be defined, even if soft-float. */
-#ifdef __VFP_FP__
-#ifdef __ARMEL__
-#define __IEEE_LITTLE_ENDIAN
-#else
-#define __IEEE_BIG_ENDIAN
-#endif
-#else
-#define __IEEE_BIG_ENDIAN
-#ifdef __ARMEL__
-#define __IEEE_BYTES_LITTLE_ENDIAN
-#endif
-#endif
-#endif
-
-#ifdef __hppa__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#if defined (__sparc) || defined (__sparc__)
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __m32r__
-#ifdef __LITTLE_ENDIAN__
-#define __IEEE_LITTLE_ENDIAN
-#else
-#define __IEEE_BIG_ENDIAN
-#endif
-#endif
-
-#if defined(__m68k__) || defined(__mc68000__)
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#if defined (__H8300__) || defined (__H8300H__)
-#define __IEEE_BIG_ENDIAN
-#define __SMALL_BITFIELDS
-#define _DOUBLE_IS_32BITS
-#endif
-
-#ifdef __H8500__
-#define __IEEE_BIG_ENDIAN
-#define __SMALL_BITFIELDS
-#define _DOUBLE_IS_32BITS
-#endif
+#include "config.h"
-#ifdef __sh__
-#ifdef __LITTLE_ENDIAN__
-#define __IEEE_LITTLE_ENDIAN
+#if defined(WORDS_BIGENDIAN)
+# define __IEEE_BIG_ENDIAN
#else
-#define __IEEE_BIG_ENDIAN
+# define __IEEE_LITTLE_ENDIAN
#endif
-
-#ifdef __SH3E__
-#define _DOUBLE_IS_32BITS
-#endif
-#endif
-
-#ifdef _AM29K
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __i386__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#ifdef __x86_64__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#ifdef __i960__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#ifdef __MIPSEL__
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#ifdef __MIPSEB__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __pj__
-#ifdef __pjl__
-#define __IEEE_LITTLE_ENDIAN
-#else
-#define __IEEE_BIG_ENDIAN
-#endif
-#endif
-
-/* necv70 was __IEEE_LITTLE_ENDIAN. */
-
-#ifdef __W65__
-#define __IEEE_LITTLE_ENDIAN
-#define __SMALL_BITFIELDS
-#define _DOUBLE_IS_32BITS
-#endif
-
-#if defined(__Z8001__) || defined(__Z8002__)
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __m88k__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __v800
-#define __IEEE_LITTLE_ENDIAN
-#endif
-
-#if defined (__PPC__) || defined (__ppc__) || defined (__ppc64__)
-#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) \
- || defined (__APPLE__)
-#define __IEEE_BIG_ENDIAN
-#else
-#if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(__WIN32__) && __WIN32__)
-#define __IEEE_LITTLE_ENDIAN
-#endif
-#endif
-#endif
-
-#ifdef __fr30__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifdef __mcore__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-
-#ifdef __ia64__
-#ifdef __BIG_ENDIAN__
-#define __IEEE_BIG_ENDIAN
-#else
-#define __IEEE_LITTLE_ENDIAN
-#endif
-#endif
-
-#ifdef __s390__
-#define __IEEE_BIG_ENDIAN
-#endif
-
-#ifndef __IEEE_BIG_ENDIAN
-#ifndef __IEEE_LITTLE_ENDIAN
-#error Endianess not declared!!
-#endif /* not __IEEE_LITTLE_ENDIAN */
-#endif /* not __IEEE_BIG_ENDIAN */
#endif /* not __IEEE_LITTLE_ENDIAN */
#endif /* not __IEEE_BIG_ENDIAN */
More information about the kaffe
mailing list