64bit multiplication now is separate from 32bit multiplication because it can only easily be carried out between two registers
Signed-off-by: Arthur HUILLET <arthur.huil...@free.fr> --- arch/x86/insn-selector_32.brg | 5 +++++ include/jit/expression.h | 1 + jit/arithmetic-bc.c | 2 +- jit/tree-printer.c | 1 + test/jit/arithmetic-bc-test.c | 2 +- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/insn-selector_32.brg b/arch/x86/insn-selector_32.brg index fa375c2..d790b44 100644 --- a/arch/x86/insn-selector_32.brg +++ b/arch/x86/insn-selector_32.brg @@ -241,6 +241,11 @@ reg: OP_MUL(reg, EXPR_LOCAL) 1 __binop_reg_local(state, s, tree, INSN_MUL_MEMBASE_EAX, eax, 0); } +reg: OP_MUL_64(reg, reg) 1 +{ + assert(!"todo mul64"); +} + reg: OP_DIV(reg, EXPR_LOCAL) 1 { div_reg_local(state, s, tree); diff --git a/include/jit/expression.h b/include/jit/expression.h index 506c4d8..e39843e 100644 --- a/include/jit/expression.h +++ b/include/jit/expression.h @@ -38,6 +38,7 @@ enum binary_operator { OP_ADD = EXPR_LAST, OP_SUB, OP_MUL, + OP_MUL_64, OP_DIV, OP_DIV_64, OP_REM, diff --git a/jit/arithmetic-bc.c b/jit/arithmetic-bc.c index 7d8e1c7..54b3dcd 100644 --- a/jit/arithmetic-bc.c +++ b/jit/arithmetic-bc.c @@ -81,7 +81,7 @@ int convert_imul(struct parse_context *ctx) int convert_lmul(struct parse_context *ctx) { - return convert_binop(ctx, J_LONG, OP_MUL); + return convert_binop(ctx, J_LONG, OP_MUL_64); } int convert_fmul(struct parse_context *ctx) diff --git a/jit/tree-printer.c b/jit/tree-printer.c index 3e4c948..38026c2 100644 --- a/jit/tree-printer.c +++ b/jit/tree-printer.c @@ -354,6 +354,7 @@ static const char *op_names[] = { [OP_ADD] = "add", [OP_SUB] = "sub", [OP_MUL] = "mul", + [OP_MUL_64] = "mul64", [OP_DIV] = "div", [OP_DIV_64] = "div64", [OP_REM] = "rem", diff --git a/test/jit/arithmetic-bc-test.c b/test/jit/arithmetic-bc-test.c index 5866d37..c1af209 100644 --- a/test/jit/arithmetic-bc-test.c +++ b/test/jit/arithmetic-bc-test.c @@ -79,7 +79,7 @@ void test_convert_sub(void) void test_convert_mul(void) { assert_convert_binop(J_INT, OP_MUL, OPC_IMUL); - assert_convert_binop(J_LONG, OP_MUL, OPC_LMUL); + assert_convert_binop(J_LONG, OP_MUL_64, OPC_LMUL); assert_convert_binop(J_FLOAT, OP_MUL, OPC_FMUL); assert_convert_binop(J_DOUBLE, OP_MUL, OPC_DMUL); } -- 1.6.2.2 ------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel