![]() |
Raven Engine v0.1
|
Namespaces | |
| namespace | Crux |
| namespace | Crux::Detail |
Macros | |
| #define | RV_FMA(a, b, c) |
| Fused-multiply-add: computes (a * b + c) in one operation if supported. | |
| #define | RV_RoundToInt(x) |
| Round float to nearest int (ties to even) without branches. | |
| #define | RV_USE_COS_FROM_QUAD(q) |
| True if quadrant q (0-3) indicates we should compute cosine. | |
| #define | RV_NEGATE_FROM_QUAD(q) |
| True if quadrant q (0-3) indicates the result should be negated. | |
Local constants for range reduction (float) | |
| void | Crux::Detail::ReduceAngle (float x, float &outXr, unsigned int &outQuad) noexcept |
| Reduce angle into [-pi/4, pi/4] and extract quadrant. | |
| #define RV_FMA | ( | a, | |
| b, | |||
| c ) |
Fused-multiply-add: computes (a * b + c) in one operation if supported.
| a | First multiplicand. |
| b | Second multiplicand. |
| c | Addend. |
On MSVC with FMA support, maps to _mm_fmadd_ss; otherwise falls back to (a*b + c).
| #define RV_NEGATE_FROM_QUAD | ( | q | ) |
True if quadrant q (0-3) indicates the result should be negated.
| q | Quadrant index from ReduceAngle. |
| #define RV_RoundToInt | ( | x | ) |
Round float to nearest int (ties to even) without branches.
| x | Value to round. |
MSVC uses _mm_round_ss + _mm_cvtss_si32; GCC/Clang use __builtin_rintf.
| #define RV_USE_COS_FROM_QUAD | ( | q | ) |
True if quadrant q (0-3) indicates we should compute cosine.
| q | Quadrant index from ReduceAngle. |