| 286 | } |
| 287 | |
| 288 | static inline void set_cop1_cs(uint32_t val) { |
| 289 | uint32_t rounding_mode = val & 0x3; |
| 290 | int round = FE_TONEAREST; |
| 291 | switch (rounding_mode) { |
| 292 | case 0: // round to nearest value |
| 293 | round = FE_TONEAREST; |
| 294 | break; |
| 295 | case 1: // round to zero (truncate) |
| 296 | round = FE_TOWARDZERO; |
| 297 | break; |
| 298 | case 2: // round to positive infinity (ceil) |
| 299 | round = FE_UPWARD; |
| 300 | break; |
| 301 | case 3: // round to negative infinity (floor) |
| 302 | round = FE_DOWNWARD; |
| 303 | break; |
| 304 | } |
| 305 | fesetround(round); |
| 306 | } |
| 307 | |
| 308 | #define S32(val) \ |
| 309 | ((int32_t)(val)) |
nothing calls this directly
no outgoing calls
no test coverage detected