[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: |
Klaus Treichel |
Subject: |
Re: [Dotgnu-libjit] Problems with load and store on x86_64 |
Date: |
Sat, 04 Oct 2008 13:06:56 +0200 |
Ji Jan,
Am Freitag, den 03.10.2008, 21:38 +0100 schrieb Jan Wedekind:
> Hi,
> 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
stackframe.
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
explicitely).
So this might cause problems too.
Can you please try the attached patch if it fixes your problem?
Klaus
kt-081004.patch
Description: Text Data
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil