]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
* jit/jit-apply-alpha.c jit/jit-apply-alpha.h: Fix jit_redirector_size.
authorThomas Cort <linuxgeek@gmail.com>
Tue, 22 Aug 2006 23:41:32 +0000 (23:41 +0000)
committerThomas Cort <linuxgeek@gmail.com>
Tue, 22 Aug 2006 23:41:32 +0000 (23:41 +0000)
alpha_call is 6 instructions, not 1. 5 to load the addr, 1 to call.

* jit/jit-gen-alpha.h: add macros for fp sign copy and arithmetic.

* jit/jit-rules-alpha.c: remove TODO() from unused functions.

ChangeLog
jit/jit-apply-alpha.c
jit/jit-apply-alpha.h
jit/jit-gen-alpha.h
jit/jit-rules-alpha.c

index cf9c3c34ec65dea749822e29789167c8b7d32cbc..251f90ed668136471f49c1ec61d11ed981dee676 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-08-23  Thomas Cort  <linuxgeek@gmail.com>
+
+       * jit/jit-apply-alpha.c jit/jit-apply-alpha.h: Fix jit_redirector_size.
+       alpha_call is 6 instructions, not 1. 5 to load the addr, 1 to call.
+
+       * jit/jit-gen-alpha.h: add macros for fp sign copy and arithmetic.
+
+       * jit/jit-rules-alpha.c: remove TODO() from unused functions.
+
 2006-08-23  Aleksey Demakov  <ademakov@gmail.com>
 
        * jit/jit-internal.h (struct _jit_function): change the type of
