This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: Calling movnti without sfence?
- From: "rajagopal, dwarak" <dwarak dot rajagopal at amd dot com>
- To: "H.J. Lu" <hjl at lucon dot org>, "GNU C Library" <libc-alpha at sources dot redhat dot com>
- Cc: aj at suse dot de
- Date: Wed, 7 Nov 2007 11:55:19 -0600
- Subject: RE: Calling movnti without sfence?
- References: <20071107144618.GA30943@lucon.org>
Yes, sfence should be used in the place where you suggested.
- Dwarak
> -----Original Message-----
> From: libc-alpha-owner@sourceware.org [mailto:libc-alpha-
> owner@sourceware.org] On Behalf Of H.J. Lu
> Sent: Wednesday, November 07, 2007 8:46 AM
> To: GNU C Library
> Cc: aj@suse.de
> Subject: Calling movnti without sfence?
>
> While working on improving x86-64 memset, I noticed that movnti
> is called without sfence:
>
> 11:
> movnti %r8,(%rcx)
> movnti %r8,0x8(%rcx)
> movnti %r8,0x10(%rcx)
> movnti %r8,0x18(%rcx)
> movnti %r8,0x20(%rcx)
> movnti %r8,0x28(%rcx)
> movnti %r8,0x30(%rcx)
> movnti %r8,0x38(%rcx)
> add $0x40,%rcx
> dec %rax
> jne 11b
> jmp 4b
>
> Is that intentional? Shouldn't it be
>
> 11:
> movnti %r8,(%rcx)
> movnti %r8,0x8(%rcx)
> movnti %r8,0x10(%rcx)
> movnti %r8,0x18(%rcx)
> movnti %r8,0x20(%rcx)
> movnti %r8,0x28(%rcx)
> movnti %r8,0x30(%rcx)
> movnti %r8,0x38(%rcx)
> add $0x40,%rcx
> dec %rax
> jne 11b
> sfence
> jmp 4b
>
>
> H.J.
>