[PATCH] D15075: No error for conflict between inputs\outputs and clobber list

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 27 11:41:58 PST 2016


Both work:

#define DECLARE_ASM_REP_MOVS(Type, Movs)
    \
  template <> void asm_rep_movs<Type>(Type * dst, Type * src, size_t size)
{   \
    __asm__("rep " Movs " \n\t"
   \
            : "+D"(dst), "+S"(src), "+c"(size) \
            : \
            : "memory");                                  \
  }

#define DECLARE_ASM_REP_MOVS(Type, Movs)
    \
  template <> void asm_rep_movs<Type>(Type * dst, Type * src, size_t size)
{   \
    __asm__("rep " Movs " \n\t"
   \
            : "=D"(dst), "=S"(src), "=c"(size) \
            : "D"(dst), "S"(src), "c"(size) \
            : "memory");                                  \
  }

On Tue, Dec 27, 2016 at 10:55 AM Akira Hatanaka via Phabricator <
reviews at reviews.llvm.org> wrote:

> ahatanak added a comment.
>
> I guess it doesn't build because output constraints need "=" (e.g., "=D")?
>
> Also, I think all registers ("D", "S", and "c") should be in both the
> output and input operands list. You can probably declare new variables and
> use them in the output operands  (e.g., "=D"(newDst)) or use input/output
> operands "+" (the former is simpler in this case, since you want to use the
> original values of dst and src).
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D15075
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161227/393bc324/attachment.html>


More information about the cfe-commits mailing list