From: Bernhard Urban Date: Tue, 8 Jun 2010 14:02:15 +0000 (+0200) Subject: ppc: eq (codea_abgabe_ak.0) X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=uebersetzerbau-ss10.git;a=commitdiff_plain;h=41b58f7412731cc4e7e27043e0d118aa328f3db7 ppc: eq (codea_abgabe_ak.0) --- diff --git a/gesamt_ppc/code.bfe b/gesamt_ppc/code.bfe index bee2d86..e626376 100644 --- a/gesamt_ppc/code.bfe +++ b/gesamt_ppc/code.bfe @@ -161,11 +161,16 @@ void gen_eqless(struct treenode *bnode, char *op, short e0, short e1, short deep printf("\tand $1, %%%s\n", BN_REG); #else if(e0) { KIDREG2PARM(0); } else { moveimm(KID_VAL(0), BN_REG); } - if(e1) { KIDREG2PARM(1); } else { moveimm(KID_VAL(1), KID_REG(1)); } - if(strcmp(op,"e")==0 && KID_VAL(1) == 0) { + if(e1) { KIDREG2PARM(1); } else { if(KID_VAL(1) != 0) moveimm(KID_VAL(1), KID_REG(1)); } + if(strcmp(op,"e")==0 && KID_VAL(1) == 0 && KID_VAL(0) == 0) { /* not */ printf("\tcntlzw %s,%s\n", KID_REG(0), KID_REG(0)); printf("\tsrwi %s,%s,5\n", BN_REG, KID_REG(0)); + } else if(strcmp(op, "e")==0) { + /* eq */ + printf("\txor %s,%s,%s\n", BN_REG, KID_REG(0), KID_REG(1)); + printf("\tcntlzw %s,%s\n", BN_REG, BN_REG); + printf("\tsrwi %s,%s,5\n", BN_REG, BN_REG); } else if(strcmp(op, "l")==0 || strcmp(op, "g")==0) { /* less */ printf("\tcmpw 7,%s,%s\n", KID_REG(1), KID_REG(0));