Walter Bright Wrote: > On 12/29/2011 5:13 AM, a wrote: > > The needles loads and stores would make it impossible to write an efficient > > simd add function even if the functions containing asm blocks could be > > inlined. > > This does what you're asking for: > > void test(ref float a, ref float b) > { > asm > { > naked; > movaps XMM0,[RSI]; > addps XMM0,[RDI]; > movaps [RSI],XMM0; > movaps XMM0,[RSI]; > addps XMM0,[RDI]; > movaps [RSI],XMM0; > ret; > } > }
What I want is to be able to write short functions using inline assembly and have them inlined and compiled even to a single instruction where possible. This can be done with gcc. See my post here: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=153879