Commit 6fc9dbcc17fc158886131df2cb6d2f190fccf736
1 parent
450e62e7
Fix and improve 64 bit immediate loading
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4946 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
7 additions
and
4 deletions
tcg/ppc64/tcg-target.c
@@ -448,15 +448,18 @@ static void tcg_out_movi (TCGContext *s, TCGType type, | @@ -448,15 +448,18 @@ static void tcg_out_movi (TCGContext *s, TCGType type, | ||
448 | } | 448 | } |
449 | else { | 449 | else { |
450 | if ((uint64_t) arg >> 32) { | 450 | if ((uint64_t) arg >> 32) { |
451 | + uint16_t h16 = arg >> 16; | ||
452 | + uint16_t l16 = arg; | ||
453 | + | ||
451 | tcg_out_movi32 (s, ret, (arg >> 32) + (arg32 < 0)); | 454 | tcg_out_movi32 (s, ret, (arg >> 32) + (arg32 < 0)); |
452 | tcg_out_rld (s, RLDICR, ret, ret, 32, 31); | 455 | tcg_out_rld (s, RLDICR, ret, ret, 32, 31); |
453 | - if (arg32) { | ||
454 | - tcg_out_movi32 (s, 0, arg32); | ||
455 | - tcg_out32 (s, ADD | TAB (ret, ret, 0)); | ||
456 | - } | 456 | + if (h16) tcg_out32 (s, ORIS | RS (ret) | RA (ret) | h16); |
457 | + if (l16) tcg_out32 (s, ORI | RS (ret) | RA (ret) | l16); | ||
457 | } | 458 | } |
458 | else { | 459 | else { |
459 | tcg_out_movi32 (s, ret, arg32); | 460 | tcg_out_movi32 (s, ret, arg32); |
461 | + if (arg32 < 0) | ||
462 | + tcg_out_rld (s, RLDICL, ret, ret, 0, 32); | ||
460 | } | 463 | } |
461 | } | 464 | } |
462 | } | 465 | } |