1 // SPDX-License-Identifier: GPL-2.0
2 /*---------------------------------------------------------------------------+
5 | Code to implement the FPU register/register arithmetic instructions |
7 | Copyright (C) 1992,1993,1997 |
8 | W. Metzenthen, 22 Parker St, Ormond, Vic 3163, Australia |
9 | E-mail billm@suburbia.net |
12 +---------------------------------------------------------------------------*/
14 #include "fpu_system.h"
16 #include "control_w.h"
24 FPU_add(&st(i
), FPU_gettagi(i
), 0, control_word
);
32 FPU_mul(&st(i
), FPU_gettagi(i
), 0, control_word
);
39 FPU_sub(0, FPU_rm
, control_word
);
46 FPU_sub(REV
, FPU_rm
, control_word
);
53 FPU_div(0, FPU_rm
, control_word
);
60 FPU_div(REV
, FPU_rm
, control_word
);
68 FPU_add(&st(i
), FPU_gettagi(i
), i
, control_word
);
75 FPU_mul(&st(0), FPU_gettag0(), FPU_rm
, control_word
);
82 FPU_sub(DEST_RM
, FPU_rm
, control_word
);
89 FPU_sub(REV
| DEST_RM
, FPU_rm
, control_word
);
96 FPU_div(DEST_RM
, FPU_rm
, control_word
);
103 FPU_div(REV
| DEST_RM
, FPU_rm
, control_word
);
111 if (FPU_add(&st(i
), FPU_gettagi(i
), i
, control_word
) >= 0)
119 if (FPU_mul(&st(0), FPU_gettag0(), FPU_rm
, control_word
) >= 0)
125 /* fsubrp st(i),st */
127 if (FPU_sub(DEST_RM
, FPU_rm
, control_word
) >= 0)
135 if (FPU_sub(REV
| DEST_RM
, FPU_rm
, control_word
) >= 0)
141 /* fdivrp st(i),st */
143 if (FPU_div(DEST_RM
, FPU_rm
, control_word
) >= 0)
151 if (FPU_div(REV
| DEST_RM
, FPU_rm
, control_word
) >= 0)