qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 04/20] disas/nanomips: Remove helper methods from class


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 04/20] disas/nanomips: Remove helper methods from class
Date: Tue, 16 Aug 2022 02:19:43 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

On 15/8/22 09:26, Milica Lazarevic wrote:
Helper methods from NMD class like NMD::renumber_registers,
NMD::decode_gpr_gpr4... etc. are removed from the class. They're now
declared global static functions.

Following helper methods have been deleted because they're not used by
the nanomips disassembler:
- NMD::encode_msbd_from_pos_and_size,
- NMD::encode_s_from_s_hi,
- NMD::neg_copy

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
---
  disas/nanomips.cpp | 322 +++++++++++++++++++++------------------------
  disas/nanomips.h   | 144 --------------------
  2 files changed, 151 insertions(+), 315 deletions(-)

-uint64 NMD::copy(uint64 d)
+static uint64 copy(uint64 d)
  {
      return d;
  }
-int64 NMD::copy(int64 d)
+static int64 copy(int64 d)
  {
      return d;
  }

Does that build in C? You are declaring 2 functions with the same name
but a different prototype... Shouldn't you squash patch #14 here which
rename these functions with the return value as suffix?

-int64 NMD::neg_copy(uint64 d)
+static int64 neg_copy(uint64 d)
  {
      return 0ll - d;
  }
-int64 NMD::neg_copy(int64 d)
-{
-    return -d;
-}

Ditto.



reply via email to

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