* src/vm/jit/x86_64/codegen.h: Use multi-byte NOP for code alignment.
[cacao.git] / src / vm / jit / x86_64 / emit.h
index 24239e431eacba210eb2337368770e55eadb2747..ebf6e361f6a9d03eb85cf8af09436cacefc27c91 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/x86_64/emit.h - machine dependent emit function prototypes
 
-   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, 2009
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -31,8 +29,8 @@
 #include "config.h"
 #include "vm/types.h"
 
-#include "vm/jit/codegen-common.h"
-#include "vm/jit/jit.h"
+#include "vm/jit/codegen-common.hpp"
+#include "vm/jit/jit.hpp"
 
 
 /* macros to create code ******************************************************/
@@ -180,6 +178,10 @@ typedef union {
 
 /* function prototypes ********************************************************/
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void emit_cmovxx(codegendata *cd, instruction *iptr, s4 s, s4 d);
 
 
@@ -191,6 +193,7 @@ void emit_lshift(jitdata *jd, s4 shift_op, instruction *iptr);
 
 /* integer instructions */
 
+void emit_nop(codegendata *cd, int length);
 void emit_mov_reg_reg(codegendata *cd, s8 reg, s8 dreg);
 void emit_mov_imm_reg(codegendata *cd, s8 imm, s8 reg);
 void emit_movl_reg_reg(codegendata *cd, s8 reg, s8 dreg);
@@ -219,6 +222,7 @@ void emit_movswq_reg_reg(codegendata *cd, s8 reg, s8 dreg);
 void emit_movswq_membase_reg(codegendata *cd, s8 basereg, s8 disp, s8 dreg);
 void emit_movslq_reg_reg(codegendata *cd, s8 reg, s8 dreg);
 void emit_movslq_membase_reg(codegendata *cd, s8 basereg, s8 disp, s8 dreg);
+void emit_movzbq_reg_reg(codegendata *cd, s8 reg, s8 dreg);
 void emit_movzwq_reg_reg(codegendata *cd, s8 reg, s8 dreg);
 void emit_movzwq_membase_reg(codegendata *cd, s8 basereg, s8 disp, s8 dreg);
 void emit_movswq_memindex_reg(codegendata *cd, s8 disp, s8 basereg, s8 indexreg, s8 scale, s8 reg);
@@ -243,6 +247,8 @@ void emit_alul_imm32_reg(codegendata *cd, s4 opc, s4 imm, s4 dreg);
 void emit_alul_imm_reg(codegendata *cd, s8 opc, s8 imm, s8 dreg);
 void emit_alu_imm_membase(codegendata *cd, s8 opc, s8 imm, s8 basereg, s8 disp);
 void emit_alul_imm_membase(codegendata *cd, s8 opc, s8 imm, s8 basereg, s8 disp);
+void emit_alu_memindex_reg(codegendata *cd, s8 opc, s8 disp, s8 basereg, s8 indexreg, s8 scale, s8 reg);
+void emit_alul_memindex_reg(codegendata *cd, s8 opc, s8 disp, s8 basereg, s8 indexreg, s8 scale, s8 reg);
 void emit_test_reg_reg(codegendata *cd, s8 reg, s8 dreg);
 void emit_testl_reg_reg(codegendata *cd, s8 reg, s8 dreg);
 void emit_test_imm_reg(codegendata *cd, s8 imm, s8 reg);
@@ -251,7 +257,10 @@ void emit_testb_imm_reg(codegendata *cd, s8 imm, s8 reg);
 void emit_lea_membase_reg(codegendata *cd, s8 basereg, s8 disp, s8 reg);
 void emit_leal_membase_reg(codegendata *cd, s8 basereg, s8 disp, s8 reg);
 
+void emit_incl_reg(codegendata *cd, s8 reg);
+void emit_incq_reg(codegendata *cd, s8 reg);
 void emit_incl_membase(codegendata *cd, s8 basereg, s8 disp);
+void emit_incq_membase(codegendata *cd, s8 basereg, s8 disp);
 
 void emit_cltd(codegendata *cd);
 void emit_cqto(codegendata *cd);
@@ -356,6 +365,19 @@ void emit_xorpd_membase_reg(codegendata *cd, s8 basereg, s8 disp, s8 dreg);
 /* system instructions ********************************************************/
 
 void emit_rdtsc(codegendata *cd);
+void emit_mfence(codegendata *cd);
+
+
+/**
+ * Emit code to recompute the procedure vector. This is a nop,
+ * because we do not use a procedure vector.
+ */
+static inline void emit_recompute_pv(codegendata* cd) {}
+
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _MD_EMIT_H */
 
@@ -371,4 +393,5 @@ void emit_rdtsc(codegendata *cd);
  * c-basic-offset: 4
  * tab-width: 4
  * End:
+ * vim:noexpandtab:sw=4:ts=4:
  */