summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 14:44:01 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-01 09:01:08 +0000
commit4cf9f223ac7af769370c623ec5c006d385801fe6 (patch)
tree24aa11edeb324f6d08217b54d481696696a6aae7 /core
parentf9dfe4e59f16025f1c3a2d22a910c9b026e211d3 (diff)
downloadchrome-ec-4cf9f223ac7af769370c623ec5c006d385801fe6.tar.gz
core/minute-ia/include/fpu.h: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: I983361bfb6f943967b312d5510106576482894bf Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729851 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/minute-ia/include/fpu.h123
1 files changed, 55 insertions, 68 deletions
diff --git a/core/minute-ia/include/fpu.h b/core/minute-ia/include/fpu.h
index 553807352a..8b1915134d 100644
--- a/core/minute-ia/include/fpu.h
+++ b/core/minute-ia/include/fpu.h
@@ -12,19 +12,15 @@
#ifdef CONFIG_FPU
-#define M_PI 3.14159265358979323846
-#define M_PI_2 1.57079632679489661923
+#define M_PI 3.14159265358979323846
+#define M_PI_2 1.57079632679489661923
static inline float sqrtf(float v)
{
float root;
/* root = fsqart (v); */
- asm volatile(
- "fsqrt"
- : "=t" (root)
- : "0" (v)
- );
+ asm volatile("fsqrt" : "=t"(root) : "0"(v));
return root;
}
@@ -34,11 +30,7 @@ static inline float fabsf(float v)
float root;
/* root = fabs (v); */
- asm volatile(
- "fabs"
- : "=t" (root)
- : "0" (v)
- );
+ asm volatile("fabs" : "=t"(root) : "0"(v));
return root;
}
@@ -51,12 +43,11 @@ static inline float logf(float v)
{
float res;
- asm volatile(
- "fldln2\n"
- "fxch\n"
- "fyl2x\n"
- : "=t" (res)
- : "0" (v));
+ asm volatile("fldln2\n"
+ "fxch\n"
+ "fyl2x\n"
+ : "=t"(res)
+ : "0"(v));
return res;
}
@@ -70,20 +61,19 @@ static inline float expf(float v)
{
float res;
- asm volatile(
- "fldl2e\n"
- "fmulp\n"
- "fld %%st(0)\n"
- "frndint\n"
- "fsubr %%st(0),%%st(1)\n" /* bug-binutils/19054 */
- "fxch %%st(1)\n"
- "f2xm1\n"
- "fld1\n"
- "faddp\n"
- "fscale\n"
- "fstp %%st(1)\n"
- : "=t" (res)
- : "0" (v));
+ asm volatile("fldl2e\n"
+ "fmulp\n"
+ "fld %%st(0)\n"
+ "frndint\n"
+ "fsubr %%st(0),%%st(1)\n" /* bug-binutils/19054 */
+ "fxch %%st(1)\n"
+ "f2xm1\n"
+ "fld1\n"
+ "faddp\n"
+ "fscale\n"
+ "fstp %%st(1)\n"
+ : "=t"(res)
+ : "0"(v));
return res;
}
@@ -97,24 +87,23 @@ static inline float powf(float x, float y)
{
float res;
- asm volatile(
- "fyl2x\n"
- "fld %%st(0)\n"
- "frndint\n"
- "fsub %%st,%%st(1)\n"
- "fxch\n"
- "fchs\n"
- "f2xm1\n"
- "fld1\n"
- "faddp\n"
- "fxch\n"
- "fld1\n"
- "fscale\n"
- "fstp %%st(1)\n"
- "fmulp\n"
- : "=t" (res)
- : "0" (x), "u" (y)
- : "st(1)");
+ asm volatile("fyl2x\n"
+ "fld %%st(0)\n"
+ "frndint\n"
+ "fsub %%st,%%st(1)\n"
+ "fxch\n"
+ "fchs\n"
+ "f2xm1\n"
+ "fld1\n"
+ "faddp\n"
+ "fxch\n"
+ "fld1\n"
+ "fscale\n"
+ "fstp %%st(1)\n"
+ "fmulp\n"
+ : "=t"(res)
+ : "0"(x), "u"(y)
+ : "st(1)");
return res;
}
@@ -125,16 +114,15 @@ static inline float ceilf(float v)
float res;
unsigned short control_word, control_word_tmp;
- asm volatile("fnstcw %0" : "=m" (control_word));
+ asm volatile("fnstcw %0" : "=m"(control_word));
/* Set Rounding Mode to 10B, round up toward +infinity */
control_word_tmp = (control_word | 0x0800) & 0xfbff;
- asm volatile(
- "fld %3\n"
- "fldcw %1\n"
- "frndint\n"
- "fldcw %2"
- : "=t" (res)
- : "m" (control_word_tmp), "m"(control_word), "m" (v));
+ asm volatile("fld %3\n"
+ "fldcw %1\n"
+ "frndint\n"
+ "fldcw %2"
+ : "=t"(res)
+ : "m"(control_word_tmp), "m"(control_word), "m"(v));
return res;
}
@@ -144,7 +132,7 @@ static inline float atan2f(float y, float x)
{
float res;
- asm volatile("fpatan" : "=t" (res) : "0" (x), "u" (y) : "st(1)");
+ asm volatile("fpatan" : "=t"(res) : "0"(x), "u"(y) : "st(1)");
return res;
}
@@ -154,11 +142,10 @@ static inline float atanf(float v)
{
float res;
- asm volatile(
- "fld1\n"
- "fpatan\n"
- : "=t" (res)
- : "0" (v));
+ asm volatile("fld1\n"
+ "fpatan\n"
+ : "=t"(res)
+ : "0"(v));
return res;
}
@@ -168,7 +155,7 @@ static inline float sinf(float v)
{
float res;
- asm volatile("fsin" : "=t" (res) : "0" (v));
+ asm volatile("fsin" : "=t"(res) : "0"(v));
return res;
}
@@ -178,7 +165,7 @@ static inline float cosf(float v)
{
float res;
- asm volatile("fcos" : "=t" (res) : "0" (v));
+ asm volatile("fcos" : "=t"(res) : "0"(v));
return res;
}
@@ -189,5 +176,5 @@ static inline float acosf(float v)
return atan2f(sqrtf(1.0 - v * v), v);
}
-#endif /* CONFIG_FPU */
-#endif /* __CROS_EC_FPU_H */
+#endif /* CONFIG_FPU */
+#endif /* __CROS_EC_FPU_H */