On Thu, 2009-07-09 at 07:18 +0300, Eduard - Gabriel Munteanu wrote: > Signed-off-by: Eduard - Gabriel Munteanu <eduard.munte...@linux360.ro> > --- > arch/x86/insn-selector.brg | 29 +++++++++++++++++++++++++++++ > 1 files changed, 29 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/insn-selector.brg b/arch/x86/insn-selector.brg > index ac34ec0..0ded186 100644 > --- a/arch/x86/insn-selector.brg > +++ b/arch/x86/insn-selector.brg > @@ -1277,6 +1277,7 @@ arg: EXPR_NO_ARGS > > arg: EXPR_ARG(EXPR_VALUE) 1 > { > + #ifdef CONFIG_X86_32 > struct expression *expr, *arg_expr; > unsigned long long imm; > > @@ -1289,6 +1290,19 @@ arg: EXPR_ARG(EXPR_VALUE) 1 > } > > select_insn(s, tree, imm_insn(INSN_PUSH_IMM, imm & ~0UL)); > + > + #else > + > + struct expression *expr, *arg_expr; > + unsigned long long imm; > + > + expr = to_expr(tree); > + arg_expr = to_expr(expr->arg_expression); > + imm = arg_expr->value; > + > + select_insn(s, tree, imm_reg_insn(INSN_MOV_IMM_REG, > + imm, get_fixed_var(s->b_parent, > REG_RDI))); > + #endif > } > > arg: EXPR_ARG(EXPR_FVALUE) 1 > @@ -1305,6 +1319,7 @@ arg: EXPR_ARG(EXPR_FVALUE) 1 > > arg: EXPR_ARG(reg) > { > + #ifdef CONFIG_X86_32 > struct var_info *src; > struct expression *expr, *arg_expr; > > @@ -1320,6 +1335,20 @@ arg: EXPR_ARG(reg) > select_insn(s, tree, reg_insn(INSN_PUSH_REG, src)); > > state->reg1 = src; > + > + #else > + > + struct var_info *src; > + struct expression *expr, *arg_expr; > + > + expr = to_expr(tree); > + arg_expr = to_expr(expr->arg_expression); > + > + src = state->left->reg1; > + select_insn(s, tree, reg_reg_insn(INSN_MOV_REG_REG, src, > get_fixed_var(s->b_parent, REG_RDI))); > + > + state->reg1 = src; > + #endif > } > > arg: EXPR_ARGS_LIST(arg, arg)
Well, as I've said before, I'd do a #ifdef CONFIG_X86_32 # include "insn-selector_32.brg" #else # include "insn-selector_64.brg" #endif somewhere there. There's going to be quite a few rules that can't be shared (e.g. integer arithmetic). Pekka ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel