On Thu, Dec 3, 2020 at 9:50 AM Jakub Jelinek <ja...@redhat.com> wrote:
>
> Hi!
>
> ix86_md_asm_adjust right above this code uses:
>       machine_mode dest_mode = GET_MODE (dest);
>       if (!SCALAR_INT_MODE_P (dest_mode))
>         {
>           error ("invalid type for %<asm%> flag output");
>           continue;
>         }
> but then assumes that dest_mode can be only [QHSD]Imode and nothing else.
>
> The following patch handles TImode and hypothetically even wider modes
> by handling it like DImode for 32-bit.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2020-12-03  Jakub Jelinek  <ja...@redhat.com>
>
>         PR target/98086
>         * config/i386/i386.c (ix86_md_asm_adjust): Use dest_mode DImode
>         or SImode for modes wider than DImode.  If dest_mode isn't SImode
>         or GET_MODE (dest) isn't DImode, use convert_to_mode.

The whole part should be simply rewritten to:

--cut here--
      if (dest_mode == QImode)
    emit_insn (gen_rtx_SET (dest, x));
      else
    {
      rtx reg = gen_reg_rtx (QImode);
      emit_insn (gen_rtx_SET (reg, x));

      reg = convert_to_mode (GET_MODE (dest), reg, 1);
      emit_move_insn (dest, reg);
    }
--cut here--

Uros.

Reply via email to