Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

lea behaviour

Vladimir_Dergachev
681 Views

What are the sideeffects of LEA instruction ?

I am seeing a fairly large number of CPU  cycles attributed to LEA, which is used to compute &ARRAY[base+i*stride+j]. Does the computed address cause a cache fault ?

thank you

Vladimir Dergachev

0 Kudos
3 Replies
James_C_Intel2
Employee
681 Views

lea cannot cause a cache miss, because it does not perform a memory access. It is just doing arithmetic on registers. If you are seeing a lot of time attributed to lea operations, then it is probably caused by dependency stalls in the in-order pipe (so cases where the lea is using as input a register whose value was modified in the previous instruction). 

0 Kudos
Vladimir_Dergachev
681 Views

Ahh, thank you ! I was not sure how much of mov functionality was retained. Is the latency information available anywhere ? I'd like to understand where the stalls are coming from - in some cases lea had a lot of time attributed to it, even though neighbouring instructions with similar dependency levels had much lower time.

Could this be due to difficulty sharing lea hardware between four threads ?

0 Kudos
TaylorIoTKidd
New Contributor I
681 Views

The best tool to identify such stalls is VTune (http://software.intel.com/en-us/intel-vtune-amplifier-xe) or a simliar tool.

Regards
--
Taylor

0 Kudos
Reply