Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 10 Feb 2012 15:22:38 +0400
From: Solar Designer <solar@...nwall.com>
To: musl@...ts.openwall.com
Subject: Re: tough choice on thread pointer initialization issue

On Fri, Feb 10, 2012 at 02:42:52PM +0400, Solar Designer wrote:
> [...] I just did some testing on
> a Core 2'ish CPU (E5420), and the instruction is very fast.  I put 1000
> instances of:
> 
> movl %ss,%eax
> testl %eax,%eax
> jz 0
> 
> one after another, and this runs in just 1 cycle per the three
> instructions above (so 1000 cycles for the 1000 instances total).

To test my approach to testing this, I tried using:

movw %ss,%ax

followed by 1000 instances of:

movl %eax,%gs

or:

movw %ax,%gs

This executes in about 16.5 cycles per instruction.  Indeed, setting a
segment register is slow - but reading it apparently is not, at least
not on this CPU.

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.