Mercurial > repos > blastem
comparison m68k_core_x86.c @ 976:8cdd4ddedd9a
Properly imlement btst with an immediate destination. Fixes a crash in NHL 95.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 23 Apr 2016 12:43:23 -0700 |
parents | 20e30ca7e8a2 |
children | 771875b5f519 |
comparison
equal
deleted
inserted
replaced
975:c6b19939da7b | 976:8cdd4ddedd9a |
---|---|
1585 //b### with memory destination is modulo 8 | 1585 //b### with memory destination is modulo 8 |
1586 //x86-64 doesn't support 8-bit bit operations | 1586 //x86-64 doesn't support 8-bit bit operations |
1587 //so we fake it by forcing the bit number to be modulo 8 | 1587 //so we fake it by forcing the bit number to be modulo 8 |
1588 and_ir(code, 7, src_op->base, SZ_D); | 1588 and_ir(code, 7, src_op->base, SZ_D); |
1589 size = SZ_D; | 1589 size = SZ_D; |
1590 } | |
1591 if (dst_op->mode == MODE_IMMED) { | |
1592 dst_op->base = src_op->base == opts->gen.scratch1 ? opts->gen.scratch2 : opts->gen.scratch1; | |
1593 mov_ir(code, dst_op->disp, dst_op->base, SZ_B); | |
1594 dst_op->mode = MODE_REG_DIRECT; | |
1590 } | 1595 } |
1591 if (dst_op->mode == MODE_REG_DIRECT) { | 1596 if (dst_op->mode == MODE_REG_DIRECT) { |
1592 op_rr(code, inst, src_op->base, dst_op->base, size); | 1597 op_rr(code, inst, src_op->base, dst_op->base, size); |
1593 } else { | 1598 } else { |
1594 op_rrdisp(code, inst, src_op->base, dst_op->base, dst_op->disp, size); | 1599 op_rrdisp(code, inst, src_op->base, dst_op->base, dst_op->disp, size); |