Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
fpu_emu.h File Reference
#include "fpu_system.h"
#include <asm/sigcontext.h>
#include <asm/math_emu.h>
#include <linux/linkage.h>
#include "fpu_proto.h"

Go to the source code of this file.

Data Structures

struct  address
 
struct  fpu__reg
 
struct  overrides
 
struct  fpu_addr_modes
 

Macros

#define PECULIAR_486
 
#define Const(x)   x
 
#define EXP_BIAS   Const(0)
 
#define EXP_OVER   Const(0x4000) /* smallest invalid large exponent */
 
#define EXP_UNDER   Const(-0x3fff) /* largest invalid small exponent */
 
#define EXP_WAY_UNDER
 
#define EXP_Infinity   EXP_OVER
 
#define EXP_NaN   EXP_OVER
 
#define EXTENDED_Ebias   Const(0x3fff)
 
#define EXTENDED_Emin   (-0x3ffe) /* smallest valid exponent */
 
#define SIGN_POS   Const(0)
 
#define SIGN_NEG   Const(0x80)
 
#define SIGN_Positive   Const(0)
 
#define SIGN_Negative   Const(0x8000)
 
#define TW_Denormal   Const(4) /* De-normal */
 
#define TW_Infinity   Const(5) /* + or - infinity */
 
#define TW_NaN   Const(6) /* Not a Number */
 
#define TW_Unsupported   Const(7) /* Not supported by an 80486 */
 
#define TAG_Valid   Const(0) /* valid */
 
#define TAG_Zero   Const(1) /* zero */
 
#define TAG_Special
 
#define TAG_Empty   Const(3) /* empty */
 
#define TAG_Error   Const(0x80) /* probably need to abort */
 
#define LOADED_DATA
 
#define REV   0x10
 
#define DEST_RM   0x20
 
#define LOADED   0x40
 
#define FPU_Exception   Const(0x80000000) /* Added to tag returns. */
 
#define RE_ENTRANT_CHECK_OFF
 
#define RE_ENTRANT_CHECK_ON
 
#define FWAIT_OPCODE   0x9b
 
#define OP_SIZE_PREFIX   0x66
 
#define ADDR_SIZE_PREFIX   0x67
 
#define PREFIX_CS   0x2e
 
#define PREFIX_DS   0x3e
 
#define PREFIX_ES   0x26
 
#define PREFIX_SS   0x36
 
#define PREFIX_FS   0x64
 
#define PREFIX_GS   0x65
 
#define PREFIX_REPE   0xf3
 
#define PREFIX_REPNE   0xf2
 
#define PREFIX_LOCK   0xf0
 
#define PREFIX_CS_   1
 
#define PREFIX_DS_   2
 
#define PREFIX_ES_   3
 
#define PREFIX_FS_   4
 
#define PREFIX_GS_   5
 
#define PREFIX_SS_   6
 
#define PREFIX_DEFAULT   7
 
#define PROTECTED   4
 
#define SIXTEEN   1 /* We rely upon this being 1 (true) */
 
#define VM86   SIXTEEN
 
#define PM16   (SIXTEEN | PROTECTED)
 
#define SEG32   PROTECTED
 
#define register_base   ((u_char *) registers )
 
#define fpu_register(x)   ( * ((FPU_REG *)( register_base + 10 * (x & 7) )) )
 
#define st(x)   ( * ((FPU_REG *)( register_base + 10 * ((top+x) & 7) )) )
 
#define STACK_OVERFLOW   (FPU_stackoverflow(&st_new_ptr))
 
#define NOT_EMPTY(i)   (!FPU_empty_i(i))
 
#define NOT_EMPTY_ST0   (st0_tag ^ TAG_Empty)
 
#define poppop()   { FPU_pop(); FPU_pop(); }
 
#define push()   { top--; }
 
#define signbyte(a)   (((u_char *)(a))[9])
 
#define getsign(a)   (signbyte(a) & 0x80)
 
#define setsign(a, b)   { if (b) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; }
 
#define copysign(a, b)
 
#define changesign(a)   { signbyte(a) ^= 0x80; }
 
#define setpositive(a)   { signbyte(a) &= 0x7f; }
 
#define setnegative(a)   { signbyte(a) |= 0x80; }
 
#define signpositive(a)   ( (signbyte(a) & 0x80) == 0 )
 
#define signnegative(a)   (signbyte(a) & 0x80)
 
