aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-26 11:20:50 +0000
committermalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-26 11:20:50 +0000
commit6fc9dbcc17fc158886131df2cb6d2f190fccf736 (patch)
tree1c94ffb6cb0c30614ca56bc50a55c853e044276f
parent450e62e768d98b701a48f583bcca2d8ee79a23d2 (diff)
downloadqemu-6fc9dbcc17fc158886131df2cb6d2f190fccf736.zip
qemu-6fc9dbcc17fc158886131df2cb6d2f190fccf736.tar.gz
qemu-6fc9dbcc17fc158886131df2cb6d2f190fccf736.tar.bz2
Fix and improve 64 bit immediate loading
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4946 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--tcg/ppc64/tcg-target.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
index e45021b..83604ad 100644
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -448,15 +448,18 @@ static void tcg_out_movi (TCGContext *s, TCGType type,
}
else {
if ((uint64_t) arg >> 32) {
+ uint16_t h16 = arg >> 16;
+ uint16_t l16 = arg;
+
tcg_out_movi32 (s, ret, (arg >> 32) + (arg32 < 0));
tcg_out_rld (s, RLDICR, ret, ret, 32, 31);
- if (arg32) {
- tcg_out_movi32 (s, 0, arg32);
- tcg_out32 (s, ADD | TAB (ret, ret, 0));
- }
+ if (h16) tcg_out32 (s, ORIS | RS (ret) | RA (ret) | h16);
+ if (l16) tcg_out32 (s, ORI | RS (ret) | RA (ret) | l16);
}
else {
tcg_out_movi32 (s, ret, arg32);
+ if (arg32 < 0)
+ tcg_out_rld (s, RLDICL, ret, ret, 0, 32);
}
}
}