r4844@macbookpro: aamine | 2009-05-16 17:50:02 +0900

* net/loveruby/cflat/sysdep/x86/AssemblyFile.java: use Type instead of size.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4213 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
Minero Aoki 2009-05-17 02:27:34 +00:00
parent 84626ea57e
commit ed319a4bc0
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,8 @@
Sat May 16 17:48:49 2009 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/sysdep/x86/AssemblyFile.java: use Type
instead of size.
Sat May 16 17:20:36 2009 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/asm/Register.java: use enum for register

View File

@ -90,12 +90,13 @@ public class AssemblyFile {
}
protected String typeSuffix(Type t) {
switch (t.size()) {
case 1: return "b";
case 2: return "w";
case 4: return "l";
switch (t) {
case INT8: return "b";
case INT16: return "w";
case INT32: return "l";
case INT64: return "q";
default:
throw new Error("unknown type size: " + t.size());
throw new Error("unknown register type: " + t.size());
}
}