]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Pointer-relative loads and stores for structures in the x86 back end.
authorRhys Weatherley <rweather@southern-storm.com.au>
Fri, 10 Sep 2004 03:01:24 +0000 (03:01 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Fri, 10 Sep 2004 03:01:24 +0000 (03:01 +0000)
ChangeLog
jit/jit-rules-x86.sel

index e86a9004b88d5d13e51720e19ce3355b57e03283..f83863e54955fe1bf2e55082c16843e20de266e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
 
+2004-09-10  Rhys Weatherley  <rweather@southern-storm.com.au>
+
+       * jit/jit-rules-x86.sel: pointer-relative loads and stores
+       for structures in the x86 back end.
+
 2004-09-09  Rhys Weatherley  <rweather@southern-storm.com.au>
 
        * jit/jit-rules-x86.c, jit/jit-rules-x86.sel: add some support
index 0a300848468a42043cb15f9ef5a4a0b6d6590f9c..30aa4ccf75d5c4bff0118071c3eb73edc468ee0a 100644 (file)
@@ -2620,8 +2620,24 @@ JIT_OP_STORE_RELATIVE_NFLOAT: manual
 
 JIT_OP_STORE_RELATIVE_STRUCT: manual
        [] -> {
-               /* TODO */
-               TODO();
+               unsigned char *inst;
+               int reg = _jit_regs_load_value
+                       (gen, insn->dest, 0,
+                        (insn->flags & (JIT_INSN_DEST_NEXT_USE |
+                                                        JIT_INSN_DEST_LIVE)));
+               _jit_regs_spill_all(gen);
+               _jit_gen_fix_value(insn->value1);
+               inst = gen->posn.ptr;
+               if(!jit_cache_check_for_n(&(gen->posn), 128))
+               {
+                       jit_cache_mark_full(&(gen->posn));
+                       return;
+               }
+               reg = _jit_reg_info[reg].cpu_reg;
+               inst = memory_copy(gen, inst, reg, (int)(insn->value2->address),
+                                                  X86_EBP, insn->value1->frame_offset,
+                                                  jit_type_get_size(jit_value_get_type(insn->value1)));
+               gen->posn.ptr = inst;
        }
 
 JIT_OP_ADD_RELATIVE: unary