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

Function get_cop1_cs

include/recomp.h:264–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264static inline uint32_t get_cop1_cs() {
265 uint32_t rounding_mode = 0;
266 switch (fegetround()) {
267 // round to nearest value
268 case FE_TONEAREST:
269 default:
270 rounding_mode = 0;
271 break;
272 // round to zero (truncate)
273 case FE_TOWARDZERO:
274 rounding_mode = 1;
275 break;
276 // round to positive infinity (ceil)
277 case FE_UPWARD:
278 rounding_mode = 2;
279 break;
280 // round to negative infinity (floor)
281 case FE_DOWNWARD:
282 rounding_mode = 3;
283 break;
284 }
285 return rounding_mode;
286}
287
288static inline void set_cop1_cs(uint32_t val) {
289 uint32_t rounding_mode = val & 0x3;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected