microblaze: Speed up base + index addressing mode
authorEdgar E. Iglesias <edgar.iglesias@petalogix.com>
Sat, 24 Jul 2010 21:25:49 +0000 (23:25 +0200)
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>
Sat, 24 Jul 2010 21:25:49 +0000 (23:25 +0200)
Speed up reg + reg addressing mode when any of the regs is r0.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
target-microblaze/translate.c

index 3a766d8fea1c7036596cfb4fff363868226e8476..9c0492e56aa4447a94310c82bdf7cb02dbac39e4 100644 (file)
@@ -788,6 +788,13 @@ static inline TCGv *compute_ldst_addr(DisasContext *dc, TCGv *t)
 
     /* Treat the fast cases first.  */
     if (!dc->type_b) {
+        /* If any of the regs is r0, return a ptr to the other.  */
+        if (dc->ra == 0) {
+            return &cpu_R[dc->rb];
+        } else if (dc->rb == 0) {
+            return &cpu_R[dc->ra];
+        }
+
         *t = tcg_temp_new();
         tcg_gen_add_tl(*t, cpu_R[dc->ra], cpu_R[dc->rb]);
         return t;