This source file includes following definitions.
- reg_mul
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #include "exception.h"
17 #include "reg_constant.h"
18 #include "fpu_emu.h"
19
20
21
22 void reg_mul(FPU_REG *a, FPU_REG *b, FPU_REG *dest)
23 {
24 if (!(a->tag | b->tag))
25 {
26
27 reg_u_mul(a, b, dest);
28 dest->exp += - EXP_BIAS + 1;
29 dest->sign = (a->sign ^ b->sign);
30 dest->tag = TW_Valid;
31 if ( dest->exp <= EXP_UNDER )
32 { arith_underflow(FPU_st0_ptr); }
33 else if ( dest->exp >= EXP_OVER )
34 { arith_overflow(FPU_st0_ptr); }
35 return;
36 }
37 else if ((a->tag <= TW_Zero) && (b->tag <= TW_Zero))
38 {
39
40
41
42 reg_move(&CONST_Z, dest);
43 }
44 else if ((a->tag <= TW_Denormal) && (b->tag <= TW_Denormal))
45 {
46
47
48 EXCEPTION(EX_INTERNAL|0x105);
49 reg_move(&CONST_Z, dest);
50 }
51 else
52 {
53
54 if ( (a->tag == TW_NaN) || (b->tag == TW_NaN) )
55 { real_2op_NaN(a, b, dest); return; }
56 else if (a->tag == TW_Infinity)
57 {
58 if (b->tag == TW_Zero)
59 { arith_invalid(dest); return; }
60 else
61 {
62 reg_move(a, dest);
63 dest->sign = a->sign == b->sign ? SIGN_POS : SIGN_NEG;
64 }
65 }
66 else if (b->tag == TW_Infinity)
67 {
68 if (a->tag == TW_Zero)
69 { arith_invalid(dest); return; }
70 else
71 {
72 reg_move(b, dest);
73 dest->sign = a->sign == b->sign ? SIGN_POS : SIGN_NEG;
74 }
75 }
76 #ifdef PARANOID
77 else
78 {
79 EXCEPTION(EX_INTERNAL|0x102);
80 }
81 #endif PARANOID
82 dest->sign = (a->sign ^ b->sign);
83 }
84 }