(emit_bgt, emit_ble, emit_bnan): New functions.
* src/vm/jit/emit-common.h (emit_beq, emit_bne, emit_blt, emit_bge)
(emit_bgt, emit_ble, emit_bnan): Added.
* src/vm/jit/codegen-common.h (BRANCH_UNCONDITIONAL, BRANCH_EQ)
(BRANCH_NE, BRANCH_LT, BRANCH_GE, BRANCH_GT, BRANCH_LE, BRANCH_NAN):
Added.
Changes: Christian Ullrich
Edwin Steiner
- $Id: codegen-common.h 6064 2006-11-27 15:23:55Z edwin $
+ $Id: codegen-common.h 6075 2006-11-28 19:58:02Z twisti $
*/
#define GET_HIGH_REG(a) (((a) & 0xffff0000) >> 16)
+/* branch conditions **********************************************************/
+
+#define BRANCH_UNCONDITIONAL -1
+
+#define BRANCH_EQ (ICMD_IFEQ - ICMD_IFEQ)
+#define BRANCH_NE (ICMD_IFNE - ICMD_IFEQ)
+#define BRANCH_LT (ICMD_IFLT - ICMD_IFEQ)
+#define BRANCH_GE (ICMD_IFGE - ICMD_IFEQ)
+#define BRANCH_GT (ICMD_IFGT - ICMD_IFEQ)
+#define BRANCH_LE (ICMD_IFLE - ICMD_IFEQ)
+
+#define BRANCH_NAN 256
+
+
/************************* critical sections *********************************/
struct codegen_critical_section_t {
}
+/* emit_bxx ********************************************************************
+
+ Wrappers for conditional branch instructions.
+
+*******************************************************************************/
+
+void emit_beq(codegendata *cd, basicblock *target)
+{
+ emit_bc(cd, target, BRANCH_EQ);
+}
+
+
+void emit_bne(codegendata *cd, basicblock *target)
+{
+ emit_bc(cd, target, BRANCH_NE);
+}
+
+
+void emit_blt(codegendata *cd, basicblock *target)
+{
+ emit_bc(cd, target, BRANCH_LT);
+}
+
+
+void emit_bge(codegendata *cd, basicblock *target)
+{
+ emit_bc(cd, target, BRANCH_GE);
+}
+
+
+void emit_bgt(codegendata *cd, basicblock *target)
+{
+ emit_bc(cd, target, BRANCH_GT);
+}
+
+
+void emit_ble(codegendata *cd, basicblock *target)
+{
+ emit_bc(cd, target, BRANCH_LE);
+}
+
+
+void emit_bnan(codegendata *cd, basicblock *target)
+{
+ emit_bc(cd, target, BRANCH_NAN);
+}
+
+
/* emit_array_checks ***********************************************************
Emit exception checks for array accesses, if they need to be
void emit_iconst(codegendata *cd, s4 d, s4 value);
void emit_lconst(codegendata *cd, s4 d, s8 value);
+void emit_br(codegendata *cd, basicblock *target);
+void emit_bc(codegendata *cd, basicblock *target, s4 condition);
+
+void emit_beq(codegendata *cd, basicblock *target);
+void emit_bne(codegendata *cd, basicblock *target);
+void emit_blt(codegendata *cd, basicblock *target);
+void emit_bge(codegendata *cd, basicblock *target);
+void emit_bgt(codegendata *cd, basicblock *target);
+void emit_ble(codegendata *cd, basicblock *target);
+
+void emit_bnan(codegendata *cd, basicblock *target);
+
void emit_arithmetic_check(codegendata *cd, s4 reg);
void emit_arrayindexoutofbounds_check(codegendata *cd, s4 s1, s4 s2);
void emit_arraystore_check(codegendata *cd, s4 reg);