c++ - Two way address translation or what? -


i looking @ arm assembly code c++ native code. target platform windows phone 8, , build environment visual studio 2012.

i inspecting arm assembly code possibilities of code optimisation maximum.

i confused regarding requirement 1 of instruction in arm code, under.

c++ code:

double lmean= kseedsl[n]; 

arm code:

1: ldr r3,[sp,#0x4c] 2: ldr r3,[r3]                     // r3= kseedsl 3: add r2,r3,r6,lsl #3             // r2 = &kseedsl[n] (r6 has value of "n") 4: vldr d13,[r2]                   // d13 = *(r2) 

i understand addresses variables such kseedsl(which input arguement in function) stored in stack. clueless why require 2 ldr (line1, 2) load address of kseedsl r3. per knowledge, have expected [sp,#0x4c] directly store address kseedsl passed function arguement.

kindly point out missing on here. expect standard concept unaware of.

edit: skeleton of function under:

void function_xyz(     vector<double>&             kseedsl,     vector<double>&             kseedsa,     vector<double>&             kseedsb,     vector<int>&                kseedsx,     vector<int>&                kseedsy,     unsigned short*             klabels,     const int&                  step,     const double&               m,     int                         iter,     int                         *omaxsegsize); 

because kseedsl std::vector<double>&, need 2 load instructions @ actual data contained in vector.

the first load instruction loads location of std::vector object r3.
second load instruction loads address of data area managed std::vector. happens stored in first member of std::vector in implementation.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -