~lsof/antcc

b02aecc21e951484fcb2702f2e3328e76cd9064d — lemon 1 year, 3 months ago eca20d8
fix emit() setcc and copy
1 files changed, 2 insertions(+), 1 deletions(-)

M amd64/emit.c
M amd64/emit.c => amd64/emit.c +2 -1
@@ 632,7 632,7 @@ Xsetcc(uchar **pcode, enum cc cc, enum reg reg)

   if (in_range(reg, RSP, RDI)) rex = 0x40;
   rex |= (reg >> 3); /* REX.B */
   if (rex) B(rex);
   if (rex) B(rex | 0x40);
   B(0x0F), B(0x90+cc); /* SETcc */
   B(0xC0 + (reg & 7)); /* ModR/M with mod=11, rm=reg */



@@ 687,6 687,7 @@ gencopy(uchar **pcode, enum irclass cls, struct block *blk, int curi, struct ope
       * which may clobber flags */
      const struct addr *addr = &addrht[val.i];
      if (flagslivep(blk, curi)) goto Lea;
      if (addr->base.t != RREG) goto Lea;
      if (addr->base.bits && dst.reg == mkregoper(addr->base).reg) { /* base = dst */
         if (addr->index.bits && !addr->disp && !addr->shift){
            /* lea Rx, [Rx + Ry] -> add Rx, Ry */