fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / libjava / testsuite / libjava.compile / OperatorBenchmark.java
blob700e5f82031f9d32063961e20f7308b004b0647b
2 /*
3 * Copyright (c) 1996, 1997 by Doug Bell <dbell@shvn.com>. All Rights Reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
28 // This file has been hacked to compile without the rest of the
29 // benchmark code.
31 class OperatorBenchmark {
33 public int getSampleCount() { return 0; }
34 public int getSampleMillis() { return 0; }
35 public boolean go;
36 public int useint[];
37 public void startTest () { }
38 public long finishTest () { return 0; }
39 public void startTimer (boolean b) { }
40 public void stopTimer (int a, int b) { }
41 public void report (String s) { }
42 public void println (String s) { }
44 public int getTestTime () {
45 return (int) (100 * getSampleCount() * getSampleMillis()) / 1000;
48 public int getRunningTime () {
49 return (int) (1.1 * getTestTime());
52 public long runTest () {
53 int dummy1 = 0, dummy2 = 0, dummy3 = 0; // occupy implicit index slots
54 int cnt, ii;
55 byte b1 = 1, b2 = 2, b3 = 3;
56 short s1 = 1, s2 = 2, s3 = 3;
57 int i1 = 1, i2 = 2, i3 = 3;
58 long l1 = 1, l2 = 2, l3 = 3;
59 float f1 = 1, f2 = 2, f3 = 3;
60 double d1 = 1, d2 = 2, d3 = 3;
62 startTest();
64 println("--- byte operators, local vars");
66 for (cnt = getSampleCount(); --cnt >= 0; ) {
67 startTimer(true);
68 for (ii = 0; go; ii++)
69 b1++;
70 stopTimer(cnt, ii);
72 report("byte++");
74 for (cnt = getSampleCount(); --cnt >= 0; ) {
75 startTimer(true);
76 for (ii = 0; go; ii++)
77 b1 += b2;
78 stopTimer(cnt, ii);
80 report("byte += byte");
82 for (cnt = getSampleCount(); --cnt >= 0; ) {
83 startTimer(true);
84 for (ii = 0; go; ii++)
85 b1 = (byte) (b2 + b3);
86 stopTimer(cnt, ii);
88 report("byte = byte + byte");
90 for (cnt = getSampleCount(); --cnt >= 0; ) {
91 startTimer(true);
92 for (ii = 0; go; ii++)
93 b1 *= b2;
94 stopTimer(cnt, ii);
96 report("byte *= byte");
98 for (cnt = getSampleCount(); --cnt >= 0; ) {
99 startTimer(true);
100 for (ii = 0; go; ii++)
101 b1 = (byte) (b2 * b3);
102 stopTimer(cnt, ii);
104 report("byte = byte * byte");
106 for (cnt = getSampleCount(); --cnt >= 0; ) {
107 startTimer(true);
108 for (ii = 0; go; ii++)
109 b1 *= 2;
110 stopTimer(cnt, ii);
112 report("byte *= 2");
114 for (cnt = getSampleCount(); --cnt >= 0; ) {
115 startTimer(true);
116 for (ii = 0; go; ii++)
117 b1 <<= 1;
118 stopTimer(cnt, ii);
120 report("byte <<= 1");
122 for (cnt = getSampleCount(); --cnt >= 0; ) {
123 startTimer(true);
124 for (ii = 0; go; ii++)
125 b1 %= b2;
126 stopTimer(cnt, ii);
128 report("byte %= byte");
130 for (cnt = getSampleCount(); --cnt >= 0; ) {
131 startTimer(true);
132 for (ii = 0; go; ii++)
133 b1 = (byte) (b2 % b3);
134 stopTimer(cnt, ii);
136 report("byte = byte % byte");
138 for (cnt = getSampleCount(); --cnt >= 0; ) {
139 startTimer(true);
140 for (ii = 0; go; ii++)
141 b1 /= b2;
142 stopTimer(cnt, ii);
144 report("byte /= byte");
146 for (cnt = getSampleCount(); --cnt >= 0; ) {
147 startTimer(true);
148 for (ii = 0; go; ii++)
149 b1 = (byte) (b2 / b3);
150 stopTimer(cnt, ii);
152 report("byte = byte / byte");
154 for (cnt = getSampleCount(); --cnt >= 0; ) {
155 startTimer(true);
156 for (ii = 0; go; ii++)
157 b1 /= 2;
158 stopTimer(cnt, ii);
160 report("byte /= 2");
162 for (cnt = getSampleCount(); --cnt >= 0; ) {
163 startTimer(true);
164 for (ii = 0; go; ii++)
165 b1 >>= 1;
166 stopTimer(cnt, ii);
168 report("byte >>= 1");
170 for (cnt = getSampleCount(); --cnt >= 0; ) {
171 startTimer(true);
172 for (ii = 0; go; ii++)
173 b1 >>= i2;
174 stopTimer(cnt, ii);
176 report("byte >>= int");
178 for (cnt = getSampleCount(); --cnt >= 0; ) {
179 startTimer(true);
180 for (ii = 0; go; ii++)
181 b1 = (byte) (b2 >> i3);
182 stopTimer(cnt, ii);
184 report("byte = byte >> int");
186 for (cnt = getSampleCount(); --cnt >= 0; ) {
187 startTimer(true);
188 for (ii = 0; go; ii++)
189 b1 |= b2;
190 stopTimer(cnt, ii);
192 report("byte |= byte");
194 for (cnt = getSampleCount(); --cnt >= 0; ) {
195 startTimer(true);
196 for (ii = 0; go; ii++)
197 b1 = (byte) (b2 | b3);
198 stopTimer(cnt, ii);
200 report("byte = byte | byte");
202 for (cnt = getSampleCount(); --cnt >= 0; ) {
203 startTimer(true);
204 for (ii = 0; go; ii++)
205 b1 &= b2;
206 stopTimer(cnt, ii);
208 report("byte &= byte");
210 for (cnt = getSampleCount(); --cnt >= 0; ) {
211 startTimer(true);
212 for (ii = 0; go; ii++)
213 b1 = (byte) (b2 & b3);
214 stopTimer(cnt, ii);
216 report("byte = byte & byte");
218 for (cnt = getSampleCount(); --cnt >= 0; ) {
219 startTimer(true);
220 for (ii = 0; go; ii++)
221 b1 ^= b2;
222 stopTimer(cnt, ii);
224 report("byte ^= byte");
226 for (cnt = getSampleCount(); --cnt >= 0; ) {
227 startTimer(true);
228 for (ii = 0; go; ii++)
229 b1 = (byte) (b2 ^ b3);
230 stopTimer(cnt, ii);
232 report("byte = byte ^ byte");
235 println("--- short operators, local vars");
237 for (cnt = getSampleCount(); --cnt >= 0; ) {
238 startTimer(true);
239 for (ii = 0; go; ii++)
240 s1++;
241 stopTimer(cnt, ii);
243 report("short++");
245 for (cnt = getSampleCount(); --cnt >= 0; ) {
246 startTimer(true);
247 for (ii = 0; go; ii++)
248 s1 += s2;
249 stopTimer(cnt, ii);
251 report("short += short");
253 for (cnt = getSampleCount(); --cnt >= 0; ) {
254 startTimer(true);
255 for (ii = 0; go; ii++)
256 s1 = (short) (s2 + s3);
257 stopTimer(cnt, ii);
259 report("short = short + short");
261 for (cnt = getSampleCount(); --cnt >= 0; ) {
262 startTimer(true);
263 for (ii = 0; go; ii++)
264 s1 *= s2;
265 stopTimer(cnt, ii);
267 report("short *= short");
269 for (cnt = getSampleCount(); --cnt >= 0; ) {
270 startTimer(true);
271 for (ii = 0; go; ii++)
272 s1 = (short) (s2 * s3);
273 stopTimer(cnt, ii);
275 report("short = short * short");
277 for (cnt = getSampleCount(); --cnt >= 0; ) {
278 startTimer(true);
279 for (ii = 0; go; ii++)
280 s1 *= 2;
281 stopTimer(cnt, ii);
283 report("short *= 2");
285 for (cnt = getSampleCount(); --cnt >= 0; ) {
286 startTimer(true);
287 for (ii = 0; go; ii++)
288 s1 <<= 1;
289 stopTimer(cnt, ii);
291 report("short <<= 1");
293 for (cnt = getSampleCount(); --cnt >= 0; ) {
294 startTimer(true);
295 for (ii = 0; go; ii++)
296 s1 %= s2;
297 stopTimer(cnt, ii);
299 report("short %= short");
301 for (cnt = getSampleCount(); --cnt >= 0; ) {
302 startTimer(true);
303 for (ii = 0; go; ii++)
304 s1 = (short) (s2 % s3);
305 stopTimer(cnt, ii);
307 report("short = short % short");
309 for (cnt = getSampleCount(); --cnt >= 0; ) {
310 startTimer(true);
311 for (ii = 0; go; ii++)
312 s1 /= s2;
313 stopTimer(cnt, ii);
315 report("short /= short");
317 for (cnt = getSampleCount(); --cnt >= 0; ) {
318 startTimer(true);
319 for (ii = 0; go; ii++)
320 s1 = (short) (s2 / s3);
321 stopTimer(cnt, ii);
323 report("short = short / short");
325 for (cnt = getSampleCount(); --cnt >= 0; ) {
326 startTimer(true);
327 for (ii = 0; go; ii++)
328 s1 /= 2;
329 stopTimer(cnt, ii);
331 report("short /= 2");
333 for (cnt = getSampleCount(); --cnt >= 0; ) {
334 startTimer(true);
335 for (ii = 0; go; ii++)
336 s1 >>= 1;
337 stopTimer(cnt, ii);
339 report("short >>= 1");
341 for (cnt = getSampleCount(); --cnt >= 0; ) {
342 startTimer(true);
343 for (ii = 0; go; ii++)
344 s1 >>= i2;
345 stopTimer(cnt, ii);
347 report("short >>= int");
349 for (cnt = getSampleCount(); --cnt >= 0; ) {
350 startTimer(true);
351 for (ii = 0; go; ii++)
352 s1 = (short) (s2 >> i3);
353 stopTimer(cnt, ii);
355 report("short = short >> int");
357 for (cnt = getSampleCount(); --cnt >= 0; ) {
358 startTimer(true);
359 for (ii = 0; go; ii++)
360 s1 |= s2;
361 stopTimer(cnt, ii);
363 report("short |= short");
365 for (cnt = getSampleCount(); --cnt >= 0; ) {
366 startTimer(true);
367 for (ii = 0; go; ii++)
368 s1 = (short) (s2 | s3);
369 stopTimer(cnt, ii);
371 report("short = short | short");
373 for (cnt = getSampleCount(); --cnt >= 0; ) {
374 startTimer(true);
375 for (ii = 0; go; ii++)
376 s1 &= s2;
377 stopTimer(cnt, ii);
379 report("short &= short");
381 for (cnt = getSampleCount(); --cnt >= 0; ) {
382 startTimer(true);
383 for (ii = 0; go; ii++)
384 s1 = (short) (s2 & s3);
385 stopTimer(cnt, ii);
387 report("short = short & short");
389 for (cnt = getSampleCount(); --cnt >= 0; ) {
390 startTimer(true);
391 for (ii = 0; go; ii++)
392 s1 ^= s2;
393 stopTimer(cnt, ii);
395 report("short ^= short");
397 for (cnt = getSampleCount(); --cnt >= 0; ) {
398 startTimer(true);
399 for (ii = 0; go; ii++)
400 s1 = (short) (s2 ^ s3);
401 stopTimer(cnt, ii);
403 report("short = short ^ short");
406 println("--- int operators, local vars");
408 for (cnt = getSampleCount(); --cnt >= 0; ) {
409 startTimer(true);
410 for (ii = 0; go; ii++)
411 i1++;
412 stopTimer(cnt, ii);
414 report("int++");
416 for (cnt = getSampleCount(); --cnt >= 0; ) {
417 startTimer(true);
418 for (ii = 0; go; ii++)
419 i1 += i2;
420 stopTimer(cnt, ii);
422 report("int += int");
424 for (cnt = getSampleCount(); --cnt >= 0; ) {
425 startTimer(true);
426 for (ii = 0; go; ii++)
427 i1 = (i2 + i3);
428 stopTimer(cnt, ii);
430 report("int = int + int");
432 for (cnt = getSampleCount(); --cnt >= 0; ) {
433 startTimer(true);
434 for (ii = 0; go; ii++)
435 i1 *= i2;
436 stopTimer(cnt, ii);
438 report("int *= int");
440 for (cnt = getSampleCount(); --cnt >= 0; ) {
441 startTimer(true);
442 for (ii = 0; go; ii++)
443 i1 = (i2 * i3);
444 stopTimer(cnt, ii);
446 report("int = int * int");
448 for (cnt = getSampleCount(); --cnt >= 0; ) {
449 startTimer(true);
450 for (ii = 0; go; ii++)
451 i1 *= 2;
452 stopTimer(cnt, ii);
454 report("int *= 2");
456 for (cnt = getSampleCount(); --cnt >= 0; ) {
457 startTimer(true);
458 for (ii = 0; go; ii++)
459 i1 <<= 1;
460 stopTimer(cnt, ii);
462 report("int <<= 1");
464 for (cnt = getSampleCount(); --cnt >= 0; ) {
465 startTimer(true);
466 for (ii = 0; go; ii++)
467 i1 %= i2;
468 stopTimer(cnt, ii);
470 report("int %= int");
472 for (cnt = getSampleCount(); --cnt >= 0; ) {
473 startTimer(true);
474 for (ii = 0; go; ii++)
475 i1 = (i2 % i3);
476 stopTimer(cnt, ii);
478 report("int = int % int");
480 for (cnt = getSampleCount(); --cnt >= 0; ) {
481 startTimer(true);
482 for (ii = 0; go; ii++)
483 i1 /= i2;
484 stopTimer(cnt, ii);
486 report("int /= int");
488 for (cnt = getSampleCount(); --cnt >= 0; ) {
489 startTimer(true);
490 for (ii = 0; go; ii++)
491 i1 = (i2 / i3);
492 stopTimer(cnt, ii);
494 report("int = int / int");
496 for (cnt = getSampleCount(); --cnt >= 0; ) {
497 startTimer(true);
498 for (ii = 0; go; ii++)
499 i1 /= 2;
500 stopTimer(cnt, ii);
502 report("int /= 2");
504 for (cnt = getSampleCount(); --cnt >= 0; ) {
505 startTimer(true);
506 for (ii = 0; go; ii++)
507 i1 >>= 1;
508 stopTimer(cnt, ii);
510 report("int >>= 1");
512 for (cnt = getSampleCount(); --cnt >= 0; ) {
513 startTimer(true);
514 for (ii = 0; go; ii++)
515 i1 >>= i2;
516 stopTimer(cnt, ii);
518 report("int >>= int");
520 for (cnt = getSampleCount(); --cnt >= 0; ) {
521 startTimer(true);
522 for (ii = 0; go; ii++)
523 i1 = i2 >> i3;
524 stopTimer(cnt, ii);
526 report("int = int >> int");
528 for (cnt = getSampleCount(); --cnt >= 0; ) {
529 startTimer(true);
530 for (ii = 0; go; ii++)
531 i1 |= i2;
532 stopTimer(cnt, ii);
534 report("int |= int");
536 for (cnt = getSampleCount(); --cnt >= 0; ) {
537 startTimer(true);
538 for (ii = 0; go; ii++)
539 i1 = i2 | i3;
540 stopTimer(cnt, ii);
542 report("int = int | int");
544 for (cnt = getSampleCount(); --cnt >= 0; ) {
545 startTimer(true);
546 for (ii = 0; go; ii++)
547 i1 &= i2;
548 stopTimer(cnt, ii);
550 report("int &= int");
552 for (cnt = getSampleCount(); --cnt >= 0; ) {
553 startTimer(true);
554 for (ii = 0; go; ii++)
555 i1 = i2 & i3;
556 stopTimer(cnt, ii);
558 report("int = int & int");
560 for (cnt = getSampleCount(); --cnt >= 0; ) {
561 startTimer(true);
562 for (ii = 0; go; ii++)
563 i1 ^= i2;
564 stopTimer(cnt, ii);
566 report("int ^= int");
568 for (cnt = getSampleCount(); --cnt >= 0; ) {
569 startTimer(true);
570 for (ii = 0; go; ii++)
571 i1 = i2 ^ i3;
572 stopTimer(cnt, ii);
574 report("int = int ^ int");
577 println("--- long operators, local vars");
579 for (cnt = getSampleCount(); --cnt >= 0; ) {
580 startTimer(true);
581 for (ii = 0; go; ii++)
582 l1++;
583 stopTimer(cnt, ii);
585 report("long++");
587 for (cnt = getSampleCount(); --cnt >= 0; ) {
588 startTimer(true);
589 for (ii = 0; go; ii++)
590 l1 += l2;
591 stopTimer(cnt, ii);
593 report("long += long");
595 for (cnt = getSampleCount(); --cnt >= 0; ) {
596 startTimer(true);
597 for (ii = 0; go; ii++)
598 l1 = (l2 + l3);
599 stopTimer(cnt, ii);
601 report("long = long + long");
603 for (cnt = getSampleCount(); --cnt >= 0; ) {
604 startTimer(true);
605 for (ii = 0; go; ii++)
606 l1 *= l2;
607 stopTimer(cnt, ii);
609 report("long *= long");
611 for (cnt = getSampleCount(); --cnt >= 0; ) {
612 startTimer(true);
613 for (ii = 0; go; ii++)
614 l1 = (l2 * l3);
615 stopTimer(cnt, ii);
617 report("long = long * long");
619 for (cnt = getSampleCount(); --cnt >= 0; ) {
620 startTimer(true);
621 for (ii = 0; go; ii++)
622 l1 *= 2;
623 stopTimer(cnt, ii);
625 report("long *= 2");
627 for (cnt = getSampleCount(); --cnt >= 0; ) {
628 startTimer(true);
629 for (ii = 0; go; ii++)
630 l1 <<= 1;
631 stopTimer(cnt, ii);
633 report("long <<= 1");
635 for (cnt = getSampleCount(); --cnt >= 0; ) {
636 startTimer(true);
637 for (ii = 0; go; ii++)
638 l1 %= l2;
639 stopTimer(cnt, ii);
641 report("long %= long");
643 for (cnt = getSampleCount(); --cnt >= 0; ) {
644 startTimer(true);
645 for (ii = 0; go; ii++)
646 l1 = (l2 % l3);
647 stopTimer(cnt, ii);
649 report("long = long % long");
651 for (cnt = getSampleCount(); --cnt >= 0; ) {
652 startTimer(true);
653 for (ii = 0; go; ii++)
654 l1 /= l2;
655 stopTimer(cnt, ii);
657 report("long /= long");
659 for (cnt = getSampleCount(); --cnt >= 0; ) {
660 startTimer(true);
661 for (ii = 0; go; ii++)
662 l1 = (l2 / l3);
663 stopTimer(cnt, ii);
665 report("long = long / long");
667 for (cnt = getSampleCount(); --cnt >= 0; ) {
668 startTimer(true);
669 for (ii = 0; go; ii++)
670 l1 /= 2;
671 stopTimer(cnt, ii);
673 report("long /= 2");
675 for (cnt = getSampleCount(); --cnt >= 0; ) {
676 startTimer(true);
677 for (ii = 0; go; ii++)
678 l1 >>= 1;
679 stopTimer(cnt, ii);
681 report("long >>= 1");
683 for (cnt = getSampleCount(); --cnt >= 0; ) {
684 startTimer(true);
685 for (ii = 0; go; ii++)
686 l1 >>= i2;
687 stopTimer(cnt, ii);
689 report("long >>= int");
691 for (cnt = getSampleCount(); --cnt >= 0; ) {
692 startTimer(true);
693 for (ii = 0; go; ii++)
694 l1 = l2 >> i3;
695 stopTimer(cnt, ii);
697 report("long = long >> int");
699 for (cnt = getSampleCount(); --cnt >= 0; ) {
700 startTimer(true);
701 for (ii = 0; go; ii++)
702 l1 |= l2;
703 stopTimer(cnt, ii);
705 report("long |= long");
707 for (cnt = getSampleCount(); --cnt >= 0; ) {
708 startTimer(true);
709 for (ii = 0; go; ii++)
710 l1 = l2 | l3;
711 stopTimer(cnt, ii);
713 report("long = long | long");
715 for (cnt = getSampleCount(); --cnt >= 0; ) {
716 startTimer(true);
717 for (ii = 0; go; ii++)
718 l1 &= l2;
719 stopTimer(cnt, ii);
721 report("long &= long");
723 for (cnt = getSampleCount(); --cnt >= 0; ) {
724 startTimer(true);
725 for (ii = 0; go; ii++)
726 l1 = l2 & l3;
727 stopTimer(cnt, ii);
729 report("long = long & long");
731 for (cnt = getSampleCount(); --cnt >= 0; ) {
732 startTimer(true);
733 for (ii = 0; go; ii++)
734 l1 ^= l2;
735 stopTimer(cnt, ii);
737 report("long ^= long");
739 for (cnt = getSampleCount(); --cnt >= 0; ) {
740 startTimer(true);
741 for (ii = 0; go; ii++)
742 l1 = l2 ^ l3;
743 stopTimer(cnt, ii);
745 report("long = long ^ long");
748 println("--- float operators, local vars");
750 for (cnt = getSampleCount(); --cnt >= 0; ) {
751 startTimer(true);
752 for (ii = 0; go; ii++)
753 f1 += f2;
754 stopTimer(cnt, ii);
756 report("float += float");
758 for (cnt = getSampleCount(); --cnt >= 0; ) {
759 startTimer(true);
760 for (ii = 0; go; ii++)
761 f1 = (float) (f2 + f3);
762 stopTimer(cnt, ii);
764 report("float = float + float");
766 for (cnt = getSampleCount(); --cnt >= 0; ) {
767 startTimer(true);
768 for (ii = 0; go; ii++)
769 f1 *= f2;
770 stopTimer(cnt, ii);
772 report("float *= float");
774 for (cnt = getSampleCount(); --cnt >= 0; ) {
775 startTimer(true);
776 for (ii = 0; go; ii++)
777 f1 = (float) (f2 * f3);
778 stopTimer(cnt, ii);
780 report("float = float * float");
782 for (cnt = getSampleCount(); --cnt >= 0; ) {
783 startTimer(true);
784 for (ii = 0; go; ii++)
785 f1 %= f2;
786 stopTimer(cnt, ii);
788 report("float %= float");
790 for (cnt = getSampleCount(); --cnt >= 0; ) {
791 startTimer(true);
792 for (ii = 0; go; ii++)
793 f1 = (float) (f2 % f3);
794 stopTimer(cnt, ii);
796 report("float = float % float");
798 for (cnt = getSampleCount(); --cnt >= 0; ) {
799 startTimer(true);
800 for (ii = 0; go; ii++)
801 f1 /= f2;
802 stopTimer(cnt, ii);
804 report("float /= float");
806 for (cnt = getSampleCount(); --cnt >= 0; ) {
807 startTimer(true);
808 for (ii = 0; go; ii++)
809 f1 = (float) (f2 / f3);
810 stopTimer(cnt, ii);
812 report("float = float / float");
815 println("--- double operators, local vars");
817 for (cnt = getSampleCount(); --cnt >= 0; ) {
818 startTimer(true);
819 for (ii = 0; go; ii++)
820 d1 += d2;
821 stopTimer(cnt, ii);
823 report("double += double");
825 for (cnt = getSampleCount(); --cnt >= 0; ) {
826 startTimer(true);
827 for (ii = 0; go; ii++)
828 d1 = (d2 + d3);
829 stopTimer(cnt, ii);
831 report("double = double + double");
833 for (cnt = getSampleCount(); --cnt >= 0; ) {
834 startTimer(true);
835 for (ii = 0; go; ii++)
836 d1 *= d2;
837 stopTimer(cnt, ii);
839 report("double *= double");
841 for (cnt = getSampleCount(); --cnt >= 0; ) {
842 startTimer(true);
843 for (ii = 0; go; ii++)
844 d1 = (d2 * d3);
845 stopTimer(cnt, ii);
847 report("double = double * double");
849 for (cnt = getSampleCount(); --cnt >= 0; ) {
850 startTimer(true);
851 for (ii = 0; go; ii++)
852 d1 %= d2;
853 stopTimer(cnt, ii);
855 report("double %= double");
857 for (cnt = getSampleCount(); --cnt >= 0; ) {
858 startTimer(true);
859 for (ii = 0; go; ii++)
860 d1 = (d2 % d3);
861 stopTimer(cnt, ii);
863 report("double = double % double");
865 for (cnt = getSampleCount(); --cnt >= 0; ) {
866 startTimer(true);
867 for (ii = 0; go; ii++)
868 d1 /= d2;
869 stopTimer(cnt, ii);
871 report("double /= double");
873 for (cnt = getSampleCount(); --cnt >= 0; ) {
874 startTimer(true);
875 for (ii = 0; go; ii++)
876 d1 = (d2 / d3);
877 stopTimer(cnt, ii);
879 report("double = double / double");
881 useint[0] = dummy1; useint[1] = dummy2; useint[2] = dummy3;
882 return finishTest();
884 } // class OperatorBenchmark
886 // EOF