zhangyu-duck opened a new pull request, #21369:
URL: https://github.com/apache/nuttx/pull/21369

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   Enable CONFIG_TRICORE_STRING_FUNCTION in the triboard_tc4x9_com:nsh 
configuration, so the board uses the optimized TriCore assembly string/memory 
functions (libs/libc/machine/tricore/gnu) instead of the generic C 
implementations.
   
   ## Impact
   
   Board configuration only 
(boards/tricore/tc4xx/triboard_tc4x9_com/configs/nsh/defconfig). No code 
changes. Other boards and architectures are not affected.
   
   ## Testing
   
   Built triboard_tc4x9_com:nsh (TC4xx, cmake) with tricore-elf-gcc on Ubuntu 
host and ran on the TC4x9 TriBoard.
   
   Disassembly of the final ELF confirms that memcpy, memset, memmove, memcmp, 
memchr, strcmp, strcpy, strlen, strchr, strchrnul, strncmp, strnlen, strncpy, 
stpcpy and strrchr all come from the arch_*.S implementations.
   
   A self-test calling each of these 15 functions over different alignments, 
lengths and offsets, checked against constant expected values, passes on the 
board with the option both disabled and enabled:
   
   ```
   CONFIG_TRICORE_STRING_FUNCTION=y
   ...
   STRFN RESULT PASS (0 of 15 functions failed)
   ```
   
   Performance on 256-byte buffers, asm speed vs C speed:
   
   | function | speedup |
   |---|---|
   | strnlen | 2.38x |
   | strcmp | 2.18x |
   | memcmp | 1.72x |
   | strncmp | 1.66x |
   | memset | 1.45x |
   | memmove | 1.40x |
   | strlen | 1.39x |
   | memchr | 1.25x |
   | strrchr | 1.24x |
   | strncpy | 1.23x |
   | strchrnul | 1.18x |
   | memcpy | 1.17x |
   | strcpy | 1.15x |
   | strcat | 1.14x |
   | strchr | 1.12x |
   | stpcpy | 1.01x |
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to