[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dotgnu-libjit] Problems with load and store on x86_64

From: Jan Wedekind
Subject: Re: [Dotgnu-libjit] Problems with load and store on x86_64
Date: Mon, 6 Oct 2008 22:05:00 +0100 (BST)

On Sat, 4 Oct 2008, Klaus Treichel wrote:
Ji Jan,

Am Freitag, den 03.10.2008, 21:38 +0100 schrieb Jan Wedekind:
     I am trying to use libjit for doing element-wise operations on arrays.
The program below fills an array with values 0, 1, 2, ... and then
adds 1 to it using libjit (i.e. the result should be 1, 2, 3, ...).
     Under x86 it works so far. However on x86_64 it does not work for
combinations of 8-bit or 16-bit numbers with floating point numbers
(it returns large floating point numbers). I don't have any idea why
it doesn't work. Can anybody help?

Thanks in advance!

I thing i found the problem on x86_64.

The conversion to nfloat expects a jit_type_int in ste stackframe but
it's a sbyte. This causes the upper 3 bytes being random values.

The attached patch spills values with typesizes < 4 like ints to the
The x86_64 SysV abi doesn't mention if values passed to a function are
expanded to 4 or a bytes by the caller first (Only Bool is mentioned
So this might cause problems too.

Can you please try the attached patch if it fixes your problem?


I tested in on the 64bit machine and it works! Thanks a lot!
It would have taken me quite some time to find this.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]