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 <
revi...@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
>
>
>
>
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to