https://en.wikipedia.org/wiki/Transacti … Extensions

Intel Transactional Synchronization Extensions (Intel TSX) comes in two flavours: HLE and RTM.

Hardware Lock Elision (HLE) adds two new instruction prefixes,

XACQUIRE = 0xF2
can only be used with the lockd version of these instructions: ADD, ADC, AND, BTC, BTR, BTS, CMPXCHG, CMPXCHG8B, DEC, INC, NEG, NOT, OR, SBB, SUB, XOR, XADD, XCHG.

XRELEASE = 0xF3
the same instructions plus MOV mem, reg and MOV mem, imm without a lock prefix.

https://stackoverflow.com/questions/425 … sx-ni-diff
Due to their implementation, these two aspects are decoupled (either can be supported separately from the other) and only RTM introduces new instructions.

The RTM (Restricted Transactional Memory) introduces three new (или четыре, если считать xtest?) instructions: xbegin, xend and xabort.

TSX работает поверх механизма кешей. У cache line появляется дополнительный бит — что этот cache line в данный момент используется транзакцией.

Поток начинает транзакцию специальной инструкцией. После этого и до комита транзакции все операции, работающие с памятью, помечают соответствующий cache line как участвующий в транзакции. А если соответствующий cache line уже занят другой транзакцией, то процессор делает переход по специальному адресу, который задаётся в начале транзакции.

A new instruction xtest is available if HLE (or RTM) is present, it sets the ZF is the processor is not inside a transaction.

A complete reference can be found on Intel Manual 1 - Chapter 15.

Отредактировано Лис (2017-07-29 10:20:59)