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

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

[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and to


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET engine, compilers and tools (pnet) branch, master, updated. 5554b0becd1ad4ba617cefdd05a54da1d19bb1ae
Date: Tue, 20 Apr 2010 18:58:21 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET engine, compilers and tools (pnet)".

The branch, master has been updated
       via  5554b0becd1ad4ba617cefdd05a54da1d19bb1ae (commit)
      from  e0924390747a05f6a1143923e4f15d50d49334f5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=5554b0becd1ad4ba617cefdd05a54da1d19bb1ae

commit 5554b0becd1ad4ba617cefdd05a54da1d19bb1ae
Author: Klaus Treichel <address@hidden>
Date:   Tue Apr 20 20:58:06 2010 +0200

    Add support for unrolling LDELEMA on arm.

diff --git a/ChangeLog b/ChangeLog
index b5fc004..85f0ed8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,13 @@
        * engine/lib_gc.c (_IL_GC_ReRegisterForFinalizeInternal): Set the
        finalization context for the reregistered finalizer.
 
+       * engine/arm_codegen.h (arm_alu_reg_reg_lslimm, arm_muladd_reg_reg_reg):
+       Add codegeneration macros.
+
+       * engine/md_arm.h (md_lea_membase): Optimize
+       (md_lea_memindex_shift, md_lea_memindex_mul): Add macros for calculating
+       the effective addresses of array elements.
+
 2010-04-18  Klaus Treichel  <address@hidden>
 
        * engine/cvm.h: Replace the opcode COP_CKARRAY_LOAD_I4 by the two
@@ -16,7 +23,7 @@
        Implement the two new opcodes.
        (COP_CKARRAY_LOAD_I4): Remove implementation of this opcode.
 
-       * engine/cvmc_ptr.c (GetArrayElementAddress): Ad new support function
+       * engine/cvmc_ptr.c (GetArrayElementAddress): Add new support function
        for the cli LDELEMA opcode.
        (CVMCoder_ArrayAccess): Use the new function for the IL_OP_LDELEMA
        opcode.
diff --git a/engine/arm_codegen.h b/engine/arm_codegen.h
index 168570e..5d3505f 100644
--- a/engine/arm_codegen.h
+++ b/engine/arm_codegen.h
@@ -235,6 +235,11 @@ typedef enum
  */
 
 /*
+ * MLA is available in arm versions 2 and above 
+ */
+#define ARM_HAS_MLA 1
+
+/*
  * LDRSB and LDRSH are available in arm versions 4 and above.
  */
 #define ARM_HAS_LDRSB 1
@@ -274,6 +279,15 @@ typedef unsigned int *arm_inst_ptr;
                                                        (((unsigned 
int)(sreg1)) << 16) | \
                                                         ((unsigned 
int)(sreg2)); \
                        } while (0)
+#define        arm_alu_reg_reg_lslimm(inst,opc,dreg,sreg1,sreg2,shift) \
+                       do { \
+                               *(inst)++ = arm_always | \
+                                                       (((unsigned int)(opc)) 
<< 21) | \
+                                                       (((unsigned int)(dreg)) 
<< 12) | \
+                                                       (((unsigned 
int)(sreg1)) << 16) | \
+                                                       (((unsigned int)(shift) 
& 0x1f) << 7) | \
+                                                        ((unsigned 
int)(sreg2)); \
+                       } while (0)
 #define        arm_alu_reg_imm8(inst,opc,dreg,sreg,imm)        \
                        do { \
                                *(inst)++ = arm_always_imm | \
@@ -502,6 +516,23 @@ extern arm_inst_ptr _arm_mov_reg_imm(arm_inst_ptr inst, 
int reg, int value);
                                } \
                        } while (0)
 
+#if ARM_HAS_MLA
+
+/*
+ * Perform a multiply and accumulate operation.
+ * dreg = sreg1 + sreg2 * sreg3
+ */
+#define arm_muladd_reg_reg_reg(inst,cond,dreg,sreg1,sreg2,sreg3)       \
+                       do { \
+                               *(inst)++ = (arm_build_prefix((cond), 
0x00200090) | \
+                                                       ((dreg) << 16) | \
+                                                       ((sreg1) << 12) | \
+                                                       ((sreg2) << 8) | \
+                                                       (sreg3)); \
+                       } while (0)
+
+#endif /* ARM_HAS_MLA */
+
 /*
  * Branch or jump immediate by a byte offset.  The offset is
  * assumed to be +/- 32 Mbytes.
diff --git a/engine/md_arm.h b/engine/md_arm.h
index ea65f40..447e9af 100644
--- a/engine/md_arm.h
+++ b/engine/md_arm.h
@@ -644,11 +644,31 @@ typedef arm_inst_ptr      md_inst_ptr;
 #define        md_lea_membase(inst,reg,basereg,offset) \
                        do { \
                                int ___value = (int)(offset); \
-                               arm_mov_reg_reg((inst), (reg), (basereg)); \
-                               if(___value != 0) \
+                               if(___value == 0) \
                                { \
-                                       arm_alu_reg_imm((inst), ARM_ADD, (reg), 
(reg), ___value); \
+                                       arm_mov_reg_reg((inst), (reg), 
(basereg)); \
                                } \
+                               else \
+                               { \
+                                       arm_alu_reg_imm((inst), ARM_ADD, (reg), 
(basereg), ___value); \
+                               } \
+                       } while (0)
+
+/*
+ * Load the effective address of a memory base + shifted index into
+ * a register.
+ */
+#define        md_lea_memindex_shift(inst,reg,basereg,indexreg,shift,offset)   
\
+                               arm_alu_reg_reg_lslimm((inst), ARM_ADD, (reg), 
(basereg), (indexreg), (shift))
+
+/*
+ * Load the effective address of a memory base + multiplied index into
+ * a register.
+ */
+#define        md_lea_memindex_mul(inst,reg,basereg,indexreg,imm,offset)       
\
+                       do { \
+                               arm_mov_reg_imm((inst), ARM_WORK, imm); \
+                               arm_muladd_reg_reg_reg((inst), ARM_CC_AL, 
(reg), (basereg), (indexreg), ARM_WORK); \
                        } while (0)
 
 /*

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog            |    9 ++++++++-
 engine/arm_codegen.h |   31 +++++++++++++++++++++++++++++++
 engine/md_arm.h      |   26 +++++++++++++++++++++++---
 3 files changed, 62 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
DotGNU Portable.NET engine, compilers and tools (pnet)




reply via email to

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