www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - SSE intrinsics?

reply Hoenir <mrmocool gmx.de> writes:
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.
Nov 19 2008
parent reply bearophile <bearophileHUGS lycos.com> writes:
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
Nov 19 2008
next sibling parent Hoenir <mrmocool gmx.de> writes:
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 ;)
Nov 19 2008
prev sibling parent reply "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
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? ;)
Nov 19 2008
parent reply Trass3r <mrmocool gmx.de> writes:
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.
Jan 22 2009
parent Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
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.
Jan 22 2009