Print this page
10495 libc should know how many FPU exceptions there are


  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #ifndef _SYS_IEEEFP_H
  28 #define _SYS_IEEEFP_H
  29 
  30 #pragma ident   "%Z%%M% %I%     %E% SMI"        /* SunOS4.0 1.6 */
  31 
  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 /*
  37  * Sun types for IEEE floating point.
  38  */
  39 
  40 #if defined(__sparc)
  41 
  42 enum fp_direction_type {        /* rounding direction */
  43         fp_nearest      = 0,
  44         fp_tozero       = 1,
  45         fp_positive     = 2,
  46         fp_negative     = 3
  47 };
  48 
  49 enum fp_precision_type {        /* extended rounding precision */
  50         fp_extended     = 0,
  51         fp_single       = 1,
  52         fp_double       = 2,
  53         fp_precision_3  = 3
  54 };
  55 
  56 enum fp_exception_type {        /* exceptions according to bit number */
  57         fp_inexact      = 0,
  58         fp_division     = 1,
  59         fp_underflow    = 2,
  60         fp_overflow     = 3,
  61         fp_invalid      = 4
  62 };

  63 
  64 enum fp_trap_enable_type {      /* trap enable bits according to bit number */
  65         fp_trap_inexact = 0,
  66         fp_trap_division        = 1,
  67         fp_trap_underflow       = 2,
  68         fp_trap_overflow        = 3,
  69         fp_trap_invalid = 4
  70 };
  71 
  72 #elif defined(__i386) || defined(__amd64)
  73 
  74 enum fp_direction_type {        /* rounding direction */
  75         fp_nearest      = 0,
  76         fp_negative     = 1,
  77         fp_positive     = 2,
  78         fp_tozero       = 3
  79 };
  80 
  81 enum fp_precision_type {        /* extended rounding precision */
  82         fp_single       = 0,
  83         fp_precision_3  = 1,
  84         fp_double       = 2,
  85         fp_extended     = 3
  86 };
  87 
  88 enum fp_exception_type {        /* exceptions according to bit number */
  89         fp_invalid      = 0,
  90         fp_denormalized = 1,
  91         fp_division     = 2,
  92         fp_overflow     = 3,
  93         fp_underflow    = 4,
  94         fp_inexact      = 5
  95 };

  96 
  97 enum fp_trap_enable_type {      /* trap enable bits according to bit number */
  98         fp_trap_invalid = 0,
  99         fp_trap_denormalized    = 1,
 100         fp_trap_division        = 2,
 101         fp_trap_overflow        = 3,
 102         fp_trap_underflow       = 4,
 103         fp_trap_inexact = 5
 104 };
 105 
 106 #endif  /* __i386 || __amd64 */
 107 
 108 enum fp_class_type {            /* floating-point classes */
 109         fp_zero         = 0,
 110         fp_subnormal    = 1,
 111         fp_normal       = 2,
 112         fp_infinity     = 3,
 113         fp_quiet        = 4,
 114         fp_signaling    = 5
 115 };


  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #ifndef _SYS_IEEEFP_H
  28 #define _SYS_IEEEFP_H
  29 


  30 #ifdef  __cplusplus
  31 extern "C" {
  32 #endif
  33 
  34 /*
  35  * Sun types for IEEE floating point.
  36  */
  37 
  38 #if defined(__sparc)
  39 
  40 enum fp_direction_type {        /* rounding direction */
  41         fp_nearest      = 0,
  42         fp_tozero       = 1,
  43         fp_positive     = 2,
  44         fp_negative     = 3
  45 };
  46 
  47 enum fp_precision_type {        /* extended rounding precision */
  48         fp_extended     = 0,
  49         fp_single       = 1,
  50         fp_double       = 2,
  51         fp_precision_3  = 3
  52 };
  53 
  54 enum fp_exception_type {        /* exceptions according to bit number */
  55         fp_inexact      = 0,
  56         fp_division     = 1,
  57         fp_underflow    = 2,
  58         fp_overflow     = 3,
  59         fp_invalid      = 4
  60 };
  61 #define N_IEEE_EXCEPTION 5      /* Number of floating-point exceptions. */
  62 
  63 enum fp_trap_enable_type {      /* trap enable bits according to bit number */
  64         fp_trap_inexact = 0,
  65         fp_trap_division        = 1,
  66         fp_trap_underflow       = 2,
  67         fp_trap_overflow        = 3,
  68         fp_trap_invalid = 4
  69 };
  70 
  71 #elif defined(__i386) || defined(__amd64)
  72 
  73 enum fp_direction_type {        /* rounding direction */
  74         fp_nearest      = 0,
  75         fp_negative     = 1,
  76         fp_positive     = 2,
  77         fp_tozero       = 3
  78 };
  79 
  80 enum fp_precision_type {        /* extended rounding precision */
  81         fp_single       = 0,
  82         fp_precision_3  = 1,
  83         fp_double       = 2,
  84         fp_extended     = 3
  85 };
  86 
  87 enum fp_exception_type {        /* exceptions according to bit number */
  88         fp_invalid      = 0,
  89         fp_denormalized = 1,
  90         fp_division     = 2,
  91         fp_overflow     = 3,
  92         fp_underflow    = 4,
  93         fp_inexact      = 5
  94 };
  95 #define N_IEEE_EXCEPTION 6      /* Number of floating-point exceptions. */
  96 
  97 enum fp_trap_enable_type {      /* trap enable bits according to bit number */
  98         fp_trap_invalid = 0,
  99         fp_trap_denormalized    = 1,
 100         fp_trap_division        = 2,
 101         fp_trap_overflow        = 3,
 102         fp_trap_underflow       = 4,
 103         fp_trap_inexact = 5
 104 };
 105 
 106 #endif  /* __i386 || __amd64 */
 107 
 108 enum fp_class_type {            /* floating-point classes */
 109         fp_zero         = 0,
 110         fp_subnormal    = 1,
 111         fp_normal       = 2,
 112         fp_infinity     = 3,
 113         fp_quiet        = 4,
 114         fp_signaling    = 5
 115 };