MFENCE vs. LOCK addl

Jiva, Azeem Azeem.Jiva at amd.com
Wed Feb 25 20:05:45 PST 2009


Except that gets you two locked xchgs, which is slower than an mfence.  My proposal is:

push rax
xchg rax, (rsp)
pop rax


-----Original Message-----
From: John Rose [mailto:John.Rose at Sun.COM]
Sent: Wed 2/25/2009 5:30 PM
To: Paul Hohensee
Cc: Tom Rodriguez; hotspot compiler; Jiva, Azeem
Subject: Re: MFENCE vs. LOCK addl
 
Tom Rodriguez wrote:

> Avoiding push/pop at all seems much better to me.

Another way to avoid push/pop is to just double the xchgq/l:

   xchgq rax, (rsp, 0)
   xchgq rax, (rsp, 0)




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20090225/ed87775a/attachment.html 


More information about the hotspot-compiler-dev mailing list