lightning
[Top][All Lists]
Advanced

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

Re: [Lightning] Porting GNU Smalltalk to lightning 2


From: Paulo César Pereira de Andrade
Subject: Re: [Lightning] Porting GNU Smalltalk to lightning 2
Date: Wed, 19 Nov 2014 00:00:48 -0200

2014-11-18 18:06 GMT-02:00 Holger Hans Peter Freyther <address@hidden>:
> On Mon, Nov 17, 2014 at 12:19:33PM -0200, Paulo César Pereira de Andrade 
> wrote:
>
>> $ (cd check; ./lightning -mcpu=4 the-test.tst)
>>
>> that should force it to generate code that should work on any
>> armv5 board (I only tested lightning on armv5te or newer, but
>> have been only testing in armv7 for more than one year).
>
> I just copied my build directory and executed some tests wihtout
> libtool and some tests work, others crash. So there seems to be
> a general armv5(te) issue?

  I may have misunderstood some details/restrictions on manuals,
but I am 100% the original implementation did work on a board that
advertised itself as armv5te. After that I only worked on panda boards,
and lately only on qemu images.

> ~/lightning/build/check# .libs/lightning -mcpu=5 -mthumb=0 $PWD
> /../../git/check/3to2.tst
> Illegal instruction
> ~/lightning/build/check# .libs/lightning -mcpu=5 -mthumb=1 $PWD
> /../../git/check/3to2.tst
> Illegal instruction
> ~/lightning/build/check# .libs/lightning -mcpu=5 -mvfp=0 $PWD/.
> ./../git/check/3to2.tst
> Illegal instruction
> ~/lightning/build/check# .libs/lightning -mcpu=5 -mneon=0 -mvfp
> =0 $PWD/../../git/check/3to2.tst
> Illegal instruction
> ~/lightning/build/check# .libs/lightning -mcpu=4 $PWD/../../git
> /check/3to2.tst
> 0
> 1
> 1
> 1
> 0
> 1
> 1
> 1
> 0
> 1
> 1
> 0
> 1
> 1
> 1
> 0
> 1
> 1
> 1
> 0
> 1
> 1

  It should be one instruction being incorrectly encoded.

  Please post output of

$ cat /proc/cpuinfo

> ~/lightning/build/check# .libs/ccall -h
> Illegal instruction

please also run:

$ cd check
$ make debug
[...]
(gdb) b _jit_clear_state
(gdb) r 3to2.tst
(gdb) x/80i _jit->code.ptr
(gdb) c
<<< it crashes >>>
(gdb) x/10i $pc-20

But I am almost sure it is caused by the macro

#  define jit_armv5e_p()        (jit_cpu.version >= 5 && jit_cpu.extend)

returning true. It just checks if the /proc/cpuinfo ""CPU architecture:"
line has a 'e' or 'E' in which case it assumes it supports some
extensions, particularly the ldrd and strd instructions.

You can comment the line:

            jit_cpu.extend = 1;

in lib/jit_arm.c to confirm it.

Actually, the check in the macro is buggy, armv6 or newer must
support ldbrd and strd, but then, on those lightning defaults to
generate thumb instructions, so not much of a problem...

Thanks,
Paulo



reply via email to

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