Altera_Forum
Honored Contributor
21 years agoHI! I don't know instruction cycle
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gif HI!
I want fast CopyMemory function and write inline asm code. (under line) I don't know " LDW, STW" machine cycle.. Why very very slow "LDW, STW" ? Test KIT : Cyclone 50Mhz STD void CopyMemory(void *IN_pDS, void *IN_pSC, int IN_iSZ) { IN_iSZ >>= 2; //INF: DIV 4 , B.OF: 4BYTE MOVE asm ( "LABEL_1: \n\t" "ldw r7, 0(%1) \n\t" //??Cycle STD "stw r7, 0(%0) \n\t" //??Cycle STD "addi %1, %1, 4 \n\t" //1Cycle STD "addi %0, %0, 4 \n\t" //1Cycle STD "addi %2, %2, -1 \n\t" //1Cycle STD "bne %2, %3, LABEL_1 \n\t" //2Cycle STD : : "r"(IN_pDS), "r"(IN_pSC), "r"(IN_iSZ), "r"(0) ); }