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

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