annotate test/int.c @ 492:cc1a5f764782

*** empty log message ***
author kono
date Wed, 21 Dec 2005 12:10:43 +0900
parents 0c256ea2a97e
children 5d3b4669854c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
1 #include "stdio.h"
a9261154cde9 integer operation debug
kono
parents:
diff changeset
2
114
e6cb1e293b35 float/int passed.
kono
parents: 113
diff changeset
3 double sin(double);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
4 void test1();
a9261154cde9 integer operation debug
kono
parents:
diff changeset
5 void print(int d);
a9261154cde9 integer operation debug
kono
parents:
diff changeset
6
a9261154cde9 integer operation debug
kono
parents:
diff changeset
7 int test2(int f,int i);
a9261154cde9 integer operation debug
kono
parents:
diff changeset
8
a9261154cde9 integer operation debug
kono
parents:
diff changeset
9 unsigned f = 3;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
10 int d = -3;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
11 unsigned f1 = 3;
132
07eb1249f07a *** empty log message ***
kono
parents: 127
diff changeset
12 unsigned f2 = 4;
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
13 int d1 = -3;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
14 int d2 = -2;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
15 unsigned h = 65536*100;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
16
a9261154cde9 integer operation debug
kono
parents:
diff changeset
17 int
a9261154cde9 integer operation debug
kono
parents:
diff changeset
18 d2i(int d) {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
19 return (int)d;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
20 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
21
a9261154cde9 integer operation debug
kono
parents:
diff changeset
22 int
a9261154cde9 integer operation debug
kono
parents:
diff changeset
23 i2d(int u) {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
24 return (int)u;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
25 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
26
a9261154cde9 integer operation debug
kono
parents:
diff changeset
27 unsigned u;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
28 unsigned
a9261154cde9 integer operation debug
kono
parents:
diff changeset
29 d2u(int d) {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
30 return (unsigned)d;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
31 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
32
a9261154cde9 integer operation debug
kono
parents:
diff changeset
33 int
a9261154cde9 integer operation debug
kono
parents:
diff changeset
34 u2d(unsigned u) {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
35 return (int)u;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
36 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
37
a9261154cde9 integer operation debug
kono
parents:
diff changeset
38 int
a9261154cde9 integer operation debug
kono
parents:
diff changeset
39 main(int ac,char *av[]) {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
40 int g;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
41 int i;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
42 unsigned u;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
43 unsigned d00 = ac?-30:ac;
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
44 unsigned d01 = 0x3ffffff;
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
45 unsigned d02 = 0x300;
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
46
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
47 printf("#0046:%d %f %d %f\n",1,0.1,1,0.1);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
48 printf("#0047:%f %d %f %d\n",0.1,1,0.1,1);
114
e6cb1e293b35 float/int passed.
kono
parents: 113
diff changeset
49
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
50 printf("#0049:%u %u %u\n",d00,d01%d02,d01*d02);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
51
a9261154cde9 integer operation debug
kono
parents:
diff changeset
52 g = 1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
53 g = -g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
54 printf("#0053:%d\ncond ",g);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
55 if(f==f*1) printf("#0054:1 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
56 if(d==f*1) printf("#0055:2 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
57 if(f==f1) printf("#0056:3 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
58 if(d==d1) printf("#0057:4 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
59 if(d==d2) printf("#0058:-4 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
60 if(d>d1) printf("#0059:5 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
61 if(d>d2) printf("#0060:-5 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
62 if(d>=d1) printf("#0061:6 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
63 if(d>=d2) printf("#0062:-6 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
64 if(d!=d1) printf("#0063:7 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
65 if(d!=d2) printf("#0064:-7 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
66 if(d<d1) printf("#0065:8 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
67 if(d<d2) printf("#0066:-8 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
68 if(d<=d1) printf("#0067:9 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
69 if(d<=d2) printf("#0068:-9 ");
132
07eb1249f07a *** empty log message ***
kono
parents: 127
diff changeset
70
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
71 printf("#0070:unsigned ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
72 if(f>f1) printf("#0071:5 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
73 if(f>f2) printf("#0072:-5 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
74 if(f>=f1) printf("#0073:6 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
75 if(f>=f2) printf("#0074:-6 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
76 if(f!=f1) printf("#0075:7 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
77 if(f!=f2) printf("#0076:-7 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
78 if(f<f1) printf("#0077:8 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
79 if(f<f2) printf("#0078:-8 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
80 if(f<=f1) printf("#0079:9 ");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
81 if(f<=f2) printf("#0080:-9 ");
132
07eb1249f07a *** empty log message ***
kono
parents: 127
diff changeset
82
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
83 d = 123; f=-234;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
84 i = d;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
85 d = i;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
86 i = f;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
87 f = i;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
88 printf("#0087:\n%d %d %d",i,d,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
89 f = g = d = d1 = d2 = f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
90 printf("#0089: %d %d %d %d\n",i,d,f,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
91
a9261154cde9 integer operation debug
kono
parents:
diff changeset
92 d = 320967294; f=224967294;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
93 u = d;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
94 d = u;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
95 u = f;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
96 f = u;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
97 printf("#0096:%u %d %d\n",u,d,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
98
a9261154cde9 integer operation debug
kono
parents:
diff changeset
99 print(1.0);
a9261154cde9 integer operation debug
kono
parents:
diff changeset
100 print(0.1234*100);
a9261154cde9 integer operation debug
kono
parents:
diff changeset
101 print(1.234e6);
a9261154cde9 integer operation debug
kono
parents:
diff changeset
102 print(-1.234e+3);
a9261154cde9 integer operation debug
kono
parents:
diff changeset
103
a9261154cde9 integer operation debug
kono
parents:
diff changeset
104 test1();
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
105 printf("#0104:nested call: %d\n",test2(test2(test2(test2(-333,3),5),6),7));
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
106 /* test3(40,20); */
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
107 return 0;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
108 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
109
a9261154cde9 integer operation debug
kono
parents:
diff changeset
110 void
a9261154cde9 integer operation debug
kono
parents:
diff changeset
111 print(int d)
a9261154cde9 integer operation debug
kono
parents:
diff changeset
112 {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
113 unsigned f;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
114 int *dd;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
115
a9261154cde9 integer operation debug
kono
parents:
diff changeset
116 f = d;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
117
a9261154cde9 integer operation debug
kono
parents:
diff changeset
118
a9261154cde9 integer operation debug
kono
parents:
diff changeset
119 dd = (int*) &f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
120 printf("#0119:f %d ",f);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
121 printf("#0120:dx %08x \n",*(dd));
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
122 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
123
a9261154cde9 integer operation debug
kono
parents:
diff changeset
124 int
a9261154cde9 integer operation debug
kono
parents:
diff changeset
125 testd(int i,int j)
a9261154cde9 integer operation debug
kono
parents:
diff changeset
126 {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
127 return j+1.1+.0e3+12.3e-12;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
128 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
129
a9261154cde9 integer operation debug
kono
parents:
diff changeset
130 unsigned
a9261154cde9 integer operation debug
kono
parents:
diff changeset
131 testf(unsigned i,unsigned j)
a9261154cde9 integer operation debug
kono
parents:
diff changeset
132 {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
133 return j+1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
134 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
135
a9261154cde9 integer operation debug
kono
parents:
diff changeset
136 void
a9261154cde9 integer operation debug
kono
parents:
diff changeset
137 ahoaho() {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
138 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
139
a9261154cde9 integer operation debug
kono
parents:
diff changeset
140 void
a9261154cde9 integer operation debug
kono
parents:
diff changeset
141 test1()
a9261154cde9 integer operation debug
kono
parents:
diff changeset
142 {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
143 unsigned f;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
144 unsigned f1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
145 int g;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
146 int g1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
147 unsigned *pf;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
148 unsigned *pf1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
149 int *pg;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
150 int *pg1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
151 int n = 1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
152
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
153 printf("#0152:simple int ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
154 f = 1.3;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
155
a9261154cde9 integer operation debug
kono
parents:
diff changeset
156 g = 1.0;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
157 g = g+g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
158 printf("#0157:%d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
159 g1 = g*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
160 printf("#0159:%d:%d\t",n++,g1);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
161 g = g/g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
162 printf("#0161:%d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
163 g = g-g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
164 printf("#0163:%d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
165 g = sin(g1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
166 printf("#0165:%d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
167 g = testd(g,g1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
168 printf("#0167:%d:%d\t",n++,g);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
169 printf("#0168:\n");
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
170 g = g+g;
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
171
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
172 g = 3.0;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
173 printf("#0172:%d:%d\t",n++,g);
186
6391432ca002 nkf binary fix
kono
parents: 132
diff changeset
174 g1 = g<<2;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
175 printf("#0174:<< %d:%d\t",n++,g1);
186
6391432ca002 nkf binary fix
kono
parents: 132
diff changeset
176 g1 = g<<f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
177 printf("#0176:<< %d:%d\t",n++,g1);
186
6391432ca002 nkf binary fix
kono
parents: 132
diff changeset
178 g1 = g>>2;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
179 printf("#0178:>> %d:%d\t",n++,g1);
186
6391432ca002 nkf binary fix
kono
parents: 132
diff changeset
180 g1 = g>>f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
181 printf("#0180:>> %d:%d\t",n++,g1);
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
182 g = g%g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
183 printf("#0182:% %d:%d\t",n++,g);
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
184 g = g|g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
185 printf("#0184:| %d:%d\t",n++,g);
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
186 g = g&g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
187 printf("#0186:& %d:%d\t",n++,g);
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
188 g = g^g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
189 printf("#0188:^ %d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
190
186
6391432ca002 nkf binary fix
kono
parents: 132
diff changeset
191 g = -120;
6391432ca002 nkf binary fix
kono
parents: 132
diff changeset
192 g1 = g>>2;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
193 printf("#0192:>> %d:%d\t",n++,g1);
186
6391432ca002 nkf binary fix
kono
parents: 132
diff changeset
194 g1 = g>>f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
195 printf("#0194:>> %d:%d\t",n++,g1);
209
7bfc1435cdc6 regv fix done
kono
parents: 186
diff changeset
196
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
197 printf("#0196:\n");
186
6391432ca002 nkf binary fix
kono
parents: 132
diff changeset
198
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
199 printf("#0198:simple unsigned ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
200 f = f+f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
201 printf("#0200:%d:%d\t",n++,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
202 f1 = f*f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
203 printf("#0202:%d:%d\t",n++,f1);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
204 f = f/f1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
205 printf("#0204:%d:%d\t",n++,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
206 f = f-f1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
207 printf("#0206:%d:%d\t",n++,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
208 f = sin(f1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
209 printf("#0208:%d:%d\t",n++,f);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
210 printf("#0209:\n");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
211
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
212 f = 3.0;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
213 printf("#0212:%d:%d\t",n++,f);
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
214 f1 = f<<f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
215 printf("#0214:%d:%d\t",n++,f1);
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
216 f = f%f1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
217 printf("#0216:%d:%d\t",n++,f);
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
218 f = f|f1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
219 printf("#0218:%d:%d\t",n++,f);
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
220 f = f&f1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
221 printf("#0220:%d:%d\t",n++,f);
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
222 f = f^f1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
223 printf("#0222:%d:%d\t",n++,f);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
224 printf("#0223:\n");
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
225
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
226
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
227 printf("#0226:post/pre increment ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
228 g1 = g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
229 printf("#0228:%d:%d\t",n++,g1++ - ++g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
230
a9261154cde9 integer operation debug
kono
parents:
diff changeset
231 f1 = f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
232 printf("#0231:%d:%d\t",n++,f1++ - ++f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
233
a9261154cde9 integer operation debug
kono
parents:
diff changeset
234 g1 = g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
235 printf("#0234:%d:%d\t",n++,g1-- - --g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
236
a9261154cde9 integer operation debug
kono
parents:
diff changeset
237 f1 = f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
238 printf("#0237:%d:%d\t",n++,f1-- - --f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
239
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
240 printf("#0239:\n");
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
241 printf("#0240:simple calc ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
242
114
e6cb1e293b35 float/int passed.
kono
parents: 113
diff changeset
243 f=3.13; g=-7.56; f1=-5.13; g1=7.56;
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
244
a9261154cde9 integer operation debug
kono
parents:
diff changeset
245 g = f+f;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
246 printf("#0245:%d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
247 f = g*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
248 printf("#0247:%d:%d\t",n++,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
249 g = g*g+f*f-g1*g1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
250 printf("#0249:%d:%d\t",n++,g);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
251 printf("#0250:\n");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
252
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
253 printf("#0252:unsigned argument ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
254 f = testf(f,f1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
255 printf("#0254:%d:%d\t",n++,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
256
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
257 printf("#0256:\nindirect ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
258 n=1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
259 f = 1.3; pf=&f; pf1=&f1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
260
a9261154cde9 integer operation debug
kono
parents:
diff changeset
261 ahoaho();
a9261154cde9 integer operation debug
kono
parents:
diff changeset
262 g = 1.0; pg=&g; pg1=&g1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
263 *pg = *pg+ *pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
264 printf("#0263:%d:%d\t",n++,*pg);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
265 *pg1 = *pg**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
266 printf("#0265:%d:%d\t",n++,*pg1);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
267 *pg = *pg/ *pg1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
268 printf("#0267:%d:%d\t",n++,*pg);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
269 *pg = *pg-*pg1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
270 printf("#0269:%d:%d\t",n++,*pg);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
271 *pg = sin(*pg1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
272 printf("#0271:%d:%d\t",n++,*pg);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
273 *pg = testd(*pg,*pg1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
274 printf("#0273:%d:%d\t",n++,*pg);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
275 printf("#0274:\n");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
276
a9261154cde9 integer operation debug
kono
parents:
diff changeset
277 *pf = *pf+*pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
278 printf("#0277:%d:%d\t",n++,*pf);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
279 *pf1 = *pf**pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
280 printf("#0279:%d:%d\t",n++,*pf1);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
281 *pf = *pf/ *pf1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
282 printf("#0281:%d:%d\t",n++,*pf);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
283 *pf = *pf-*pf1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
284 printf("#0283:%d:%d\t",n++,*pf);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
285 *pf = sin(*pf1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
286 printf("#0285:%d:%d\t",n++,*pf);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
287 printf("#0286:\n");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
288
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
289 printf("#0288:indirect post/pre ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
290 *pg1 = *pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
291 printf("#0290:%d:%d\t",n++,(*pg1)++ - ++(*pg));
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
292
a9261154cde9 integer operation debug
kono
parents:
diff changeset
293 *pf1 = *pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
294 printf("#0293:%d:%d\t",n++,(*pf1)++ - ++(*pf));
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
295
a9261154cde9 integer operation debug
kono
parents:
diff changeset
296 *pg1 = *pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
297 printf("#0296:%d:%d\t",n++, (*pg1)-- - --(*pg));
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
298
a9261154cde9 integer operation debug
kono
parents:
diff changeset
299 *pf1 = *pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
300 printf("#0299:%d:%d\t",n++, (*pf1)-- - --(*pf));
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
301 printf("#0300:\n");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
302
114
e6cb1e293b35 float/int passed.
kono
parents: 113
diff changeset
303 *pf=3.13; *pg=-7.56; *pf1=-5.13; *pg1=7.56;
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
304
a9261154cde9 integer operation debug
kono
parents:
diff changeset
305 *pg = *pf+*pf;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
306 printf("#0305:%d:%d\t",n++,*pg);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
307 *pf = *pg**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
308 printf("#0307:%d:%d\t",n++,*pf);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
309 *pg = *pg**pg+*pf**pf-*pg1**pg1;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
310 printf("#0309:%d:%d\t",n++,*pg);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
311 printf("#0310:\n");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
312
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
313 printf("#0312:unsigned argument ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
314
a9261154cde9 integer operation debug
kono
parents:
diff changeset
315 *pf = testf(*pf,*pf1);
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
316 printf("#0315:%d:%d\t",n++,*pf);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
317
a9261154cde9 integer operation debug
kono
parents:
diff changeset
318
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
319 printf("#0318:\nassop ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
320 n=1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
321 f = 1.3;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
322 g = 1.0;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
323
a9261154cde9 integer operation debug
kono
parents:
diff changeset
324 g *= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
325 printf("#0324:%d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
326 g /= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
327 printf("#0326:%d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
328 g -= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
329 printf("#0328:%d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
330 g += 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
331 printf("#0330:%d:%d\t",n++,g);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
332
127
eb4d8975926c Intel float fix
kono
parents: 116
diff changeset
333 g = -3;
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
334 f *= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
335 printf("#0334:%d:%d\t",n++,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
336 f /= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
337 printf("#0336:%d:%d\t",n++,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
338 f -= 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
339 printf("#0338:%d:%d\t",n++,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
340 f += 2*g;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
341 printf("#0340:%d:%d\t",n++,f);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
342 printf("#0341:\n");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
343
a9261154cde9 integer operation debug
kono
parents:
diff changeset
344 n=1;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
345 f = 1.3;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
346 g = 1.0;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
347
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
348 printf("#0347:indirect assop ");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
349 *pg *= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
350 printf("#0349:%d:%d\t",n++,*pg);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
351 *pg /= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
352 printf("#0351:%d:%d\t",n++,*pg);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
353 *pg -= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
354 printf("#0353:%d:%d\t",n++,*pg);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
355 *pg += 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
356 printf("#0355:%d:%d\t",n++,*pg);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
357
127
eb4d8975926c Intel float fix
kono
parents: 116
diff changeset
358 *pg = -3;
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
359 *pf *= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
360 printf("#0359:%d:%d\t",n++,*pf);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
361 *pf /= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
362 printf("#0361:%d:%d\t",n++,*pf);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
363 *pf -= 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
364 printf("#0363:%d:%d\t",n++,*pf);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
365 *pf += 2**pg;
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
366 printf("#0365:%d:%d\t",n++,*pf);
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
367 printf("#0366:\n");
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
368
a9261154cde9 integer operation debug
kono
parents:
diff changeset
369
a9261154cde9 integer operation debug
kono
parents:
diff changeset
370 return;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
371 }
a9261154cde9 integer operation debug
kono
parents:
diff changeset
372
a9261154cde9 integer operation debug
kono
parents:
diff changeset
373 int
a9261154cde9 integer operation debug
kono
parents:
diff changeset
374 test2(int f,int i)
a9261154cde9 integer operation debug
kono
parents:
diff changeset
375 {
a9261154cde9 integer operation debug
kono
parents:
diff changeset
376 int g,h;
a9261154cde9 integer operation debug
kono
parents:
diff changeset
377
a9261154cde9 integer operation debug
kono
parents:
diff changeset
378 if (i<=0) return f;
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
379 #if 0
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
380 printf("#0379:rec: %d %d\n",i,f);
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
381 #endif
a9261154cde9 integer operation debug
kono
parents:
diff changeset
382 g = f*2;
114
e6cb1e293b35 float/int passed.
kono
parents: 113
diff changeset
383 h = f-3.5;
e6cb1e293b35 float/int passed.
kono
parents: 113
diff changeset
384 return h/3-(3.0-(g+3)*test2(f*1.5,i-1)/(h-1));
113
a9261154cde9 integer operation debug
kono
parents:
diff changeset
385 }
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
386
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
387 int
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
388 test3(int base,int base1)
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
389 {
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
390 int i,j;
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
391 for(i=0;i<10;i++) {
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
392 for(j=0;j<10;j++) {
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
393 printf("#0392:%d ",(base+i)%(base1+j));
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
394 }
427
0c256ea2a97e Bitfield left value for ia32
kono
parents: 209
diff changeset
395 printf("#0394:\n");
116
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
396 }
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
397 return 0;
b14ff9671c90 register offset fix
kono
parents: 114
diff changeset
398 }