summaryrefslogtreecommitdiff
path: root/tcg/ppc/tcg-target.c
diff options
context:
space:
mode:
authormalc <av1474@comtv.ru>2010-02-07 02:48:48 +0300
committermalc <av1474@comtv.ru>2010-02-07 02:48:48 +0300
commit27a7797b0935260571a2577d1c39e87db4f28b86 (patch)
treeb358327a7cbfc20e0486cbe654cf7b752a373d26 /tcg/ppc/tcg-target.c
parentb0809bf7ca99e445f7176d64b15e1c441f25e903 (diff)
tcg/ppc32: proper setcond implementation
Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'tcg/ppc/tcg-target.c')
-rw-r--r--tcg/ppc/tcg-target.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
index 274480eb8..502df87dd 100644
--- a/tcg/ppc/tcg-target.c
+++ b/tcg/ppc/tcg-target.c
@@ -1147,7 +1147,7 @@ static void tcg_out_setcond (TCGContext *s, int cond, TCGArg arg0,
| ME (31)
)
);
- return;
+ break;
case TCG_COND_NE:
if (const_arg2) {
@@ -1178,47 +1178,47 @@ static void tcg_out_setcond (TCGContext *s, int cond, TCGArg arg0,
tcg_out32 (s, ADDIC | RT (arg0) | RA (arg) | 0xffff);
tcg_out32 (s, SUBFE | TAB (arg0, arg0, arg));
}
- return;
+ break;
+
+ case TCG_COND_GT:
+ case TCG_COND_GTU:
+ sh = 30;
+ crop = 0;
+ goto crtest;
- case TCG_COND_LTU:
case TCG_COND_LT:
+ case TCG_COND_LTU:
sh = 29;
crop = 0;
- break;
+ goto crtest;
- case TCG_COND_GEU:
case TCG_COND_GE:
+ case TCG_COND_GEU:
sh = 31;
crop = CRNOR | BT (7, CR_EQ) | BA (7, CR_LT) | BB (7, CR_LT);
- break;
+ goto crtest;
- case TCG_COND_LEU:
case TCG_COND_LE:
+ case TCG_COND_LEU:
sh = 31;
crop = CRNOR | BT (7, CR_EQ) | BA (7, CR_GT) | BB (7, CR_GT);
- break;
-
- case TCG_COND_GTU:
- case TCG_COND_GT:
- sh = 30;
- crop = 0;
+ crtest:
+ tcg_out_cmp (s, cond, arg1, arg2, const_arg2, 7);
+ if (crop) tcg_out32 (s, crop);
+ tcg_out32 (s, MFCR | RT (0));
+ tcg_out32 (s, (RLWINM
+ | RA (arg0)
+ | RS (0)
+ | SH (sh)
+ | MB (31)
+ | ME (31)
+ )
+ );
break;
default:
tcg_abort ();
}
-
- tcg_out_cmp (s, cond, arg1, arg2, const_arg2, 7);
- if (crop) tcg_out32 (s, crop);
- tcg_out32 (s, MFCR | RT (0));
- tcg_out32 (s, (RLWINM
- | RA (arg0)
- | RS (0)
- | SH (sh)
- | MB (31)
- | ME (31)
- )
- );
}
static void tcg_out_setcond2 (TCGContext *s, const TCGArg *args,