summaryrefslogtreecommitdiff
path: root/zephyr/fpu.cmake
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /zephyr/fpu.cmake
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-factory-guybrush-14600.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'zephyr/fpu.cmake')
-rw-r--r--zephyr/fpu.cmake40
1 files changed, 0 insertions, 40 deletions
diff --git a/zephyr/fpu.cmake b/zephyr/fpu.cmake
deleted file mode 100644
index 5f1c698b15..0000000000
--- a/zephyr/fpu.cmake
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2021 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-#[[
-Disclaimer: the following example is pieced together from
-https://lemire.me/blog/2020/06/26/gcc-not-nearest/ along with other information
-found in GCC documentation.
-
-The following flags are needed to to ensure consistent FPU rounding in unit
-tests. For example using GNU GCC 7.5 rounds down. Note that at the time of
-writing, Clang 13.0.0 passes all the FPU unit tests without these flags.
-
-Some of the sensor logic which requires FPU support is susceptible to rounding
-errors. In GCC 7.5, as an example:
-
- double x = 50178230318.0;
- double y = 100000000000.0;
- double ratio = x/y;
-
-In this example, we would expect ratio to be 0.50178230318. Instead, using a
-64-bit float, it falls between:
-* The floating-point number 0.501782303179999944 == 4519653187245114 * 2 ** -53
-* The floating-point number 0.501782303180000055 == 4519653187245115 * 2 ** -53
-
-The real mantissa using the same logic should be:
-0.50178230318 = 4519653187245114.50011795456 * 2 ** -53
-
-Since the mantissa's decimal is just over 0.5, it should stand to reason that
-the correct solution is 0.501782303180000055. To force GCC to round correctly
-we must set the following modes:
-1. 'sse' - Generate SSE instructions.
-2. 'fpmath=sse' - Use scalar floating-point instructions present in the SSE
- instruction set.
-3. 'arch=pentium4' - Choose the Pentium4 because it's a stable choice that
- supports SSE and is known to work (there may be other good choices).
-]]
-if(DEFINED CONFIG_SOC_POSIX)
- zephyr_cc_option(-msse -mfpmath=sse -march=pentium4)
-endif()