* src/vm/jit/s390/codegen.c: Fixed build.
[cacao.git] / src / vm / jit / s390 / codegen.h
index 8cb750ac9e50340626144c4f53efead7f62ca56f..28ceb970a57084a1d28714a3ca681c376a393345 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/s390/codegen.h - code generation macros for s390
 
-   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
-   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-   J. Wenninger, Institut f. Computersprachen - TU Wien
+   Copyright (C) 1996-2005, 2006, 2007, 2008, 2010
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -34,7 +32,7 @@
 
 #include "vm/types.h"
 
-#include "vm/jit/jit.h"
+#include "vm/jit/jit.hpp"
 
 
 /* MCODECHECK(icnt) */
             codegen_increase(cd); \
     } while (0)
 
+#define ALIGNCODENOP \
+    do { \
+        while (((ptrint) cd->mcodeptr) & 2) { \
+            M_NOP2; \
+        } \
+        while (((ptrint) cd->mcodeptr) & 4) { \
+            M_NOP; \
+        } \
+    } while (0)
+
 /* some patcher defines *******************************************************/
 
 #define PATCHER_CALL_SIZE    2          /* size in bytes of a patcher call    */
 #define PATCHER_NOPS M_NOP3
-#define PATCHER_NOPS_SKIP   2
 
 /* branch defines ************************************************************/
 
@@ -64,9 +71,6 @@
                } \
        } while (0) 
 
-/* stub defines **************************************************************/
-
-#define COMPILERSTUB_CODESIZE    (SZ_AHI + SZ_L + SZ_L + SZ_BCR)
 
 /* *** BIG TODO ***
  * Make all this inline functions !!!!!!!!!!
@@ -696,6 +700,7 @@ static inline uint8_t N_ILL_GET_TYPE(uint8_t *instrp) {
 
 #define M_MOV(a, b) N_LR(b, a)
 #define M_FMOV(a, b) N_LDR(b, a)
+#define M_DMOV(a, b) M_FMOV((a), (b))
 #define M_DST(r, b, d) _IFNEG(d, assert(0), N_STD(r, d, RN, b))
 #define M_FST(r, b, d) _IFNEG(d, assert(0), N_STE(r, d, RN, b))
 #define M_IST(r, b, d) _IFNEG( \
@@ -736,6 +741,7 @@ static inline uint8_t N_ILL_GET_TYPE(uint8_t *instrp) {
 #define M_ICMP(a, b) N_CR(a, b)
 #define M_ICMPU(a, b) N_CLR(a, b)
 #define M_ICMP_IMM(a, b) N_CHI(a, b)
+#define M_ACMP(a, b) N_CR(a, b)
 #define M_CVTIF(src, dst) N_CEFBR(dst, src)
 #define M_CVTID(src, dst) N_CDFBR(dst, src)
 #define M_FMUL(a, dest) N_MEEBR(dest, a)
@@ -809,42 +815,6 @@ static inline uint8_t N_ILL_GET_TYPE(uint8_t *instrp) {
            ICONST(GET_LOW_REG((reg)), (s4) ((s8) (c))); \
        } while (0)
 
-/* M_INTMOVE:
-    generates an integer-move from register a to b.
-    if a and b are the same int-register, no code will be generated.
-*/ 
-
-#define M_INTMOVE(reg,dreg) \
-    do { \
-        if ((reg) != (dreg)) { \
-            M_MOV(reg, dreg); \
-        } \
-    } while (0)
-
-#define M_LNGMOVE(a, b) \
-    do { \
-        if (GET_HIGH_REG(a) == GET_LOW_REG(b)) { \
-            assert((GET_LOW_REG(a) != GET_HIGH_REG(b))); \
-            M_INTMOVE(GET_HIGH_REG(a), GET_HIGH_REG(b)); \
-            M_INTMOVE(GET_LOW_REG(a), GET_LOW_REG(b)); \
-        } else { \
-            M_INTMOVE(GET_LOW_REG(a), GET_LOW_REG(b)); \
-            M_INTMOVE(GET_HIGH_REG(a), GET_HIGH_REG(b)); \
-        } \
-    } while (0)
-
-/* M_FLTMOVE:
-    generates a floating-point-move from register a to b.
-    if a and b are the same float-register, no code will be generated
-*/ 
-
-#define M_FLTMOVE(reg,dreg) \
-    do { \
-        if ((reg) != (dreg)) { \
-            M_FMOV(reg, dreg); \
-        } \
-    } while (0)
-
 #define M_ISUB_IMM32(imm, tmpreg, reg) \
        do { \
                if (N_VALID_IMM(imm)) { \
@@ -857,10 +827,6 @@ static inline uint8_t N_ILL_GET_TYPE(uint8_t *instrp) {
 
 #define M_ASUB_IMM32(imm, tmpreg, reg) M_ISUB_IMM32(imm, tmpreg, reg)
 
-#define PROFILE_CYCLE_START 
-
-#define PROFILE_CYCLE_STOP 
-
 #endif /* _CODEGEN_H */
 
 /*