3

I saw haswell's microarchitecture from below link mentioned that some pipelines can carry on fast LEA and some can run slow LEA, what's the meaning of fast LEA and slow LEA here? Related to LEA instruction? The search results are usually biases to LEA instruction, and don't lead to direct answer.

http://www.realworldtech.com/haswell-cpu/4/

Thomson
  • 20,586
  • 28
  • 90
  • 134

1 Answers1

3

Most dedicated ALU units exist only on part of the execution ports (with constant changes being made from generation to generation), the CPU has to pick one of the possible ports according to the instruction (or rather the micro-operation) being performed. When Multiple identical ports can do the same, it should attempt to do some balancing, and there may be other possible factors. The exact algorithm of course is never published.

In this case however, the LEA operations are split into slow and fast ones, according to this link, the slow ones are due to using 3 operand LEAs (base, index, offset). It actually also provides you with a performance monitor to measure how many such cases you encounter.

Leeor
  • 19,260
  • 5
  • 56
  • 87
  • thanks. I am interested in why LEA is separated from ALU, since it is just sort of ALU operation (mostly add?) – Thomson Jan 23 '14 at 01:33
  • @Thomson - *Mostly*, but not *completely*, it's much more complicated due to the extra source and therefore I believe it uses a dedicated execution unit - probably the same one that's usually reserved for memory operands (since it's already there and capable of doing that computation). A simple Add/Sub ALU probably can't cope with that. See also this answer - http://stackoverflow.com/a/11389785/2016408 – Leeor Jan 23 '14 at 20:39