dotgnu-pnet-commits
[Top][All Lists]
Advanced

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

[dotgnu-pnet-commits] libjit ChangeLog jit/jit-rules-alpha.c jit/jit-...


From: Thomas Cort
Subject: [dotgnu-pnet-commits] libjit ChangeLog jit/jit-rules-alpha.c jit/jit-...
Date: Tue, 15 Aug 2006 01:09:00 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    libjit
Changes by:     Thomas Cort <tcort>     06/08/15 01:09:00

Modified files:
        .              : ChangeLog 
        jit            : jit-rules-alpha.c jit-rules-alpha.h 
                         jit-rules-alpha.ins 

Log message:
        Add a TODO() macro to print unimplemented warnings. Fix some
        casting warnings. Implement _jit_gen_redirector(...). Fix
        JIT_CDECL_WORD_REG_PARAMS to use the correct parameter
        registers. Add some stack push and pop instructions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libjit/ChangeLog?cvsroot=dotgnu-pnet&r1=1.248&r2=1.249
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-rules-alpha.c?cvsroot=dotgnu-pnet&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-rules-alpha.h?cvsroot=dotgnu-pnet&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-rules-alpha.ins?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/ChangeLog,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -b -r1.248 -r1.249
--- ChangeLog   14 Aug 2006 19:21:19 -0000      1.248
+++ ChangeLog   15 Aug 2006 01:08:59 -0000      1.249
@@ -1,3 +1,10 @@
+2006-08-15  Thomas Cort  <address@hidden>
+       * jit/jit-rules-alpha.c jit/jit-rules-alpha.h jit/jit-rules-alpha.ins
+       Add a TODO() macro to print unimplemented warnings. Fix some 
+       casting warnings. Implement _jit_gen_redirector(...). Fix
+       JIT_CDECL_WORD_REG_PARAMS to use the correct parameter 
+       registers. Add some stack push and pop instructions.
+
 2006-08-15  Kirill Kononenko  <address@hidden>
 
        * configure.in: add --enable-signals option;

Index: jit/jit-rules-alpha.c
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-rules-alpha.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- jit/jit-rules-alpha.c       12 Aug 2006 01:37:00 -0000      1.5
+++ jit/jit-rules-alpha.c       15 Aug 2006 01:09:00 -0000      1.6
@@ -108,6 +108,12 @@
        /* Nothing to do here */;
 }
 
+#define TODO()          \
+        do { \
+                fprintf(stderr, "TODO at %s, %d\n", __FILE__, (int)__LINE__); \
+        } while (0)
+
+
 /*
  * Get the ELF machine and ABI type information for this platform. The 
  * machine field should be set to one of the EM_* values in 
@@ -198,7 +204,7 @@
                alpha_inst code = (alpha_inst) fixup;
                next     = (void **)(fixup[0]);
 
-               _alpha_li64(code,ALPHA_AT,inst);
+               _alpha_li64(code,ALPHA_AT,(long int)inst);
                alpha_jmp(code,ALPHA_ZERO,ALPHA_AT,1);
 
                fixup    = next;
@@ -293,7 +299,7 @@
  * stack location for a subsequent indirect call.
  */
 int _jit_setup_indirect_pointer(jit_function_t func, jit_value_t value) {
-       /* NOT IMPLEMENTED YET */
+       TODO();
        return 0;
 }
 
@@ -301,14 +307,14 @@
  * TODO: write what this function is supposed to do
  */
 void _jit_gen_spill_top(jit_gencode_t gen, int reg, jit_value_t value, int 
pop) {
-       /* NOT IMPLEMENTED YET */;
+       TODO();
 }
 
 /*
  * TODO: write what this function is supposed to do
  */
 void _jit_gen_spill_global(jit_gencode_t gen, int reg, jit_value_t value) {
-       /* NOT IMPLEMENTED YET */;
+       TODO();
 }
 
 /*
@@ -427,7 +433,7 @@
                alpha_inst code = (alpha_inst) fixup;
                next     = (void **)(fixup[0]);
 
-               _alpha_li64(code,ALPHA_AT,(gen->posn.ptr));
+               _alpha_li64(code,ALPHA_AT,(long int)(gen->posn.ptr));
                alpha_jmp(code,ALPHA_ZERO,ALPHA_AT,1);
 
                fixup    = next;
@@ -533,11 +539,7 @@
 }
 
 void _jit_gen_load_global(jit_gencode_t gen, int reg, jit_value_t value) {
-/*
-       NOT IMPLEMENTED YET!
-       jit_cache_setup_output();
-       jit_cache_end_output();
-*/
+       TODO();
 }
 
 
