Re: Inlining asm functions

2009-06-11 Thread Frits van Bommel
Brad Roberts wrote: On Thu, 11 Jun 2009, Frits van Bommel wrote: Note that for LDC, an even more optimal arrangement is something like[1]: - version(LDC) import ldc.llvmasm; creal expi(real y) { return __asm!(creal)("fsincos", "={st(0)},={st(1)},0", y); } - My appologies if I

Re: Inlining asm functions

2009-06-11 Thread Brad Roberts
On Thu, 11 Jun 2009, Frits van Bommel wrote: > bearophile wrote: > > creal expi(real y) { > > version (LDC) pragma(allow_inline); > > asm { fld y; > > fsincos; > > fxch ST(1), ST(0); > > } > > // add code here if asm isn't allowed >

Re: Inlining asm functions

2009-06-11 Thread Frits van Bommel
bearophile wrote: While implementing some code I have seen that LDC (that uses Tango) isn't able to inline the code of expi, that is little more than a fsincos asm instruction. LDC is now able to inline sqrt, etc (that increases their efficiency a lot), but expi contains asm, and such function

Re: Inlining asm functions

2009-06-10 Thread Don
bearophile wrote: While implementing some code I have seen that LDC (that uses Tango) isn't able to inline the code of expi, that is little more than a fsincos asm instruction. LDC is now able to inline sqrt, etc (that increases their efficiency a lot), but expi contains asm, and such function