lkml.org 
[lkml]   [2019]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/asm: Add support for MOVDIR64B instruction
On Fri, Aug 02, 2019 at 10:15:33AM +0200, Peter Zijlstra wrote:
> On Thu, Aug 01, 2019 at 12:49:48PM -0700, Luck, Tony wrote:
> > On Thu, Aug 01, 2019 at 10:43:48PM +0300, Alexey Dobriyan wrote:
> > > > +static inline void movdir64b(void *dst, const void *src)
> > > > +{
> > > > + /* movdir64b [rdx], rax */
> > > > + asm volatile(".byte 0x66, 0x0f, 0x38, 0xf8, 0x02"
> > > > + : "=m" (*(char *)dst)
> > > ^^^^^^^^^^
> > >
> > > > + : "d" (src), "a" (dst));
> > > > +}
> > >
> > > Probably needs fake 64-byte type, so that compiler knows what is dirty.
> >
> > Would that be something like this?
> >
> > static inline void movdir64b(void *dst, const void *src)
> > {
> > struct dstbytes {
> > char pad[64];
> > };
> >
> > /* movdir64b [rdx], rax */
> > asm volatile(".byte 0x66, 0x0f, 0x38, 0xf8, 0x02"
> > : "=m" (*(struct dstbytes *)dst)
> > : "d" (src), "a" (dst));
> > }
>
> Can the source and destination overlap? The SDM doesn't seem to mention
> this.

Good question. I'll ask to clarify this.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2019-08-02 14:58    [W:0.150 / U:7.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site