Re: Probably a bug in LuaJIT x86

  • From: Egor Skriptunoff <egor.skriptunoff@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 21 Aug 2018 22:22:58 +0300

On Fri, Aug 17, 2018 at 4:50 PM, szbnwer@xxxxxxxxx wrote:


so that LuaJIT would not create intermediate double datatype?
All I want is standard int32 arithmetics with usual wraparound addition.
[...]
Is there exist more fast and more compact way to perform int32
arithmetics in LuaJIT?

i believe that anything can be achieved via bit
operations, but that can become a mindbender monster (cool),



Yes, it is possible to write 32-bit addition so that all temporary results
never exceed int32 range.
32-bit value is represented as two 16-bit "digits", bitwise operations are
used to split/join "digits".
But it is slow.

Other related posts: