This source file includes following definitions.
- reg_mul
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include "exception.h"
18 #include "reg_constant.h"
19 #include "fpu_emu.h"
20 #include "fpu_system.h"
21
22
23
24 void reg_mul(FPU_REG *a, FPU_REG *b, FPU_REG *dest, unsigned int control_w)
25 {
26 char sign = (a->sign ^ b->sign);
27
28 if (!(a->tag | b->tag))
29 {
30
31 reg_u_mul(a, b, dest, control_w);
32 dest->sign = sign;
33 return;
34 }
35 else if ((a->tag <= TW_Zero) && (b->tag <= TW_Zero))
36 {
37 #ifdef DENORM_OPERAND
38 if ( ((b->tag == TW_Valid) && (b->exp <= EXP_UNDER)) ||
39 ((a->tag == TW_Valid) && (a->exp <= EXP_UNDER)) )
40 {
41 if ( denormal_operand() ) return;
42 }
43 #endif DENORM_OPERAND
44
45
46
47 reg_move(&CONST_Z, dest);
48 #ifdef PECULIAR_486
49
50
51 dest->sign = sign;
52 #endif PECULIAR_486
53 return;
54 }
55 #if 0
56 else if ((a->tag <= TW_Denormal) && (b->tag <= TW_Denormal))
57 {
58
59
60 EXCEPTION(EX_INTERNAL|0x105);
61 reg_move(&CONST_Z, dest);
62 }
63 #endif
64 else
65 {
66
67 if ( (a->tag == TW_NaN) || (b->tag == TW_NaN) )
68 { real_2op_NaN(a, b, dest); return; }
69 else if (a->tag == TW_Infinity)
70 {
71 if (b->tag == TW_Zero)
72 { arith_invalid(dest); return; }
73 else
74 {
75 #ifdef DENORM_OPERAND
76 if ( (b->tag == TW_Valid) && (b->exp <= EXP_UNDER) &&
77 denormal_operand() )
78 return;
79 #endif DENORM_OPERAND
80 reg_move(a, dest);
81 dest->sign = sign;
82 }
83 return;
84 }
85 else if (b->tag == TW_Infinity)
86 {
87 if (a->tag == TW_Zero)
88 { arith_invalid(dest); return; }
89 else
90 {
91 #ifdef DENORM_OPERAND
92 if ( (a->tag == TW_Valid) && (a->exp <= EXP_UNDER) &&
93 denormal_operand() )
94 return;
95 #endif DENORM_OPERAND
96 reg_move(b, dest);
97 dest->sign = sign;
98 }
99 return;
100 }
101 #ifdef PARANOID
102 else
103 {
104 EXCEPTION(EX_INTERNAL|0x102);
105 }
106 #endif PARANOID
107 }
108 }