lua-users home
lua-l archive

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


Bulat Ziganshin wrote:
> > This works out just fine for desktop-class CPUs, but of course one
> > needs to rethink narrowing for FP-challenged CPUs. In this case a
> > dual representation of stored number values with normalization
> > steps after FP operations is probably better. But this has
> > far-reaching consequences for the whole VM. So far I've been able
> > to avoid it.
> 
> it's probably obvious, but are you considered distinguishing 2 number
> types and dispatching code for them separately? JIT does it for Lua
> standard types, i.e. you may generate two invocations of some
> functions depending on number/string type of its parameter. how about
> separating also the int/double cases?

Sure, that's what I meant. Specializing JIT-generated code to a
particular number representation is fairly easy with the current
framework. The complications arise because all of the static parts
of the VM need to handle both types, too. And it's hard to avoid
the expensive normalization steps outside of compiled code.

--Mike