fegetround.c 318 B

12345678910111213141516
  1. /*
  2. (C) Copyright 2019 Kalray S.A.
  3. This file provides fegetround for the Coolidge processor.
  4. */
  5. #include <fenv.h>
  6. int fegetround(void)
  7. {
  8. /* Get all $cs flags (exception flags and rounding mode) */
  9. fenv_t rm;
  10. rm = __builtin_kvx_get(KVX_SFR_CS);
  11. /* Return the rounding mode */
  12. return rm & FE_RND_MASK;
  13. }