optimization of lib function memcpy

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

optimization of lib function memcpy

718件の閲覧回数
LewisThin
Contributor III

hello everyone,

S32K344 and GCC 10.2 were used for my project developping. in my project, memset and memcpy were use freqently.

i found that the memcpy and memset in lib is vevry simple and low efficienct by byte operation.

i have developped the optimized functions using SIMD operations.

now i wanna to replace the memcpy and memset functions in the lib in a transparent method, namely, i wanna to use #include <string.h> in my source files.

and more, the optimized functions are in a .h file and with an inline modifier.

is there any way to achieve the goal.

thanks

best regards.

タグ(2)
0 件の賞賛
返信
3 返答(返信)

451件の閲覧回数
Henrik-Wires
Contributor III

If you define a global memcpy function in your application then it should take priority over the standard function in the library. This can not be inline however, must be compiled as a standard global (non-static) function.

Another possible option is to add a define or alternatively a forced include via compiler directive settings, effectively rewriting the source files on the fly while compiling. Enabling your application and referenced drivers to use your version

0 件の賞賛
返信

677件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @LewisThin 

We do not recommend replacing functions from standard libraries. However, if you need to use a custom function, you can create and add your own library. For detailed instructions, refer to HOWTO: Add a static library file into S32DS GCC project, where you will find further information that may be useful.

 

BR, VaneB

0 件の賞賛
返信

579件の閲覧回数
LewisThin
Contributor III

hi,  VaneB

Thanks for your reply. the instructions in  the lib are too inefficient for our project. but memcpy is in many sources files and changing the source files are not accepteable. 

do you have any other ideas?

best regards!

タグ(2)
0 件の賞賛
返信