Not implemented for now because the emulation function returns float,
        and we cannot talk to functions returning floats that respect the
        ABI for now.

Signed-off-by: Arthur Huillet <arthur.huil...@free.fr>
---
 include/jit/expression.h      |    1 +
 jit/arithmetic-bc.c           |    2 +-
 jit/tree-printer.c            |    1 +
 test/jit/arithmetic-bc-test.c |    2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/jit/expression.h b/include/jit/expression.h
index 916eac6..d9c0b71 100644
--- a/include/jit/expression.h
+++ b/include/jit/expression.h
@@ -79,6 +79,7 @@ enum binary_operator {
        OP_FSUB,
        OP_FMUL,
        OP_FDIV,
+       OP_FREM,
 
        BINOP_LAST,     /* Not a real operator. Keep this last. */
 };
diff --git a/jit/arithmetic-bc.c b/jit/arithmetic-bc.c
index 32720fb..eb05952 100644
--- a/jit/arithmetic-bc.c
+++ b/jit/arithmetic-bc.c
@@ -125,7 +125,7 @@ int convert_lrem(struct parse_context *ctx)
 
 int convert_frem(struct parse_context *ctx)
 {
-       return convert_binop(ctx, J_FLOAT, OP_REM);
+       return convert_binop(ctx, J_FLOAT, OP_FREM);
 }
 
 int convert_drem(struct parse_context *ctx)
diff --git a/jit/tree-printer.c b/jit/tree-printer.c
index f125575..55b3adb 100644
--- a/jit/tree-printer.c
+++ b/jit/tree-printer.c
@@ -410,6 +410,7 @@ static const char *op_names[] = {
        [OP_FMUL] = "fmul",
        [OP_FNEG] = "fneg",
        [OP_FDIV] = "fdiv",
+       [OP_FREM] = "frem",
        [OP_SHL] = "shl",
        [OP_SHL_64] = "shl64",
        [OP_SHR] = "shr",
diff --git a/test/jit/arithmetic-bc-test.c b/test/jit/arithmetic-bc-test.c
index 056071b..463ad3c 100644
--- a/test/jit/arithmetic-bc-test.c
+++ b/test/jit/arithmetic-bc-test.c
@@ -96,7 +96,7 @@ void test_convert_rem(void)
 {
        assert_convert_binop(J_INT, OP_REM, OPC_IREM);
        assert_convert_binop(J_LONG, OP_REM_64, OPC_LREM);
-       assert_convert_binop(J_FLOAT, OP_REM, OPC_FREM);
+       assert_convert_binop(J_FLOAT, OP_FREM, OPC_FREM);
        assert_convert_binop(J_DOUBLE, OP_REM, OPC_DREM);
 }
 
-- 
1.6.3.3



------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to