I'm confused when I met the assembly code in the xc source file, e.g. clockgen.xc, from line 369 :
Code: Select all
/* Read level data */
//g_inputLevelData[i] = samples_to_host_inputs[i];
asm volatile("ldw %0, %1[%2]":"=r"(tmp):"r"((const int *)samples_to_host_inputs),"r"(i));
g_inputLevelData[i] = tmp;
/* Reset level data */
//samples_to_host_inputs[i] = 0;
asm volatile("stw %0, %1[%2]"::"r"(0),"r"((const int *)samples_to_host_inputs),"r"(i));
Why can not use the commented C code ?
Is it written as C code, the compiler will convert it into more assembly code, which will affect the execution speed?
Thanks a lot.