diff --git a/lib/libm/math.c b/lib/libm/math.c
index 7cbec5fb32d65ab80d5b1990a2f1fb82d8955c2a..732049236d84bbf6f7b41f9d00953b515cd1b03b 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 0000000000000000000000000000000000000000..12ffebf827090b9969df7fcecba86161847af8f2
--- /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/stmhal/Makefile b/stmhal/Makefile
index e2e1dc6a15b9d4616c6dde3250ae8ee5afc28a11..a7a3018cc392258c9b1e984be54e20fe68a3d33d 100644
--- a/stmhal/Makefile
+++ b/stmhal/Makefile
@@ -81,6 +81,7 @@ endif
 SRC_LIB = $(addprefix lib/,\
 	libc/string0.c \
 	libm/math.c \
+	libm/thumb_vfp_sqrtf.c \
 	libm/asinfacosf.c \
 	libm/atanf.c \
 	libm/atan2f.c \