[PATCH v3 09/16] scripts/decodetree: Add support for 48-bit instructions

Philippe Mathieu-Daudé posted 16 patches 11 months, 3 weeks ago
Maintainers: John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>
[PATCH v3 09/16] scripts/decodetree: Add support for 48-bit instructions
Posted by Philippe Mathieu-Daudé 11 months, 3 weeks ago
Some nanoMIPS instructions are encoded using 48-bit.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 scripts/decodetree.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index e8b72da3a97..88cd476d2d3 100644
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -1543,6 +1543,10 @@ def main():
                 insntype = 'uint64_t'
                 insnmask = 0xffffffffffffffff
                 bitop_width = 64
+            elif insnwidth == 48:
+                insntype = 'uint64_t'
+                insnmask = 0xffffffffffff
+                bitop_width = 64
             elif insnwidth != 32:
                 error(0, 'cannot handle insns of width', insnwidth)
         elif o == '--test-for-error':
-- 
2.45.2


Re: [PATCH v3 09/16] scripts/decodetree: Add support for 48-bit instructions
Posted by Richard Henderson 11 months, 3 weeks ago
On 11/26/24 07:59, Philippe Mathieu-Daudé wrote:
> Some nanoMIPS instructions are encoded using 48-bit.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   scripts/decodetree.py | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/decodetree.py b/scripts/decodetree.py
> index e8b72da3a97..88cd476d2d3 100644
> --- a/scripts/decodetree.py
> +++ b/scripts/decodetree.py
> @@ -1543,6 +1543,10 @@ def main():
>                   insntype = 'uint64_t'
>                   insnmask = 0xffffffffffffffff
>                   bitop_width = 64
> +            elif insnwidth == 48:
> +                insntype = 'uint64_t'
> +                insnmask = 0xffffffffffff
> +                bitop_width = 64
>               elif insnwidth != 32:
>                   error(0, 'cannot handle insns of width', insnwidth)
>           elif o == '--test-for-error':

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

This is probably simpler than falling back to the variable-length decodetree stuff.


r~