index 9c07a20359d0689bcffe3af334e9edb4e9f4cfc5..7e30369e988d51df574c85fc97a6e6ed9bc2f714 100644 (file)
@@ -119,7 +119,7 @@ void *_jit_create_redirector(unsigned char *buf, void *func, void *user_data, in
        /* Force any pending hardware exceptions to be raised. (1 instruction) */
        alpha_trapb(inst);
 
-       /* Call the redirector handling function (1 instruction) */
+       /* Call the redirector handling function (6 instruction) */
        alpha_call(inst, func);
 
        /* Restore the return address. (1 instruction) */
index 63d5e4c68e7ef4b63535e334d8fd5de8eb580b29..0f4d542846e616806d68e6edca339388dda07772 100644 (file)
@@ -32,7 +32,7 @@
  * 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             (41 /* instructions */ * 4 /* bytes per instruction */)
+#define jit_redirector_size             (46 /* instructions */ * 4 /* bytes per instruction */)
 
 /*
  * We should pad unused code space with NOP's.
index ae93dfd80ada8a4f7f90eff44bda23b3d4fc9032..d1b13a32f0b058027066386e6c954a1a5d4eb6aa 100644 (file)
@@ -258,6 +258,15 @@ void jump_to_epilog(jit_gencode_t, alpha_inst, jit_block_t);
 #define ALPHA_OP_ITOFS         0x14
 #define ALPHA_OP_ITOFF         0x14
 #define ALPHA_OP_ITOFT         0x14
+#define ALPHA_OP_ADDS          0x16
+#define ALPHA_OP_SUBS          0x16
+#define ALPHA_OP_ADDT          0x16
+#define ALPHA_OP_SUBT          0x16
+#define ALPHA_OP_MULT          0x16
+#define ALPHA_OP_DIVT          0x16
+#define ALPHA_OP_CPYS          0x17
+#define ALPHA_OP_CPYSN         0x17
+#define ALPHA_OP_CPYSE         0x17
 #define ALPHA_OP_TRAPB         0x18
 #define ALPHA_OP_JMP           0x1a
 #define ALPHA_OP_JSR           0x1a
@@ -390,6 +399,19 @@ void jump_to_epilog(jit_gencode_t, alpha_inst, jit_block_t);
 #define ALPHA_FUNC_ITOFF       0x14
 #define ALPHA_FUNC_ITOFT       0x24
 
+/* floating point arithmetic operations -- use with ALPHA_OP_* == 0x16 */
+#define ALPHA_FUNC_ADDS                0x80
+#define ALPHA_FUNC_SUBS                0x81
+#define ALPHA_FUNC_ADDT                0xA0
+#define ALPHA_FUNC_SUBT                0xA1
+#define ALPHA_FUNC_MULT                0xA2
+#define ALPHA_FUNC_DIVT                0xA3
+
+/* floating point sign copy operations -- use with ALPHA_OP_* == 0x17 */
+#define ALPHA_FUNC_CPYS                0x20
+#define ALPHA_FUNC_CPYSN       0x21
+#define ALPHA_FUNC_CPYSE       0x22
+
 /* trap barrier -- use with ALPHA_OP_* == 0x18 */
 #define ALPHA_FUNC_TRAPB       0x0
 
@@ -651,6 +673,19 @@ void jump_to_epilog(jit_gencode_t, alpha_inst, jit_block_t);
 #define alpha_itoff(inst,sreg,fdreg)           alpha_encode_fpop(inst,ALPHA_OP_ITOFF,ALPHA_FUNC_ITOFF,sreg,ALPHA_ZERO,fdreg)
 #define alpha_itoft(inst,sreg,fdreg)           alpha_encode_fpop(inst,ALPHA_OP_ITOFT,ALPHA_FUNC_ITOFT,sreg,ALPHA_ZERO,fdreg)
 
+/* Floating point arithmetic instructions */
+#define alpha_adds(inst,fsreg0,fsreg1,fdreg)    alpha_encode_fpop(inst,ALPHA_OP_ADDS,ALPHA_FUNC_ADDS,fsreg0,fsreg1,fdreg)
+#define alpha_subs(inst,fsreg0,fsreg1,fdreg)    alpha_encode_fpop(inst,ALPHA_OP_SUBS,ALPHA_FUNC_SUBS,fsreg0,fsreg1,fdreg)
+#define alpha_addt(inst,fsreg0,fsreg1,fdreg)    alpha_encode_fpop(inst,ALPHA_OP_ADDT,ALPHA_FUNC_ADDT,fsreg0,fsreg1,fdreg)
+#define alpha_subt(inst,fsreg0,fsreg1,fdreg)    alpha_encode_fpop(inst,ALPHA_OP_SUBT,ALPHA_FUNC_SUBT,fsreg0,fsreg1,fdreg)
+#define alpha_mult(inst,fsreg0,fsreg1,fdreg)    alpha_encode_fpop(inst,ALPHA_OP_MULT,ALPHA_FUNC_MULT,fsreg0,fsreg1,fdreg)
+#define alpha_divt(inst,fsreg0,fsreg1,fdreg)    alpha_encode_fpop(inst,ALPHA_OP_DIVT,ALPHA_FUNC_DIVT,fsreg0,fsreg1,fdreg)
+
+/* Floating point sign copy instructions */
+#define alpha_cpys(inst,fsreg0,fsreg1,fdreg)   alpha_encode_fpop(inst,ALPHA_OP_CPYS,ALPHA_FUNC_CPYS,fsreg0,fsreg1,fdreg)
+#define alpha_cpysn(inst,fsreg0,fsreg1,fdreg)  alpha_encode_fpop(inst,ALPHA_OP_CPYSN,ALPHA_FUNC_CPYSN,fsreg0,fsreg1,fdreg)
+#define alpha_cpyse(inst,fsreg0,fsreg1,fdreg)  alpha_encode_fpop(inst,ALPHA_OP_CPYSE,ALPHA_FUNC_CPYSE,fsreg0,fsreg1,fdreg)
+
 /* load immediate pseudo instruction. */
 #define _alpha_li64(code,dreg,val)                             \
 do {                                                           \
index c49c906c2366593da60c60df6167541827a7ba59..d9c737164f55765f3d7c35b918f71f369a979ab9 100644 (file)
@@ -267,18 +267,17 @@ int _jit_setup_indirect_pointer(jit_function_t func, jit_value_t value) {
        return 0;
 }
 
-/*
- * TODO: write what this function is supposed to do
- */
+void _jit_gen_exch_top(jit_gencode_t gen, int reg, int pop) {
+       /* not used by alpha */;
+}
+
+
 void _jit_gen_spill_top(jit_gencode_t gen, int reg, jit_value_t value, int pop) {
-       TODO();
+       /* not used by alpha */;
 }
 
-/*
- * TODO: write what this function is supposed to do
- */
 void _jit_gen_spill_global(jit_gencode_t gen, int reg, jit_value_t value) {
-       TODO();
+       /* not used by alpha */;
 }
 
 /*
@@ -548,13 +547,6 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func, jit_block_t block, ji
        }
 }
 
-/*
- * TODO: write what this function is supposed to do
- */
-void _jit_gen_exch_top(jit_gencode_t gen, int reg, int pop) {
-       TODO();
-}
-
 void _jit_gen_fix_value(jit_value_t value) {
 
        if (!(value->has_frame_offset) && !(value->is_constant)) {