root/kernel/FPU-emu/fpu_arith.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. fadd__
  2. fmul__
  3. fsub__
  4. fsubr_
  5. fdiv__
  6. fdivr_
  7. fadd_i
  8. fmul_i
  9. fsubri
  10. fsub_i
  11. fdivri
  12. fdiv_i
  13. faddp_
  14. fmulp_
  15. fsubrp
  16. fsubp_
  17. fdivrp
  18. fdivp_

   1 /*---------------------------------------------------------------------------+
   2  |  fpu_arith.c                                                              |
   3  |                                                                           |
   4  | Code to implement the FPU register/register arithmetic instructions       |
   5  |                                                                           |
   6  | Copyright (C) 1992,1993                                                   |
   7  |                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,      |
   8  |                       Australia.  E-mail apm233m@vaxc.cc.monash.edu.au    |
   9  |                                                                           |
  10  |                                                                           |
  11  +---------------------------------------------------------------------------*/
  12 
  13 #include "fpu_system.h"
  14 #include "fpu_emu.h"
  15 #include "control_w.h"
  16 
  17 
  18 void fadd__()
     /* [previous][next][first][last][top][bottom][index][help] */
  19 {
  20   /* fadd st,st(i) */
  21   reg_add(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr);
  22   PRECISION_ADJUST(FPU_st0_ptr);
  23 }
  24 
  25 
  26 void fmul__()
     /* [previous][next][first][last][top][bottom][index][help] */
  27 {
  28   /* fmul st,st(i) */
  29   reg_mul(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr);
  30   PRECISION_ADJUST(FPU_st0_ptr);
  31 }
  32 
  33 
  34 
  35 void fsub__()
     /* [previous][next][first][last][top][bottom][index][help] */
  36 {
  37   /* fsub st,st(i) */
  38   reg_sub(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr);
  39   PRECISION_ADJUST(FPU_st0_ptr);
  40 }
  41 
  42 
  43 void fsubr_()
     /* [previous][next][first][last][top][bottom][index][help] */
  44 {
  45   /* fsubr st,st(i) */
  46   reg_sub(&st(FPU_rm), FPU_st0_ptr, FPU_st0_ptr);
  47   PRECISION_ADJUST(FPU_st0_ptr);
  48 }
  49 
  50 
  51 void fdiv__()
     /* [previous][next][first][last][top][bottom][index][help] */
  52 {
  53   /* fdiv st,st(i) */
  54   reg_div(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr);
  55   PRECISION_ADJUST(FPU_st0_ptr);
  56 }
  57 
  58 
  59 void fdivr_()
     /* [previous][next][first][last][top][bottom][index][help] */
  60 {
  61   /* fdivr st,st(i) */
  62   reg_div(&st(FPU_rm), FPU_st0_ptr, FPU_st0_ptr);
  63   PRECISION_ADJUST(FPU_st0_ptr);
  64 }
  65 
  66 
  67 
  68 void fadd_i()
     /* [previous][next][first][last][top][bottom][index][help] */
  69 {
  70   /* fadd st(i),st */
  71   reg_add(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm));
  72   PRECISION_ADJUST(&st(FPU_rm));
  73 }
  74 
  75 
  76 void fmul_i()
     /* [previous][next][first][last][top][bottom][index][help] */
  77 {
  78   /* fmul st(i),st */
  79   reg_mul(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm));
  80   PRECISION_ADJUST(&st(FPU_rm));
  81 }
  82 
  83 
  84 void fsubri()
     /* [previous][next][first][last][top][bottom][index][help] */
  85 {
  86   /* fsubr st(i),st */
  87   /* This is the sense of the 80486 manual
  88      reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm)); */
  89   reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm));
  90   PRECISION_ADJUST(&st(FPU_rm));
  91 }
  92 
  93 
  94 void fsub_i()
     /* [previous][next][first][last][top][bottom][index][help] */
  95 {
  96   /* fsub st(i),st */
  97   /* This is the sense of the 80486 manual
  98      reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm)); */
  99   reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm));
 100   PRECISION_ADJUST(&st(FPU_rm));
 101 }
 102 
 103 
 104 void fdivri()
     /* [previous][next][first][last][top][bottom][index][help] */
 105 {
 106   /* fdivr st(i),st */
 107   reg_div(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm));
 108   PRECISION_ADJUST(&st(FPU_rm));
 109 }
 110 
 111 
 112 void fdiv_i()
     /* [previous][next][first][last][top][bottom][index][help] */
 113 {
 114   /* fdiv st(i),st */
 115   reg_div(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm));
 116   PRECISION_ADJUST(&st(FPU_rm));
 117 }
 118 
 119 
 120 
 121 void faddp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 122 {
 123   /* faddp st(i),st */
 124   reg_add(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm));
 125   PRECISION_ADJUST(&st(FPU_rm));
 126   pop();
 127 }
 128 
 129 
 130 void fmulp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 131 {
 132   /* fmulp st(i),st */
 133   reg_mul(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm));
 134   PRECISION_ADJUST(&st(FPU_rm));
 135   pop();
 136 }
 137 
 138 
 139 
 140 void fsubrp()
     /* [previous][next][first][last][top][bottom][index][help] */
 141 {
 142   /* fsubrp st(i),st */
 143   /* This is the sense of the 80486 manual
 144      reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm)); */
 145   reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm));
 146   PRECISION_ADJUST(&st(FPU_rm));
 147   pop();
 148 }
 149 
 150 
 151 void fsubp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 152 {
 153   /* fsubp st(i),st */
 154   /* This is the sense of the 80486 manual
 155      reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm)); */
 156   reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm));
 157   PRECISION_ADJUST(&st(FPU_rm));
 158   pop();
 159 }
 160 
 161 
 162 void fdivrp()
     /* [previous][next][first][last][top][bottom][index][help] */
 163 {
 164   /* fdivrp st(i),st */
 165   reg_div(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm));
 166   PRECISION_ADJUST(&st(FPU_rm));
 167   pop();
 168 }
 169 
 170 
 171 void fdivp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 172 {
 173   /* fdivp st(i),st */
 174   reg_div(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm));
 175   PRECISION_ADJUST(&st(FPU_rm));
 176   pop();
 177 }
 178 

/* [previous][next][first][last][top][bottom][index][help] */