#define exponent(x)   (((*(short *)&((x)->exp)) & 0x7fff) - EXTENDED_Ebias)
 
#define setexponentpos(x, y)
 
#define exponent16(x)   (*(short *)&((x)->exp))
 
#define setexponent16(x, y)   { (*(short *)&((x)->exp)) = (y); }
 
#define addexponent(x, y)   { (*(short *)&((x)->exp)) += (y); }
 
#define stdexp(x)   { (*(short *)&((x)->exp)) += EXTENDED_Ebias; }
 
#define isdenormal(ptr)   (exponent(ptr) == EXP_BIAS+EXP_UNDER)
 
#define significand(x)   ( ((unsigned long long *)&((x)->sigl))[0] )
 

Typedefs

typedef void(* FUNC )(void)
 
typedef struct fpu__reg FPU_REG
 
typedef void(* FUNC_ST0 )(FPU_REG *st0_ptr, u_char st0_tag)
 

Functions

asmlinkage int FPU_normalize (FPU_REG *x)
 
asmlinkage int FPU_normalize_nuo (FPU_REG *x)
 
asmlinkage int FPU_u_sub (FPU_REG const *arg1, FPU_REG const *arg2, FPU_REG *answ, unsigned int control_w, u_char sign, int expa, int expb)
 
asmlinkage int FPU_u_mul (FPU_REG const *arg1, FPU_REG const *arg2, FPU_REG *answ, unsigned int control_w, u_char sign, int expon)
 
asmlinkage int FPU_u_div (FPU_REG const *arg1, FPU_REG const *arg2, FPU_REG *answ, unsigned int control_w, u_char sign)
 
asmlinkage int FPU_u_add (FPU_REG const *arg1, FPU_REG const *arg2, FPU_REG *answ, unsigned int control_w, u_char sign, int expa, int expb)
 
asmlinkage int wm_sqrt (FPU_REG *n, int dummy1, int dummy2, unsigned int control_w, u_char sign)
 
asmlinkage unsigned FPU_shrx (void *l, unsigned x)
 
asmlinkage unsigned FPU_shrxs (void *v, unsigned x)
 
asmlinkage unsigned long FPU_div_small (unsigned long long *x, unsigned long y)
 
asmlinkage int FPU_round (FPU_REG *arg, unsigned int extent, int dummy, unsigned int control_w, u_char sign)
 

Variables

u_char const data_sizes_16 [32]
 

Macro Definition Documentation

#define addexponent (   x,
  y 
)    { (*(short *)&((x)->exp)) += (y); }

Definition at line 177 of file fpu_emu.h.

#define ADDR_SIZE_PREFIX   0x67

Definition at line 90 of file fpu_emu.h.

#define changesign (   a)    { signbyte(a) ^= 0x80; }

Definition at line 160 of file fpu_emu.h.

#define Const (   x)    x

Definition at line 26 of file fpu_emu.h.

#define copysign (   a,
  b 
)
Value:
{ if (getsign(a)) signbyte(b) |= 0x80; \
else signbyte(b) &= 0x7f; }

Definition at line 158 of file fpu_emu.h.

#define DEST_RM   0x20

Definition at line 62 of file fpu_emu.h.

#define EXP_BIAS   Const(0)

Definition at line 29 of file fpu_emu.h.

#define EXP_Infinity   EXP_OVER

Definition at line 33 of file fpu_emu.h.

#define EXP_NaN   EXP_OVER

Definition at line 34 of file fpu_emu.h.

#define EXP_OVER   Const(0x4000) /* smallest invalid large exponent */

Definition at line 30 of file fpu_emu.h.

#define EXP_UNDER   Const(-0x3fff) /* largest invalid small exponent */

Definition at line 31 of file fpu_emu.h.

#define EXP_WAY_UNDER
Value:
Const(-0x6000) /* Below the smallest denormal, but
still a 16 bit nr. */

Definition at line 32 of file fpu_emu.h.

#define exponent (   x)    (((*(short *)&((x)->exp)) & 0x7fff) - EXTENDED_Ebias)

Definition at line 172 of file fpu_emu.h.

#define exponent16 (   x)    (*(short *)&((x)->exp))

Definition at line 175 of file fpu_emu.h.

#define EXTENDED_Ebias   Const(0x3fff)

Definition at line 36 of file fpu_emu.h.

#define EXTENDED_Emin   (-0x3ffe) /* smallest valid exponent */

Definition at line 37 of file fpu_emu.h.

#define FPU_Exception   Const(0x80000000) /* Added to tag returns. */

