<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Nevermind.<BR>
<BR>
<A href="http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html">http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html</A><BR><BR><BR><BR><BR><BR> <BR>
<HR id=stopSpelling>
From: jay.krell@cornell.edu<BR>To: hosking@cs.purdue.edu; m3devel@elegosoft.com<BR>Date: Fri, 18 Dec 2009 18:04:27 +0000<BR>Subject: [M3devel] cas/casp?<BR><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
Tony is this right?<BR> <BR> <BR>conceptually:<BR> <BR> <BR>result := CAS(VAR destination, compare, exchange)<BR> <BR> <BR>old := destination<BR>if old := compare then<BR> destination = exchange<BR>return old<BR> <BR> <BR>bool result := CASP(VAR destination, compare, exchange)<BR>P for predicate aka returning bool<BR> <BR> <BR>old := destination<BR>if old = compare then<BR> destination := exchange<BR> return true<BR>return false<BR> <BR> <BR>I'm pretty sure it is.<BR> <BR> <BR>I'll have this for 16 bit and 32 bit values shortly, for now requiring<BR>a recent Microsoft compiler and it generates function calls.<BR>But inlining should be easy enough.<BR>And then 8bit and 64bit.<BR> <BR> <BR>Also this will probably not work on 386 or 486 but require Pentium or somesuch.<BR>I don't know when various instructions were introduced but I know<BR>386 is much poorer here than modern processors.<BR> <BR> <BR>I assume only support int8, uint8, int16, uint16, int32, uint32, int64, uint64, size_t, ptrdiff_t<BR>and not e.g. floating point.<BR> <BR> <BR> - Jay<BR> </body>
</html>