FYI: Copying the conversation.
On 09/06/2022 18.31, Vince Del Vecchio wrote:
On Thu, Jun 9, 2022 at 10:34AM, Thomas Huth wrote:
On 09/06/2022 16.15, Claudio Fontana wrote:
On 6/9/22 13:27, Claudio Fontana wrote:
On 6/9/22 10:57, Daniel P. Berrangé wrote:
On Thu, Jun 09, 2022 at
Hi everyone, I am interested in taking on this task.
Milica
On 9/5/22 10:55, Milica Lazarevic wrote:
> Since there's no support for exception handling in C, the try-catch
> blocks have been deleted, and throw clauses are replaced. When a runtime
> error happens, we're printing out the error message. Disassembling of
> the current instructio
Any comments on this patch?
From: Milica Lazarevic
Sent: Monday, August 15, 2022 9:31 AM
To: th...@redhat.com
Cc: qemu-devel@nongnu.org ; cfont...@suse.de
; berra...@redhat.com ;
pbonz...@redhat.com ; vince.delvecc...@mediatek.com
; richard.hender...@linaro.org
directly printing
"CP" and integer value instead.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 110 +++--
1 file changed, 45 insertions(+), 65 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 441204bb84..e269f85
The following is moved from the nanomips.h to nanomips.cpp file:
- #include line
- typedefs
- enums
- definition of the Pool struct.
Header file nanomips.h will be deleted to be consistent with the rest of
the disas/ code.
Signed-off-by: Milica Lazarevic
Reviewed-by: Philippe Mathieu-Daudé
Following functions just wrap the decode_gpr_gpr3() function:
- encode_rs3_and_check_rs3_ge_rt3()
- encode_rs3_and_check_rs3_lt_rt3()
Therefore those have been deleted. Calls to these two functions have
been replaced with calls to decode_gpr_gpr3.
Signed-off-by: Milica Lazarevic
---
disas
version. Same as in (16);
calls to
CPR have been deleted, and the second(now the only) call to img_format is
slightly
changed.
Regards,
Milica
Milica Lazarevic (24):
disas/nanomips: Remove namespace img
disas/nanomips: Extract enums out of the NMD class
disas/nanomips
Change enums to typedef enums to keep naming clear.
Signed-off-by: Milica Lazarevic
Reviewed-by: Thomas Huth
Reviewed-by: Richard Henderson
---
disas/nanomips.cpp | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index
Now that everything has been converted to C code the nanomips.cpp file
has been renamed. Therefore, meson.build file is also changed.
Signed-off-by: Milica Lazarevic
---
disas/meson.build | 2 +-
disas/{nanomips.cpp => nanomips.c} | 0
2 files changed, 1 insertion(+)
of the m_requested_instruction_categories field
is removed, we can delete the field declaration and initialization in
the NMD class. Also, we're changing the way of the construction of the
NMD object in the nanomips_dis function.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 13 +
disas/nanomips.h | 4
,
- NMD::encode_s_from_s_hi,
- NMD::neg_copy
Global functions used by those methods:
- nanomips_dis
- sign_extend
- extract_bits
have also been defined as static global functions.
Signed-off-by: Milica Lazarevic
Reviewed-by: Richard Henderson
---
disas/nanomips.cpp | 328
that conditional_function type functions are not part of the NMD
class we can't access them using the this pointer. Thus, the use of
the this pointer has been deleted.
Signed-off-by: Milica Lazarevic
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson
---
disas/nanomips.cpp | 42
g_autofree attribute is added for every dynamically allocated string to
prevent memory leaking.
The implementation of the several functions that work with dynamically
allocated strings is slightly changed so we can add those attributes.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp
Header file nanomips.h has been deleted for the nanomips disassembler to
stay consistent with the rest of the disassemblers which don't include
extra header files.
Signed-off-by: Milica Lazarevic
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson
---
disas/nanomips.h | 26
is a C++ library and it's not used by disassembler.
Signed-off-by: Milica Lazarevic
Reviewed-by: Thomas Huth
Reviewed-by: Richard Henderson
---
disas/nanomips.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 7fed1abff0..e3c5c51db1 100644
Definitions of enums TABLE_ENTRY_TYPE and TABLE_ATTRIBUTE_TYPE are moved
out of the NMD class. The main goal is to remove NMD class completely.
Signed-off-by: Milica Lazarevic
Reviewed-by: Thomas Huth
Reviewed-by: Richard Henderson
---
disas/nanomips.cpp | 8 +++
disas/nanomips.h | 59
is moved to the end of the nanomips.cpp file,
right after the implementation of the Disassemble function.
Signed-off-by: Milica Lazarevic
Reviewed-by: Richard Henderson
---
disas/nanomips.cpp | 202 ++---
disas/nanomips.h | 15
2 files changed, 100
() to discard further disassembling after the error message
prints and by adding the siglongjmp() function to imitate throwing an
error. The goal was to maintain the same output as it was.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 100 -
1 file
Replaced argument passing by reference with passing by address.
Signed-off-by: Milica Lazarevic
Reviewed-by: Thomas Huth
Reviewed-by: Richard Henderson
---
disas/nanomips.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
, and now we're directly printing the integer
values instead.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 756 -
1 file changed, 265 insertions(+), 491 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 816155527d
after the initialization of the MAJOR Pool table.
Signed-off-by: Milica Lazarevic
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson
---
disas/nanomips.cpp | 363 ++---
disas/nanomips.h | 201 ++---
2 files changed, 193
Disassemble function that calls the other variant of it is deleted.
Where it is called, now we're directly calling the other implementation.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/disas/nanomips.cpp b
On 9/5/22 10:55, Milica Lazarevic wrote:
> -static std::string save_restore_list(uint64 rt, uint64 count, uint64 gp)
> +static char *save_restore_list(uint64 rt, uint64 count, uint64 gp)
> {
> -std::string str;
> +/*
> + * Currently, this file compiles as a cpp fil
Thanks, it's more clear to me now! I'll modify it in the next by the
suggestions.
From: Richard Henderson
Sent: Thursday, September 8, 2022 11:14 PM
To: Milica Lazarevic ; th...@redhat.com
Cc: qemu-devel@nongnu.org ; cfont...@suse.de
; berra...@redhat.com
The following is moved from the nanomips.h to nanomips.cpp file:
- #include line
- typedefs
- enums
- definition of the Pool struct.
Header file nanomips.h will be deleted to be consistent with the rest of
the disas/ code.
Signed-off-by: Milica Lazarevic
Reviewed-by: Philippe Mathieu-Daudé
, this patch is much smaller than in the previous
version.
(14) disas/nanomips: Introduce Dis_info struct
Same as in (3). Instead of using global variables, all the necessary
information
are packed into the struct and added as an argument wherever needed.
Regards,
Milica
Milica Lazarevic
,
- NMD::encode_s_from_s_hi,
- NMD::neg_copy
Global functions used by those methods:
- nanomips_dis
- sign_extend
- extract_bits
have also been defined as static global functions.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 328 +
disas
Header file nanomips.h has been deleted for the nanomips disassembler to
stay consistent with the rest of the disassemblers which don't include
extra header files.
Signed-off-by: Milica Lazarevic
Reviewed-by: Philippe Mathieu-Daudé
---
disas/nanomips.h | 26 --
1 file
of the img_format()
function, which returns a dynamically allocated string. To be able to
free that string for every disassembly_function, a strdup() call is
added for a return value of some disassembly functions like TLBGINV,
TLBGINVF, TLBGP, etc.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp
Definitions of enums TABLE_ENTRY_TYPE and TABLE_ATTRIBUTE_TYPE are moved
out of the NMD class. The main goal is to remove NMD class completely.
Signed-off-by: Milica Lazarevic
Reviewed-by: Thomas Huth
---
disas/nanomips.cpp | 8 +++
disas/nanomips.h | 59
is moved to the end of the nanomips.cpp file,
right after the implementation of the Disassemble function.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 202 ++---
disas/nanomips.h | 17
2 files changed, 100 insertions(+), 119 deletions
that conditional_function type functions are not part of the NMD
class we can't access them using the this pointer. Thus, the use of
the this pointer has been deleted.
Signed-off-by: Milica Lazarevic
Reviewed-by: Philippe Mathieu-Daudé
---
disas/nanomips.cpp | 42
Now that everything is converted to the C code, nanomips.cpp file is
renamed to "nanomips.c". Therefore, meson.build file is also changed.
The explicit cast after the call to g_malloc() is no longer needed
because the file now compiles as a C code.
Signed-off-by: Milica Lazarevic
.
Signed-off-by: Milica Lazarevic
Reviewed-by: Philippe Mathieu-Daudé
---
disas/nanomips.cpp | 363 ++---
disas/nanomips.h | 200 ++---
2 files changed, 193 insertions(+), 370 deletions(-)
diff --git a/disas/nanomips.cpp b/disas
is a C++ library and it's not used by disassembler.
Signed-off-by: Milica Lazarevic
Reviewed-by: Thomas Huth
---
disas/nanomips.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index c11c0aceaf..bfbd472150 100644
--- a/disas/nanomips.cpp
+++ b
() to discard further disassembling after the error message
prints and by adding the siglongjmp() function to imitate throwing an
error. The goal was to maintain the same output as it was.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 126 ++---
1 file
Change enums to typedef enums to keep naming clear.
Signed-off-by: Milica Lazarevic
Reviewed-by: Thomas Huth
---
disas/nanomips.cpp | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index a8295ebfa8..f57d255de3 100644
Replaced argument passing by reference with passing by address.
Signed-off-by: Milica Lazarevic
Reviewed-by: Thomas Huth
---
disas/nanomips.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index f57d255de3..ab54456c2e 100644
Changed the type of the table parameter in Disassemble function:
- from const Pool *
- to const struct Pool *
Signed-off-by: Milica Lazarevic
Reviewed-by: Thomas Huth
---
disas/nanomips.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disas/nanomips.cpp b/disas
is a C++ library and it's not used by disassembler.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index cab53f482b..23db8177ef 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -32,7
This patchset converts the nanomips disassembler to plain C. C++ features
like class, std::string type, exception handling, and function overloading
have been removed and replaced with the equivalent C code.
Please see the discussion about why converting it here:
is moved to the end of the nanomips.cpp file,
right after the implementation of the Disassemble function.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 204 ++---
disas/nanomips.h | 14
2 files changed, 101 insertions(+), 117 deletions
Header file nanomips.h has been deleted for the nanomips disassembler to
stay consistent with the rest of the disassemblers which don't include
extra header files.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.h | 28
1 file changed, 28 deletions(-)
delete
,
- NMD::encode_s_from_s_hi,
- NMD::neg_copy
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 322 +
disas/nanomips.h | 144
2 files changed, 151 insertions(+), 315 deletions(-)
diff --git a/disas/nanomips.cpp b/disas
Change enums to typedef enums to keep naming clear
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index a8cd878809..9406805367 100644
--- a/disas/nanomips.cpp
+++ b/disas
Class fields have been replaced with the public static variables.
Therefore, there is no more need for a constructor. The main goal is to
remove NMD class completely.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 6 +-
disas/nanomips.h | 9 -
2 files changed, 5
.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 363 ++---
disas/nanomips.h | 201 ++---
2 files changed, 193 insertions(+), 371 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 205c4f3143..c35ece428c
The following is moved from the nanomips.h to nanomips.cpp file:
- #include line
- typedefs
- enums
- definition of the Pool struct.
Header file nanomips.h will be deleted to be consistent with the rest of
the disas/ code.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 53
Now that everything has been converted to C code the nanomips.cpp file
has been renamed. Therefore, meson.build file is also changed.
Signed-off-by: Milica Lazarevic
---
disas/meson.build | 2 +-
disas/{nanomips.cpp => nanomips.c} | 0
2 files changed, 1 insertion(+)
() to discard further disassembling after the error message
prints and by adding the siglongjmp() function to imitate throwing an
error.The goal was to maintain the same output as it was.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 135 +++--
1 file
that conditional_function type functions are not part of the NMD
class we can't access them using the this pointer. Thus, the use of
the this pointer has been deleted.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 42 +-
disas/nanomips.h | 14
Replaced argument passing by reference with passing by address.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 9406805367..7dfefdc5ed 100644
--- a/disas/nanomips.cpp
Definitions of enums TABLE_ENTRY_TYPE and TABLE_ATTRIBUTE_TYPE are moved
out of the NMD class. The main goal is to remove NMD class completely.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 8 +++
disas/nanomips.h | 59 +++---
2 files
Modifier static has been added to the remaining functions that shouldn't
be used outside of the nanomips disassembler.
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index
the result of the img_format()
function, which returns a dynamically allocated string. To be able to
free that string for every disassembly_function, a strdup() call is
added for returning value of some disassembly functions like TLBGINV,
TLBGINVF, TLBGP, etc.
Signed-off-by: Milica Lazarevic
---
disas
Changed the type of the table parameter in Disassemble function:
- from const Pool *
- to const struct Pool *
Signed-off-by: Milica Lazarevic
---
disas/nanomips.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 7dfefdc5ed
Yes, it should. I'll squash it in the next version, thanks.
Milica
From: Philippe Mathieu-Daudé on behalf of
Philippe Mathieu-Daudé
Sent: Tuesday, August 16, 2022 2:22 AM
To: Milica Lazarevic ; th...@redhat.com
Cc: qemu-devel@nongnu.org ; cfont...@suse.de
nanoMIPS ISA support is planned to be maintained.
Signed-off-by: Milica Lazarevic
---
MAINTAINERS | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 6966490c94..66e083b455 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -237,10 +237,16 @@ R
: Philippe Mathieu-Daudé ; Richard Henderson
; Milica Lazarevic ;
Thomas Huth ; Jiaxun Yang ; Markus
Armbruster ; Vince Del Vecchio
Subject: [PATCH] MAINTAINERS: Inherit from nanoMIPS
6 months ago Stefan Pejic stepped in as nanoMIPS maintainer
(see commit a 8e0e23445a "target/mips: Undepreca
Hi,
Stefan is no longer working with us, but I will be more than happy to take
maintaining the nanoMIPS ISA on me!
Regards,
Milica
Any comments on this?
61 matches
Mail list logo