I want to reduce the instruction codes using the inline-assembler for more faster operation because the S32DS compiler repeatedly generates the same codes shown in the below Figure-1.
( Note: The Figure-1 shows a part of init_edma_tcd_15() function in edma.c in the sample program 'SPI_DMA_MPC5744P'. )
Therefore I am trying the inline-assembler coding, but I can not compile it shown in the below Figure-2.
I could not find the inline assembler example like this situation for MPC5744P although I found the ARM GCC Inline Assembler Cookbook which is different to the Power-Architecture.
Does someone teach me how to use the inline-assembler ?
Thank you for your reply.
I have confirmed the adding % character in shown the below the figure.
In addition, could you teach me the followings ?
Question-1 : Do I have to save & restore the value of the registers when I choose the register using the "%r" at inline-assembler ?
I am afraid of the destroying the values of the register coded with C-source.
Because I don't know the role of the other resisters although I guess the r1 is used to the stack-pointer.
( I would use this coding way if I know the role of resisters under the S32DS Power-architecture. )
Question-2 : When I coded the following,
__asm__ volatile ( "e_lis %0, %1" : "=r" ( v_arg ) : "r" (64522) );
the S32DS compiler choosed the r7 register in shown the bottom of below figure.
Can I code it such as like I let the compiler to choose the register?
Thank you for your information.
I understood.
Hi,
please take a look at this thread:
https://community.nxp.com/thread/395621
It's necessary to add % character before the register name like: %r3
Or change the compiler settings as mentioned in the last post.
Regards,
Lukas