On 20-06-2012 21:48, Joseph Rushton Wakeling wrote:
On 20/06/12 20:35, Alex Rønne Petersen wrote:
And x86 inline assembler... on ARM? I don't think I follow.

If I understand http://dlang.org/iasm.html correctly, the idea is that D
should have an inline assembler for each target architecture.

AFAICS what's desired is that you should be able to insert

asm
{
// target-specific assembly goes here
}

.... and have it accepted by _any_ D compiler. That seems to me to be an
important part of the language in general and even more so on
architectures that are suited to embedded systems. So while it may make
sense to cut the inline assembly in the short term for GDC, it doesn't
make sense to me for it to be a change that lasts.

GDC currently supports x86, ARM, PowerPC, MIPS, SPARC, and possibly others. The language reference lists assembly syntax for x86. I understand that in an ideal world, we'd have standardized assembly syntaxes for all of these architectures, but somebody has to actually spec and implement them.

Besides, Iain has already pointed out that the x86 syntax in the spec doesn't integrate with GCC's inline assembly support at all (which is why GDC had the glue code for it). It took around 2000 lines (if memory serves) to translate the D inline assembly to GCC inline assembly. Now imagine having to do this for every architecture ever supported.

--
Alex Rønne Petersen
a...@lycus.org
http://lycus.org

Reply via email to