1 /*---------------------------------------------------------------------------+
4 | Code to implement the FPU register/register arithmetic instructions |
6 | Copyright (C) 1992,1993,1997 |
7 | W. Metzenthen, 22 Parker St, Ormond, Vic 3163, Australia |
8 | E-mail billm@suburbia.net |
11 +---------------------------------------------------------------------------*/
13 #include "fpu_system.h"
15 #include "control_w.h"
23 FPU_add(&st(i
), FPU_gettagi(i
), 0, control_word
);
31 FPU_mul(&st(i
), FPU_gettagi(i
), 0, control_word
);
38 FPU_sub(0, FPU_rm
, control_word
);
45 FPU_sub(REV
, FPU_rm
, control_word
);
52 FPU_div(0, FPU_rm
, control_word
);
59 FPU_div(REV
, FPU_rm
, control_word
);
67 FPU_add(&st(i
), FPU_gettagi(i
), i
, control_word
);
74 FPU_mul(&st(0), FPU_gettag0(), FPU_rm
, control_word
);
81 FPU_sub(DEST_RM
, FPU_rm
, control_word
);
88 FPU_sub(REV
| DEST_RM
, FPU_rm
, control_word
);
95 FPU_div(DEST_RM
, FPU_rm
, control_word
);
102 FPU_div(REV
| DEST_RM
, FPU_rm
, control_word
);
110 if (FPU_add(&st(i
), FPU_gettagi(i
), i
, control_word
) >= 0)
118 if (FPU_mul(&st(0), FPU_gettag0(), FPU_rm
, control_word
) >= 0)
124 /* fsubrp st(i),st */
126 if (FPU_sub(DEST_RM
, FPU_rm
, control_word
) >= 0)
134 if (FPU_sub(REV
| DEST_RM
, FPU_rm
, control_word
) >= 0)
140 /* fdivrp st(i),st */
142 if (FPU_div(DEST_RM
, FPU_rm
, control_word
) >= 0)
150 if (FPU_div(REV
| DEST_RM
, FPU_rm
, control_word
) >= 0)