Logo
Explore Help
Register Sign In
fengqi/lv_micropython
1
0
Fork 0
You've already forked lv_micropython
Code Issues Pull Requests 1 Actions Packages Projects Releases Wiki Activity
lv_micropython/lib/libm_dbl/thumb_vfp_sqrt.c

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
256 B
C
Raw Normal View History

stm32: Use hardware double sqrt on F7/H7 MCUs. Identical to cd527bb324ade952d11a134859d38bf5272c165e but for doubles. This gives a -2.754% improvement on bm_float.py, and -35% improvement on calling sqrt in a loop.
2019-10-09 22:59:35 +11:00
// an implementation of sqrt for Thumb using hardware double-precision VFP instructions
double sqrt(double x) {
double ret;
lib/libm: Use __asm__ instead of asm. `asm` is not part of the C standard and causes a complier error when `-std=c99` is used. `__asm__` is the recommended alternative. https://gcc.gnu.org/onlinedocs/gcc/extensions-to-the-c-language-family/alternate-keywords.html Signed-off-by: David Lechner <david@pybricks.com>
2022-11-09 12:03:31 -06:00
__asm__ volatile (
stm32: Use hardware double sqrt on F7/H7 MCUs. Identical to cd527bb324ade952d11a134859d38bf5272c165e but for doubles. This gives a -2.754% improvement on bm_float.py, and -35% improvement on calling sqrt in a loop.
2019-10-09 22:59:35 +11:00
"vsqrt.f64 %P0, %P1\n"
: "=w" (ret)
: "w" (x));
return ret;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 92ms Template: 0ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API