root/drivers/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   billm@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   clear_C1();
  23   reg_add(&st(0), &st(FPU_rm), &st(0), control_word);
  24 }
  25 
  26 
  27 void fmul__()
     /* [previous][next][first][last][top][bottom][index][help] */
  28 {
  29   /* fmul st,st(i) */
  30   clear_C1();
  31   reg_mul(&st(0), &st(FPU_rm), &st(0), control_word);
  32 }
  33 
  34 
  35 
  36 void fsub__()
     /* [previous][next][first][last][top][bottom][index][help] */
  37 {
  38   /* fsub st,st(i) */
  39   clear_C1();
  40   reg_sub(&st(0), &st(FPU_rm), &st(0), control_word);
  41 }
  42 
  43 
  44 void fsubr_()
     /* [previous][next][first][last][top][bottom][index][help] */
  45 {
  46   /* fsubr st,st(i) */
  47   clear_C1();
  48   reg_sub(&st(FPU_rm), &st(0), &st(0), control_word);
  49 }
  50 
  51 
  52 void fdiv__()
     /* [previous][next][first][last][top][bottom][index][help] */
  53 {
  54   /* fdiv st,st(i) */
  55   clear_C1();
  56   reg_div(&st(0), &st(FPU_rm), &st(0), control_word);
  57 }
  58 
  59 
  60 void fdivr_()
     /* [previous][next][first][last][top][bottom][index][help] */
  61 {
  62   /* fdivr st,st(i) */
  63   clear_C1();
  64   reg_div(&st(FPU_rm), &st(0), &st(0), control_word);
  65 }
  66 
  67 
  68 
  69 void fadd_i()
     /* [previous][next][first][last][top][bottom][index][help] */
  70 {
  71   /* fadd st(i),st */
  72   clear_C1();
  73   reg_add(&st(0), &st(FPU_rm), &st(FPU_rm), control_word);
  74 }
  75 
  76 
  77 void fmul_i()
     /* [previous][next][first][last][top][bottom][index][help] */
  78 {
  79   /* fmul st(i),st */
  80   clear_C1();
  81   reg_mul(&st(0), &st(FPU_rm), &st(FPU_rm), control_word);
  82 }
  83 
  84 
  85 void fsubri()
     /* [previous][next][first][last][top][bottom][index][help] */
  86 {
  87   /* fsubr st(i),st */
  88   /* This is the sense of the 80486 manual
  89      reg_sub(&st(FPU_rm), &st(0), &st(FPU_rm), control_word); */
  90   clear_C1();
  91   reg_sub(&st(0), &st(FPU_rm), &st(FPU_rm), control_word);
  92 }
  93 
  94 
  95 void fsub_i()
     /* [previous][next][first][last][top][bottom][index][help] */
  96 {
  97   /* fsub st(i),st */
  98   /* This is the sense of the 80486 manual
  99      reg_sub(&st(0), &st(FPU_rm), &st(FPU_rm), control_word); */
 100   clear_C1();
 101   reg_sub(&st(FPU_rm), &st(0), &st(FPU_rm), control_word);
 102 }
 103 
 104 
 105 void fdivri()
     /* [previous][next][first][last][top][bottom][index][help] */
 106 {
 107   /* fdivr st(i),st */
 108   clear_C1();
 109   reg_div(&st(0), &st(FPU_rm), &st(FPU_rm), control_word);
 110 }
 111 
 112 
 113 void fdiv_i()
     /* [previous][next][first][last][top][bottom][index][help] */
 114 {
 115   /* fdiv st(i),st */
 116   clear_C1();
 117   reg_div(&st(FPU_rm), &st(0), &st(FPU_rm), control_word);
 118 }
 119 
 120 
 121 
 122 void faddp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 123 {
 124   /* faddp st(i),st */
 125   clear_C1();
 126   if ( !reg_add(&st(0), &st(FPU_rm), &st(FPU_rm), control_word) )
 127     pop();
 128 }
 129 
 130 
 131 void fmulp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 132 {
 133   /* fmulp st(i),st */
 134   clear_C1();
 135   if ( !reg_mul(&st(0), &st(FPU_rm), &st(FPU_rm), control_word) )
 136     pop();
 137 }
 138 
 139 
 140 
 141 void fsubrp()
     /* [previous][next][first][last][top][bottom][index][help] */
 142 {
 143   /* fsubrp st(i),st */
 144   /* This is the sense of the 80486 manual
 145      reg_sub(&st(FPU_rm), &st(0), &st(FPU_rm), control_word); */
 146   clear_C1();
 147   if ( !reg_sub(&st(0), &st(FPU_rm), &st(FPU_rm), control_word) )
 148     pop();
 149 }
 150 
 151 
 152 void fsubp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 153 {
 154   /* fsubp st(i),st */
 155   /* This is the sense of the 80486 manual
 156      reg_sub(&st(0), &st(FPU_rm), &st(FPU_rm), control_word); */
 157   clear_C1();
 158   if ( !reg_sub(&st(FPU_rm), &st(0), &st(FPU_rm), control_word) )
 159     pop();
 160 }
 161 
 162 
 163 void fdivrp()
     /* [previous][next][first][last][top][bottom][index][help] */
 164 {
 165   /* fdivrp st(i),st */
 166   clear_C1();
 167   if ( !reg_div(&st(0), &st(FPU_rm), &st(FPU_rm), control_word) )
 168     pop();
 169 }
 170 
 171 
 172 void fdivp_()
     /* [previous][next][first][last][top][bottom][index][help] */
 173 {
 174   /* fdivp st(i),st */
 175   clear_C1();
 176   if ( !reg_div(&st(FPU_rm), &st(0), &st(FPU_rm), control_word) )
 177     pop();
 178 }
 179 

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