X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=gesamt_ppc%2Fchelper.c;h=2e736ea421618c08867b07b598b27cfdbbf2d615;hb=HEAD;hp=3f4776d735f98b7259289e9ae9685d443825c20a;hpb=7b8df533cad8c9a84e4da9b60f26b5109daef638;p=uebersetzerbau-ss10.git diff --git a/gesamt_ppc/chelper.c b/gesamt_ppc/chelper.c index 3f4776d..2e736ea 100644 --- a/gesamt_ppc/chelper.c +++ b/gesamt_ppc/chelper.c @@ -56,8 +56,15 @@ void move(char *src, char *dst) void moveimm(long imm, char *dst) { - /* TODO: 32 bits... */ - printf("\tli %s,%d\n", dst, imm); + if((imm > 65536-1) || (imm < -65536)) { + /* high word */ + printf("\tlis %s,%d@ha\n", dst, imm); + /* low word */ + printf("\taddi %s,%s,%d@l\n", dst, dst, imm); + } else { + /* just low word */ + printf("\tli %s,%d@l\n", dst, imm); + } } char *next_reg(char *s, int params)