| |
| /* |
| * Copyright (C) 2008-2009 Advanced Micro Devices, Inc. All Rights Reserved. |
| * |
| * This file is part of libacml_mv. |
| * |
| * libacml_mv is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU Lesser General Public |
| * License as published by the Free Software Foundation; either |
| * version 2.1 of the License, or (at your option) any later version. |
| * |
| * libacml_mv is distributed in the hope that it will be useful, |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| * Lesser General Public License for more details. |
| * |
| * You should have received a copy of the GNU Lesser General Public |
| * License along with libacml_mv. If not, see |
| * <http://www.gnu.org/licenses/>. |
| * |
| */ |
| |
| |
| #ifndef __LIBM_SPECIAL_H__ |
| #define __LIBM_SPECIAL_H__ |
| |
| // exception status set |
| #define MXCSR_ES_INEXACT 0x00000020 |
| #define MXCSR_ES_UNDERFLOW 0x00000010 |
| #define MXCSR_ES_OVERFLOW 0x00000008 |
| #define MXCSR_ES_DIVBYZERO 0x00000004 |
| #define MXCSR_ES_INVALID 0x00000001 |
| |
| void __amd_handle_errorf(int type, int error, const char *name, |
| float arg1, unsigned int arg1_is_snan, |
| float arg2, unsigned int arg2_is_snan, |
| float retval, unsigned int retval_is_snan); |
| |
| void __amd_handle_error(int type, int error, const char *name, |
| double arg1, |
| double arg2, |
| double retval); |
| |
| /* Code from GRTE/v4 math.h */ |
| /* Types of exceptions in the `type' field. */ |
| #ifndef DOMAIN |
| struct exception |
| { |
| int type; |
| char *name; |
| double arg1; |
| double arg2; |
| double retval; |
| }; |
| |
| extern int matherr (struct exception *__exc); |
| |
| # define X_TLOSS 1.41484755040568800000e+16 |
| |
| /* Types of exceptions in the `type' field. */ |
| # define DOMAIN 1 |
| # define SING 2 |
| # define OVERFLOW 3 |
| # define UNDERFLOW 4 |
| # define TLOSS 5 |
| # define PLOSS 6 |
| |
| /* SVID mode specifies returning this large value instead of infinity. */ |
| # define HUGE 3.40282347e+38F |
| |
| /* Use this define to enable a (dummy) definition of matherr(). */ |
| #define NEED_FAKE_MATHERR |
| |
| #else /* !SVID */ |
| |
| # ifdef __USE_XOPEN |
| /* X/Open wants another strange constant. */ |
| # define MAXFLOAT 3.40282347e+38F |
| # endif |
| |
| #endif /* DOMAIN */ |
| /* Code from GRTE/v4 math.h */ |
| |
| #endif // __LIBM_SPECIAL_H__ |