From: Klaus Treichel Date: Sun, 30 Mar 2008 16:05:57 +0000 (+0000) Subject: Fix the integer sign functions. Return 1 for values > 0 instead of 0. X-Git-Tag: before.move.to.git~93 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=d559a193bd5a89b86349723c9b5c75e687ae415a;p=francis%2Flibjit.git Fix the integer sign functions. Return 1 for values > 0 instead of 0. --- diff --git a/ChangeLog b/ChangeLog index 7a4ef98..a76d98a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * jit/jit-gen-x86-64.h: Add macros for the test, imul, cdw/cdq/cqo and cmov instructions. + * jit/jit-intrinsic.c (jit_int_sign, jit_long_sign): Return 1 for + values greater than 0 instead of 0. + * jit/jit-rules-x84-64.ins: Add IMUL, IDIV, IDIV_UN, IREM, IREM_UN, LMUL, LDIV, LDIV_UN, LREM and LREM_UN opcodes. Replace the compares with zero done with or with test instructions. diff --git a/jit/jit-intrinsic.c b/jit/jit-intrinsic.c index b23b408..06d63c1 100644 --- a/jit/jit-intrinsic.c +++ b/jit/jit-intrinsic.c @@ -349,7 +349,7 @@ jit_int jit_int_sign(jit_int value1) } else if(value1 > 0) { - return 0; + return 1; } else { @@ -876,7 +876,7 @@ jit_int jit_long_sign(jit_long value1) } else if(value1 > 0) { - return 0; + return 1; } else {