Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*---------------------------------------------------------------------------+
0003  |  control_w.h                                                              |
0004  |                                                                           |
0005  | Copyright (C) 1992,1993                                                   |
0006  |                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,      |
0007  |                       Australia.  E-mail   billm@vaxc.cc.monash.edu.au    |
0008  |                                                                           |
0009  +---------------------------------------------------------------------------*/
0010 
0011 #ifndef _CONTROLW_H_
0012 #define _CONTROLW_H_
0013 
0014 #ifdef __ASSEMBLY__
0015 #define _Const_(x)  $##x
0016 #else
0017 #define _Const_(x)  x
0018 #endif
0019 
0020 #define CW_RC       _Const_(0x0C00) /* rounding control */
0021 #define CW_PC       _Const_(0x0300) /* precision control */
0022 
0023 #define CW_Precision    Const_(0x0020)  /* loss of precision mask */
0024 #define CW_Underflow    Const_(0x0010)  /* underflow mask */
0025 #define CW_Overflow Const_(0x0008)  /* overflow mask */
0026 #define CW_ZeroDiv  Const_(0x0004)  /* divide by zero mask */
0027 #define CW_Denormal Const_(0x0002)  /* denormalized operand mask */
0028 #define CW_Invalid  Const_(0x0001)  /* invalid operation mask */
0029 
0030 #define CW_Exceptions   _Const_(0x003f) /* all masks */
0031 
0032 #define RC_RND      _Const_(0x0000)
0033 #define RC_DOWN     _Const_(0x0400)
0034 #define RC_UP       _Const_(0x0800)
0035 #define RC_CHOP     _Const_(0x0C00)
0036 
0037 /* p 15-5: Precision control bits affect only the following:
0038    ADD, SUB(R), MUL, DIV(R), and SQRT */
0039 #define PR_24_BITS        _Const_(0x000)
0040 #define PR_53_BITS        _Const_(0x200)
0041 #define PR_64_BITS        _Const_(0x300)
0042 #define PR_RESERVED_BITS  _Const_(0x100)
0043 /* FULL_PRECISION simulates all exceptions masked */
0044 #define FULL_PRECISION  (PR_64_BITS | RC_RND | 0x3f)
0045 
0046 #endif /* _CONTROLW_H_ */