System programming in D (Was: The God Language)
Paulo Pinto
pjmlp at progtools.org
Thu Dec 29 10:28:17 PST 2011
Specially because some 64 bit compilers are providing intrinsics as the only way to access the processor.
Visual C++ for example, does not provide inline assembly support.
David Nadlinger Wrote:
> On 12/29/11 2:13 PM, a wrote:
> > void test(ref V a, ref V b)
> > {
> > asm
> > {
> > movaps XMM0, a;
> > addps XMM0, b;
> > movaps a, XMM0;
> > }
> > asm
> > {
> > movaps XMM0, a;
> > addps XMM0, b;
> > movaps a, XMM0;
> > }
> > }
> >
> > [â¦]
> >
> > 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.
>
> Yes, this is indeed a problem, and as far as I'm aware, usually solved
> in the gamedev world by using the (SSE) intrinsics your favorite C++
> compiler provides, instead of resorting to inline asm.
>
> David
More information about the Digitalmars-d
mailing list