<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
(* tmp := Mem [s1.A].t;<BR> Mem [s1.A].t := tmp op s0.u;<BR> s1.u := tmp; pop *)<BR><BR><BR>
Tony, are you sure you want to return the old value, not the new value?<BR>
That's not great on x86.<BR>
I believe for "or" and "and", you end up having to do a compare exchange loops.<BR>
<BR>
<BR>
For xor, add, sub, you can compute the old value, ok.<BR>
But if caller wanted the old value, he can do that himself also.<BR>
Caller can also write a compare_exchange loop.<BR>
<BR>
<BR>
Therefore, I think it should be:<BR>
<BR>
(* tmp := Mem [s1.A].t;<BR> Mem [s1.A].t := tmp op s0.u;<BR> s1.u := tmp op s0.u; pop *)<BR><BR>
There is of course value in storing the value in mem and stack, since mem<BR>
can change right away.<BR>
<BR>
<BR>
- Jay<BR><BR> </body>
</html>