[kaffe] CVS kaffe (guilhem): Important fixes for JIT3/ppc.

Kaffe CVS cvs-commits at kaffe.org
Fri Jul 1 10:00:21 PDT 2005


PatchSet 6676 
Date: 2005/07/01 16:53:35
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Important fixes for JIT3/ppc.


        * config/powerpc/jit.h: Include jit-labels.h
        (CALL_KAFFE_EXCEPTION): Use apple syntax on register if necessary.

        * kaffe/kaffevm/jit3/icode.c
        (cvt_float_int, cvt_double_int): Imported JIT code to do a precise NaN
        conversion.

Members: 
	ChangeLog:1.4201->1.4202 
	config/powerpc/jit.h:1.2->1.3 
	kaffe/kaffevm/jit3/icode.c:1.55->1.56 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4201 kaffe/ChangeLog:1.4202
--- kaffe/ChangeLog:1.4201	Fri Jul  1 11:06:31 2005
+++ kaffe/ChangeLog	Fri Jul  1 16:53:35 2005
@@ -1,3 +1,12 @@
+2005-07-01  Guilhem Lavaux  <guilhem at kaffe.org>
+
+	* config/powerpc/jit.h: Include jit-labels.h
+	(CALL_KAFFE_EXCEPTION): Use apple syntax on register if necessary.
+
+	* kaffe/kaffevm/jit3/icode.c
+	(cvt_float_int, cvt_double_int): Imported JIT code to do a precise NaN
+	conversion.
+
 2005-07-01  Davanum Srinivas <dims at yahoo.com>
 
 	* binreloc/prefix.c: (br_locate) Fix for cygwin.
Index: kaffe/config/powerpc/jit.h
diff -u kaffe/config/powerpc/jit.h:1.2 kaffe/config/powerpc/jit.h:1.3
--- kaffe/config/powerpc/jit.h:1.2	Tue Dec 21 00:15:28 2004
+++ kaffe/config/powerpc/jit.h	Fri Jul  1 16:53:39 2005
@@ -93,6 +93,16 @@
 /*
  * Call a jitted java exception handler.
  */
+#if defined(__APPLE__)
+#define CALL_KAFFE_EXCEPTION(frame, handler, object) \
+	asm volatile ("mr r1, %0\n" \
+		      "\tlwz r10, 0(r1)\n" \
+		      "\tlmw r14, -72(r10)\n" \
+		      "\tmr r3, %1\n" \
+		      "\tmtctr %2\n" \
+		      "\tbctr\n" \
+		      : : "r" (frame), "r" (object), "r" (handler) : "r3")
+#else
 #define CALL_KAFFE_EXCEPTION(frame, handler, object) \
 	asm volatile ("mr 1, %0\n" \
 		      "\tlwz 10, 0(1)\n" \
@@ -101,6 +111,7 @@
 		      "\tmtctr %2\n" \
 		      "\tbctr\n" \
 		      : : "r" (frame), "r" (object), "r" (handler) : "r3")
+#endif
 
 /*
  * Call a JanosVM catastrophe handler.
@@ -124,5 +135,7 @@
 #define KAFFEJIT_TO_NATIVE(M)
 
 #define PUSHARG_FORWARDS
+
+#include "jit-labels.h"
 
 #endif
Index: kaffe/kaffe/kaffevm/jit3/icode.c
diff -u kaffe/kaffe/kaffevm/jit3/icode.c:1.55 kaffe/kaffe/kaffevm/jit3/icode.c:1.56
--- kaffe/kaffe/kaffevm/jit3/icode.c:1.55	Mon May 30 09:24:01 2005
+++ kaffe/kaffe/kaffevm/jit3/icode.c	Fri Jul  1 16:53:39 2005
@@ -4291,6 +4291,36 @@
 	used_ieee_rounding = true;
 #if defined(HAVE_cvt_float_int)
 	slot_slot_slot(dst, 0, src, HAVE_cvt_float_int, Tcomplex);
+#elif defined(HAVE_cvt_float_int_ieee)
+	{
+	  SlotInfo *tmp;
+	  
+	  slot_alloctmp(tmp);
+
+	  end_sub_block();
+	  and_int_const(tmp, src, FEXPMASK);
+	  cbranch_int_const_ne(tmp, FEXPMASK, reference_label(1, 1));
+	  
+	  and_int_const(tmp, src, FMANMASK);
+	  cbranch_int_const_eq(tmp, 0, reference_label(1, 2));
+
+          start_sub_block();
+	  move_int_const(dst, 0);
+	  end_sub_block();
+	  branch_a(reference_label(1, 3));
+
+	  set_label(1, 1);
+	  set_label(1, 2);
+	  start_sub_block();
+	  slot_slot_lslot(dst, 0, src, HAVE_cvt_float_int_ieee, Tcomplex);
+	  end_sub_block();
+
+	  set_label(1, 3);
+
+	  start_sub_block();
+
+	  slot_freetmp(tmp);
+	}
 #else
 	begin_func_sync();
 	pusharg_float(src, 0);
@@ -4338,6 +4368,39 @@
 	used_ieee_rounding = true;
 #if defined(HAVE_cvt_double_int)
 	slot_slot_lslot(dst, NULL, src, HAVE_cvt_double_int, Tcomplex);
+#elif defined(HAVE_cvt_double_int_ieee)
+	{
+	  SlotInfo *tmp;
+	  int i;
+	  
+	  end_sub_block();
+	  slot_alloc2tmp(tmp);
+
+	  and_long_const(tmp, src, DEXPMASK);
+	  cbranch_int_const_ne(LSLOT(tmp), (jint)(DEXPMASK & 0xffffffff), reference_label(1, 1));
+	  cbranch_int_const_ne(HSLOT(tmp), (jint)((DEXPMASK >> 32) & 0xffffffff), reference_label(1, 2));
+	  
+	  and_long_const(tmp, src, DMANMASK);
+	  cbranch_int_const_ne(LSLOT(tmp), 0, reference_label(1, 3));
+	  cbranch_int_const_eq(HSLOT(tmp), 0, reference_label(1, 4));
+
+	  set_label(1, 3);
+	  start_sub_block();
+	  move_int_const(dst, 0);
+	  end_sub_block();
+	  branch_a(reference_label(1, 5));
+
+	  set_label(1, 4);
+	  set_label(1, 1);
+	  set_label(1, 2);
+	  start_sub_block();
+	  slot_slot_lslot(dst, 0, src, HAVE_cvt_double_int_ieee, Tcomplex);
+	  end_sub_block();
+
+	  set_label(1, 5);
+	  slot_free2tmp(tmp);
+	  start_sub_block();
+	}
 #else
 	begin_func_sync();
 	pusharg_double(src, 0);



More information about the kaffe mailing list