qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-8.0 5/7] hw/mips/bootloader: Implement nanoMIPS SW opcode


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH-for-8.0 5/7] hw/mips/bootloader: Implement nanoMIPS SW opcode
Date: Sun, 11 Dec 2022 21:30:27 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

On 11/12/22 17:24, Richard Henderson wrote:
On 12/10/22 10:02, Philippe Mathieu-Daudé wrote:
On 10/12/22 16:55, Philippe Mathieu-Daudé wrote:
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  hw/mips/bootloader.c | 24 +++++++++++++++++++++++-
  1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
index 997e74ee52..cc3df385df 100644
--- a/hw/mips/bootloader.c
+++ b/hw/mips/bootloader.c
@@ -150,9 +150,31 @@ static void bl_gen_lui(void **p, bl_reg rt, uint32_t imm32)
      }
  }
+static void bl_gen_ori_nm(void **ptr, bl_reg rt, bl_reg rs, uint16_t imm)
+{
+    uint16_t *p = (uint16_t *)*ptr;
+    uint32_t insn = 0;

Similarly, we should check whether imm fits in 12-bit.

I think you should simply split at the "li" level instead of lui+ori.

Clever.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]