On Thu, Jan 22, 2009 at 10:43 AM, Trass3r <[email protected]> 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.
