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"
24 FPU_add(&st(i), FPU_gettagi(i), 0, control_word);
33 FPU_mul(&st(i), FPU_gettagi(i), 0, control_word);
42 FPU_sub(0, FPU_rm, control_word);
50 FPU_sub(REV, FPU_rm, control_word);
58 FPU_div(0, FPU_rm, control_word);
66 FPU_div(REV, FPU_rm, control_word);
76 FPU_add(&st(i), FPU_gettagi(i), i, control_word);
84 FPU_mul(&st(0), FPU_gettag0(), FPU_rm, control_word);
92 FPU_sub(DEST_RM, FPU_rm, control_word);
100 FPU_sub(REV|DEST_RM, FPU_rm, control_word);
108 FPU_div(DEST_RM, FPU_rm, control_word);
116 FPU_div(REV|DEST_RM, FPU_rm, control_word);
126 if ( FPU_add(&st(i), FPU_gettagi(i), i, control_word) >= 0 )
135 if ( FPU_mul(&st(0), FPU_gettag0(), FPU_rm, control_word) >= 0 )
143 /* fsubrp st(i),st */
145 if ( FPU_sub(DEST_RM, FPU_rm, control_word) >= 0 )
154 if ( FPU_sub(REV|DEST_RM, FPU_rm, control_word) >= 0 )
161 /* fdivrp st(i),st */
163 if ( FPU_div(DEST_RM, FPU_rm, control_word) >= 0 )
172 if ( FPU_div(REV|DEST_RM, FPU_rm, control_word) >= 0 )