Inter-compiler portability of asm between gdc and ldc2 (and dmd)
Cecil Ward
cecil at cecilward.com
Thu Jul 16 23:06:24 UTC 2020
On Wednesday, 15 July 2020 at 08:17:06 UTC, kinke wrote:
> On Wednesday, 15 July 2020 at 00:26:13 UTC, Cecil Ward wrote:
>> I have a fair amount of code written in D which uses GDC’s
>> syntax for inline asm and currently it is therefore GDC-only.
>> It would like people to be able to build it alternatively
>> using LDC as well, and maybe even DMD.
>>
>> It’s a shame about the huge syntactic differences between the
>> asm syntax of GDC and LDC; both have their merits, but GDC
>> seems to me to be the most powerful, although I don’t pretend
>> to have studied LDC’s approach just glanced at it once very
>> briefly.
>
> You're not up-to-date, LDC supports gdc/gcc-style inline asm
> since version 1.21.
Since you were kind enough to let me know about this, I gave it a
try - built some D-asm with LDC instead of GDC. The first problem
I had was that of being out of date "adjacent" " " "literal" " "
"strings" do not get automatically concatenation any more. I
wrote out each line of asm in its own literal string, with a
second literal string at the end consisting of only "\n\t".
The serious problem though is the error
"Error: symbolic names for operands in GCC-style assembly are
not supported yet"
I use symbolic names for registers everywhere, for readability
and for order-independence. So that means I am dead. Looks like I
will be sticking to GDC for asm for a while yet.
Shame.
More information about the Digitalmars-d
mailing list