projects
/
nestedvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lessconstants support for classfilecompiler
[nestedvm.git]
/
src
/
org
/
ibex
/
nestedvm
/
Interpreter.java
diff --git
a/src/org/ibex/nestedvm/Interpreter.java
b/src/org/ibex/nestedvm/Interpreter.java
index
1fcdc4b
..
df9a111
100644
(file)
--- a/
src/org/ibex/nestedvm/Interpreter.java
+++ b/
src/org/ibex/nestedvm/Interpreter.java
@@
-7,7
+7,7
@@
package org.ibex.nestedvm;
import org.ibex.nestedvm.util.*;
import java.io.*;
import org.ibex.nestedvm.util.*;
import java.io.*;
-public class Interpreter extends UnixRuntime {
+public class Interpreter extends UnixRuntime implements Cloneable {
// Registers
private int[] registers = new int[32];
private int hi,lo;
// Registers
private int[] registers = new int[32];
private int hi,lo;
@@
-51,6
+51,13
@@
public class Interpreter extends UnixRuntime {
}
}
}
}
+ protected Object clone() throws CloneNotSupportedException {
+ Interpreter r = (Interpreter) super.clone();
+ r.registers = (int[]) registers.clone();
+ r.fpregs = (int[]) fpregs.clone();
+ return r;
+ }
+
// Main interpretor
// the return value is meaningless, its just to catch people typing "return" by accident
private final int runSome() throws FaultException,ExecutionException {
// Main interpretor
// the return value is meaningless, its just to catch people typing "return" by accident
private final int runSome() throws FaultException,ExecutionException {
@@
-87,7
+94,7
@@
public class Interpreter extends UnixRuntime {
int tmp, addr; // temporaries
r[ZERO] = 0;
int tmp, addr; // temporaries
r[ZERO] = 0;
-
+
switch(op) {
case 0: {
switch(subcode) {
switch(op) {
case 0: {
switch(subcode) {
@@
-118,7
+125,7
@@
public class Interpreter extends UnixRuntime {
continue OUTER;
case 12: // SYSCALL
this.pc = pc;
continue OUTER;
case 12: // SYSCALL
this.pc = pc;
- r[V0] = syscall(r[V0],r[A0],r[A1],r[A2],r[A3]);
+ r[V0] = syscall(r[V0],r[A0],r[A1],r[A2],r[A3],r[T0],r[T1]);
if(state != RUNNING) { this.pc = nextPC; break OUTER; }
break;
case 13: // BREAK
if(state != RUNNING) { this.pc = nextPC; break OUTER; }
break;
case 13: // BREAK
@@
-136,7
+143,7
@@
public class Interpreter extends UnixRuntime {
lo = r[rs];
break;
case 24: { // MULT
lo = r[rs];
break;
case 24: { // MULT
- long hilo = (long)(r[rs]) * ((long)r[rt]);
+ long hilo = ((long)r[rs]) * ((long)r[rt]);
hi = (int) (hilo >>> 32);
lo = (int) hilo;
break;
hi = (int) (hilo >>> 32);
lo = (int) hilo;
break;
@@
-356,6
+363,9
@@
public class Interpreter extends UnixRuntime {
case 60: // C.LT.S
setFC(getFloat(fs) < getFloat(ft));
break;
case 60: // C.LT.S
setFC(getFloat(fs) < getFloat(ft));
break;
+ case 62: // C.LE.S
+ setFC(getFloat(fs) <= getFloat(ft));
+ break;
default: throw new ExecutionException("Invalid Instruction 17/" + rs + "/" + subcode + " at " + sourceLine(pc));
}
break;
default: throw new ExecutionException("Invalid Instruction 17/" + rs + "/" + subcode + " at " + sourceLine(pc));
}
break;
@@
-415,6
+425,9
@@
public class Interpreter extends UnixRuntime {
}
case 20: { // Integer
switch(subcode) {
}
case 20: { // Integer
switch(subcode) {
+ case 32: // CVT.S.W
+ setFloat(fd,f[fs]);
+ break;
case 33: // CVT.D.W
setDouble(fd,f[fs]);
break;
case 33: // CVT.D.W
setDouble(fd,f[fs]);
break;