On Sun, Nov 1, 2020 at 2:04 PM Iain Sandoe <i...@sandoe.co.uk> wrote:
>
> Hi Uros,
>
> I was looking into the test fails for the new keylocker-* testcases.
>
> Many are because of missing “_” (which seems to happen more often than
> not).  These I can fix trivially.
>
> But some are because we have:
>
> name+constant(%rip) being emitted on Linux
>
> and
>
> constant+name(%rip) being emitted on Darwin.
>
> ——
>
> The reason is that Darwin is always PIC and so outputs
> (const:DI (plus:DI (symbol_ref:DI ("h2") [flags 0x2] <var_decl
> 0x7ffff55e3c60 h2>)
>          (const_int 16 [0x10])))
>
> using - gcc/i386.c:output_pic_addr_const
>
> Linux outputs the same thing
>
> using - gcc/final.c:output_addr_const
>
> ====
>
> for the PLUS case final.c says:
>
>        /* Some assemblers need integer constants to appear last (eg masm).  */
>
>
> for the PLUS case i386.c says:
>
>        /* Some assemblers need integer constants to appear first.  */
>
> =====
>
> So .. I could make a really tedious patch to match the different forms in the
> keylocker tests for Darwin ..
>
> .. but ISTM that maybe one of those comments is wrong / out of date - and the
> right thing would be to fix that.

I don't know which assemblers are referred to in the comment, but gas
accepts both forms:

       mov k2+16(%rip), %eax
       mov 16+k2(%rip), %eax

> Any insight welcome,

Maybe those scan-asm regexp are too strict and should be relaxed a
bit. Please resolve this issue with the author (CC'd).

Uros.

Reply via email to