lkml.org 
[lkml]   [2015]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] x86/asm/entry/64: Use shorter MOVs from segmers registers
On 05/14/2015 11:07 AM, Denys Vlasenko wrote:
> "movw %ds,%cx" insn needs a 0x66 prefix, while "movw %ds,%ecx" does not.
> The difference is that latter form (on 64-bit CPUs) overwrites
> entire %ecx, not only its lower half.
>
> But subsequent code doesn't depend on the value of upper
> half of %ecx, we can safely use the shorter insn.
>
> The new code is also faster than old one - now we don't depend on old value
> of %ecx, but this code fragment is not performance-critical.

This is still misleading. On P6 or later CPUs, not just 64 bits, this
zeroes the upper half, whereas on older CPUs it is undefined. Which is
still fine, but if we are going to make such a minor change we should
get it correct.

-hpa




\
 
 \ /
  Last update: 2015-05-15 00:21    [W:0.042 / U:1.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site