Definition at line 65 of file fpu_emu.h.

#define fpu_register (   x)    ( * ((FPU_REG *)( register_base + 10 * (x & 7) )) )

Definition at line 142 of file fpu_emu.h.

#define FWAIT_OPCODE   0x9b

Definition at line 88 of file fpu_emu.h.

#define getsign (   a)    (signbyte(a) & 0x80)

Definition at line 156 of file fpu_emu.h.

#define isdenormal (   ptr)    (exponent(ptr) == EXP_BIAS+EXP_UNDER)

Definition at line 180 of file fpu_emu.h.

#define LOADED   0x40

Definition at line 63 of file fpu_emu.h.

#define LOADED_DATA
Value:
Const(10101) /* Special st() number to identify
loaded data (not on stack). */

Definition at line 58 of file fpu_emu.h.

#define NOT_EMPTY (   i)    (!FPU_empty_i(i))

Definition at line 146 of file fpu_emu.h.

#define NOT_EMPTY_ST0   (st0_tag ^ TAG_Empty)

Definition at line 148 of file fpu_emu.h.

#define OP_SIZE_PREFIX   0x66

Definition at line 89 of file fpu_emu.h.

#define PECULIAR_486

Definition at line 20 of file fpu_emu.h.

#define PM16   (SIXTEEN | PROTECTED)

Definition at line 137 of file fpu_emu.h.

#define poppop ( )    { FPU_pop(); FPU_pop(); }

Definition at line 150 of file fpu_emu.h.

#define PREFIX_CS   0x2e

Definition at line 91 of file fpu_emu.h.

#define PREFIX_CS_   1

Definition at line 100 of file fpu_emu.h.

#define PREFIX_DEFAULT   7

Definition at line 106 of file fpu_emu.h.

#define PREFIX_DS   0x3e

Definition at line 92 of file fpu_emu.h.

#define PREFIX_DS_   2

Definition at line 101 of file fpu_emu.h.

#define PREFIX_ES   0x26

Definition at line 93 of file fpu_emu.h.

#define PREFIX_ES_   3

Definition at line 102 of file fpu_emu.h.

#define PREFIX_FS   0x64

Definition at line 95 of file fpu_emu.h.

#define PREFIX_FS_   4

Definition at line 103 of file fpu_emu.h.

#define PREFIX_GS   0x65

Definition at line 96 of file fpu_emu.h.

#define PREFIX_GS_   5

Definition at line 104 of file fpu_emu.h.

#define PREFIX_LOCK   0xf0

Definition at line 99 of file fpu_emu.h.

#define PREFIX_REPE   0xf3

Definition at line 97 of file fpu_emu.h.

#define PREFIX_REPNE   0xf2

Definition at line 98 of file fpu_emu.h.

#define PREFIX_SS   0x36

Definition at line 94 of file fpu_emu.h.

#define PREFIX_SS_   6

Definition at line 105 of file fpu_emu.h.

#define PROTECTED   4

Definition at line 134 of file fpu_emu.h.

#define push ( )    { top--; }

Definition at line 153 of file fpu_emu.h.

#define RE_ENTRANT_CHECK_OFF

Definition at line 84 of file fpu_emu.h.

#define RE_ENTRANT_CHECK_ON

Definition at line 85 of file fpu_emu.h.

#define register_base   ((u_char *) registers )

Definition at line 141 of file fpu_emu.h.

#define REV   0x10

Definition at line 61 of file fpu_emu.h.

#define SEG32   PROTECTED

Definition at line 138 of file fpu_emu.h.

#define setexponent16 (   x,
  y 
)    { (*(short *)&((x)->exp)) = (y); }

Definition at line 176 of file fpu_emu.h.

#define setexponentpos (   x,
  y 
)
Value:
{ (*(short *)&((x)->exp)) = \
((y) + EXTENDED_Ebias) & 0x7fff; }

Definition at line 173 of file fpu_emu.h.

#define setnegative (   a)    { signbyte(a) |= 0x80; }

Definition at line 162 of file fpu_emu.h.

#define setpositive (   a)    { signbyte(a) &= 0x7f; }

Definition at line 161 of file fpu_emu.h.

#define setsign (   a,
  b 
)    { if (b) signbyte(a) |= 0x80; else signbyte(a) &= 0x7f; }

Definition at line 157 of file fpu_emu.h.

#define SIGN_NEG   Const(0x80)

Definition at line 40 of file fpu_emu.h.