@@ -548,8 +550,20 @@
  * version after recompilation.
  */
 void *_jit_gen_redirector(jit_gencode_t gen, jit_function_t func) {
-       /* NOT IMPLEMENTED YET */
+       void *ptr, *entry;
+       alpha_inst inst = (alpha_inst) gen->posn.ptr;
+
+       if (!jit_cache_check_for_n(&(gen->posn), 8*6)) {
+               jit_cache_mark_full(&(gen->posn));
        return NULL;
+       }
+
+       ptr = (void *)&(func->entry_point);
+       entry = gen->posn.ptr;
+
+       alpha_call(inst, ptr);
+
+       return entry;
 }
 
 /*
@@ -574,7 +588,7 @@
  * TODO: write what this function is supposed to do
  */
 void _jit_gen_exch_top(jit_gencode_t gen, int reg, int pop) {
-       /* NOT IMPLEMENTED YET */;
+       TODO();
 }
 
 void _jit_gen_fix_value(jit_value_t value) {

Index: jit/jit-rules-alpha.h
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-rules-alpha.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- jit/jit-rules-alpha.h       23 Jul 2006 04:45:36 -0000      1.4
+++ jit/jit-rules-alpha.h       15 Aug 2006 01:09:00 -0000      1.5
@@ -198,10 +198,10 @@
 /*
  * Parameter passing rules.
  */
-#define JIT_CDECL_WORD_REG_PARAMS      {9,10,11,12,13,14,-1}
+#define JIT_CDECL_WORD_REG_PARAMS      {16,17,18,19,20,21,-1}
 #define JIT_MAX_WORD_REG_PARAMS                6
-#define JIT_INITIAL_STACK_OFFSET       0
-#define JIT_INITIAL_FRAME_SIZE                 (14*8)
+#define JIT_INITIAL_STACK_OFFSET       (14*8)
+#define JIT_INITIAL_FRAME_SIZE                 (sizeof(void*))
 
 #ifdef __cplusplus
 };

Index: jit/jit-rules-alpha.ins
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-rules-alpha.ins,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- jit/jit-rules-alpha.ins     12 Aug 2006 01:37:00 -0000      1.3
+++ jit/jit-rules-alpha.ins     15 Aug 2006 01:09:00 -0000      1.4
@@ -402,3 +402,38 @@
                alpha_call(inst, (insn->dest));
        }
 
+/*
+ * Stack pushes and pops.
+ */
+
+JIT_OP_RETURN_REG: manual
+        [] -> {
+               /* Nothing to do here */;
+       }
+
+JIT_OP_PUSH_INT: unary_note
+       [imm] -> {
+               alpha_li(inst,ALPHA_AT,$1);
+               alpha_stq(inst,ALPHA_AT,ALPHA_SP,0);
+               alpha_lda(inst,ALPHA_SP,ALPHA_SP,-8);
+       }
+       [reg] -> {
+               alpha_stq(inst,$1,ALPHA_SP,0);
+               alpha_lda(inst,ALPHA_SP,ALPHA_SP,-8);
+       }
+
+JIT_OP_PUSH_LONG: unary_note
+       [imm] -> {
+               alpha_li(inst,ALPHA_AT,$1);
+               alpha_stq(inst,ALPHA_AT,ALPHA_SP,0);
+               alpha_lda(inst,ALPHA_SP,ALPHA_SP,-8);
+       }
+       [reg] -> {
+               alpha_stq(inst,$1,ALPHA_SP,0);
+               alpha_lda(inst,ALPHA_SP,ALPHA_SP,-8);
+       }
+
+JIT_OP_POP_STACK:
+       [] -> {
+               alpha_lda(inst,ALPHA_SP,ALPHA_SP,insn->value1->address);
+       }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]