|
|
1.1 root 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 [email protected] |
8: | |
9: | |
10: +---------------------------------------------------------------------------*/
11:
12: #include "fpu_system.h"
13: #include "fpu_emu.h"
14:
15:
16: void fadd__()
17: {
18: /* fadd st,st(i) */
19: reg_add(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr);
20: }
21:
22:
23: void fmul__()
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__()
32: {
33: /* fsub st,st(i) */
34: reg_sub(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr);
35: }
36:
37:
38: void fsubr_()
39: {
40: /* fsubr st,st(i) */
41: reg_sub(&st(FPU_rm), FPU_st0_ptr, FPU_st0_ptr);
42: }
43:
44:
45: void fdiv__()
46: {
47: /* fdiv st,st(i) */
48: reg_div(FPU_st0_ptr, &st(FPU_rm), FPU_st0_ptr);
49: }
50:
51:
52: void fdivr_()
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()
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()
68: {
69: /* fmul st(i),st */
70: reg_mul(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm));
71: }
72:
73:
74: void fsubri()
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()
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()
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()
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_()
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_()
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()
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_()
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()
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_()
153: {
154: /* fdivp st(i),st */
155: reg_div(&st(FPU_rm), FPU_st0_ptr, &st(FPU_rm));
156: pop();
157: }
158:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.