#define SIGN_Negative   Const(0x8000)

Definition at line 43 of file fpu_emu.h.

#define SIGN_POS   Const(0)

Definition at line 39 of file fpu_emu.h.

#define SIGN_Positive   Const(0)

Definition at line 42 of file fpu_emu.h.

#define signbyte (   a)    (((u_char *)(a))[9])

Definition at line 155 of file fpu_emu.h.

#define significand (   x)    ( ((unsigned long long *)&((x)->sigl))[0] )

Definition at line 182 of file fpu_emu.h.

#define signnegative (   a)    (signbyte(a) & 0x80)

Definition at line 164 of file fpu_emu.h.

#define signpositive (   a)    ( (signbyte(a) & 0x80) == 0 )

Definition at line 163 of file fpu_emu.h.

#define SIXTEEN   1 /* We rely upon this being 1 (true) */

Definition at line 135 of file fpu_emu.h.

#define st (   x)    ( * ((FPU_REG *)( register_base + 10 * ((top+x) & 7) )) )

Definition at line 143 of file fpu_emu.h.

#define STACK_OVERFLOW   (FPU_stackoverflow(&st_new_ptr))

Definition at line 145 of file fpu_emu.h.

#define stdexp (   x)    { (*(short *)&((x)->exp)) += EXTENDED_Ebias; }

Definition at line 178 of file fpu_emu.h.

#define TAG_Empty   Const(3) /* empty */

Definition at line 55 of file fpu_emu.h.

#define TAG_Error   Const(0x80) /* probably need to abort */

Definition at line 56 of file fpu_emu.h.

#define TAG_Special
Value:
Const(2) /* De-normal, + or - infinity,
or Not a Number */

Definition at line 54 of file fpu_emu.h.

#define TAG_Valid   Const(0) /* valid */

Definition at line 52 of file fpu_emu.h.

#define TAG_Zero   Const(1) /* zero */

Definition at line 53 of file fpu_emu.h.

#define TW_Denormal   Const(4) /* De-normal */

Definition at line 47 of file fpu_emu.h.

#define TW_Infinity   Const(5) /* + or - infinity */

Definition at line 48 of file fpu_emu.h.

#define TW_NaN   Const(6) /* Not a Number */

Definition at line 49 of file fpu_emu.h.

#define TW_Unsupported   Const(7) /* Not supported by an 80486 */

Definition at line 50 of file fpu_emu.h.

#define VM86   SIXTEEN

Definition at line 136 of file fpu_emu.h.

Typedef Documentation

Definition at line 121 of file fpu_emu.h.

typedef void(* FUNC)(void)

Definition at line 120 of file fpu_emu.h.

typedef void(* FUNC_ST0)(FPU_REG *st0_ptr, u_char st0_tag)

Definition at line 122 of file fpu_emu.h.

Function Documentation

asmlinkage unsigned long FPU_div_small ( unsigned long long x,
unsigned long  y 
)
asmlinkage int FPU_normalize ( FPU_REG x)
asmlinkage int FPU_normalize_nuo ( FPU_REG x)
asmlinkage int FPU_round ( FPU_REG arg,
unsigned int  extent,
int  dummy,
unsigned int  control_w,
u_char  sign 
)
asmlinkage unsigned FPU_shrx ( void l,
unsigned  x 
)
asmlinkage unsigned FPU_shrxs ( void v,
unsigned  x 
)
asmlinkage int FPU_u_add ( FPU_REG const arg1,
FPU_REG const arg2,
FPU_REG answ,
unsigned int  control_w,
u_char  sign,
int  expa,
int  expb 
)
asmlinkage int FPU_u_div ( FPU_REG const arg1,
FPU_REG const arg2,
FPU_REG answ,
unsigned int  control_w,
u_char  sign 
)
asmlinkage int FPU_u_mul ( FPU_REG const arg1,
FPU_REG const arg2,
FPU_REG answ,
unsigned int  control_w,
u_char  sign,
int  expon 
)
asmlinkage int FPU_u_sub ( FPU_REG const arg1,
FPU_REG const arg2,
FPU_REG answ,
unsigned int  control_w,
u_char  sign,
int  expa,
int  expb 
)
asmlinkage int wm_sqrt ( FPU_REG n,
int  dummy1,
int  dummy2,
unsigned int  control_w,
u_char  sign 
)

Variable Documentation

u_char const data_sizes_16[32]

Definition at line 47 of file load_store.c.