diff options
author | Kyoung Kim <kyoung.il.kim@intel.com> | 2016-10-28 18:08:12 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-01-09 23:47:24 -0800 |
commit | 1765faf803fc2af034938838816790d81f77d4c9 (patch) | |
tree | ef44306ce62b5a37fa8c9002bc67efcc1b8b1204 /core | |
parent | a61ef28c1506d037b290ad49c7efd6d2f775044a (diff) | |
download | chrome-ec-1765faf803fc2af034938838816790d81f77d4c9.tar.gz |
minute-ia: fix floating point inline assembly
change inline assembly for fsqrt and fabs
BUG=none
BRANCH=None
TEST=`make buildall -j`
1. Compare sqareroot(2) from calculator and from sqrtf(2.0f) by multiplying
1.0 x 10E8 for both values to convert int32_t and check the difference.
2. read timestampt before and after 'sqrtf()' and calculate execution
time.
Change-Id: I62694d8b084a3a74040dc298354b4fd685e77729
Signed-off-by: Kyoung Kim <kyoung.il.kim@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/404927
Commit-Ready: Kyoung Il Kim <kyoung.il.kim@intel.com>
Tested-by: Kyoung Il Kim <kyoung.il.kim@intel.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Kyoung Il Kim <kyoung.il.kim@intel.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/minute-ia/include/math.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/minute-ia/include/math.h b/core/minute-ia/include/math.h index 0ac0ce831d..3bd778a05a 100644 --- a/core/minute-ia/include/math.h +++ b/core/minute-ia/include/math.h @@ -13,10 +13,11 @@ static inline float sqrtf(float v) { float root; + /* root = fsqart (v); */ asm volatile( - "fsqrt %0, %1" - : "=w" (root) - : "w" (v) + "fsqrt" + : "=t" (root) + : "0" (v) ); return root; } @@ -25,10 +26,11 @@ static inline float fabsf(float v) { float root; + /* root = fabs (v); */ asm volatile( - "fabs %0, %1" - : "=w" (root) - : "w" (v) + "fabs" + : "=t" (root) + : "0" (v) ); return root; } |