X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=mach.c;h=e8a719bce782baef14c7775692ee96ee634b50be;hp=747300228ba04432e0cad285c2480562c4f2a32e;hb=ff8188b7e279f99cf11ac8a283c4146af324d26f;hpb=c0bdc914edf683ad221f2d733edcde749eb2cdfe diff --git a/mach.c b/mach.c index 7473002..e8a719b 100644 --- a/mach.c +++ b/mach.c @@ -822,10 +822,12 @@ int m_move(WORD inst, WORD size) int siz = (int)size; // Try to optimize to MOVEQ + // N.B.: We can get away with casting the uint64_t to a 32-bit value + // because it checks for a SIZL (i.e., a 32-bit value). if (CHECK_OPTS(OPT_MOVEL_MOVEQ) && (siz == SIZL) && (am0 == IMMED) && (am1 == DREG) && ((a0exattr & (TDB | DEFINED)) == DEFINED) - && (a0exval + 0x80 < 0x100)) + && ((uint32_t)a0exval + 0x80 < 0x100)) { m_moveq((WORD)0x7000, (WORD)0); @@ -979,7 +981,7 @@ int m_br(WORD inst, WORD siz) return error(rel_error); //} - v = a0exval - (sloc + 2); + v = (uint32_t)a0exval - (sloc + 2); // Optimize branch instr. size if (siz == SIZN) @@ -1105,7 +1107,7 @@ int m_trap(WORD inst, WORD siz) // int m_movem(WORD inst, WORD siz) { - uint32_t eval; + uint64_t eval; WORD i; WORD w; WORD rmask; @@ -1251,7 +1253,6 @@ int m_br30(WORD inst, WORD siz) // int m_bfop(WORD inst, WORD siz) { - if ((bfval1 > 31) || (bfval1 < 0)) return error("bfxxx offset: immediate value must be between 0 and 31");