[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/22] target/openrisc: Optimize l.jal to next
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 20/22] target/openrisc: Optimize l.jal to next |
Date: |
Wed, 8 Feb 2017 20:51:52 -0800 |
This allows the tcg optimizer to see, and fold, all of the
constants involved in a GOT base register load sequence.
Signed-off-by: Richard Henderson <address@hidden>
---
target/openrisc/translate.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
index 66064e1..cda84b6 100644
--- a/target/openrisc/translate.c
+++ b/target/openrisc/translate.c
@@ -198,7 +198,11 @@ static void gen_jump(DisasContext *dc, int32_t n26,
uint32_t reg, uint32_t op0)
tcg_gen_movi_tl(jmp_pc, tmp_pc);
break;
case 0x01: /* l.jal */
- tcg_gen_movi_tl(cpu_R[9], (dc->pc + 8));
+ tcg_gen_movi_tl(cpu_R[9], dc->pc + 8);
+ /* Optimize jal being used to load the PC for PIC. */
+ if (tmp_pc == dc->pc + 8) {
+ return;
+ }
tcg_gen_movi_tl(jmp_pc, tmp_pc);
break;
case 0x03: /* l.bnf */
--
2.9.3
- [Qemu-devel] [PATCH 13/22] target/openrisc: Use movcond where appropriate, (continued)
- [Qemu-devel] [PATCH 13/22] target/openrisc: Use movcond where appropriate, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 14/22] target/openrisc: Set flags on helpers, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 11/22] target/openrisc: Keep SR_F in a separate variable, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 15/22] target/openrisc: Enable trap, csync, msync, psync for user mode, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 16/22] target/openrisc: Implement msync, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 17/22] target/openrisc: Represent MACHI:MACLO as a single unit, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 18/22] target/openrisc: Implement muld, muldu, macu, msbu, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 19/22] target/openrisc: Fix madd, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 20/22] target/openrisc: Optimize l.jal to next,
Richard Henderson <=
- [Qemu-devel] [PATCH 21/22] target/openrisc: Tidy ppc/npc implementation, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 22/22] target/openrisc: Tidy handling of delayed branches, Richard Henderson, 2017/02/08
- [Qemu-devel] [PATCH 23/22] linux-user: Honor CLONE_SETTLS for openrisc, Richard Henderson, 2017/02/09
- Re: [Qemu-devel] [PATCH 00/22] target/openrisc updates, G 3, 2017/02/09