<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Sebastian,<br></div><div><br>On Nov 4, 2015, at 2:34 PM, Sebastián Krynski &lt;<a href="mailto:skrynski@gmail.com">skrynski@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><div dir="ltr">Hello, as I mentioned before I'm starting to implement an atomic operator (a swap between two variables).<div>I have compiled the StackVM (at least to get started) in Ubuntu 32bits.</div><div>A few questions:</div><div><br></div><div>- Should I be working on&nbsp;<span style="font-size:12.8px">generation.image while doing the implementation? If so, should I be running the simulated VM running another image while doing my tests?</span></div></div></div></blockquote><div><br></div>I like to use the simulator on an image that starts up a read-eval-print-loop so I can type expressions into the simulation without having to drive the simulated gui, which is slooooow. &nbsp;If Pharo requires a command line arg to start the REPL then you can add this when you launch the simulation.<div><br><blockquote type="cite"><div><div dir="ltr"><div><span style="font-size:12.8px">- Do you think it is possible to implement the operations in Slang or using &nbsp;</span><span style="font-size:12.8px">#cCode:inSmalltalk:? Otherwise I will need to do it in assembler and inline it</span></div></div></div></blockquote><div><br></div>Please do /not/ use&nbsp;<span style="background-color: rgba(255, 255, 255, 0);">#cCode:inSmalltalk:, it's a horrible hack. &nbsp;Instead use the pattern used for strcmp et al. &nbsp;Define a selector, say compare:swap: and implement its simulation up in VMClass. &nbsp;Mark the method with the &lt;doNotGenerate&gt; pragma. Slang will then output it as compareswap(a,b). &nbsp;Then implement this with a macro in platforms/Cross/vm/sqAtomic.h, eg in terms of the gcc intrinsics.</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">When it comes to the Cog JIT you can add either an abstract instruction or a generated runtime routine, depending on complexity. &nbsp;Don't worry about this now, but there is already support for CAS in the JIT.</span></div><div><br><blockquote type="cite"><div dir="ltr"><div><span style="font-size: 12.8px;">Thanks</span></div><div><span style="font-size:12.8px">Sebastián</span></div></div>
</blockquote><div><span style="background-color: rgba(255, 255, 255, 0);"><br>_,,,^..^,,,_ (phone)</span></div></div></body></html>