Skip to content

Commit a4e5708

Browse files
rrwhxrth7680
authored andcommitted
tcg/mips: mips sync* encode error
OPC_SYNC_WMB, OPC_SYNC_MB, OPC_SYNC_ACQUIRE, OPC_SYNC_RELEASE and OPC_SYNC_RMB have wrong encode. According to the mips manual, their encode should be 'OPC_SYNC | 0x?? << 6' rather than 'OPC_SYNC | 0x?? << 5'. Wrong encode can lead illegal instruction errors. These instructions often appear with multi-threaded simulation. Fixes: 6f0b991 ("tcg/mips: Add support for fence") Reviewed-by: Richard Henderson <[email protected]> Reviewed-by: Aleksandar Markovic <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: lixinyu <[email protected]> Message-Id: <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent 17e1e49 commit a4e5708

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tcg/mips/tcg-target.inc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,11 @@ typedef enum {
404404

405405
/* MIPS r6 introduced names for weaker variants of SYNC. These are
406406
backward compatible to previous architecture revisions. */
407-
OPC_SYNC_WMB = OPC_SYNC | 0x04 << 5,
408-
OPC_SYNC_MB = OPC_SYNC | 0x10 << 5,
409-
OPC_SYNC_ACQUIRE = OPC_SYNC | 0x11 << 5,
410-
OPC_SYNC_RELEASE = OPC_SYNC | 0x12 << 5,
411-
OPC_SYNC_RMB = OPC_SYNC | 0x13 << 5,
407+
OPC_SYNC_WMB = OPC_SYNC | 0x04 << 6,
408+
OPC_SYNC_MB = OPC_SYNC | 0x10 << 6,
409+
OPC_SYNC_ACQUIRE = OPC_SYNC | 0x11 << 6,
410+
OPC_SYNC_RELEASE = OPC_SYNC | 0x12 << 6,
411+
OPC_SYNC_RMB = OPC_SYNC | 0x13 << 6,
412412

413413
/* Aliases for convenience. */
414414
ALIAS_PADD = sizeof(void *) == 4 ? OPC_ADDU : OPC_DADDU,

0 commit comments

Comments
 (0)