> SB-TRANSACTION is a SBCL compiler plugin for the x86-64 family of CPUs
> to access the new Restricted Transactional Memory (RTM) assembler
> instructions dealing with hardware memory transactions (described for
> example at
> introduced by Intel on Core i5 4570, Core i5 4670 and Core i7 4770.
I won't comment on most of your work as I don't have a CPU supporting
But I can point you at some info about prefix instructions.
> 2) I did not yet implement Hardware Lock Elision (HLE), an alternative
> set of assembler instructions to use hardware transactional memory,
> and it seems quite a more difficult task to me, as the relevant
> instructions XACQUIRE and XRELEASE must be used as prefixes for other
> instructions as MOV, LOCK XADD, and in general memory writes. In my
> ignorance I see no other solution than duplicating a lot of existing
> VOPs as compare-and-swap, regular memory writes... to add variants
> which insert the prefixes XACQUIRE or XRELEASE. A lot of work, and a
> lot of duplicated code.
> Any suggestion about a better way to implement them?
See my commits 65bdee4ba534e82c352cff3eec16473daaf285dd
"Improve handling of x86[-64] prefix instructions in the disassembler."
and eb53f2bf913aa34aee83b35eb2b709a2e0d40366 "Make the disassembler
understand instruction prefixes." from 2011, and the ones around these
The commit messages explain how to define instruction prefixes that
avoid the duplicated code you rightly don't want. This way is already
used for REX, LOCK, REP etc. Please compare the assembly side of LOCK
with REP: You have the choice whether to make the prefix an additional
argument to the main instruction as done with REP or have it be a
separate instruction to be inserted by (INST ...).
(Don't look at REX because that additionally is suppressed in the
disassembly and must sometimes be placed after the first byte of the
Also, you have the choice to make your X... simply normal instructions.
That makes the disassembly look less nice but otherwise works just as
well (see how the disassembly of LOCK looked before my changes, when
LOCK was a normal instruction, shown in the commit message of the
"Improve ..." commit cited above).
If you want your prefixes printed like FS on x86, that is, directly
before the memory reference, you need to find out how that is done with
FS. I believe that means modifying some internal function in the
Hope that helps! Regards