On Apr 8, 2013 12:10 AM, "John Colvin" <john.loughran.colvin@gmail.com> wrote:
>
> On Sunday, 7 April 2013 at 23:02:28 UTC, John Colvin wrote:
>>
>> void main() {
>>         version(D_InlineAsm_X86_64) {
>>                 pragma(msg,"x64");
>>         }
>>         else version(D_InlineAsm_X86) {
>>                 pragma(msg,"x86");
>>         }
>>         else {
>>                 pragma(msg,"None");
>>         }
>> }
>>
>> dmd/ldc -m64: x64
>> gdc -m64/32 : None
>
>
> Ah, I see D inline asm isn't supported in gdc. When I removed the version check from my code I got a massive slew of errors telling me so (one for every asm line, not one per asm block).
>
> What's stopping iasm in gdc, ldc appears to have no problem.

If only that logic held water...

GDC actually provided the implementation of iasm to LDC.  Reasons why it was yanked out.
- one big ugly x86 special case.
- depended on backend headers poisoned for use in the frontend.
- frontend should not know or care about what arch it is targeting.
- likewise, use of TARGET_ macros is tabooed in gcc frontends.
- most iasm in druntime/phobos rely on dmd's non-standard calling convention.
- it has been argued in the past that gdc should not define D_InlineAsm_X86 if it does not follow dmd's ABI.

Could probably think of a few dozen more to throw at you.

Regards
--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';