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 #include "status_w.h"
  17 
  18 
  19 void fadd__()
     /* [previous][next][first][last][top][bottom][index][help] */
  20 {
  21   /* fadd st,st(i) */
  22 #ifdef PECULIAR_486
  23   /* Default, this conveys no information, but an 80486 does it. */
  24   clear_C1();
  25 #endif PECULIAR_486
  26   reg_add(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr, control_word);
  27 }
  28 
  29 
  30 void fmul__()
     /* [previous][next][first][last][top][bottom][index][help] */
  31 {
  32   /* fmul st,st(i) */
  33 #ifdef PECULIAR_486
  34   /* Default, this conveys no information, but an 80486 does it. */
  35   clear_C1();
  36 #endif PECULIAR_486
  37   reg_mul(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr, control_word);
  38 }
  39 
  40 
  41 
  42 void fsub__()
     /* [previous][next][first][last][top][bottom][index][help] */
  43 {
  44   /* fsub st,st(i) */
  45 #ifdef PECULIAR_486
  46   /* Default, this conveys no information, but an 80486 does it. */
  47   clear_C1();
  48 #endif PECULIAR_486
  49   reg_sub(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr, control_word);
  50 }
  51 
  52 
  53 void fsubr_()
     /* [previous][next][first][last][top][bottom][index][help] */
  54 {
  55   /* fsubr st,st(i) */
  56 #ifdef PECULIAR_486
  57   /* Default, this conveys no information, but an 80486 does it. */
  58   clear_C1();
  59 #endif PECULIAR_486
  60   reg_sub(&st(FPU_rm), FPU_st0_ptr, FPU_st0_ptr, control_word);
  61 }
  62 
  63 
  64 void fdiv__()
     /* [previous][next][first][last][top][bottom][index][help] */
  65 {
  66   /* fdiv st,st(i) */
  67 #ifdef PECULIAR_486
  68   /* Default, this conveys no information, but an 80486 does it. */
  69   clear_C1();
  70 #endif PECULIAR_486
  71   reg_div(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr, control_word);
  72 }
  73 
  74 
  75 void fdivr_()
     /* [previous][next][first][last][top][bottom][index][help] */
  76 {
  77   /* fdivr st,st(i) */
  78 #ifdef PECULIAR_486
  79   /* Default, this conveys no information, but an 80486 does it. */
  80   clear_C1();
  81 #endif PECULIAR_486
  82   reg_div(&st(FPU_rm), FPU_st0_ptr, FPU_st0_ptr, control_word);
  83 }
  84 
  85 
  86 
  87 void fadd_i()
     /* [previous][next][first][last][top][bottom][index][help] */
  88 {
  89   /* fadd st(i),st */
  90 #ifdef PECULIAR_486
  91   /* Default, this conveys no information, but an 80486 does it. */
  92   clear_C1();
  93 #endif PECULIAR_486
  94   reg_add(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
  95 }
  96 
  97 
  98 void fmul_i()
     /* [previous][next][first][last][top][bottom][index][help] */
  99 {
 100   /* fmul st(i),st */
 101 #ifdef PECULIAR_486
 102   /* Default, this conveys no information, but an 80486 does it. */
 103   clear_C1();
 104 #endif PECULIAR_486
 105   reg_mul(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
 106 }
 107 
 108 
 109 void fsubri()
     /* [previous][next][first][last][top][bottom][index][help] */
 110 {
 111   /* fsubr st(i),st */
 112   /* This is the sense of the 80486 manual
 113      reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word); */
 114 #ifdef PECULIAR_486
 115   /* Default, this conveys no information, but an 80486 does it. */
 116   clear_C1();
 117 #endif PECULIAR_486
 118   reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
 119 }
 120 
 121 
 122 void fsub_i()
     /* [previous][next][first][last][top][bottom][index][help] */
 123 {
 124   /* fsub st(i),st */
 125   /* This is the sense of the 80486 manual
 126      reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word); */
 127 #ifdef PECULIAR_486
 128   /* Default, this conveys no information, but an 80486 does it. */
 129   clear_C1();
 130 #endif PECULIAR_486
 131   reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word);
 132 }
 133 
 134 
 135 void fdivri()
     /* [previous][next][first][last][top][bottom][index][help] */
 136 {
 137   /* fdivr st(i),st */
 138 #ifdef PECULIAR_486
 139   /* Default, this conveys no information, but an 80486 does it. */
 140   clear_C1();
 141 #endif PECULIAR_486
 142   reg_div(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word);
 143 }
 144 
 145 
 146 void fdiv_i()
     /* [previous][next][first][last][top][bottom][index][help] */
 147 {
 148   /* fdiv st(i),st */
 149 #ifdef PECULIAR_486
 150   /* Default, this conveys no information, but an 80486 does it. */
 151   clear_C1();
 152 #endif PECULIAR_486
 153   reg_div(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word);
 154 }
 155 
 156 
 157 
 158 void faddp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 159 {
 160   /* faddp st(i),st */
 161 #ifdef PECULIAR_486
 162   /* Default, this conveys no information, but an 80486 does it. */
 163   clear_C1();
 164 #endif PECULIAR_486
 165   if ( !reg_add(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word) )
 166     pop();
 167 }
 168 
 169 
 170 void fmulp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 171 {
 172   /* fmulp st(i),st */
 173 #ifdef PECULIAR_486
 174   /* Default, this conveys no information, but an 80486 does it. */
 175   clear_C1();
 176 #endif PECULIAR_486
 177   if ( !reg_mul(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word) )
 178     pop();
 179 }
 180 
 181 
 182 
 183 void fsubrp()
     /* [previous][next][first][last][top][bottom][index][help] */
 184 {
 185   /* fsubrp st(i),st */
 186   /* This is the sense of the 80486 manual
 187      reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word); */
 188 #ifdef PECULIAR_486
 189   /* Default, this conveys no information, but an 80486 does it. */
 190   clear_C1();
 191 #endif PECULIAR_486
 192   if ( !reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word) )
 193     pop();
 194 }
 195 
 196 
 197 void fsubp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 198 {
 199   /* fsubp st(i),st */
 200   /* This is the sense of the 80486 manual
 201      reg_sub(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word); */
 202 #ifdef PECULIAR_486
 203   /* Default, this conveys no information, but an 80486 does it. */
 204   clear_C1();
 205 #endif PECULIAR_486
 206   if ( !reg_sub(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word) )
 207     pop();
 208 }
 209 
 210 
 211 void fdivrp()
     /* [previous][next][first][last][top][bottom][index][help] */
 212 {
 213   /* fdivrp st(i),st */
 214 #ifdef PECULIAR_486
 215   /* Default, this conveys no information, but an 80486 does it. */
 216   clear_C1();
 217 #endif PECULIAR_486
 218   if ( !reg_div(FPU_st0_ptr, &st(FPU_rm), &st(FPU_rm), control_word) )
 219     pop();
 220 }
 221 
 222 
 223 void fdivp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 224 {
 225   /* fdivp st(i),st */
 226 #ifdef PECULIAR_486
 227   /* Default, this conveys no information, but an 80486 does it. */
 228   clear_C1();
 229 #endif PECULIAR_486
 230   if ( !reg_div(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm), control_word) )
 231     pop();
 232 }
 233 

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