From: Bernhard Urban Date: Tue, 13 Jul 2010 07:56:10 +0000 (+0200) Subject: Revert "gesamt: teilweise mehrere befehle in einer zeile -- mal schauen ob das dem... X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=uebersetzerbau-ss10.git;a=commitdiff_plain;h=16705cf56da9f03c383319e63ffe3fe01613bd24 Revert "gesamt: teilweise mehrere befehle in einer zeile -- mal schauen ob das dem skript vom ertl auffaellt :P" This reverts commit 98b6e9ee3e4ae4fd21bfb9394f56eafbfd62061e. ... weils nix brachte ;) --- diff --git a/gesamt/code.bfe b/gesamt/code.bfe index 15d02f3..cad2d58 100644 --- a/gesamt/code.bfe +++ b/gesamt/code.bfe @@ -46,8 +46,8 @@ void gen_id_eno(struct treenode *bnode) KIDKIDREG2PARM(1,1); KIDREG2PARM(0); move(KID_REG(0), BN_REG); - printf("\tsubq %%%s, %%%s", KIDKID_REG(1,1), BN_REG); - printf("; subq %%%s, %%%s\n", KIDKID_REG(1,0), BN_REG); + printf("\tsubq %%%s, %%%s\n", KIDKID_REG(1,1), BN_REG); + printf("\tsubq %%%s, %%%s\n", KIDKID_REG(1,0), BN_REG); } void gen_e_field(struct treenode *bnode, char *instr) @@ -125,25 +125,25 @@ void gen_eqless(struct treenode *bnode, char *op, short e0, short e1, short deep if(e0 && e1) { if(deep) { KIDKIDREG2PARM(1,0); - printf("\tcmp %d(%%%s), %%%s", bnode->kids[1]->soffset *8, KIDKID_REG(1,0), KID_REG(0)); + printf("\tcmp %d(%%%s), %%%s\n", bnode->kids[1]->soffset *8, KIDKID_REG(1,0), KID_REG(0)); } else { - printf("\tcmp %%%s, %%%s", KID_REG(1), KID_REG(0)); + printf("\tcmp %%%s, %%%s\n", KID_REG(1), KID_REG(0)); } } else if(e0 && !e1) { if (deep == 0) { - printf("\tcmp $%d, %%%s", KID_VAL(1), KID_REG(0)); + printf("\tcmp $%d, %%%s\n", KID_VAL(1), KID_REG(0)); } else if (deep == 1) { KIDKIDREG2PARM(0,0); - printf("\tcmp $%d, %%%s", KID_VAL(1), KIDKID_REG(0,0)); + printf("\tcmp $%d, %%%s\n", KID_VAL(1), KIDKID_REG(0,0)); } else if (deep == 2) { KIDKIDKIDREG2PARM(0,0,0); - printf("\tcmp $%d, %%%s", KID_VAL(1), KIDKIDKID_REG(0,0,0)); + printf("\tcmp $%d, %%%s\n", KID_VAL(1), KIDKIDKID_REG(0,0,0)); } } else if(!e0 && e1) { - printf("\tcmp $%d, %%%s", KID_VAL(0), KID_REG(1)); + printf("\tcmp $%d, %%%s\n", KID_VAL(0), KID_REG(1)); } - printf("; set%s %%%s", op, reg_64to8l(BN_REG)); - printf("; and $1, %%%s\n", BN_REG); + printf("\tset%s %%%s\n", op, reg_64to8l(BN_REG)); + printf("\tand $1, %%%s\n", BN_REG); } void gen_lea(struct treenode *bnode, short e) @@ -168,13 +168,13 @@ void gen_subspecial(struct treenode *bnode, short e) if(e) { if(KIDKID_VAL(1,0) != 0) { - printf("\tsubq $%d, %%%s", KIDKID_VAL(1,0), BN_REG); + printf("\tsubq $%d, %%%s\n", KIDKID_VAL(1,0), BN_REG); } } else { - printf("\tsubq %%%s, %%%s", KIDKID_REG(1,0), BN_REG); + printf("\tsubq %%%s, %%%s\n", KIDKID_REG(1,0), BN_REG); } if(e) KIDKIDREG2PARM(1,1); - printf("; addq %%%s, %%%s\n", KIDKID_REG(1,1), BN_REG); + printf("\taddq %%%s, %%%s\n", KIDKID_REG(1,1), BN_REG); } void assign_var(struct treenode *bnode) @@ -191,22 +191,21 @@ void make_call(struct treenode *bnode, short skippop) { short *sc = bnode->sc; int j, off = 0; - printf("\t//params pushen (skippop: %d)\n\t", skippop); + printf("\t//params pushen (skippop: %d)\n", skippop); for(j = 0; j < bnode->soffset; j++) { if(sc[j] == 1) - printf("xchg %%%s, %d(%%rsp); ", param_reg(j), (j - off)*8); + printf("\txchg %%%s, %d(%%rsp)\n", param_reg(j), (j - off)*8); else { if (sc[j] == 0) { - printf("pushq %%%s; ", param_reg(j)); + printf("\tpushq %%%s\n", param_reg(j)); off++; } } } - printf("\n\t//vars pushen\n\t"); + printf("\t//vars pushen\n"); for(j = bnode->soffset; j < bnode->soffset + bnode->vars; j++) { - printf("pushq %%%s; ", param_reg(j)); + printf("\tpushq %%%s\n", param_reg(j)); } - printf("\n"); /* TODO: schoener machen... */ if(strcmp(BN_REG, "rax")!=0) { @@ -229,20 +228,20 @@ void make_call(struct treenode *bnode, short skippop) if(skippop) goto cleanup; - printf("\t//vars poppen\n\t"); + printf("\t//vars poppen\n"); for(j = bnode->soffset + bnode->vars - 1; j > bnode->soffset - 1; j--) { - printf("popq %%%s; ", param_reg(j)); + printf("\tpopq %%%s\n", param_reg(j)); } - printf("\t//params poppen (sc == 0)\n\t"); + printf("\t//params poppen (sc == 0)\n"); for(j = bnode->soffset - 1; j >= 0; j--) { if(sc[j] == 0) - printf("popq %%%s; ", param_reg(j)); + printf("\tpopq %%%s\n", param_reg(j)); } - printf("\t//params poppen (sc != 0)\n\t"); + printf("\t//params poppen (sc != 0)\n"); for(j = 0; j < bnode->soffset; j++) { if(sc[j] > 0) - printf("popq %%%s; ", param_reg(j)); + printf("\tpopq %%%s\n", param_reg(j)); } cleanup: