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

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