summaryrefslogtreecommitdiff
path: root/common/console.c
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2017-06-15 15:07:35 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-19 15:33:09 -0700
commit90167c1764ab7c532b121bd08990b81631a3c896 (patch)
treecb2b1dadc7052437d071b872b6aff04df221d0d8 /common/console.c
parent0696dd1e68692ca8dae17b737e0d895561f65cd4 (diff)
downloadchrome-ec-90167c1764ab7c532b121bd08990b81631a3c896.tar.gz
math_util: Use HW instruction for int_sqrtf when available
Cortex-M4 supports a floating point square root function that takes 14 cycles to execute, which is a speed improvement over the existing binary search, and saves flash space. BUG=chromium:687624 BRANCH=None TEST=On kevin, verify that both sqrtf methods (binary search vs HW instruction) have identical results for fractional input (eg. sqrt(15.999999) = 3), except when floating point representation of square root rounds up to an integer. Verify identical results for all integers [-100, 16793602). Note that 16793602 is the first integer for which the floating point representation of sqrt rounds up to an integer. Also verify basic motion sense functions on kevin. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I8521c9a28c958b340ca83c37342253e424df0c91 Reviewed-on: https://chromium-review.googlesource.com/537734 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common/console.c')
0 files changed, 0 insertions, 0 deletions