11858SN/A/* 21858SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 31858SN/A * All rights reserved. 41858SN/A * 51858SN/A * Redistribution and use in source and binary forms, with or without 61858SN/A * modification, are permitted provided that the following conditions are 71858SN/A * met: redistributions of source code must retain the above copyright 81858SN/A * notice, this list of conditions and the following disclaimer; 91858SN/A * redistributions in binary form must reproduce the above copyright 101858SN/A * notice, this list of conditions and the following disclaimer in the 111858SN/A * documentation and/or other materials provided with the distribution; 121858SN/A * neither the name of the copyright holders nor the names of its 131858SN/A * contributors may be used to endorse or promote products derived from 141858SN/A * this software without specific prior written permission. 151858SN/A * 161858SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 171858SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 181858SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 191858SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 201858SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 211858SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 221858SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 231858SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 241858SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 251858SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 261858SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Steve Reinhardt 291858SN/A */ 301858SN/A 311858SN/A#ifndef __BASE_FENV_HH__ 321858SN/A#define __BASE_FENV_HH__ 331858SN/A 341858SN/A#include "config/use_fenv.hh" 351858SN/A 364394Ssaidi@eecs.umich.edu#define M5_FE_DOWNWARD 0 374394Ssaidi@eecs.umich.edu#define M5_FE_TONEAREST 1 384394Ssaidi@eecs.umich.edu#define M5_FE_TOWARDZERO 2 394394Ssaidi@eecs.umich.edu#define M5_FE_UPWARD 3 404394Ssaidi@eecs.umich.edu 411858SN/A#if USE_FENV 424394Ssaidi@eecs.umich.eduextern "C" { 434394Ssaidi@eecs.umich.eduvoid m5_fesetround(int rm); 444394Ssaidi@eecs.umich.eduint m5_fegetround(); 454394Ssaidi@eecs.umich.edu} 461858SN/A#else 471858SN/A 481858SN/A// Dummy definitions to allow code to compile w/o a real <fenv.h>. 494394Ssaidi@eecs.umich.eduinline void m5_fesetround(int rm) { ; } 504394Ssaidi@eecs.umich.eduinline int m5_fegetround() {return 0; } 511858SN/A 521858SN/A#endif // USE_FENV 531858SN/A 541858SN/A 551858SN/A#endif // __BASE_FENV_HH__ 56