Message ID | 1484311923-28637-2-git-send-email-laurent@vivier.eu |
---|---|
State | New |
Headers | show |
On 01/13/2017 04:51 AM, Laurent Vivier wrote: > M680x0 bit operations with an immediate value use 9 bits of the 16bit > value, while coldfire ones use only 8 bits. I don't see that in the reference manual. Where do you get this from? r~
Le 13/01/2017 à 18:55, Richard Henderson a écrit : > On 01/13/2017 04:51 AM, Laurent Vivier wrote: >> M680x0 bit operations with an immediate value use 9 bits of the 16bit >> value, while coldfire ones use only 8 bits. > > I don't see that in the reference manual. Where do you get this from? See "BSET Instruction Format:BIT NUMBER STATIC, SPECIFIED AS IMMEDIATE DATA", p. 4.58 of "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL", "BIT NUMBER" is bits 0 to 8 of extended word. See "Test a Bit and Set", p. 4-22 of "ColdFire Family Programmer’s Reference Manual, Rev. 3" (link given by Thomas), "Bit Number" is bits 0 to 7 of extended word. I've found the problem with RISU. Thanks, Laurent
On 01/13/2017 10:23 AM, Laurent Vivier wrote: > See "BSET Instruction Format:BIT NUMBER STATIC, SPECIFIED AS IMMEDIATE > DATA", p. 4.58 of "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL", "BIT > NUMBER" is bits 0 to 8 of extended word. Oops, yep. I misread that. Reviewed-by: Richard Henderson <rth@twiddle.net> r~
diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 5f7357e..410f56a 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -1801,9 +1801,16 @@ DISAS_INSN(bitop_im) op = (insn >> 6) & 3; bitnum = read_im16(env, s); - if (bitnum & 0xff00) { - disas_undef(env, s, insn); - return; + if (m68k_feature(s->env, M68K_FEATURE_M68000)) { + if (bitnum & 0xfe00) { + disas_undef(env, s, insn); + return; + } + } else { + if (bitnum & 0xff00) { + disas_undef(env, s, insn); + return; + } } SRC_EA(env, src1, opsize, 0, op ? &addr: NULL);
M680x0 bit operations with an immediate value use 9 bits of the 16bit value, while coldfire ones use only 8 bits. Signed-off-by: Laurent Vivier <laurent@vivier.eu> --- target/m68k/translate.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)