summaryrefslogtreecommitdiff
path: root/tcg/ppc/tcg-target.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcg/ppc/tcg-target.c')
-rw-r--r--tcg/ppc/tcg-target.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
index 39319903cd..c69a39eb9e 100644
--- a/tcg/ppc/tcg-target.c
+++ b/tcg/ppc/tcg-target.c
@@ -415,7 +415,7 @@ static void tcg_out_b (TCGContext *s, int mask, tcg_target_long target)
disp = target - (tcg_target_long) s->code_ptr;
if ((disp << 6) >> 6 == disp)
- tcg_out32 (s, B | disp | mask);
+ tcg_out32 (s, B | (disp & 0x3fffffc) | mask);
else {
tcg_out_movi (s, TCG_TYPE_I32, 0, (tcg_target_long) target);
tcg_out32 (s, MTSPR | RS (0) | CTR);