qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH-for-8.0 2/7] hw/mips/bootloader: Pass 32-bit immediate value


From: Richard Henderson
Subject: Re: [PATCH-for-8.0 2/7] hw/mips/bootloader: Pass 32-bit immediate value to LUI opcode generator
Date: Sun, 11 Dec 2022 09:57:50 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 12/10/22 09:54, Philippe Mathieu-Daudé wrote:
-static void bl_gen_lui(void **p, bl_reg rt, uint16_t imm)
+static void bl_gen_lui(void **p, bl_reg rt, uint32_t imm32)
  {
      /* R6: It's a alias of AUI with RS = 0 */
-    bl_gen_i_type(p, 0x0f, 0, rt, imm);
+    assert(imm32 <= UINT16_MAX);
+    bl_gen_i_type(p, 0x0f, 0, rt, extract32(imm32, 16, 16));

This assert is obviously incorrect.  You wanted to test

   (imm32 & 0xffff) == 0


r~



reply via email to

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