3

I want to use Intel TSX synchronization extensions with Delphi. But AFAIK Delphi does not support any extended assembly past SSE 4.2 so can it be done otherwise? And how would one go about detecting such a feature aswell.

This feature is supported since 2012 for Haswell processors.

Alex Guteniev
  • 12,039
  • 2
  • 34
  • 79
user4855729
  • 147
  • 5
  • 3
    TSX extension is not available even on some Haswell processors. In 2014 Intel reported bug in implementation and many processors are affected (TSX should be disabled at such CPUs). Why do you need it? Could you explain task (i am quite sure it will not help you)? – Andrei Galatyn May 10 '15 at 21:01
  • 1
    [TSX was disabled for Haswell and early Broadwell CPUs via microcode update.](http://techreport.com/news/26911/errata-prompts-intel-to-disable-tsx-in-haswell-early-broadwell-cpus) – afrazier May 11 '15 at 00:49

1 Answers1

0

For HLE part of TSX probably by using REPE/REPNE prefix; if Delphi will not allow you to use it in "wrong" context, DB F3 / DB F2 should do. For the RTM part, probably just DB all the stuff.

Both TSX and RTM can be detected by CPUID. HLE does not even need detection - it automatically falls back due to REPE/REPNE prefixes being no-op in this context before HLE.

Anyway, I'm not sure if it is useful now, even ignoring 4 years late answer, since TSX may be useless nowadays - see my question Has Hardware Lock Elision gone forever due to Spectre Mitigation?

Alex Guteniev
  • 12,039
  • 2
  • 34
  • 79