changeset 9 | 96e5fb8b040d |
-1:000000000000 | 9:96e5fb8b040d |
---|---|
1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // e32test\bench\t_t64fnc.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include <e32std.h> |
|
19 #include <e32std_private.h> |
|
20 |
|
21 GLREF_D volatile TInt64 count; |
|
22 GLREF_D volatile TInt64 a, b, c; |
|
23 |
|
24 TInt TInt64Addition(TAny*) |
|
25 { |
|
26 |
|
27 TInt64 al = a; |
|
28 const TInt64 bl = b; |
|
29 const TInt64 x = 1; |
|
30 for(;;) |
|
31 { |
|
32 al +=bl; |
|
33 al +=bl; |
|
34 al +=bl; |
|
35 al +=bl; |
|
36 al +=bl; |
|
37 al +=bl; |
|
38 al +=bl; |
|
39 al +=bl; |
|
40 al +=bl; |
|
41 al +=bl; |
|
42 |
|
43 al +=bl; |
|
44 al +=bl; |
|
45 al +=bl; |
|
46 al +=bl; |
|
47 al +=bl; |
|
48 al +=bl; |
|
49 al +=bl; |
|
50 al +=bl; |
|
51 al +=bl; |
|
52 al +=bl; |
|
53 |
|
54 al +=bl; |
|
55 al +=bl; |
|
56 al +=bl; |
|
57 al +=bl; |
|
58 al +=bl; |
|
59 al +=bl; |
|
60 al +=bl; |
|
61 al +=bl; |
|
62 al +=bl; |
|
63 al +=bl; |
|
64 |
|
65 al +=bl; |
|
66 al +=bl; |
|
67 al +=bl; |
|
68 al +=bl; |
|
69 al +=bl; |
|
70 al +=bl; |
|
71 al +=bl; |
|
72 al +=bl; |
|
73 al +=bl; |
|
74 al +=bl; |
|
75 |
|
76 al +=bl; |
|
77 al +=bl; |
|
78 al +=bl; |
|
79 al +=bl; |
|
80 al +=bl; |
|
81 al +=bl; |
|
82 al +=bl; |
|
83 al +=bl; |
|
84 al +=bl; |
|
85 al +=bl; |
|
86 |
|
87 al +=bl; |
|
88 al +=bl; |
|
89 al +=bl; |
|
90 al +=bl; |
|
91 al +=bl; |
|
92 al +=bl; |
|
93 al +=bl; |
|
94 al +=bl; |
|
95 al +=bl; |
|
96 al +=bl; |
|
97 |
|
98 al +=bl; |
|
99 al +=bl; |
|
100 al +=bl; |
|
101 al +=bl; |
|
102 al +=bl; |
|
103 al +=bl; |
|
104 al +=bl; |
|
105 al +=bl; |
|
106 al +=bl; |
|
107 al +=bl; |
|
108 |
|
109 al +=bl; |
|
110 al +=bl; |
|
111 al +=bl; |
|
112 al +=bl; |
|
113 al +=bl; |
|
114 al +=bl; |
|
115 al +=bl; |
|
116 al +=bl; |
|
117 al +=bl; |
|
118 al +=bl; |
|
119 |
|
120 al +=bl; |
|
121 al +=bl; |
|
122 al +=bl; |
|
123 al +=bl; |
|
124 al +=bl; |
|
125 al +=bl; |
|
126 al +=bl; |
|
127 al +=bl; |
|
128 al +=bl; |
|
129 al +=bl; |
|
130 |
|
131 al +=bl; |
|
132 al +=bl; |
|
133 al +=bl; |
|
134 al +=bl; |
|
135 al +=bl; |
|
136 al +=bl; |
|
137 al +=bl; |
|
138 al +=bl; |
|
139 al +=bl; |
|
140 al +=bl; |
|
141 |
|
142 a = al; |
|
143 count += x; |
|
144 if (!count) |
|
145 break; |
|
146 } |
|
147 return (TInt)count; |
|
148 } |
|
149 |
|
150 TInt TInt64Subtraction(TAny*) |
|
151 { |
|
152 |
|
153 a = MAKE_TINT64(0x31514531,0x93471672u); |
|
154 b = MAKE_TINT64(0x51514531,0x33847162); |
|
155 |
|
156 TInt64 al = a; |
|
157 const TInt64 bl = b; |
|
158 const TInt64 x = 1; |
|
159 for(;;) |
|
160 { |
|
161 al -=bl; |
|
162 al -=bl; |
|
163 al -=bl; |
|
164 al -=bl; |
|
165 al -=bl; |
|
166 al -=bl; |
|
167 al -=bl; |
|
168 al -=bl; |
|
169 al -=bl; |
|
170 al -=bl; |
|
171 |
|
172 al -=bl; |
|
173 al -=bl; |
|
174 al -=bl; |
|
175 al -=bl; |
|
176 al -=bl; |
|
177 al -=bl; |
|
178 al -=bl; |
|
179 al -=bl; |
|
180 al -=bl; |
|
181 al -=bl; |
|
182 |
|
183 al -=bl; |
|
184 al -=bl; |
|
185 al -=bl; |
|
186 al -=bl; |
|
187 al -=bl; |
|
188 al -=bl; |
|
189 al -=bl; |
|
190 al -=bl; |
|
191 al -=bl; |
|
192 al -=bl; |
|
193 |
|
194 al -=bl; |
|
195 al -=bl; |
|
196 al -=bl; |
|
197 al -=bl; |
|
198 al -=bl; |
|
199 al -=bl; |
|
200 al -=bl; |
|
201 al -=bl; |
|
202 al -=bl; |
|
203 al -=bl; |
|
204 |
|
205 al -=bl; |
|
206 al -=bl; |
|
207 al -=bl; |
|
208 al -=bl; |
|
209 al -=bl; |
|
210 al -=bl; |
|
211 al -=bl; |
|
212 al -=bl; |
|
213 al -=bl; |
|
214 al -=bl; |
|
215 |
|
216 al -=bl; |
|
217 al -=bl; |
|
218 al -=bl; |
|
219 al -=bl; |
|
220 al -=bl; |
|
221 al -=bl; |
|
222 al -=bl; |
|
223 al -=bl; |
|
224 al -=bl; |
|
225 al -=bl; |
|
226 |
|
227 al -=bl; |
|
228 al -=bl; |
|
229 al -=bl; |
|
230 al -=bl; |
|
231 al -=bl; |
|
232 al -=bl; |
|
233 al -=bl; |
|
234 al -=bl; |
|
235 al -=bl; |
|
236 al -=bl; |
|
237 |
|
238 al -=bl; |
|
239 al -=bl; |
|
240 al -=bl; |
|
241 al -=bl; |
|
242 al -=bl; |
|
243 al -=bl; |
|
244 al -=bl; |
|
245 al -=bl; |
|
246 al -=bl; |
|
247 al -=bl; |
|
248 |
|
249 al -=bl; |
|
250 al -=bl; |
|
251 al -=bl; |
|
252 al -=bl; |
|
253 al -=bl; |
|
254 al -=bl; |
|
255 al -=bl; |
|
256 al -=bl; |
|
257 al -=bl; |
|
258 al -=bl; |
|
259 |
|
260 al -=bl; |
|
261 al -=bl; |
|
262 al -=bl; |
|
263 al -=bl; |
|
264 al -=bl; |
|
265 al -=bl; |
|
266 al -=bl; |
|
267 al -=bl; |
|
268 al -=bl; |
|
269 al -=bl; |
|
270 |
|
271 a = al; |
|
272 count += x; |
|
273 if (!count) |
|
274 break; |
|
275 } |
|
276 return (TInt)count; |
|
277 } |
|
278 |
|
279 |
|
280 TInt TInt64Multiplication(TAny*) |
|
281 { |
|
282 a = MAKE_TINT64(0xffffffff,0xfa0a1f00u); |
|
283 b = MAKE_TINT64(0x0,0xfa0a1f00u); |
|
284 |
|
285 TInt64 al = a; |
|
286 const TInt64 bl = b; |
|
287 const TInt64 x = 1; |
|
288 |
|
289 for(;;) |
|
290 { |
|
291 al *=bl; |
|
292 al *=bl; |
|
293 al *=bl; |
|
294 al *=bl; |
|
295 al *=bl; |
|
296 al *=bl; |
|
297 al *=bl; |
|
298 al *=bl; |
|
299 al *=bl; |
|
300 al *=bl; |
|
301 |
|
302 al *=bl; |
|
303 al *=bl; |
|
304 al *=bl; |
|
305 al *=bl; |
|
306 al *=bl; |
|
307 al *=bl; |
|
308 al *=bl; |
|
309 al *=bl; |
|
310 al *=bl; |
|
311 al *=bl; |
|
312 |
|
313 al *=bl; |
|
314 al *=bl; |
|
315 al *=bl; |
|
316 al *=bl; |
|
317 al *=bl; |
|
318 al *=bl; |
|
319 al *=bl; |
|
320 al *=bl; |
|
321 al *=bl; |
|
322 al *=bl; |
|
323 |
|
324 al *=bl; |
|
325 al *=bl; |
|
326 al *=bl; |
|
327 al *=bl; |
|
328 al *=bl; |
|
329 al *=bl; |
|
330 al *=bl; |
|
331 al *=bl; |
|
332 al *=bl; |
|
333 al *=bl; |
|
334 |
|
335 al *=bl; |
|
336 al *=bl; |
|
337 al *=bl; |
|
338 al *=bl; |
|
339 al *=bl; |
|
340 al *=bl; |
|
341 al *=bl; |
|
342 al *=bl; |
|
343 al *=bl; |
|
344 al *=bl; |
|
345 |
|
346 al *=bl; |
|
347 al *=bl; |
|
348 al *=bl; |
|
349 al *=bl; |
|
350 al *=bl; |
|
351 al *=bl; |
|
352 al *=bl; |
|
353 al *=bl; |
|
354 al *=bl; |
|
355 al *=bl; |
|
356 |
|
357 al *=bl; |
|
358 al *=bl; |
|
359 al *=bl; |
|
360 al *=bl; |
|
361 al *=bl; |
|
362 al *=bl; |
|
363 al *=bl; |
|
364 al *=bl; |
|
365 al *=bl; |
|
366 al *=bl; |
|
367 |
|
368 al *=bl; |
|
369 al *=bl; |
|
370 al *=bl; |
|
371 al *=bl; |
|
372 al *=bl; |
|
373 al *=bl; |
|
374 al *=bl; |
|
375 al *=bl; |
|
376 al *=bl; |
|
377 al *=bl; |
|
378 |
|
379 al *=bl; |
|
380 al *=bl; |
|
381 al *=bl; |
|
382 al *=bl; |
|
383 al *=bl; |
|
384 al *=bl; |
|
385 al *=bl; |
|
386 al *=bl; |
|
387 al *=bl; |
|
388 al *=bl; |
|
389 |
|
390 al *=bl; |
|
391 al *=bl; |
|
392 al *=bl; |
|
393 al *=bl; |
|
394 al *=bl; |
|
395 al *=bl; |
|
396 al *=bl; |
|
397 al *=bl; |
|
398 al *=bl; |
|
399 al *=bl; |
|
400 |
|
401 a = al; |
|
402 count += x; |
|
403 if (!count) |
|
404 break; |
|
405 } |
|
406 return (TInt)count; |
|
407 } |
|
408 |
|
409 TInt TInt64Division(TAny*) |
|
410 { |
|
411 |
|
412 a = MAKE_TINT64(0x31514531,0x93471672u); |
|
413 b = MAKE_TINT64(0x0,0x05F5E100); |
|
414 |
|
415 TInt64 al = a; |
|
416 const TInt64 bl = b; |
|
417 const TInt64 x = 1; |
|
418 |
|
419 for(;;) |
|
420 { |
|
421 al /=bl; |
|
422 al /=bl; |
|
423 al /=bl; |
|
424 al /=bl; |
|
425 al /=bl; |
|
426 al /=bl; |
|
427 al /=bl; |
|
428 al /=bl; |
|
429 al /=bl; |
|
430 al /=bl; |
|
431 |
|
432 al /=bl; |
|
433 al /=bl; |
|
434 al /=bl; |
|
435 al /=bl; |
|
436 al /=bl; |
|
437 al /=bl; |
|
438 al /=bl; |
|
439 al /=bl; |
|
440 al /=bl; |
|
441 al /=bl; |
|
442 |
|
443 al /=bl; |
|
444 al /=bl; |
|
445 al /=bl; |
|
446 al /=bl; |
|
447 al /=bl; |
|
448 al /=bl; |
|
449 al /=bl; |
|
450 al /=bl; |
|
451 al /=bl; |
|
452 al /=bl; |
|
453 |
|
454 al /=bl; |
|
455 al /=bl; |
|
456 al /=bl; |
|
457 al /=bl; |
|
458 al /=bl; |
|
459 al /=bl; |
|
460 al /=bl; |
|
461 al /=bl; |
|
462 al /=bl; |
|
463 al /=bl; |
|
464 |
|
465 al /=bl; |
|
466 al /=bl; |
|
467 al /=bl; |
|
468 al /=bl; |
|
469 al /=bl; |
|
470 al /=bl; |
|
471 al /=bl; |
|
472 al /=bl; |
|
473 al /=bl; |
|
474 al /=bl; |
|
475 |
|
476 al /=bl; |
|
477 al /=bl; |
|
478 al /=bl; |
|
479 al /=bl; |
|
480 al /=bl; |
|
481 al /=bl; |
|
482 al /=bl; |
|
483 al /=bl; |
|
484 al /=bl; |
|
485 al /=bl; |
|
486 |
|
487 al /=bl; |
|
488 al /=bl; |
|
489 al /=bl; |
|
490 al /=bl; |
|
491 al /=bl; |
|
492 al /=bl; |
|
493 al /=bl; |
|
494 al /=bl; |
|
495 al /=bl; |
|
496 al /=bl; |
|
497 |
|
498 al /=bl; |
|
499 al /=bl; |
|
500 al /=bl; |
|
501 al /=bl; |
|
502 al /=bl; |
|
503 al /=bl; |
|
504 al /=bl; |
|
505 al /=bl; |
|
506 al /=bl; |
|
507 al /=bl; |
|
508 |
|
509 al /=bl; |
|
510 al /=bl; |
|
511 al /=bl; |
|
512 al /=bl; |
|
513 al /=bl; |
|
514 al /=bl; |
|
515 al /=bl; |
|
516 al /=bl; |
|
517 al /=bl; |
|
518 al /=bl; |
|
519 |
|
520 al /=bl; |
|
521 al /=bl; |
|
522 al /=bl; |
|
523 al /=bl; |
|
524 al /=bl; |
|
525 al /=bl; |
|
526 al /=bl; |
|
527 al /=bl; |
|
528 al /=bl; |
|
529 al /=bl; |
|
530 |
|
531 a = al; |
|
532 count += x; |
|
533 if (!count) |
|
534 break; |
|
535 } |
|
536 return (TInt)count; } |
|
537 |