Thread overview
SSE intrinsics?
Nov 19, 2008
Hoenir
Nov 19, 2008
bearophile
Nov 19, 2008
Hoenir
Jan 22, 2009
Trass3r
November 19, 2008
Does DMD provide/support something like the SSE intrinsics available in C++?
Or is it only available in GDC? I'm not sure if this sort of thing belongs to front- or backend.
November 19, 2008
Hoenir:
> Does DMD provide/support something like the SSE intrinsics available in C++?

Currently not. You can use SSE instructions inlining assembly code (it's not too much difficult, there are documents online that show you how to use the SSE instructions, but it may require some time to write the code).

Bye,
bearophile
November 19, 2008
bearophile schrieb:
> Hoenir:
>> Does DMD provide/support something like the SSE intrinsics available in C++?
> 
> Currently not. You can use SSE instructions inlining assembly code (it's not too much difficult, there are documents online that show you how to use the SSE instructions, but it may require some time to write the code).
> 
Yeah, I know that option, but of course it's a little bit more time-consuming and harder to maintain/change ;)
November 19, 2008
On Wed, Nov 19, 2008 at 1:32 PM, bearophile <bearophileHUGS@lycos.com> wrote:
> Hoenir:
>> Does DMD provide/support something like the SSE intrinsics available in C++?
>
> Currently not. You can use SSE instructions inlining assembly code (it's not too much difficult, there are documents online that show you how to use the SSE instructions, but it may require some time to write the code).
>
> Bye,
> bearophile
>

Why do that when you could use some template madness to make an SSE assembler?  ;)
January 22, 2009
Jarrett Billingsley schrieb:
> Why do that when you could use some template madness to make an SSE
> assembler?  ;)

^^ Would that make sense?
How do those intrinsics get evaluated? I mean in which step of compilation, in the frontend or backend, etc.
January 22, 2009
On Thu, Jan 22, 2009 at 10:43 AM, Trass3r <mrmocool@gmx.de> wrote:
> Jarrett Billingsley schrieb:
>>
>> Why do that when you could use some template madness to make an SSE assembler?  ;)
>
> ^^ Would that make sense?
> How do those intrinsics get evaluated? I mean in which step of compilation,
> in the frontend or backend, etc.

It was kind of a joke, but it's entirely possible.  You could write a compile-time x86 assembler that would take a string and turn it into a series of bytes.  Or simpler, just convert those instructions which DMD doesn't know about into bytes, and leave the other instructions alone.  You can then mix that into an assembly statement.

It's probably incredibly impractical for all but the simplest cases but keep in mind that the compiler _is_ Turing-complete.