summaryrefslogtreecommitdiff
path: root/libm/kvx/fegetround.c
blob: 05e87250682c96d68a9ee3aedb5f6d4577e4c1e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
  (C) Copyright 2019 Kalray S.A.
  This file provides fegetround for the Coolidge processor.
*/

#include <fenv.h>

int fegetround(void)
{
  /* Get all $cs flags (exception flags and rounding mode) */
  fenv_t rm;
  rm = __builtin_kvx_get(KVX_SFR_CS);

  /* Return the rounding mode */
  return rm & FE_RND_MASK;
}