summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2022-08-18 14:39:00 +1000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-24 04:03:50 +0000
commit94e0ef35c576b88ac8fb3802ca063da0689516ce (patch)
tree7797b987a639088f36d23320ef2e7e42588e3a08
parentcde4d531330a263256787a9e91681d208675a896 (diff)
downloadchrome-ec-94e0ef35c576b88ac8fb3802ca063da0689516ce.tar.gz
nissa/ite: enable FPU
Given an appropriately-configured toolchain, IT8xxx2 can enable FPU even without integer multiply support enabled in the ISA. Use of floating-point significantly reduces the instruction count for hot paths in motion sensor code, which should in turn reduce instruction cache pressure and improve performance. Performance improvement for code that is switched to use floating-point is about 10%. Overall code size is slightly increased by this change as a few support functions are now added, but by inspection motionsense code no longer contains calls to functions like __udivdi3 for 64-bit arithmetic, which are extremely large (__udivdi3 is 1108 bytes of code, more than a quarter of the IT8xxx2 instruction cache). By experiment, overall system performance is improved significantly with reduced code size. BUG=b:240485526,b:227961840 TEST=Nereid EC is much more stable than before when the gyroscope is enabled with `accelrate 2 100000`. BRANCH=none Cq-Depend: chromium:3828780 Change-Id: I88672eef39ccab115fe07a9415468ff455def112 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3840987 Reviewed-by: Andrew McRae <amcrae@google.com>
-rw-r--r--zephyr/projects/nissa/joxer/prj.conf3
-rw-r--r--zephyr/projects/nissa/nereid/prj.conf3
2 files changed, 6 insertions, 0 deletions
diff --git a/zephyr/projects/nissa/joxer/prj.conf b/zephyr/projects/nissa/joxer/prj.conf
index 714ac28d5e..c3b39b0424 100644
--- a/zephyr/projects/nissa/joxer/prj.conf
+++ b/zephyr/projects/nissa/joxer/prj.conf
@@ -7,6 +7,9 @@ CONFIG_BOARD_JOXER=y
CONFIG_CROS_FLASH_IT8XXX2=y
CONFIG_CROS_SYSTEM_IT8XXX2=y
CONFIG_ESPI_IT8XXX2=y
+CONFIG_FPU=y
+# rv32iafc/ilp32f is not supported by the toolchain, so use soft-float
+CONFIG_FLOAT_HARD=n
CONFIG_TACH_IT8XXX2=y
# Allow more time for the charger to stabilise
diff --git a/zephyr/projects/nissa/nereid/prj.conf b/zephyr/projects/nissa/nereid/prj.conf
index 18ebc494dd..9cafe43216 100644
--- a/zephyr/projects/nissa/nereid/prj.conf
+++ b/zephyr/projects/nissa/nereid/prj.conf
@@ -7,6 +7,9 @@ CONFIG_BOARD_NEREID=y
CONFIG_CROS_FLASH_IT8XXX2=y
CONFIG_CROS_SYSTEM_IT8XXX2=y
CONFIG_ESPI_IT8XXX2=y
+CONFIG_FPU=y
+# rv32iafc/ilp32f is not supported by the toolchain, so use soft-float
+CONFIG_FLOAT_HARD=n
# Allow more time for the charger to stabilise
CONFIG_PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT=5