Inline assembly question
Basile B.
b2.temp at gmx.com
Mon Nov 13 19:11:00 UTC 2017
On Monday, 13 November 2017 at 18:40:42 UTC, Basile B. wrote:
> On Sunday, 12 November 2017 at 11:01:39 UTC, Dibyendu Majumdar
> wrote:
>> [...]
>
> TBH I wonder if this is not worth a enhancement (or even a DIP)
> to have in asm blocks a special alias syntax...
>
> {
> asm
> {
> version(...)
> {
> alias First = RDI;
> alias Second = RSI;
> // ...
> }
> else
> {
> alias First = RCX;
> alias Second = RDX;
> }
> mov First, Second;
> call aFunctionWithOneParam; // called with 2nd parent
> param as 1st param
> }
> }
>
> since the whole mixin solution make the custom asm unreadable
> just because of this problem.
>
> And Even maybe some special identifiers since extern(...) may
> lead to problems...
Hmmm being the fact that "First" might be XMM0 i actually think
the predefined identifiers is clearly not a solution.
"alias" in asm blocks still stands though
More information about the Digitalmars-d-learn
mailing list