[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    Re: porting assembly x86 code
From:       Roberto Ierusalimschy <roberto () inf ! puc-rio ! br>
Date:       2013-09-27 13:19:25
Message-ID: 20130927131925.GB18032 () inf ! puc-rio ! br
[Download RAW message or body]

> The whole assembler code in Lua 5.0 is:
> 
>     #ifdef USE_FASTROUND
>     #define lua_number2int(i,d)	__asm__("fldl %1\nfistpl
> %0":"=m"(i):"m"(d))
>     #endif
> 
> ... and it is completely optional. The default is:
> 
>     #define lua_number2int(i,n)	((i)=(int)(n))
> 
> I doubt that you can base a thesis on porting this to ARM 64. Some
> similiar code is also included in newer versions of Lua, btw.

Moreover, keep in mind that this optimization is there because of the
peculiarities of how x86 does the default conversion in C. For
different architectures the whole motivation for this optimization
can be void.

-- Roberto

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic