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 if (!(a->tag | b->tag))
27 {
28
29 dest->sign = (a->sign ^ b->sign);
30 reg_u_mul(a, b, dest, control_w);
31 dest->exp += - EXP_BIAS + 1;
32
33 if ( dest->exp <= EXP_UNDER )
34 { arith_underflow(FPU_st0_ptr); }
35 else if ( dest->exp >= EXP_OVER )
36 { arith_overflow(FPU_st0_ptr); }
37 return;
38 }
39 else if ((a->tag <= TW_Zero) && (b->tag <= TW_Zero))
40 {
41
42
43
44 reg_move(&CONST_Z, dest);
45 }
46 else if ((a->tag <= TW_Denormal) && (b->tag <= TW_Denormal))
47 {
48
49
50 EXCEPTION(EX_INTERNAL|0x105);
51 reg_move(&CONST_Z, dest);
52 }
53 else
54 {
55
56 if ( (a->tag == TW_NaN) || (b->tag == TW_NaN) )
57 { real_2op_NaN(a, b, dest); return; }
58 else if (a->tag == TW_Infinity)
59 {
60 if (b->tag == TW_Zero)
61 { arith_invalid(dest); return; }
62 else
63 {
64 reg_move(a, dest);
65 dest->sign = a->sign == b->sign ? SIGN_POS : SIGN_NEG;
66 }
67 }
68 else if (b->tag == TW_Infinity)
69 {
70 if (a->tag == TW_Zero)
71 { arith_invalid(dest); return; }
72 else
73 {
74 reg_move(b, dest);
75 dest->sign = a->sign == b->sign ? SIGN_POS : SIGN_NEG;
76 }
77 }
78 #ifdef PARANOID
79 else
80 {
81 EXCEPTION(EX_INTERNAL|0x102);
82 }
83 #endif PARANOID
84 dest->sign = (a->sign ^ b->sign);
85 }
86 }