[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] libjit ChangeLog jit/jit-apply-alpha.c jit/jit-...
From: |
Thomas Cort |
Subject: |
[dotgnu-pnet-commits] libjit ChangeLog jit/jit-apply-alpha.c jit/jit-... |
Date: |
Sun, 23 Jul 2006 04:45:36 +0000 |
CVSROOT: /sources/dotgnu-pnet
Module name: libjit
Changes by: Thomas Cort <tcort> 06/07/23 04:45:36
Modified files:
. : ChangeLog
jit : jit-apply-alpha.c jit-apply-alpha.h
jit-apply-func.h jit-gen-alpha.h
jit-rules-alpha.c jit-rules-alpha.h
jit-rules-alpha.ins
Log message:
Implement the redirector for alpha. Continue to implement more functions
in jit/jit-rules-alpha.c.
There is enough done on the alpha port to compile the following function
"void func(void) { return; }" and call it 1,000,000 times without
anything
crashing. jit_dump_function shows a properly generated prolog and
epilog.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libjit/ChangeLog?cvsroot=dotgnu-pnet&r1=1.244&r2=1.245
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-apply-alpha.c?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-apply-alpha.h?cvsroot=dotgnu-pnet&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-apply-func.h?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-gen-alpha.h?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-rules-alpha.c?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-rules-alpha.h?cvsroot=dotgnu-pnet&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/libjit/jit/jit-rules-alpha.ins?cvsroot=dotgnu-pnet&r1=1.1&r2=1.2
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/ChangeLog,v
retrieving revision 1.244
retrieving revision 1.245
diff -u -b -r1.244 -r1.245
--- ChangeLog 16 Jul 2006 03:15:35 -0000 1.244
+++ ChangeLog 23 Jul 2006 04:45:36 -0000 1.245
@@ -1,3 +1,10 @@
+2006-07-23 Thomas Cort <address@hidden>
+
+ * jit/jit-apply-alpha.c jit/jit-apply-alpha.h jit/jit-apply-func.h
+ jit/jit-gen-alpha.h jit/jit-rules-alpha.c jit/jit-rules-alpha.h
+ jit/jit-rules-alpha.ins Implement the redirector for alpha.
+ Continue to implement more functions in jit/jit-rules-alpha.c.
+
2006-07-15 Thomas Cort <address@hidden>
* jit/jit-apply-alpha.c jit/jit-gen-alpha.h jit/jit-rules-alpha.h
Index: jit/jit-apply-alpha.c
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-apply-alpha.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- jit/jit-apply-alpha.c 16 Jul 2006 03:18:15 -0000 1.3
+++ jit/jit-apply-alpha.c 23 Jul 2006 04:45:36 -0000 1.4
@@ -82,18 +82,138 @@
void *_jit_create_redirector(unsigned char *buf, void *func, void *user_data,
int abi) {
alpha_inst inst = (alpha_inst) buf;
- /* NOT IMPLEMENTED YET! */
+ /* Allocate space for a new stack frame. (1 instruction) */
+ alpha_lda(inst,ALPHA_SP,ALPHA_SP,-(16*8));
- /* Set up a new stack frame */
+ /* Save the return address. (1 instruction) */
+ alpha_stq(inst,ALPHA_RA,ALPHA_SP,0*8);
- /* Push the user data onto the stack "(int)(jit_nint)user_data" */
+ /* Save the frame pointer. (1 instruction) */
+ alpha_stq(inst,ALPHA_FP,ALPHA_SP,1*8);
+
+ /* Save the integer save registers (6 instructions) */
+ alpha_stq(inst,ALPHA_S0,ALPHA_SP,2*8);
+ alpha_stq(inst,ALPHA_S1,ALPHA_SP,3*8);
+ alpha_stq(inst,ALPHA_S2,ALPHA_SP,4*8);
+ alpha_stq(inst,ALPHA_S3,ALPHA_SP,5*8);
+ alpha_stq(inst,ALPHA_S4,ALPHA_SP,6*8);
+ alpha_stq(inst,ALPHA_S5,ALPHA_SP,7*8);
+
+ /* Save the floating point save registers (8 instructions) */
+ alpha_stt(inst,ALPHA_FS0,ALPHA_SP, 8*8);
+ alpha_stt(inst,ALPHA_FS1,ALPHA_SP, 9*8);
+ alpha_stt(inst,ALPHA_FS2,ALPHA_SP,10*8);
+ alpha_stt(inst,ALPHA_FS3,ALPHA_SP,11*8);
+ alpha_stt(inst,ALPHA_FS4,ALPHA_SP,12*8);
+ alpha_stt(inst,ALPHA_FS5,ALPHA_SP,13*8);
+ alpha_stt(inst,ALPHA_FS6,ALPHA_SP,14*8);
+ alpha_stt(inst,ALPHA_FS7,ALPHA_SP,15*8);
+
+ /* Set the frame pointer (1 instruction) */
+ alpha_mov(inst,ALPHA_SP,ALPHA_FP);
+
+ /* Force any pending hardware exceptions to be raised. (1 instruction)
*/
+ alpha_trapb(inst);
+
+ /* Compute and load the global pointer */
+ alpha_ldah(inst,ALPHA_GP,ALPHA_PV,0);
+ alpha_lda( inst,ALPHA_GP,ALPHA_GP,0);
+
+ /* Allocate space for a new stack frame. */
+ alpha_lda(inst,ALPHA_SP,ALPHA_SP,-(13*8));
+
+ /* Save the return address. */
+ alpha_stq(inst,ALPHA_RA,ALPHA_SP,0*8);
+
+ /* Save integer register arguments as local variables */
+ alpha_stq(inst,ALPHA_A0,ALPHA_SP,1*8);
+ alpha_stq(inst,ALPHA_A1,ALPHA_SP,2*8);
+ alpha_stq(inst,ALPHA_A2,ALPHA_SP,3*8);
+ alpha_stq(inst,ALPHA_A3,ALPHA_SP,4*8);
+ alpha_stq(inst,ALPHA_A4,ALPHA_SP,5*8);
+ alpha_stq(inst,ALPHA_A5,ALPHA_SP,6*8);
+
+ /* Save floating-point register arguments as local variables */
+ alpha_stt(inst,ALPHA_FA0,ALPHA_SP, 7*8);
+ alpha_stt(inst,ALPHA_FA1,ALPHA_SP, 8*8);
+ alpha_stt(inst,ALPHA_FA2,ALPHA_SP, 9*8);
+ alpha_stt(inst,ALPHA_FA3,ALPHA_SP,10*8);
+ alpha_stt(inst,ALPHA_FA4,ALPHA_SP,11*8);
+ alpha_stt(inst,ALPHA_FA5,ALPHA_SP,12*8);
/* Call the redirector handling function */
+ alpha_call(inst, func);
+
+ /* Restore the return address */
+ alpha_ldq(inst,ALPHA_RA,ALPHA_SP,0*8);
+
+ /* Restore integer register arguments */
+ alpha_ldq(inst,ALPHA_A0,ALPHA_SP,1*8);
+ alpha_ldq(inst,ALPHA_A1,ALPHA_SP,2*8);
+ alpha_ldq(inst,ALPHA_A2,ALPHA_SP,3*8);
+ alpha_ldq(inst,ALPHA_A3,ALPHA_SP,4*8);
+ alpha_ldq(inst,ALPHA_A4,ALPHA_SP,5*8);
+ alpha_ldq(inst,ALPHA_A5,ALPHA_SP,6*8);
+
+ /* Restore floating-point register arguments */
+ alpha_ldt(inst,ALPHA_FA0,ALPHA_SP, 7*8);
+ alpha_ldt(inst,ALPHA_FA1,ALPHA_SP, 8*8);
+ alpha_ldt(inst,ALPHA_FA2,ALPHA_SP, 9*8);
+ alpha_ldt(inst,ALPHA_FA3,ALPHA_SP,10*8);
+ alpha_ldt(inst,ALPHA_FA4,ALPHA_SP,11*8);
+ alpha_ldt(inst,ALPHA_FA5,ALPHA_SP,12*8);
+
+ /* restore the stack pointer */
+ alpha_lda(inst,ALPHA_SP,ALPHA_SP,(13*8));
+
+ /* Set the stack pointer */
+ alpha_mov(inst,ALPHA_FP,ALPHA_SP);
+
+ /* Restore the return address. (1 instruction) */
+ alpha_ldq(inst,ALPHA_RA,ALPHA_SP,0*8);
+
+ /* Restore the frame pointer. (1 instruction) */
+ alpha_ldq(inst,ALPHA_FP,ALPHA_SP,1*8);
+
+ /* Restore the integer save registers (6 instructions) */
+ alpha_ldq(inst,ALPHA_S0,ALPHA_SP,2*8);
+ alpha_ldq(inst,ALPHA_S1,ALPHA_SP,3*8);
+ alpha_ldq(inst,ALPHA_S2,ALPHA_SP,4*8);
+ alpha_ldq(inst,ALPHA_S3,ALPHA_SP,5*8);
+ alpha_ldq(inst,ALPHA_S4,ALPHA_SP,6*8);
+ alpha_ldq(inst,ALPHA_S5,ALPHA_SP,7*8);
+
+ /* Restore the floating point save registers (8 instructions) */
+ alpha_ldt(inst,ALPHA_FS0,ALPHA_SP, 8*8);
+ alpha_ldt(inst,ALPHA_FS1,ALPHA_SP, 9*8);
+ alpha_ldt(inst,ALPHA_FS2,ALPHA_SP,10*8);
+ alpha_ldt(inst,ALPHA_FS3,ALPHA_SP,11*8);
+ alpha_ldt(inst,ALPHA_FS4,ALPHA_SP,12*8);
+ alpha_ldt(inst,ALPHA_FS5,ALPHA_SP,13*8);
+ alpha_ldt(inst,ALPHA_FS6,ALPHA_SP,14*8);
+ alpha_ldt(inst,ALPHA_FS7,ALPHA_SP,15*8);
+
+ /* Restore the stack pointer (1 instruction) */
+ alpha_lda(inst,ALPHA_SP,ALPHA_SP,16*8);
+
+ /* Force any pending hardware exceptions to be raised. (1 instruction)
*/
+ alpha_trapb(inst);
/* Jump to the function that the redirector indicated */
- alpha_jsr(inst,ALPHA_RA,ALPHA_R0,1);
+ alpha_jsr(inst,ALPHA_RA,ALPHA_V0,1);
+
+ /* Return the start of the buffer as the redirector entry point */
+ return (void *)buf;
+}
+
+void _jit_pad_buffer(unsigned char *buf, int len) {
+ alpha_inst inst = (alpha_inst) buf;
- return (void *)inst;
+ if (len > 0) {
+ do {
+ alpha_nop(inst);
+ } while (--len);
+ }
}
#endif /* alpha */
Index: jit/jit-apply-alpha.h
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-apply-alpha.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- jit/jit-apply-alpha.h 12 Jul 2006 03:06:49 -0000 1.1
+++ jit/jit-apply-alpha.h 23 Jul 2006 04:45:36 -0000 1.2
@@ -21,6 +21,22 @@
#ifndef _JIT_APPLY_ALPHA_H
#define _JIT_APPLY_ALPHA_H
-/* NOT IMPLEMENTED YET! */
+/*
+ * The maximum number of bytes that are needed to represent a closure,
+ * and the alignment to use for the closure.
+ */
+#define jit_closure_size (32 /* instructions */ * 4 /* bytes
per instruction */)
+#define jit_closure_align 32
+
+/*
+ * The number of bytes that are needed for a redirector stub.
+ * This includes any extra bytes that are needed for alignment.
+ */
+#define jit_redirector_size (100 /* instructions */ * 4 /* bytes
per instruction */)
+
+/*
+ * We should pad unused code space with NOP's.
+ */
+#define jit_should_pad 1
#endif /* _JIT_APPLY_ALPHA_H */
Index: jit/jit-apply-func.h
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-apply-func.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- jit/jit-apply-func.h 6 Apr 2006 23:42:31 -0000 1.3
+++ jit/jit-apply-func.h 23 Jul 2006 04:45:36 -0000 1.4
@@ -29,6 +29,10 @@
#include "jit-apply-arm.h"
+#elif defined(__alpha) || defined(__alpha__)
+
+#include "jit-apply-alpha.h"
+
#elif defined(__x86_64) || defined(__x86_64__)
#include "jit-apply-x86-64.h"
Index: jit/jit-gen-alpha.h
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-gen-alpha.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- jit/jit-gen-alpha.h 16 Jul 2006 03:15:36 -0000 1.3
+++ jit/jit-gen-alpha.h 23 Jul 2006 04:45:36 -0000 1.4
@@ -21,6 +21,8 @@
#ifndef _JIT_GEN_ALPHA_H
#define _JIT_GEN_ALPHA_H
+#include "jit-rules.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -139,6 +141,10 @@
typedef unsigned int * alpha_inst;
+/* misc function prototypes */
+void alpha_output_branch(jit_function_t, alpha_inst, int, jit_insn_t, int);
+void jump_to_epilog(jit_gencode_t, alpha_inst, jit_block_t);
+
#define ALPHA_REG_MASK 0x1f
#define ALPHA_REGA_SHIFT 0x15
#define ALPHA_REGB_SHIFT 0x10
@@ -179,6 +185,7 @@
#define ALPHA_OP_CMPBGE 0x10
#define ALPHA_OP_S8ADDL 0x10
#define ALPHA_OP_S8SUBL 0x10
+#define ALPHA_OP_CMPLT 0x10
#define ALPHA_OP_CMPULT 0x10
#define ALPHA_OP_ADDQ 0x10
#define ALPHA_OP_S4ADDQ 0x10
Index: jit/jit-rules-alpha.c
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-rules-alpha.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- jit/jit-rules-alpha.c 16 Jul 2006 03:15:36 -0000 1.3
+++ jit/jit-rules-alpha.c 23 Jul 2006 04:45:36 -0000 1.4
@@ -67,6 +67,13 @@
}
/*
+ * Round a size up to a multiple of the stack word size.
+ */
+#define ROUND_STACK(size) \
+ (((size) + (sizeof(alpha_inst) - 1)) & ~(sizeof(alpha_inst) - 1))
+
+
+/*
* Setup or teardown the alpha code output process.
*/
#define jit_cache_setup_output(needed) \
@@ -80,6 +87,19 @@
gen->posn.ptr = (char*) inst
/*
+ * Load the instruction pointer from the generation context.
+ */
+#define jit_gen_load_inst_ptr(gen,inst) \
+ inst = (alpha_inst) (gen)->posn.ptr;
+
+/*
+ * Save the instruction pointer back to the generation context.
+ */
+#define jit_gen_save_inst_ptr(gen,inst) \
+ (gen)->posn.ptr = (unsigned char *) inst;
+
+
+/*
* Initialize the backend. This is normally used to configure registers
* that may not appear on all CPU's in a given family. For example, only
* some ARM cores have floating-point registers.
@@ -168,10 +188,9 @@
* epilog until the full function has been processed.
*/
void _jit_gen_epilog(jit_gencode_t gen, jit_function_t func) {
- alpha_inst inst;
void **fixup, **next;
- inst = (alpha_inst) gen->posn.ptr;
+ jit_cache_setup_output(20);
/* Perform fixups on any blocks that jump to the epilog */
fixup = (void **)(gen->epilog_fixup);
@@ -181,7 +200,7 @@
fixup = next;
}
- /* Set the stack pointer */
+ /* Set the stack pointer (1 instruction) */
alpha_mov(inst,ALPHA_FP,ALPHA_SP);
/* Restore the return address. (1 instruction) */
@@ -216,6 +235,8 @@
/* Return from the current function (1 instruction) */
alpha_ret(inst,ALPHA_RA,1);
+
+ jit_cache_end_output();
}
/*
@@ -230,8 +251,37 @@
* signature alone; especially if the called function is vararg.
*/
int _jit_create_call_return_insns(jit_function_t func, jit_type_t signature,
jit_value_t *args, unsigned int num_args, jit_value_t return_value, int
is_nested) {
- /* NOT IMPLEMENTED YET */
+ jit_type_t return_type;
+ int ptr_return;
+
+ return_type = jit_type_normalize(jit_type_get_return(signature));
+ ptr_return = jit_type_return_via_pointer(return_type);
+
+ /* Bail out now if we don't need to worry about return values */
+ if (!return_value || ptr_return) {
+ return 0;
+ }
+
+ /*
+ * Structure values must be flushed into the frame, and
+ * everything else ends up in a register
+ */
+ if (jit_type_is_struct(return_type) || jit_type_is_union(return_type)) {
+ if (!jit_insn_flush_struct(func, return_value)) {
+ return 0;
+ }
+ } else if (return_type->kind == JIT_TYPE_FLOAT32 || return_type->kind
== JIT_TYPE_FLOAT64 || return_type->kind == JIT_TYPE_NFLOAT) {
+ if (!jit_insn_return_reg(func, return_value, 32 /* fv0 */)) {
+ return 0;
+ }
+ } else if (return_type->kind != JIT_TYPE_VOID) {
+ if (!jit_insn_return_reg(func, return_value, 0 /* v0 */)) {
return 0;
+ }
+ }
+
+ /* Everything is back where it needs to be */
+ return 1;
}
/*
@@ -265,7 +315,36 @@
* position, and will then generate the appropriate spill instructions.
*/
void _jit_gen_spill_reg(jit_gencode_t gen, int reg, int other_reg, jit_value_t
value) {
- /* NOT IMPLEMENTED YET */;
+ int offset;
+
+ /* Make sure that we have sufficient space */
+ jit_cache_setup_output(32);
+
+ /* If the value is associated with a global register, then copy to that
*/
+ if (value->has_global_register) {
+
alpha_mov(inst,_jit_reg_info[reg].cpu_reg,_jit_reg_info[value->global_reg].cpu_reg);
+ jit_cache_end_output();
+ return;
+ }
+
+ /* Fix the value in place within the local variable frame */
+ _jit_gen_fix_value(value);
+
+ /* Output an appropriate instruction to spill the value */
+ offset = (int)(value->frame_offset);
+
+ if (reg < 32) { /* if integer register */
+ alpha_stq(inst,reg,ALPHA_FP,offset);
+ if (other_reg != -1) {
+ offset += sizeof(void *);
+ alpha_stq(inst,other_reg,ALPHA_FP,offset);
+ }
+ } else /* floating point register */ {
+ /* TODO requires floating point support */
+ }
+
+ jit_cache_end_output();
+ return;
}
/*
@@ -362,6 +441,7 @@
* _jit_gen_fix_value.
*/
void _jit_gen_load_value(jit_gencode_t gen, int reg, int other_reg,
jit_value_t value) {
+ short int offset;
/* Make sure that we have sufficient space */
jit_cache_setup_output(32);
@@ -399,7 +479,47 @@
/* mov from value->reg to _jit_reg_info[reg].cpu_reg */
alpha_mov(inst,value->reg,_jit_reg_info[reg].cpu_reg);
- } /* TODO else load from mem */
+ } else {
+
+ /* Fix the position of the value in the stack frame */
+ _jit_gen_fix_value(value);
+ offset = (int)(value->frame_offset);
+
+ /* Load the value into the specified register */
+ switch (jit_type_normalize(value->type)->kind) {
+
+ case JIT_TYPE_SBYTE:
+/* TODO add alpha_ldb
alpha_ldb(inst,_jit_reg_info[reg].cpu_reg,ALPHA_SP,offset);
+ */ break;
+ case JIT_TYPE_UBYTE:
+
alpha_ldbu(inst,_jit_reg_info[reg].cpu_reg,ALPHA_SP,offset);
+ break;
+ case JIT_TYPE_SHORT:
+/* TODO add alpha_ldw
alpha_ldw(inst,_jit_reg_info[reg].cpu_reg,ALPHA_SP,offset);
+ */ break;
+ case JIT_TYPE_USHORT:
+
alpha_ldwu(inst,_jit_reg_info[reg].cpu_reg,ALPHA_SP,offset);
+ break;
+ case JIT_TYPE_INT:
+
alpha_ldl(inst,_jit_reg_info[reg].cpu_reg,ALPHA_SP,offset);
+ break;
+ case JIT_TYPE_UINT:
+/* TODO add alpha_ldlu
alpha_ldlu(inst,_jit_reg_info[reg].cpu_reg,ALPHA_SP,offset);
+*/ break;
+ case JIT_TYPE_LONG:
+
alpha_ldq(inst,_jit_reg_info[reg].cpu_reg,ALPHA_SP,offset);
+ break;
+ case JIT_TYPE_ULONG:
+/* TODO add alpha_ldqu
alpha_ldqu(inst,_jit_reg_info[reg].cpu_reg,ALPHA_SP,offset);
+*/ break;
+
+ /* TODO requires floating-point support */
+ case JIT_TYPE_FLOAT32:
+ case JIT_TYPE_FLOAT64:
+ case JIT_TYPE_NFLOAT:
+ break;
+ }
+ }
jit_cache_end_output();
}
@@ -430,7 +550,16 @@
* for the result to be placed in an appropriate register or memory
destination.
*/
void _jit_gen_insn(jit_gencode_t gen, jit_function_t func, jit_block_t block,
jit_insn_t insn) {
- /* NOT IMPLEMENTED YET */;
+
+ switch (insn->opcode) {
+ #define JIT_INCLUDE_RULES
+ #include "jit-rules-alpha.inc"
+ #undef JIT_INCLUDE_RULES
+
+ default:
+ fprintf(stderr, "TODO(%x) at %s, %d\n",
(int)(insn->opcode), __FILE__, (int)__LINE__);
+ break;
+ }
}
/*
@@ -440,6 +569,16 @@
/* NOT IMPLEMENTED YET */;
}
+void _jit_gen_fix_value(jit_value_t value) {
+
+ if (!(value->has_frame_offset) && !(value->is_constant)) {
+ jit_nint size =
(jit_nint)(ROUND_STACK(jit_type_get_size(value->type)));
+ value->block->func->builder->frame_size += size;
+ value->frame_offset =
-(value->block->func->builder->frame_size);
+ value->has_frame_offset = 1;
+ }
+}
+
/*
* Output a branch instruction.
*/
@@ -473,7 +612,7 @@
/*
* Jump to the current function's epilog.
*/
-void alpha_jump_to_epilog(jit_gencode_t gen, alpha_inst inst, jit_block_t
block) {
+void jump_to_epilog(jit_gencode_t gen, alpha_inst inst, jit_block_t block) {
short int offset;
/*
Index: jit/jit-rules-alpha.h
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-rules-alpha.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- jit/jit-rules-alpha.h 16 Jul 2006 03:15:36 -0000 1.3
+++ jit/jit-rules-alpha.h 23 Jul 2006 04:45:36 -0000 1.4
@@ -200,10 +200,8 @@
*/
#define JIT_CDECL_WORD_REG_PARAMS {9,10,11,12,13,14,-1}
#define JIT_MAX_WORD_REG_PARAMS 6
-
-/* TODO: find the proper values for these */
#define JIT_INITIAL_STACK_OFFSET 0
-#define JIT_INITIAL_FRAME_SIZE 0
+#define JIT_INITIAL_FRAME_SIZE (14*8)
#ifdef __cplusplus
};
Index: jit/jit-rules-alpha.ins
===================================================================
RCS file: /sources/dotgnu-pnet/libjit/jit/jit-rules-alpha.ins,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- jit/jit-rules-alpha.ins 12 Jul 2006 03:06:49 -0000 1.1
+++ jit/jit-rules-alpha.ins 23 Jul 2006 04:45:36 -0000 1.2
@@ -26,26 +26,26 @@
JIT_OP_TRUNC_SBYTE: unary
[reg] -> {
- alpha_slli(code,$1,56,$1);
- alpha_srai(code,$1,56,$1);
+ alpha_slli(inst,$1,56,$1);
+ alpha_srai(inst,$1,56,$1);
}
JIT_OP_TRUNC_UBYTE: unary
[reg] -> {
- alpha_li8(code,ALPHA_AT,0xff);
- alpha_and(code,$1,ALPHA_AT,$1);
+ _alpha_li8(inst,ALPHA_AT,0xff);
+ alpha_and(inst,$1,ALPHA_AT,$1);
}
JIT_OP_TRUNC_SHORT: unary
[reg] -> {
- alpha_slli(code,$1,56,$1);
- alpha_srai(code,$1,56,$1);
+ alpha_slli(inst,$1,56,$1);
+ alpha_srai(inst,$1,56,$1);
}
JIT_OP_TRUNC_USHORT: unary
[reg] -> {
- alpha_slli(code,$1,56,$1);
- alpha_srli(code,$1,56,$1);
+ alpha_slli(inst,$1,56,$1);
+ alpha_srli(inst,$1,56,$1);
}
/*
@@ -184,7 +184,7 @@
JIT_OP_INOT: unary
[reg] -> {
- alpha_li32(inst,ALPHA_AT,0xffffffff);
+ _alpha_li32(inst,ALPHA_AT,0xffffffff);
alpha_xor(inst,ALPHA_AT,$1,$1);
}
@@ -213,7 +213,7 @@
JIT_OP_LNOT: unary
[reg] -> {
- alpha_li64(inst,ALPHA_AT,0xffffffff);
+ _alpha_li64(inst,ALPHA_AT,0xffffffff);
alpha_xor(inst,ALPHA_AT,$1,$1);
}
@@ -308,41 +308,8 @@
}
-JIT_OP_BR_IGT: binary_branch
- [reg, reg] -> {
- /* $1 > $2 -> $at */
- alpha_cmpgt(inst, $1, $2, ALPHA_AT);
-
- /* branch if $at == 1 */
- alpha_output_branch(func, inst, ALPHA_OP_BEQ, insn, ALPHA_AT);
- }
-
-JIT_OP_BR_IGT_UN: binary_branch
- [reg, reg] -> {
- /* $1 > $2 -> $at */
- alpha_cmpugt(inst, $1, $2, ALPHA_AT);
-
- /* branch if $at == 1 */
- alpha_output_branch(func, inst, ALPHA_OP_BEQ, insn, ALPHA_AT);
- }
-
-JIT_OP_BR_IGE: binary_branch
- [reg, reg] -> {
- /* $1 >= $2 -> $at */
- alpha_cmpge(inst, $1, $2, ALPHA_AT);
-
- /* branch if $at == 1 */
- alpha_output_branch(func, inst, ALPHA_OP_BEQ, insn, ALPHA_AT);
- }
-
-JIT_OP_BR_IGE_UN: binary_branch
- [reg, reg] -> {
- /* $1 => $2 -> $at */
- alpha_cmpugt(inst, $1, $2, ALPHA_AT);
-
- /* branch if $at == 1 */
- alpha_output_branch(func, inst, ALPHA_OP_BEQ, insn, ALPHA_AT);
- }
+/* TODO: JIT_OP_BR_IGT JIT_OP_BR_IGT_UN */
+/* TODO: JIT_OP_BR_IGE JIT_OP_BR_IGE_UN */
/*
@@ -381,25 +348,7 @@
alpha_cmpule(inst,$3,$2,$1);
}
-JIT_OP_IGT: binary
- [=reg, reg, reg] -> {
- alpha_cmpgt(inst,$3,$2,$1);
- }
-
-JIT_OP_IGT_UN: binary
- [=reg, reg, reg] -> {
- alpha_cmpugt(inst,$3,$2,$1);
- }
-
-JIT_OP_IGE: binary
- [=reg, reg, reg] -> {
- alpha_cmpge(inst,$3,$2,$1);
- }
-
-JIT_OP_IGE_UN: binary
- [=reg, reg, reg] -> {
- alpha_cmpuge(inst,$3,$2,$1);
- }
+/* TODO: JIT_OP_IGT JIT_OP_IGT_UN JIT_OP_IGE JIT_OP_IGE_UN */
/*
* Mathematical opcodes.