On Wed, Mar 17, 2021 at 1:45 PM H.J. Lu <hjl.to...@gmail.com> wrote:
>
> On Wed, Mar 17, 2021 at 12:40 AM Uros Bizjak <ubiz...@gmail.com> wrote:
> >
> > On Tue, Mar 16, 2021 at 4:59 PM H.J. Lu <hjl.to...@gmail.com> wrote:
> > >
> > > On Sun, Mar 14, 2021 at 1:31 PM H.J. Lu <hjl.to...@gmail.com> wrote:
> > > >
> > > > On Sun, Mar 14, 2021 at 12:43 PM Uros Bizjak <ubiz...@gmail.com> wrote:
> > > > >
> > > > > On Sun, Mar 14, 2021 at 8:14 PM H.J. Lu <hjl.to...@gmail.com> wrote:
> > > > > > > > Done.  Here is the updated patch.  Tested on Linux/x86-64.  OK 
> > > > > > > > for master?
> > > > > > >
> > > > > > > I don't understand the purpose of the current_output_insn check 
> > > > > > > and I
> > > > > > > don't know if the usage of current_output_insn is correct. The
> > > > > > > comments are not helpful either, and no other target uses this
> > > > > > > variable in the way you propose. Can you please elaborate the 
> > > > > > > reason
> > > > > > > and the purpose of the check a bit more?
> > > > > > >
> > > > > > > Uros.
> > > > > >
> > > > > > Originally, ix86_force_load_from_GOT_p is only for non-PIC.   My 
> > > > > > patch extended
> > > > > > it to inline assembly statements where current_output_insn == NULL 
> > > > > > and PIC is
> > > > > > allowed in 64-bit.
> > > > >
> > > > > I can see this from the patch, but this explanation didn't answer my 
> > > > > question.
> > > > >
> > > >
> > > > The purpose of current_output_insn == NULL is to allow PIC for inline
> > > > asm statements in 64-bit mode.  Is there a better way to check if
> > > > ix86_print_operand () is called on inline asm statements?
> > > >
> > >
> > > Here is the v4 patch to check this_is_asm_operands for inline
> > >  asm statements.   OK for master?
> >
> > -ENOPATCH.
> >
> > Uros.
>
> Here is the patch.

-/* True if operand X should be loaded from GOT.  */
+/* True if the function symbol operand X should be loaded from GOT.

vertical space here

+   NB: For inline assembly statement, allow PIC/non-PIC in 64-bit mode
+   and in 32-bit mode, only non-PIC is allowed since we don't have
+   PIC register at call site.  Otherwise, only PIC is allowed.  */

NB: in 32-bit mode, only non-PIC is allowed in inline assembly
statements, since a PIC register could not be available at the call site.

  bool

+          /* For inline assembly statement, load function address
+         from GOT with 'P' operand modifier to avoid PLT.
+         NB: This works only with call or jmp.  */

Please remove this NB, you can't expect from users to read source
code. This should be in the documentation.

LGTM otherwise.

Thanks,
Uros.
> --
> H.J.

Reply via email to