MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / set_cop1_cs

Function set_cop1_cs

include/recomp.h:288–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288static 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))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected