projects
/
nestedvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cc4469a
)
fix sltiu
author
brian
<brian@brianweb.net>
Wed, 5 May 2004 17:35:40 +0000
(10:35 -0700)
committer
brian
<brian@brianweb.net>
Wed, 5 May 2004 17:35:40 +0000
(10:35 -0700)
darcs-hash:
20040505173540
-24bed-
47616f1354328f7c39259de93c950e7e75125ca6
.gz
src/org/ibex/nestedvm/ClassFileCompiler.java
patch
|
blob
|
history
src/org/ibex/nestedvm/Interpreter.java
patch
|
blob
|
history
src/org/ibex/nestedvm/JavaSourceCompiler.java
patch
|
blob
|
history
src/tests/Simple.c
patch
|
blob
|
history
upstream/patches/newlib-mips.patch
patch
|
blob
|
history
diff --git
a/src/org/ibex/nestedvm/ClassFileCompiler.java
b/src/org/ibex/nestedvm/ClassFileCompiler.java
index
a7f035c
..
208e365
100644
(file)
--- a/
src/org/ibex/nestedvm/ClassFileCompiler.java
+++ b/
src/org/ibex/nestedvm/ClassFileCompiler.java
@@
-1136,7
+1136,7
@@
public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
a(InstructionConstants.I2L);
pushConst(0xffffffffL);
a(InstructionConstants.LAND);
a(InstructionConstants.I2L);
pushConst(0xffffffffL);
a(InstructionConstants.LAND);
- pushConst((long)unsignedImmediate);
+ pushConst((long)signedImmediate);
a(InstructionConstants.LCMP);
b1 = a(InstructionFactory.createBranchInstruction(IFLT,null));
a(InstructionConstants.LCMP);
b1 = a(InstructionFactory.createBranchInstruction(IFLT,null));
diff --git
a/src/org/ibex/nestedvm/Interpreter.java
b/src/org/ibex/nestedvm/Interpreter.java
index
c840312
..
1fcdc4b
100644
(file)
--- a/
src/org/ibex/nestedvm/Interpreter.java
+++ b/
src/org/ibex/nestedvm/Interpreter.java
@@
-65,6
+65,7
@@
public class Interpreter extends UnixRuntime {
try {
insn = readPages[pc>>>pageShift][(pc>>>2)&PAGE_WORDS-1];
} catch (RuntimeException e) {
try {
insn = readPages[pc>>>pageShift][(pc>>>2)&PAGE_WORDS-1];
} catch (RuntimeException e) {
+ if(pc == 0xdeadbeef) throw new Error("fell off cpu: r2: " + r[2]);
insn = memRead(pc);
}
insn = memRead(pc);
}
@@
-270,7
+271,7
@@
public class Interpreter extends UnixRuntime {
r[rt] = r[rs] < signedImmediate ? 1 : 0;
break;
case 11: // SLTIU
r[rt] = r[rs] < signedImmediate ? 1 : 0;
break;
case 11: // SLTIU
- r[rt] = (r[rs]&0xffffffffL) < (unsignedImmediate&0xffffffffL) ? 1 : 0;
+ r[rt] = (r[rs]&0xffffffffL) < (signedImmediate&0xffffffffL) ? 1 : 0;
break;
case 12: // ANDI
r[rt] = r[rs] & unsignedImmediate;
break;
case 12: // ANDI
r[rt] = r[rs] & unsignedImmediate;
diff --git
a/src/org/ibex/nestedvm/JavaSourceCompiler.java
b/src/org/ibex/nestedvm/JavaSourceCompiler.java
index
a983b58
..
f7f2353
100644
(file)
--- a/
src/org/ibex/nestedvm/JavaSourceCompiler.java
+++ b/
src/org/ibex/nestedvm/JavaSourceCompiler.java
@@
-600,7
+600,7
@@
public class JavaSourceCompiler extends Compiler {
p( "r"+rt+" = r"+rs+" < "+signedImmediate+" ? 1 : 0;");
break;
case 11: // SLTIU
p( "r"+rt+" = r"+rs+" < "+signedImmediate+" ? 1 : 0;");
break;
case 11: // SLTIU
- p( "r"+rt+" = (r"+rs+"&0xffffffffL) < ("+unsignedImmediate+"&0xffffffffL) ? 1 : 0;");
+ p( "r"+rt+" = (r"+rs+"&0xffffffffL) < ("+signedImmediate+"&0xffffffffL) ? 1 : 0;");
break;
case 12: // ANDI
p( "r"+rt+" = r"+rs+" & "+unsignedImmediate+";");
break;
case 12: // ANDI
p( "r"+rt+" = r"+rs+" & "+unsignedImmediate+";");
diff --git
a/src/tests/Simple.c
b/src/tests/Simple.c
index
bb8452e
..
b55c272
100644
(file)
--- a/
src/tests/Simple.c
+++ b/
src/tests/Simple.c
@@
-4,6
+4,8
@@
char *a = "bar";
volatile char buf[] = "Hello World";
volatile char buf[] = "Hello World";
+long long l = -1614907703LL;
+
int _start() {
int _start() {
- return strlen("foo");
+ return l >= -64;
}
}
diff --git
a/upstream/patches/newlib-mips.patch
b/upstream/patches/newlib-mips.patch
index
5746917
..
889a32f
100644
(file)
--- a/
upstream/patches/newlib-mips.patch
+++ b/
upstream/patches/newlib-mips.patch
@@
-105,7
+105,7
@@
diff -urN ../newlib-1.11.0.orig/newlib/configure.host ./newlib/configure.host
syscall_dir=syscalls
;;
+ mips*-unknown-elf*)
syscall_dir=syscalls
;;
+ mips*-unknown-elf*)
-+ newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_GETTIMEOFDAY -DHAVE_FCNTL -DHAVE_OPENDIR"
++ newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_GETTIMEOFDAY -DHAVE_FCNTL -DHAVE_OPENDIR -DWANT_PRINTF_LONG_LONG"
+ syscall_dir=syscalls
+ ;;
mmix-*)
+ syscall_dir=syscalls
+ ;;
mmix-*)