Skip to content
Snippets Groups Projects
Commit 6328beb7 authored by Dan Ibanez's avatar Dan Ibanez
Browse files

fix double-return warning

this #ifdef adds a return statement
for little endian machines, but leaves
the old one, which the compiler comlains
is unreachable. this commit combines
the conditionals so we can use #else
parent caea8973
No related branches found
No related tags found
No related merge requests found
...@@ -42,12 +42,11 @@ namespace MathSpecialKokkos { ...@@ -42,12 +42,11 @@ namespace MathSpecialKokkos {
{ {
x *= x; x *= x;
x *= 1.4426950408889634074; // log_2(e) x *= 1.4426950408889634074; // log_2(e)
#if defined(__BYTE_ORDER__) #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
return (x < 1023.0) ? exp2_x86(-x) : 0.0; return (x < 1023.0) ? exp2_x86(-x) : 0.0;
#endif #else
#endif
return (x < 1023.0) ? exp2(-x) : 0.0; return (x < 1023.0) ? exp2(-x) : 0.0;
#endif
} }
// x**2, use instead of pow(x,2.0) // x**2, use instead of pow(x,2.0)
......
...@@ -41,12 +41,11 @@ namespace MathSpecial { ...@@ -41,12 +41,11 @@ namespace MathSpecial {
{ {
x *= x; x *= x;
x *= 1.4426950408889634074; // log_2(e) x *= 1.4426950408889634074; // log_2(e)
#if defined(__BYTE_ORDER__) #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
return (x < 1023.0) ? exp2_x86(-x) : 0.0; return (x < 1023.0) ? exp2_x86(-x) : 0.0;
#endif #else
#endif
return (x < 1023.0) ? exp2(-x) : 0.0; return (x < 1023.0) ? exp2(-x) : 0.0;
#endif
} }
// x**2, use instead of pow(x,2.0) // x**2, use instead of pow(x,2.0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment