lua-users home
lua-l archive

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

> My request for advice relates to the order of the fields in the expanded
> 64-bit Instruction. I recall reading somewhere about Lua changing the order
> from ABC to ACB for performance reasons, though for the life of me I have
> been unable to find that reference. I am hoping someone else remembers where
> that was, or some way to find it... I have tried a number of searches on the
> list and have come up empty handed.
> I understand the performance boost from changing ABC to ACB has to do with 
> hardware level optimisations, but that is not a level of optimisation I am
> terribly familiar with. I am wondering how changing from ABC to ACB results
> in a performance gain, and given that it does, is there any way I can
> arrange my 64-bit opcode to be more efficient then my first attempt is?

The original order (when we adopted ABC) was ABCOp (from higher to
lower bits). Later, we changed it to BCAOp. (So, the current order
gives the impression that B and C exchanged places, but it was A who
changed.) The reason was only to try to keep the most used fields in the
lower bits (because some CPUS take slighly longer to make shifts with
larger offsets). So, as A is more used than B or C, we moved it to
a lower position.

-- Roberto