annotate test/float.c @ 472:834b5792bc5f

*** empty log message ***
author kono
date Tue, 08 Nov 2005 12:14:44 +0900
parents cfa4db8b18a5
children f8ba383dbc39
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
1 #include "stdio.h"
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
2
472
834b5792bc5f *** empty log message ***
kono
parents: 471
diff changeset
3 void test8();
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
4 void print(double d);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
5
81
f94ca1168520 float first try...
kono
parents: 79
diff changeset
6 extern double sin(double);
84
1a723130a2c7 condtional
kono
parents: 82
diff changeset
7 // extern float fsin(float);
471
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
8 double test9(double f,int i);
81
f94ca1168520 float first try...
kono
parents: 79
diff changeset
9
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
10 float f = 0.3;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
11 double d = 0.3;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
12 float f1 = 0.3;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
13 double d1 = 0.3;
84
1a723130a2c7 condtional
kono
parents: 82
diff changeset
14 double d2 = -0.2;
96
7d8de41390d8 *** empty log message ***
kono
parents: 94
diff changeset
15 float h = 1.0;
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
16
91
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
17 int
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
18 d2i(double d) {
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
19 return (int)d;
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
20 }
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
21
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
22 double
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
23 i2d(int u) {
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
24 return (double)u;
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
25 }
90
07e3113c3c13 *** empty log message ***
kono
parents: 87
diff changeset
26
91
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
27 unsigned u;
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
28 unsigned
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
29 d2u(double d) {
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
30 return (unsigned)d;
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
31 }
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
32
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
33 double
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
34 u2d(unsigned u) {
9b1aeb62e0b9 powerpc continue... (floating point)
kono
parents: 90
diff changeset
35 return (double)u;
90
07e3113c3c13 *** empty log message ***
kono
parents: 87
diff changeset
36 }
07e3113c3c13 *** empty log message ***
kono
parents: 87
diff changeset
37
379
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
38 double
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
39 f2d(float u) {
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
40 double u1;
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
41 u1 = f1;
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
42 return (double)u;
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
43 }
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
44
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
45 float
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
46 d2f(double u) {
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
47 float u1;
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
48 u1 = d1;
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
49 return (float)u;
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
50 }
c7abd48191b3 ARM continue...
kono
parents: 284
diff changeset
51
471
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
52 void
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
53 test1(float id, float x,float y,float sx,float sy,int behav)
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
54 {
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
55 printf("%f %f %f %f %f %d\n", id,x,y,sx,sy,behav);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
56 }
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
57
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
58 void
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
59 test2(int id, int x,float y,float sx,float sy,int behav)
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
60 {
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
61 printf("%d %d %f %f %f %d\n", id,x,y,sx,sy,behav);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
62 }
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
63
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
64 void
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
65 test3(int id, float x,float y,float sx,float sy,int behav)
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
66 {
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
67 printf("%d %f %f %f %f %d\n", id,x,y,sx,sy,behav);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
68 }
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
69
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
70 void
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
71 test4(int id, float x,int y,float sx,float sy,int behav)
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
72 {
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
73 printf("%d %f %d %f %f %d\n", id,x,y,sx,sy,behav);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
74 }
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
75
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
76 void
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
77 test5(float id, int x,float y,int sx,float sy,int behav)
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
78 {
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
79 printf("%f %d %f %d %f %d\n", id,x,y,sx,sy,behav);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
80 }
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
81
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
82
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
83
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
84 int
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
85 main(int ac,char *av[]) {
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
86 double g;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
87 int i;
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
88 unsigned u;
108
69e2e763cce5 object assemble first try.
kono
parents: 96
diff changeset
89 double d00 = ac?0.5:3;
69e2e763cce5 object assemble first try.
kono
parents: 96
diff changeset
90
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
91 printf("#0058:%g\n",d00);
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
92
471
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
93 test1(1,2,3,10,11,4);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
94 test2(1,2,3,10,11,4);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
95 test3(1,2,3,10,11,4);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
96 test4(1,2,3,10,11,4);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
97 test5(1,2,3,10,11,4);
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
98
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
99 g = 1.0;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
100 g = -g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
101 printf("#0062:%d\ncond0 ",1);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
102 if(f==f*1.0) printf("#0063:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
103 printf("#0064:%d\ncond1 ",f==f*1.0);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
104 if(d==f*1.0) printf("#0065:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
105 printf("#0066:%d\ncond2 ",d==f*1.0);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
106 if(f==f1) printf("#0067:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
107 printf("#0068:%d\ncond3 ",f==f1);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
108 if(d==d1) printf("#0069:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
109 printf("#0070:%d\ncond4 ",d==d2);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
110 if(d==d2) printf("#0071:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
111 printf("#0072:%d\ncond5 ",(d==d2));
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
112 if(d>d1) printf("#0073:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
113 printf("#0074:%d\ncond6 ",d>d1);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
114 if(d>d2) printf("#0075:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
115 printf("#0076:%d\ncond7 ",d>d2);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
116 if(d>=d1) printf("#0077:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
117 printf("#0078:%d\ncond8 ",d>=d1);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
118 if(d>=d2) printf("#0079:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
119 printf("#0080:%d\ncond9 ",d>=d2);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
120 if(d!=d1) printf("#0081:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
121 printf("#0082:%d\ncond10 ",d!=d1);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
122 if(d!=d2) printf("#0083:5 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
123 printf("#0084:%d\ncond11 ",d!=d2);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
124 if(d<d1) printf("#0085:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
125 printf("#0086:%d\ncond12 ",d<d1);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
126 if(d<d2) printf("#0087:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
127 printf("#0088:%d\ncond13 ",d<d2);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
128 if(d<=d1) printf("#0089:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
129 printf("#0090:%d\ncond14 ",d<=d1);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
130 if(d<=d2) printf("#0091:t ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
131 printf("#0092:%d\ncond15 ",d<=d2);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
132 d = 123.4234; f=-234.333;
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
133 i = d;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
134 d = i;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
135 i = f;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
136 f = i;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
137 printf("#0098:\ni=%d d=%g f=%f",i,d,f);
94
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
138 f = g = d = d1 = d2 = f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
139 printf("#0100: i=%d d=%g f=%f g=%g\n",i,d,f,g);
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
140
86
4d1275f8a5b5 *** empty log message ***
kono
parents: 85
diff changeset
141 d = 4204967294.4234; f=4204967294.4234;
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
142 u = d;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
143 printf("#0104:1: u=%u d=%g f=%f\n",u,d,f);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
144 d = u;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
145 printf("#0106:2: u=%u d=%g f=%f\n",u,d,f);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
146 u = f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
147 printf("#0108:3: u=%u d=%g f=%f\n",u,d,f);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
148 f = u;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
149 printf("#0110:4: u=%u d=%g f=%f\n",u,d,f);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
150
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
151 print(1.0);
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
152 print(0.1234);
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
153 print(1.234e10);
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
154 print(1.234e-10);
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
155
472
834b5792bc5f *** empty log message ***
kono
parents: 471
diff changeset
156 test8();
471
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
157 printf("#0118:nested call: %g\n",test9(test9(test9(test9(-0.333,3),5),6),7));
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
158 return 0;
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
159 }
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
160
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
161 void
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
162 print(double d)
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
163 {
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
164 float f;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
165 int *dd;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
166
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
167 f = d;
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
168
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
169 dd = (int*) &d;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
170 printf("#0131:d %g ",d);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
171 printf("#0132:dx %08x %08x\n",*(dd),*(dd+1));
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
172
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
173 dd = (int*) &f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
174 printf("#0135:f %g ",f);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
175 printf("#0136:dx %08x \n",*(dd));
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
176 }
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
177
81
f94ca1168520 float first try...
kono
parents: 79
diff changeset
178 double
f94ca1168520 float first try...
kono
parents: 79
diff changeset
179 testd(double i,double j)
f94ca1168520 float first try...
kono
parents: 79
diff changeset
180 {
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
181 return j+1.1+.0e3+12.3e-12;
81
f94ca1168520 float first try...
kono
parents: 79
diff changeset
182 }
f94ca1168520 float first try...
kono
parents: 79
diff changeset
183
f94ca1168520 float first try...
kono
parents: 79
diff changeset
184 float
f94ca1168520 float first try...
kono
parents: 79
diff changeset
185 testf(float i,float j)
f94ca1168520 float first try...
kono
parents: 79
diff changeset
186 {
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
187 return j+1;
81
f94ca1168520 float first try...
kono
parents: 79
diff changeset
188 }
f94ca1168520 float first try...
kono
parents: 79
diff changeset
189
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
190 void
472
834b5792bc5f *** empty log message ***
kono
parents: 471
diff changeset
191 test8()
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
192 {
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
193 float f;
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
194 float f1;
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
195 double g;
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
196 double g1;
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
197 float *pf;
3789aef7331d minor fix
kono
parents: 84
diff changeset
198 float *pf1;
3789aef7331d minor fix
kono
parents: 84
diff changeset
199 double *pg;
3789aef7331d minor fix
kono
parents: 84
diff changeset
200 double *pg1;
3789aef7331d minor fix
kono
parents: 84
diff changeset
201 int n = 1;
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
202
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
203 printf("#0164:simple double ");
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
204 f = 1.3;
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
205
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
206 g = 1.0;
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
207 g = g+g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
208 printf("#0169:%d:%g\t",n++,g);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
209 g1 = g*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
210 printf("#0171:%d:%g\t",n++,g1);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
211 g = g/g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
212 printf("#0173:%d:%g\t",n++,g);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
213 g = g-g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
214 printf("#0175:%d:%g\t",n++,g);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
215 g = sin(g1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
216 printf("#0177:%d:%g\t",n++,g);
81
f94ca1168520 float first try...
kono
parents: 79
diff changeset
217 g = testd(g,g1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
218 printf("#0179:%d:%g\t",n++,g);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
219 printf("#0180:\n");
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
220
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
221 printf("#0182:simple float ");
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
222 f = f+f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
223 printf("#0184:%d:%g\t",n++,f);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
224 f1 = f*f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
225 printf("#0186:%d:%g\t",n++,f1);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
226 f = f/f1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
227 printf("#0188:%d:%g\t",n++,f);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
228 f = f-f1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
229 printf("#0190:%d:%g\t",n++,f);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
230 f = sin(f1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
231 printf("#0192:%d:%g\t",n++,f);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
232 printf("#0193:\n");
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
233
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
234 printf("#0195:post/pre increment ");
86
4d1275f8a5b5 *** empty log message ***
kono
parents: 85
diff changeset
235 g1 = g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
236 printf("#0197:%d:%g\t",n++,g1++ - ++g);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
237
86
4d1275f8a5b5 *** empty log message ***
kono
parents: 85
diff changeset
238 f1 = f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
239 printf("#0200:%d:%g\t",n++,f1++ - ++f);
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
240
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
241 g1 = g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
242 printf("#0203:%d:%g\t",n++,g1-- - --g);
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
243
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
244 f1 = f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
245 printf("#0206:%d:%g\t",n++,f1-- - --f);
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
246
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
247 printf("#0208:\n");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
248 printf("#0209:simple calc ");
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
249
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
250 f=0.13; g=-0.56; f1=-0.13; g1=0.56;
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
251
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
252 g = f+f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
253 printf("#0214:%d:%g\t",n++,g);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
254 f = g*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
255 printf("#0216:%d:%g\t",n++,f);
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
256 g = g*g+f*f-g1*g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
257 printf("#0218:%d:%g\t",n++,g);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
258 printf("#0219:\n");
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
259
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
260 printf("#0221:float argument ");
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
261 f = testf(f,f1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
262 printf("#0223:%d:%g\t",n++,f);
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
263
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
264 printf("#0225:\nindirect ");
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
265 n=1;
3789aef7331d minor fix
kono
parents: 84
diff changeset
266 f = 1.3; pf=&f; pf1=&f1;
3789aef7331d minor fix
kono
parents: 84
diff changeset
267
3789aef7331d minor fix
kono
parents: 84
diff changeset
268 g = 1.0; pg=&g; pg1=&g1;
3789aef7331d minor fix
kono
parents: 84
diff changeset
269 *pg = *pg+ *pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
270 printf("#0231:%d:%g\t",n++,*pg);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
271 *pg1 = *pg**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
272 printf("#0233:%d:%g\t",n++,*pg1);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
273 *pg = *pg/ *pg1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
274 printf("#0235:%d:%g\t",n++,*pg);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
275 *pg = *pg-*pg1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
276 printf("#0237:%d:%g\t",n++,*pg);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
277 *pg = sin(*pg1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
278 printf("#0239:%d:%g\t",n++,*pg);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
279 *pg = testd(*pg,*pg1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
280 printf("#0241:%d:%g\t",n++,*pg);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
281 printf("#0242:\n");
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
282
3789aef7331d minor fix
kono
parents: 84
diff changeset
283 *pf = *pf+*pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
284 printf("#0245:%d:%g\t",n++,*pf);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
285 *pf1 = *pf**pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
286 printf("#0247:%d:%g\t",n++,*pf1);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
287 *pf = *pf/ *pf1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
288 printf("#0249:%d:%g\t",n++,*pf);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
289 *pf = *pf-*pf1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
290 printf("#0251:%d:%g\t",n++,*pf);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
291 *pf = sin(*pf1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
292 printf("#0253:%d:%g\t",n++,*pf);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
293 printf("#0254:\n");
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
294
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
295 printf("#0256:indirect post/pre ");
86
4d1275f8a5b5 *** empty log message ***
kono
parents: 85
diff changeset
296 *pg1 = *pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
297 printf("#0258:%d:%g\t",n++,(*pg1)++ - ++(*pg));
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
298
86
4d1275f8a5b5 *** empty log message ***
kono
parents: 85
diff changeset
299 *pf1 = *pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
300 printf("#0261:%d:%g\t",n++,(*pf1)++ - ++(*pf));
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
301
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
302 *pg1 = *pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
303 printf("#0264:%d:%g\t",n++, (*pg1)-- - --(*pg));
86
4d1275f8a5b5 *** empty log message ***
kono
parents: 85
diff changeset
304
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
305 *pf1 = *pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
306 printf("#0267:%d:%g\t",n++, (*pf1)-- - --(*pf));
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
307 printf("#0268:\n");
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
308
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
309 *pf=0.13; *pg=-0.56; *pf1=-0.13; *pg1=0.56;
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
310
3789aef7331d minor fix
kono
parents: 84
diff changeset
311 *pg = *pf+*pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
312 printf("#0273:%d:%g\t",n++,*pg);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
313 *pf = *pg**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
314 printf("#0275:%d:%g\t",n++,*pf);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
315 *pg = *pg**pg+*pf**pf-*pg1**pg1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
316 printf("#0277:%d:%g\t",n++,*pg);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
317 printf("#0278:\n");
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
318
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
319 printf("#0280:float argument ");
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
320
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
321 *pf = testf(*pf,*pf1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
322 printf("#0283:%d:%g\t",n++,*pf);
87
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
323
1738f313f98b floating point (at most) done.
kono
parents: 86
diff changeset
324
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
325 printf("#0286:\nassop ");
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
326 n=1;
3789aef7331d minor fix
kono
parents: 84
diff changeset
327 f = 1.3;
3789aef7331d minor fix
kono
parents: 84
diff changeset
328 g = 1.0;
3789aef7331d minor fix
kono
parents: 84
diff changeset
329
3789aef7331d minor fix
kono
parents: 84
diff changeset
330 g *= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
331 printf("#0292:%d:%g\t",n++,g);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
332 g /= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
333 printf("#0294:%d:%g\t",n++,g);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
334 g -= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
335 printf("#0296:%d:%g\t",n++,g);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
336 g += 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
337 printf("#0298:%d:%g\t",n++,g);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
338
3789aef7331d minor fix
kono
parents: 84
diff changeset
339 f *= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
340 printf("#0301:%d:%g\t",n++,f);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
341 f /= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
342 printf("#0303:%d:%g\t",n++,f);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
343 f -= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
344 printf("#0305:%d:%g\t",n++,f);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
345 f += 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
346 printf("#0307:%d:%g\t",n++,f);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
347 printf("#0308:\n");
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
348
3789aef7331d minor fix
kono
parents: 84
diff changeset
349 n=1;
3789aef7331d minor fix
kono
parents: 84
diff changeset
350 f = 1.3;
3789aef7331d minor fix
kono
parents: 84
diff changeset
351 g = 1.0;
3789aef7331d minor fix
kono
parents: 84
diff changeset
352
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
353 printf("#0314:indirect assop ");
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
354 *pg *= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
355 printf("#0316:%d:%g\t",n++,*pg);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
356 *pg /= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
357 printf("#0318:%d:%g\t",n++,*pg);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
358 *pg -= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
359 printf("#0320:%d:%g\t",n++,*pg);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
360 *pg += 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
361 printf("#0322:%d:%g\t",n++,*pg);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
362
3789aef7331d minor fix
kono
parents: 84
diff changeset
363 *pf *= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
364 printf("#0325:%d:%g\t",n++,*pf);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
365 *pf /= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
366 printf("#0327:%d:%g\t",n++,*pf);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
367 *pf -= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
368 printf("#0329:%d:%g\t",n++,*pf);
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
369 *pf += 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
370 printf("#0331:%d:%g\t",n++,*pf);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
371 printf("#0332:\n");
85
3789aef7331d minor fix
kono
parents: 84
diff changeset
372
3789aef7331d minor fix
kono
parents: 84
diff changeset
373
79
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
374 return;
82d0e30f61dd *** empty log message ***
kono
parents:
diff changeset
375 }
94
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
376
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
377 double
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
378 test2(double f,int i)
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
379 {
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
380 double g,h;
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
381
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
382 if (i<=0) return f;
112
fc7de4faedfd *** empty log message ***
kono
parents: 108
diff changeset
383 #if 1
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 379
diff changeset
384 printf("#0345:rec: %d %g\n",i,f);
112
fc7de4faedfd *** empty log message ***
kono
parents: 108
diff changeset
385 #endif
94
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
386 g = f*2;
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
387 h = f-0.5;
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
388 return h/3-(3.0-(g+3)*test2(f*0.5,i-1)/(h-1));
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
389 }
471
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
390
cfa4db8b18a5 mips float arg fix
kono
parents: 427
diff changeset
391