On 5/9/26 21:13, James Hilliard wrote:
LBX performs an indexed signed byte load from base + index and writes the
sign-extended result to rd.

Wire the existing indexed-load helper to MO_SB so Octeon user-mode
binaries can use the signed byte variant alongside the existing LBUX
path.

Signed-off-by: James Hilliard <[email protected]>
---
Changes v2 -> v3:
   - Split LBX out of the combined Octeon arithmetic and memory
     instruction patch.  (requested by Richard Henderson)
---
  target/mips/tcg/octeon.decode      | 1 +
  target/mips/tcg/octeon_translate.c | 1 +
  2 files changed, 2 insertions(+)

diff --git a/target/mips/tcg/octeon.decode b/target/mips/tcg/octeon.decode
index a2bfd0751d..efb1a48b38 100644
--- a/target/mips/tcg/octeon.decode
+++ b/target/mips/tcg/octeon.decode
@@ -49,4 +49,5 @@ SNEI         011100 rs:5 rt:5 imm:s10 101111 &cmpi
  LWX          011111 ..... ..... ..... 00000 001010 @lx
  LHX          011111 ..... ..... ..... 00100 001010 @lx
  LBUX         011111 ..... ..... ..... 00110 001010 @lx
+LBX          011111 ..... ..... ..... 10110 001010 @lx
  LDX          011111 ..... ..... ..... 01000 001010 @lx
diff --git a/target/mips/tcg/octeon_translate.c 
b/target/mips/tcg/octeon_translate.c
index 1893bf359f..ecdce6ab9b 100644
--- a/target/mips/tcg/octeon_translate.c
+++ b/target/mips/tcg/octeon_translate.c
@@ -161,6 +161,7 @@ static bool trans_lx(DisasContext *ctx, arg_lx *a, MemOp 
mop)
      return true;
  }
+TRANS(LBX, trans_lx, MO_SB);
  TRANS(LBUX, trans_lx, MO_UB);
  TRANS(LHX,  trans_lx, MO_SW);
  TRANS(LWX,  trans_lx, MO_SL);


Reviewed-by: Richard Henderson <[email protected]>


r~

Reply via email to