fenv.hh (2665:a124942bacb8) | fenv.hh (4394:dbaff14bb974) |
---|---|
1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 19 unchanged lines hidden (view full) --- 28 * Authors: Steve Reinhardt 29 */ 30 31#ifndef __BASE_FENV_HH__ 32#define __BASE_FENV_HH__ 33 34#include "config/use_fenv.hh" 35 | 1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 19 unchanged lines hidden (view full) --- 28 * Authors: Steve Reinhardt 29 */ 30 31#ifndef __BASE_FENV_HH__ 32#define __BASE_FENV_HH__ 33 34#include "config/use_fenv.hh" 35 |
36#if USE_FENV | 36#define M5_FE_DOWNWARD 0 37#define M5_FE_TONEAREST 1 38#define M5_FE_TOWARDZERO 2 39#define M5_FE_UPWARD 3 |
37 | 40 |
38#include <fenv.h> 39 | 41#if USE_FENV 42extern "C" { 43void m5_fesetround(int rm); 44int m5_fegetround(); 45} |
40#else 41 42// Dummy definitions to allow code to compile w/o a real <fenv.h>. | 46#else 47 48// Dummy definitions to allow code to compile w/o a real <fenv.h>. |
49inline void m5_fesetround(int rm) { ; } 50inline int m5_fegetround() {return 0; } |
|
43 | 51 |
44#define FE_TONEAREST 0 45#define FE_DOWNWARD 0 46#define FE_UPWARD 0 47#define FE_TOWARDZERO 0 48 49inline int fesetround(int rounding_mode) { return 0; } 50 | |
51#endif // USE_FENV 52 53 54#endif // __BASE_FENV_HH__ | 52#endif // USE_FENV 53 54 55#endif // __BASE_FENV_HH__ |