| 30 | namespace Terathon |
| 31 | { |
| 32 | inline float Fabs(const float& x) |
| 33 | { |
| 34 | #ifndef TERATHON_NO_SIMD |
| 35 | |
| 36 | float result; |
| 37 | |
| 38 | VecStoreX(VecAndc(VecLoadScalar(&x), VecFloatGetMinusZero()), &result); |
| 39 | return (result); |
| 40 | |
| 41 | #else |
| 42 | |
| 43 | return ((x < 0.0F) ? -x : x); |
| 44 | |
| 45 | #endif |
| 46 | } |
| 47 | |
| 48 | inline float Fnabs(const float& x) |
| 49 | { |