diff options
author | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-10-02 20:02:31 +0000 |
---|---|---|
committer | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-10-02 20:02:31 +0000 |
commit | 3ee1b8550c6e0bb48df4614ed185964dc1a036d3 (patch) | |
tree | 9ee40b541407d82e95a5807195d8b54a27492f30 /tcg/ppc64/tcg-target.c | |
parent | bdadc0b5b6c396a77c9faed8eb6829789bfb6151 (diff) | |
download | qemu-3ee1b8550c6e0bb48df4614ed185964dc1a036d3.zip qemu-3ee1b8550c6e0bb48df4614ed185964dc1a036d3.tar.gz qemu-3ee1b8550c6e0bb48df4614ed185964dc1a036d3.tar.bz2 |
Optimize 64 bit bswap
Use rldimi instead of rldicr/or pair, saves us one instruction.
Suggested by Hollis Blanchard.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5404 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tcg/ppc64/tcg-target.c')
-rw-r--r-- | tcg/ppc64/tcg-target.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index 6b16efa..ff10c37 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -303,6 +303,7 @@ static int tcg_target_const_match (tcg_target_long val, #define RLDICL XO30( 0) #define RLDICR XO30( 1) +#define RLDIMI XO30( 3) #define BCLR XO19( 16) #define BCCTR XO19(528) @@ -691,11 +692,10 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc) break; case 3: if (bswap) { - tcg_out32 (s, LWBRX | RT (0) | RB (r0)); - tcg_out32 (s, ADDI | RT (r1) | RA (r0) | 4); - tcg_out32 (s, LWBRX | RT (data_reg) | RB (r1)); - tcg_out_rld (s, RLDICR, data_reg, data_reg, 32, 31); - tcg_out32 (s, OR | SAB (0, data_reg, data_reg)); + tcg_out_movi32 (s, 0, 4); + tcg_out32 (s, LWBRX | RT (data_reg) | RB (r0)); + tcg_out32 (s, LWBRX | RT ( r1) | RA (r0)); + tcg_out_rld (s, RLDIMI, data_reg, r1, 32, 0); } else tcg_out32 (s, LD | RT (data_reg) | RA (r0)); break; |