diff mbox series

[v2,2/3] target/mips: Cast offset field of Octeon BBIT to int16_t

Message ID 20221031132531.18122-3-jiaxun.yang@flygoat.com (mailing list archive)
State New, archived
Headers show
Series MIPS system emulation miscellaneous fixes | expand

Commit Message

Jiaxun Yang Oct. 31, 2022, 1:25 p.m. UTC
As per "Cavium Networks OCTEON Plus CN50XX Hardware Reference
Manual" offset field is signed 16 bit value. However arg_BBIT.offset
is unsigned. We need to cast it as signed to do address calculation.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
v2:
Do casting in decodetree. (philmd)
---
 target/mips/tcg/octeon.decode | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pavel Dovgalyuk Nov. 1, 2022, 5:15 a.m. UTC | #1
Acked-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>

On 31.10.2022 16:25, Jiaxun Yang wrote:
> As per "Cavium Networks OCTEON Plus CN50XX Hardware Reference
> Manual" offset field is signed 16 bit value. However arg_BBIT.offset
> is unsigned. We need to cast it as signed to do address calculation.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> v2:
> Do casting in decodetree. (philmd)
> ---
>   target/mips/tcg/octeon.decode | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/mips/tcg/octeon.decode b/target/mips/tcg/octeon.decode
> index 8929ad088e..0c787cb498 100644
> --- a/target/mips/tcg/octeon.decode
> +++ b/target/mips/tcg/octeon.decode
> @@ -12,7 +12,7 @@
>   # BBIT132    111110 ..... ..... ................
>   
>   %bbit_p      28:1 16:5
> -BBIT         11 set:1 . 10 rs:5 ..... offset:16 p=%bbit_p
> +BBIT         11 set:1 . 10 rs:5 ..... offset:s16 p=%bbit_p
>   
>   # Arithmetic
>   # BADDU rd, rs, rt
Philippe Mathieu-Daudé Nov. 7, 2022, 11:14 p.m. UTC | #2
On 31/10/22 14:25, Jiaxun Yang wrote:
> As per "Cavium Networks OCTEON Plus CN50XX Hardware Reference
> Manual" offset field is signed 16 bit value. However arg_BBIT.offset
> is unsigned. We need to cast it as signed to do address calculation.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> v2:
> Do casting in decodetree. (philmd)
> ---
>   target/mips/tcg/octeon.decode | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/mips/tcg/octeon.decode b/target/mips/tcg/octeon.decode
> index 8929ad088e..0c787cb498 100644
> --- a/target/mips/tcg/octeon.decode
> +++ b/target/mips/tcg/octeon.decode
> @@ -12,7 +12,7 @@
>   # BBIT132    111110 ..... ..... ................
>   
>   %bbit_p      28:1 16:5
> -BBIT         11 set:1 . 10 rs:5 ..... offset:16 p=%bbit_p
> +BBIT         11 set:1 . 10 rs:5 ..... offset:s16 p=%bbit_p
>   
>   # Arithmetic
>   # BADDU rd, rs, rt

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/target/mips/tcg/octeon.decode b/target/mips/tcg/octeon.decode
index 8929ad088e..0c787cb498 100644
--- a/target/mips/tcg/octeon.decode
+++ b/target/mips/tcg/octeon.decode
@@ -12,7 +12,7 @@ 
 # BBIT132    111110 ..... ..... ................
 
 %bbit_p      28:1 16:5
-BBIT         11 set:1 . 10 rs:5 ..... offset:16 p=%bbit_p
+BBIT         11 set:1 . 10 rs:5 ..... offset:s16 p=%bbit_p
 
 # Arithmetic
 # BADDU rd, rs, rt