[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Towards a faster interpreter
- From: Dibyendu Majumdar <mobile@...>
- Date: Thu, 8 Dec 2016 18:56:08 +0000
On 8 December 2016 at 18:46, Sean Conner <email@example.com> wrote:
> It was thus said that the Great Roberto Ierusalimschy once stated:
>> > I have been thinking of ways of making the Ravi interpreter faster
>> > without having to resort to assembly code etc. So far one of the areas
>> > I have not really looked at is how to improve the bytecode decoding.
>> > The main issue is that the operands B and C require an extra bit
>> > compared to operand A, so we cannot make them all 8 bits...
>> Given a 32- or 64-bit machine, why decoding 8-bit operands would be
>> faster/better than 9-bit ones?
> I would think less shifting, but not being 100% sure, I decided to test my
> assumptions. I wrote:
> void split8(unsigned int *dest,unsigned int op)
> dest = (op >> 24) & 0xFF;
> dest = (op >> 16) & 0xFF;
> dest = (op >> 8) & 0xFF;
> dest = (op ) & 0xFF;
Perhaps one of the masks could be eliminated?