Version française
Home     About     Download     Resources     Contact us    
Browse thread
Performance of threaded interpreter on hyper-threaded CPU
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Joaquin Cuenca Abela <e98cuenc@y...>
Subject: Re: [Caml-list] Re: Performance of threaded interpreter on hyper-threaded CPU
Michel wrote:

> I'm aware of the problem due to gcc's cross-jumping "optimisation"
> (described as you mention by Ertl in [1]). For the record, I tried
> disabling it with -fno-crossjumping, but as Ertl mention, this didn't
> change anything. However, judging by the versions of gcc I'm using,
> cross-jumping should also be performed on the second machine, for
> which threaded code provides a noticable gain...

Hi,

FWIW, I did some tests with gcc 3.4.2, and -fno-crossjumping works *sometimes*. If you combine it with -O2 *and* your virtual machine has less than 10 opcodes (??) then -fno-crossjumping works as expected.

Otherwise (ie, with any real virtual machine) gcc generates an extra jump, but you don't get exactly the same assembler than if you use a switched vm. The assembly for the switched vm pushes more instructions in the extra basic block than the assembly for the threaded vm.

In the threaded vm, the extra block is only (in my test) a jmp *%eax.

Cheers,

--
Joaquin Cuenca Abela