[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lightning] Shift instructions
From: |
Mike Spivey |
Subject: |
Re: [Lightning] Shift instructions |
Date: |
Thu, 19 Feb 2009 19:16:55 +0000 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20090105) |
I spoke five minutes too soon:
diff --git a/lightning/i386/core.h b/lightning/i386/core.h
index 86aee39..2f017f9 100644
--- a/lightning/i386/core.h
+++ b/lightning/i386/core.h
@@ -63,7 +63,7 @@
((rd == forced) ? JITSORRY("Register conflict for " # op) : \
(rs == forced) ? op : \
jit_save (forced) \
- ? (jit_pushr_i(forced), jit_movr_l(rs, forced), op, \
+ ? (jit_pushr_i(forced), jit_movr_l(forced, rs), op, \
jit_popr_i(forced)) \
: (jit_movr_l(rs, forced), op))
Best wishes,
-- Mike
Mike Spivey wrote:
> Dear Paolo and all,
>
> Attached is a program that attempts to compute (-16) << 2. The result
> should be -64, but -16 is printed on i386.
>
> I've tried a number of combinations, but haven't quite tracked down the
> problem yet:
>
> * Use JIT_R1 instead of JIT_V0 throughout --> fixed.
>
> * Insert jit_movi_i(JIT_R1, 3); before the shift instruction (but leave
> instruction referring to JIT_V0) --> result is -128.
>
> * Use a jit_mulr_i instruction instead of the shift --> correct result.
>
> * Use jit_lshi_i instead of jit_lshr_i --> correct result.
>
> So it looks like the problem concerns putting the shift amount into the
> ECX register before the actual shift instruction.
>
> I am sorry to be always the bearer of bad tidings, but there it is! Can
> anything be done?
>
> Best wishes,
>
> -- Mike
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Lightning mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lightning