comparison graal/com.oracle.max.asmdis/test/test/com/sun/max/asm/ppc/SpeedTest.java @ 4142:bc8527f3071c

Adjust code base to new level of warnings.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 18 Dec 2011 05:24:06 +0100
parents e233f5660da4
children
comparison
equal deleted inserted replaced
4141:04d21be7a24f 4142:bc8527f3071c
23 package test.com.sun.max.asm.ppc; 23 package test.com.sun.max.asm.ppc;
24 24
25 import static com.sun.max.asm.ppc.BranchPredictionBits.*; 25 import static com.sun.max.asm.ppc.BranchPredictionBits.*;
26 import static com.sun.max.asm.ppc.CRF.*; 26 import static com.sun.max.asm.ppc.CRF.*;
27 import static com.sun.max.asm.ppc.GPR.*; 27 import static com.sun.max.asm.ppc.GPR.*;
28
29 import java.io.*;
30 28
31 import junit.framework.*; 29 import junit.framework.*;
32 30
33 import com.sun.max.asm.*; 31 import com.sun.max.asm.*;
34 import com.sun.max.asm.ppc.complete.*; 32 import com.sun.max.asm.ppc.complete.*;
55 53
56 public static void main(String[] args) { 54 public static void main(String[] args) {
57 junit.textui.TestRunner.run(SpeedTest.class); 55 junit.textui.TestRunner.run(SpeedTest.class);
58 } 56 }
59 57
60 public byte[] produce() throws IOException, AssemblyException { 58 public byte[] produce() throws AssemblyException {
61 final int startAddress = 0x0000ecf0; 59 final int startAddress = 0x0000ecf0;
62 final PPC32Assembler asm = new PPC32Assembler(startAddress); 60 final PPC32Assembler asm = new PPC32Assembler(startAddress);
63 final Label label1 = new Label(); 61 final Label label1 = new Label();
64 62
65 asm.mflr(R0); 63 asm.mflr(R0);
100 asm.addi(SP, SP, 96); 98 asm.addi(SP, SP, 96);
101 asm.blr(); 99 asm.blr();
102 return asm.toByteArray(); 100 return asm.toByteArray();
103 } 101 }
104 102
105 public void test_speed() throws IOException, AssemblyException { 103 public void test_speed() throws AssemblyException {
106 System.out.println("start"); 104 System.out.println("start");
107 for (int i = 0; i < 10000000; i++) { 105 for (int i = 0; i < 10000000; i++) {
108 produce(); 106 produce();
109 } 107 }
110 System.out.println("done."); 108 System.out.println("done.");