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/thumb_vfp_sqrtf.c

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

12 lines
248 B
C
Raw Normal View History

lib/libm: Move Thumb-specific sqrtf function to separate file. This allows it to be used only when the hardware supports VFP instructions, preventing compile errors.
2016-11-03 12:26:32 +11:00
// an implementation of sqrtf for Thumb using hardware VFP instructions
#include <math.h>
float sqrtf(float x) {
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 (
lib/libm: Move Thumb-specific sqrtf function to separate file. This allows it to be used only when the hardware supports VFP instructions, preventing compile errors.
2016-11-03 12:26:32 +11:00
"vsqrt.f32 %[r], %[x]\n"
: [r] "=t" (x)
: [x] "t" (x));
return x;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 121ms Template: 1ms
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