[PATCH] D29485: [Builtin][ARM] Implement addsf3/__aeabi_fadd for Thumb1

Weiming Zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 22:52:46 PST 2017


weimingz created this revision.
Herald added subscribers: mgorny, aemerson.

This patch implements addsf3/__aeabi_fadd in asm for Thumb1. 
Compared with generic C version (lib/fp_add_impl.inc), it

1. all constants are materialized instead of loading from constant pool
2. no stack spills (C version uses 136 bytes stack space)
3. clz() is called only when necessary. (C version always calls it)

The asm is able to be extended to ARM/Thumb2 and for double fp easily.

In real projects, this asm brings the performance on par with gcc on cortex-m3. It was about 25% behind.


https://reviews.llvm.org/D29485

Files:
  lib/builtins/CMakeLists.txt
  lib/builtins/arm/addsf3.S

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29485.86936.patch
Type: text/x-patch
Size: 7786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170203/3eb3789e/attachment.bin>


More information about the llvm-commits mailing list