diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libm/math.c | 13 | ||||
-rw-r--r-- | lib/libm/thumb_vfp_sqrtf.c | 11 | ||||
-rw-r--r-- | lib/utils/pyexec.c | 4 | ||||
-rw-r--r-- | lib/utils/pyexec.h | 2 | ||||
-rw-r--r-- | lib/utils/pyhelp.c | 10 |
5 files changed, 20 insertions, 20 deletions
diff --git a/lib/libm/math.c b/lib/libm/math.c index 7cbec5fb32..732049236d 100644 --- a/lib/libm/math.c +++ b/lib/libm/math.c @@ -86,19 +86,6 @@ double __aeabi_dmul(double x , double y) { #endif // defined(__thumb__) -// TODO this needs a better way of testing for Thumb2 FP hardware -#if defined(__thumb2__) - -float sqrtf(float x) { - asm volatile ( - "vsqrt.f32 %[r], %[x]\n" - : [r] "=t" (x) - : [x] "t" (x)); - return x; -} - -#endif - #ifndef NDEBUG float copysignf(float x, float y) { float_s_t fx={.f = x}; diff --git a/lib/libm/thumb_vfp_sqrtf.c b/lib/libm/thumb_vfp_sqrtf.c new file mode 100644 index 0000000000..12ffebf827 --- /dev/null +++ b/lib/libm/thumb_vfp_sqrtf.c @@ -0,0 +1,11 @@ +// an implementation of sqrtf for Thumb using hardware VFP instructions + +#include <math.h> + +float sqrtf(float x) { + asm volatile ( + "vsqrt.f32 %[r], %[x]\n" + : [r] "=t" (x) + : [x] "t" (x)); + return x; +} diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index d7c2570240..61cd5a98ce 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -118,7 +118,9 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind, { size_t n_pool, n_qstr, n_str_data_bytes, n_total_bytes; qstr_pool_info(&n_pool, &n_qstr, &n_str_data_bytes, &n_total_bytes); - printf("qstr:\n n_pool=" UINT_FMT "\n n_qstr=" UINT_FMT "\n n_str_data_bytes=" UINT_FMT "\n n_total_bytes=" UINT_FMT "\n", n_pool, n_qstr, n_str_data_bytes, n_total_bytes); + printf("qstr:\n n_pool=" UINT_FMT "\n n_qstr=" UINT_FMT "\n " + "n_str_data_bytes=" UINT_FMT "\n n_total_bytes=" UINT_FMT "\n", + (unsigned)n_pool, (unsigned)n_qstr, (unsigned)n_str_data_bytes, (unsigned)n_total_bytes); } #if MICROPY_ENABLE_GC diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h index ae69a195e7..0c7567e273 100644 --- a/lib/utils/pyexec.h +++ b/lib/utils/pyexec.h @@ -49,6 +49,6 @@ void pyexec_event_repl_init(void); int pyexec_event_repl_process_char(int c); extern uint8_t pyexec_repl_active; -MP_DECLARE_CONST_FUN_OBJ(pyb_set_repl_info_obj); +MP_DECLARE_CONST_FUN_OBJ_1(pyb_set_repl_info_obj); #endif // __MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H__ diff --git a/lib/utils/pyhelp.c b/lib/utils/pyhelp.c index 5c0b2c57b7..30ff391c4b 100644 --- a/lib/utils/pyhelp.c +++ b/lib/utils/pyhelp.c @@ -29,11 +29,11 @@ #include "lib/utils/pyhelp.h" STATIC void pyhelp_print_info_about_object(mp_obj_t name_o, mp_obj_t value) { - printf(" "); + mp_printf(MP_PYTHON_PRINTER, " "); mp_obj_print(name_o, PRINT_STR); - printf(" -- "); + mp_printf(MP_PYTHON_PRINTER, " -- "); mp_obj_print(value, PRINT_STR); - printf("\n"); + mp_printf(MP_PYTHON_PRINTER, "\n"); } // Helper for 1-argument form of builtin help @@ -57,9 +57,9 @@ STATIC void pyhelp_print_info_about_object(mp_obj_t name_o, mp_obj_t value) { // void pyhelp_print_obj(const mp_obj_t obj) { // try to print something sensible about the given object - printf("object "); + mp_printf(MP_PYTHON_PRINTER, "object "); mp_obj_print(obj, PRINT_STR); - printf(" is of type %s\n", mp_obj_get_type_str(obj)); + mp_printf(MP_PYTHON_PRINTER, " is of type %s\n", mp_obj_get_type_str(obj)); mp_map_t *map = NULL; if (MP_OBJ_IS_TYPE(obj, &mp_type_module)) { |