From 5a208ce3ea26726d15e814c0498680597cca45fa Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 25 Sep 2004 08:24:11 +0000 Subject: compiler works on abs and fibonacci --- examples/gfcc/compiler/runtime.j | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'examples/gfcc/compiler/runtime.j') diff --git a/examples/gfcc/compiler/runtime.j b/examples/gfcc/compiler/runtime.j index c99523cc7..88db0b9b8 100644 --- a/examples/gfcc/compiler/runtime.j +++ b/examples/gfcc/compiler/runtime.j @@ -19,7 +19,37 @@ Label0: iconst_0 ireturn - Label1: .end method -; TODO: flt missing +.method public static flt(FF)I +.limit locals 2 +.limit stack 2 + fload_0 + fload_1 + fcmpl + ifge Label0 + iconst_1 + ireturn + Label0: + iconst_0 + ireturn +.end method + +.method public static iprintf(I)V +.limit locals 1 +.limit stack 1000 + getstatic java/lang/System/out Ljava/io/PrintStream; + iload_0 + invokevirtual java/io/PrintStream/println(I)V + return +.end method + +.method public static fprintf(F)V +.limit locals 1 +.limit stack 1000 + getstatic java/lang/System/out Ljava/io/PrintStream; + fload_0 + invokevirtual java/io/PrintStream/println(F)V + return +.end method + -- cgit v1.2.3