diff 68kinst.c @ 1627:dc1eab3ec092

Fix cycle count for shift/rotate instructions with a static shift ammount
author Michael Pavone <pavone@retrodev.com>
date Wed, 31 Oct 2018 21:58:09 -0700
parents 63f309cfbef9
children 8554751f17b5
line wrap: on
line diff
--- a/68kinst.c	Fri Oct 26 23:11:37 2018 -0700
+++ b/68kinst.c	Wed Oct 31 21:58:09 2018 -0700
@@ -1537,6 +1537,7 @@
 					immed = 8;
 				}
 				decoded->src.params.immed = immed;
+				decoded->variant = VAR_QUICK;
 			}
 			decoded->dst.addr_mode = MODE_REG;
 			decoded->dst.params.regs.pri = *istream & 0x7;
@@ -2608,9 +2609,12 @@
 #endif
 	default:
 		size = decoded->extra.size;
+		uint8_t is_quick = decoded->variant == VAR_QUICK && decoded->op != M68K_ASL && decoded->op != M68K_ASR 
+			&& decoded->op != M68K_LSL && decoded->op != M68K_LSR && decoded->op != M68K_ROXR && decoded->op != M68K_ROXL
+			&& decoded->op != M68K_ROR && decoded->op != M68K_ROL;
 		ret = sprintf(dst, "%s%s%s",
 				mnemonics[decoded->op],
-				decoded->variant == VAR_QUICK ? "q" : (decoded->variant == VAR_IMMEDIATE ? "i" : ""),
+				is_quick ? "q" : (decoded->variant == VAR_IMMEDIATE ? "i" : ""),
 				size == OPSIZE_BYTE ? ".b" : (size == OPSIZE_WORD ? ".w" : (size == OPSIZE_LONG ? ".l" : "")));
 	}
 	if (decoded->op == M68K_MOVEM) {