int dst = dstreg;
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
arm_ADD_l_ri8(dstreg + 8, 4);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
mov_l_ri(dst, comp_get_ilong((m68k_pc_offset += 4) - 4));
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jff_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(tmp, r3);
+ } else {
+ jff_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jff_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jff_MULS64(r2, r3);
+ } else {
+ jff_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dst=dstreg;
register_possible_exception();
if (extra & 0x0400) {
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=dstreg+8;
int dst=alloc_scratch();
readlong(dsta,dst);
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=dstreg+8;
int dst=alloc_scratch();
readlong(dsta,dst);
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=dstreg+8;
arm_SUB_l_ri8(dstreg+8,4);
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
lea_l_brr(dsta,8+dstreg,(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2));
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
calc_disp_ea_020(dstreg+8,comp_get_iword((m68k_pc_offset+=2)-2),dsta);
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
mov_l_ri(dsta,(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2));
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
mov_l_ri(dsta,comp_get_ilong((m68k_pc_offset+=4)-4)); /* absl */
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+m68k_pc_offset;
uae_s32 PC16off = (uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
int pctmp=alloc_scratch();
uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+m68k_pc_offset;
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dst=alloc_scratch();
mov_l_ri(dst,comp_get_ilong((m68k_pc_offset+=4)-4));
register_possible_exception();
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int src=srcreg;
int dst=dstreg;
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int srca=srcreg+8;
int src=alloc_scratch();
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int srca=srcreg+8;
int src=alloc_scratch();
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int srca=srcreg+8;
arm_SUB_l_ri8(srcreg+8,2);
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int srca=alloc_scratch();
lea_l_brr(srca,8+srcreg,(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2));
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int srca=alloc_scratch();
calc_disp_ea_020(srcreg+8,comp_get_iword((m68k_pc_offset+=2)-2),srca);
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int srca=alloc_scratch();
mov_l_ri(srca,(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2));
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int srca=alloc_scratch();
mov_l_ri(srca,comp_get_ilong((m68k_pc_offset+=4)-4)); /* absl */
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int srca=alloc_scratch();
uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+m68k_pc_offset;
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int srca=alloc_scratch();
int pctmp=alloc_scratch();
uae_u32 dstreg = (opcode >> 9) & 7;
uae_u32 m68k_pc_offset_thisinst=m68k_pc_offset;
m68k_pc_offset+=2;
+ save_flags();
dont_care_flags();
int src=alloc_scratch();
mov_l_ri(src,(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2));
int dst = dstreg;
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
arm_ADD_l_ri8(dstreg + 8, 4);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
readlong(dsta, dst);
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
mov_l_ri(dst, comp_get_ilong((m68k_pc_offset += 4) - 4));
if (extra & 0x0400) {
int r3 = (extra & 7);
- mov_l_rr(r3, dst);
- if (extra & 0x0800) {
- jnf_MULS64(r2, r3);
+ if (r2 == r3) {
+ int tmp = alloc_scratch();
+ mov_l_rr(tmp, r2);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(tmp, r3);
+ } else {
+ jnf_MULU64(tmp, r3);
+ }
+ if (currprefs.cpu_model >= 68040)
+ mov_l_rr(r2, tmp);
} else {
- jnf_MULU64(r2, r3);
+ mov_l_rr(r3, dst);
+ if (extra & 0x0800) {
+ jnf_MULS64(r2, r3);
+ } else {
+ jnf_MULU64(r2, r3);
+ }
}
} else {
if (extra & 0x0800) {
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dst=dstreg;
register_possible_exception();
if (extra & 0x0400) {
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=dstreg+8;
int dst=alloc_scratch();
readlong(dsta,dst);
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=dstreg+8;
int dst=alloc_scratch();
readlong(dsta,dst);
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=dstreg+8;
arm_SUB_l_ri8(dstreg+8,4);
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
lea_l_brr(dsta,8+dstreg,(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2));
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
calc_disp_ea_020(dstreg+8,comp_get_iword((m68k_pc_offset+=2)-2),dsta);
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
mov_l_ri(dsta,(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2));
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
mov_l_ri(dsta,comp_get_ilong((m68k_pc_offset+=4)-4)); /* absl */
int dst=alloc_scratch();
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+m68k_pc_offset;
uae_s32 PC16off = (uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dsta=alloc_scratch();
int pctmp=alloc_scratch();
uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+m68k_pc_offset;
uae_u16 extra=comp_get_iword((m68k_pc_offset+=2)-2);
int r2=(extra>>12)&7;
int r3=extra&7;
+ if (extra & 0x0400) {
+ FAIL(1);
+ m68k_pc_offset=m68k_pc_offset_thisinst;
+ return 0;
+ }
int dst=alloc_scratch();
mov_l_ri(dst,comp_get_ilong((m68k_pc_offset+=4)-4));
register_possible_exception();
}
MENDFUNC(0,make_flags_live,(void))
+MIDFUNC(0,save_flags,(void))
+{
+ make_flags_live_internal();
+ flush_flags();
+}
+MENDFUNC(0,save_flags,(void))
+
MIDFUNC(2,mov_l_mi,(IMPTR d, IM32 s))
{
/* d points always to memory in regs struct */
DECLARE_MIDFUNC(live_flags(void));
DECLARE_MIDFUNC(dont_care_flags(void));
DECLARE_MIDFUNC(make_flags_live(void));
+DECLARE_MIDFUNC(save_flags(void));
DECLARE_MIDFUNC(forget_about(W4 r));
DECLARE_MIDFUNC(f_forget_about(FW r));
}
MENDFUNC(0,make_flags_live,(void))
+MIDFUNC(0,save_flags,(void))
+{
+ make_flags_live_internal();
+ flush_flags();
+}
+MENDFUNC(0,save_flags,(void))
+
MIDFUNC(2,mov_l_mi,(IMPTR d, IMPTR s))
{
/* d usually points to memory in regs struct, but can also be a global
SET_xxCflag(REG_WORK4, REG_WORK4);
// Calculate V Flag
+ CMP_wi(REG_WORK1, 8);
+ uae_u32* branch_normal_v = (uae_u32*)get_target();
+ BLT_i(0);
+ TST_ww(REG_WORK3, REG_WORK3);
+ uae_u32* branch_done_zero = (uae_u32*)get_target();
+ BEQ_i(0);
+ SET_xxVflag(REG_WORK4, REG_WORK4);
+ uae_u32* branch_done_large = (uae_u32*)get_target();
+ B_i(0);
+ write_jmp_target(branch_normal_v, (uintptr)get_target());
CLS_ww(REG_WORK2, REG_WORK3);
CMP_ww(REG_WORK2, REG_WORK1);
BGE_i(2);
SET_xxVflag(REG_WORK4, REG_WORK4);
+ write_jmp_target(branch_done_zero, (uintptr)get_target());
+ write_jmp_target(branch_done_large, (uintptr)get_target());
MSR_NZCV_x(REG_WORK4);
} else {
SET_xxCflag(REG_WORK4, REG_WORK4);
// Calculate V Flag
+ CMP_wi(REG_WORK1, 16);
+ uae_u32* branch_normal_v = (uae_u32*)get_target();
+ BLT_i(0);
+ TST_ww(REG_WORK3, REG_WORK3);
+ uae_u32* branch_done_zero = (uae_u32*)get_target();
+ BEQ_i(0);
+ SET_xxVflag(REG_WORK4, REG_WORK4);
+ uae_u32* branch_done_large = (uae_u32*)get_target();
+ B_i(0);
+ write_jmp_target(branch_normal_v, (uintptr)get_target());
CLS_ww(REG_WORK2, REG_WORK3);
CMP_ww(REG_WORK2, REG_WORK1);
BGE_i(2);
SET_xxVflag(REG_WORK4, REG_WORK4);
+ write_jmp_target(branch_done_zero, (uintptr)get_target());
+ write_jmp_target(branch_done_large, (uintptr)get_target());
MSR_NZCV_x(REG_WORK4);
} else {
SET_xxCflag(REG_WORK4, REG_WORK4);
// Calculate V Flag
+ CMP_wi(REG_WORK1, 32);
+ uae_u32* branch_normal_v = (uae_u32*)get_target();
+ BLT_i(0);
+ TST_ww(REG_WORK3, REG_WORK3);
+ uae_u32* branch_done_zero = (uae_u32*)get_target();
+ BEQ_i(0);
+ SET_xxVflag(REG_WORK4, REG_WORK4);
+ uae_u32* branch_done_large = (uae_u32*)get_target();
+ B_i(0);
+ write_jmp_target(branch_normal_v, (uintptr)get_target());
CLS_ww(REG_WORK2, REG_WORK3);
CMP_ww(REG_WORK2, REG_WORK1);
BGE_i(2);
SET_xxVflag(REG_WORK4, REG_WORK4);
+ write_jmp_target(branch_done_zero, (uintptr)get_target());
+ write_jmp_target(branch_done_large, (uintptr)get_target());
MSR_NZCV_x(REG_WORK4);
} else {
LSR_xxx(REG_WORK2, REG_WORK2, REG_WORK4); // 64-bit shift so width==32 -> mask 0
BFI_xxii(REG_WORK2, REG_WORK2, 32, 32);
ROR_xxx(REG_WORK2, REG_WORK2, REG_WORK3);
- AND_xxx(d, d, REG_WORK2);
ROR_www(REG_WORK1, s, REG_WORK4);
BFI_xxii(REG_WORK1, REG_WORK1, 32, 32);
ROR_xxx(REG_WORK1, REG_WORK1, REG_WORK3);
- MVN_xx(REG_WORK2, REG_WORK2);
- AND_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
+ BIC_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
+ AND_xxx(d, d, REG_WORK2);
ORR_xxx(d, d, REG_WORK1);
ROR_xxi(d, d, 32);
MOV_ww(d, d); // Clean upper 32 bits after 64-bit BFINS operations
LSR_xxx(REG_WORK2, REG_WORK2, REG_WORK4); // 64-bit shift so width==32 -> mask 0
BFI_xxii(REG_WORK2, REG_WORK2, 32, 32);
ROR_xxx(REG_WORK2, REG_WORK2, REG_WORK3);
- AND_xxx(d, d, REG_WORK2);
ROR_www(REG_WORK1, s, REG_WORK4);
BFI_xxii(REG_WORK1, REG_WORK1, 32, 32);
ROR_xxx(REG_WORK1, REG_WORK1, REG_WORK3);
- MVN_xx(REG_WORK2, REG_WORK2);
- AND_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
+ BIC_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
+ // Flags come from the source field, not the positioned/masked value:
+ // N = source bit (width-1), Z = (low `width` bits of source == 0).
+ SBFX_wwii(REG_WORK3, s, 0, width);
+ TST_ww(REG_WORK3, REG_WORK3);
+ MRS_NZCV_x(REG_WORK4);
+
+ AND_xxx(d, d, REG_WORK2);
ORR_xxx(d, d, REG_WORK1);
ROR_xxi(d, d, 32);
MOV_ww(d, d); // Clean upper 32 bits after 64-bit BFINS operations
-
- // Flags come from the source field, not the positioned/masked value:
- // N = source bit (width-1), Z = (low `width` bits of source == 0).
- SBFX_wwii(REG_WORK1, s, 0, width);
- TST_ww(REG_WORK1, REG_WORK1);
+ MSR_NZCV_x(REG_WORK4);
flags_carry_inverted = false;
unlock2(offs);
LSR_xxx(REG_WORK2, REG_WORK2, REG_WORK4); // 64-bit shift so width==32 -> mask 0
BFI_xxii(REG_WORK2, REG_WORK2, 32, 32);
ROR_xxx(REG_WORK2, REG_WORK2, REG_WORK3);
- AND_xxx(d, d, REG_WORK2);
ROR_www(REG_WORK1, s, REG_WORK4);
BFI_xxii(REG_WORK1, REG_WORK1, 32, 32);
ROR_xxx(REG_WORK1, REG_WORK1, REG_WORK3);
- MVN_xx(REG_WORK2, REG_WORK2);
- AND_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
+ BIC_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
+ AND_xxx(d, d, REG_WORK2);
ORR_xxx(d, d, REG_WORK1);
ROR_xxi(d, d, 32);
MOV_ww(d, d); // Clean upper 32 bits after 64-bit BFINS operations
LSR_xxx(REG_WORK2, REG_WORK2, REG_WORK4); // 64-bit shift so width==32 -> mask 0
BFI_xxii(REG_WORK2, REG_WORK2, 32, 32);
ROR_xxx(REG_WORK2, REG_WORK2, REG_WORK3);
- AND_xxx(d, d, REG_WORK2);
ROR_www(REG_WORK1, s, REG_WORK4);
BFI_xxii(REG_WORK1, REG_WORK1, 32, 32);
ROR_xxx(REG_WORK1, REG_WORK1, REG_WORK3);
- MVN_xx(REG_WORK2, REG_WORK2);
- AND_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
-
- ORR_xxx(d, d, REG_WORK1);
- ROR_xxi(d, d, 32);
- MOV_ww(d, d); // Clean upper 32 bits after 64-bit BFINS operations
+ BIC_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
// Flags come from the source field, not the positioned/masked value.
// Shift the source left by (32 - width) so bit 31 = source bit (width-1):
// N = that bit, Z = (low `width` bits of source == 0).
- MOV_wi(REG_WORK2, 32);
- SUB_www(REG_WORK2, REG_WORK2, REG_WORK4);
- LSL_www(REG_WORK1, s, REG_WORK2);
- TST_ww(REG_WORK1, REG_WORK1);
+ MOV_wi(REG_WORK3, 32);
+ SUB_www(REG_WORK3, REG_WORK3, REG_WORK4);
+ LSL_www(REG_WORK3, s, REG_WORK3);
+ TST_ww(REG_WORK3, REG_WORK3);
+ MRS_NZCV_x(REG_WORK4);
+
+ AND_xxx(d, d, REG_WORK2);
+ ORR_xxx(d, d, REG_WORK1);
+ ROR_xxi(d, d, 32);
+ MOV_ww(d, d); // Clean upper 32 bits after 64-bit BFINS operations
+ MSR_NZCV_x(REG_WORK4);
flags_carry_inverted = false;
unlock2(width);
LSR_xxx(REG_WORK2, REG_WORK2, REG_WORK4); // 64-bit shift so width==32 -> mask 0
BFI_xxii(REG_WORK2, REG_WORK2, 32, 32);
ROR_xxx(REG_WORK2, REG_WORK2, REG_WORK3);
- AND_xxx(d, d, REG_WORK2);
ROR_www(REG_WORK1, s, REG_WORK4);
BFI_xxii(REG_WORK1, REG_WORK1, 32, 32);
ROR_xxx(REG_WORK1, REG_WORK1, REG_WORK3);
- MVN_xx(REG_WORK2, REG_WORK2);
- AND_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
+ BIC_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
+ AND_xxx(d, d, REG_WORK2);
ORR_xxx(d, d, REG_WORK1);
ROR_xxi(d, d, 32);
MOV_ww(d, d); // Clean upper 32 bits after 64-bit BFINS operations
LSR_xxx(REG_WORK2, REG_WORK2, REG_WORK4); // 64-bit shift so width==32 -> mask 0
BFI_xxii(REG_WORK2, REG_WORK2, 32, 32);
ROR_xxx(REG_WORK2, REG_WORK2, REG_WORK3);
- AND_xxx(d, d, REG_WORK2);
ROR_www(REG_WORK1, s, REG_WORK4);
BFI_xxii(REG_WORK1, REG_WORK1, 32, 32);
ROR_xxx(REG_WORK1, REG_WORK1, REG_WORK3);
- MVN_xx(REG_WORK2, REG_WORK2);
- AND_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
-
- ORR_xxx(d, d, REG_WORK1);
- ROR_xxi(d, d, 32);
- MOV_ww(d, d); // Clean upper 32 bits after 64-bit BFINS operations
+ BIC_xxx(REG_WORK1, REG_WORK1, REG_WORK2);
// Flags come from the source field, not the positioned/masked value.
// Shift the source left by (32 - width) so bit 31 = source bit (width-1):
// N = that bit, Z = (low `width` bits of source == 0).
- MOV_wi(REG_WORK2, 32);
- SUB_www(REG_WORK2, REG_WORK2, REG_WORK4);
- LSL_www(REG_WORK1, s, REG_WORK2);
- TST_ww(REG_WORK1, REG_WORK1);
+ MOV_wi(REG_WORK3, 32);
+ SUB_www(REG_WORK3, REG_WORK3, REG_WORK4);
+ LSL_www(REG_WORK3, s, REG_WORK3);
+ TST_ww(REG_WORK3, REG_WORK3);
+ MRS_NZCV_x(REG_WORK4);
+
+ AND_xxx(d, d, REG_WORK2);
+ ORR_xxx(d, d, REG_WORK1);
+ ROR_xxi(d, d, 32);
+ MOV_ww(d, d); // Clean upper 32 bits after 64-bit BFINS operations
+ MSR_NZCV_x(REG_WORK4);
flags_carry_inverted = false;
unlock2(width);
TBZ_wii(d, 31, 2);
MOV_wish(REG_WORK1, 0x9000, 16); // Set V and N (if d < 0)
} else if (currprefs.cpu_model >= 68040) {
- MRS_NZCV_x(REG_WORK1);
+ int saved_flags = readreg(FLAGTMP);
+ MOV_ww(REG_WORK1, saved_flags);
+ unlock2(saved_flags);
CLEAR_xxCflag(REG_WORK1, REG_WORK1);
} else {
// 68000/010
// Overflow: V set, C cleared; N/Z depend on CPU model (setdivuflags()).
if (currprefs.cpu_model >= 68040) {
// V set, C cleared, N and Z unchanged
- MRS_NZCV_x(REG_WORK1);
+ int saved_flags = readreg(FLAGTMP);
+ MOV_ww(REG_WORK1, saved_flags);
+ unlock2(saved_flags);
SET_xxVflag(REG_WORK1, REG_WORK1);
CLEAR_xxCflag(REG_WORK1, REG_WORK1);
} else if (currprefs.cpu_model >= 68020) {
- // V set, N set if dividend < 0, Z and C unchanged
- MRS_NZCV_x(REG_WORK1);
+ // 68020/030 preserve incoming Z/C and N, except a negative dividend sets N.
+ int saved_flags = readreg(FLAGTMP);
+ MOV_ww(REG_WORK1, saved_flags);
+ unlock2(saved_flags);
SET_xxVflag(REG_WORK1, REG_WORK1);
TBZ_wii(d, 31, 2);
SET_xxNflag(REG_WORK1, REG_WORK1);
}
prop[cft_map(opcode)].set_flags = table68k[opcode].flagdead;
prop[cft_map(opcode)].use_flags = table68k[opcode].flaglive;
+ if (table68k[opcode].mnemo == i_DIVU)
+ prop[cft_map(opcode)].use_flags |= FLAG_CZNV;
/* Unconditional jumps don't evaluate condition codes, so they
* don't actually use any flags themselves */
if (prop[cft_map(opcode)].cflow & fl_const_jump)
if (!noflags) {
comprintf("\t if (extra & 0x0400) {\n"); /* Need full 64 bit result */
comprintf("\t int r3=(extra & 7);\n");
- comprintf("\t mov_l_rr(r3,dst);\n"); /* operands now in r3 and r2 */
- comprintf("\t if (extra & 0x0800) { \n"); /* signed */
- comprintf("\t\t jff_MULS64(r2,r3);\n");
- comprintf("\t } else { \n");
- comprintf("\t\t jff_MULU64(r2,r3);\n");
- comprintf("\t } \n"); /* The result is in r2/r3, with r2 holding the lower 32 bits */
+ comprintf("\t if (r2 == r3) {\n");
+ comprintf("\t mov_l_rr(tmp,r2);\n");
+ comprintf("\t mov_l_rr(r3,dst);\n"); /* operands now in r3 and tmp */
+ comprintf("\t if (extra & 0x0800) { \n"); /* signed */
+ comprintf("\t jff_MULS64(tmp,r3);\n");
+ comprintf("\t } else { \n");
+ comprintf("\t jff_MULU64(tmp,r3);\n");
+ comprintf("\t } \n");
+ comprintf("\t if (currprefs.cpu_model >= 68040)\n");
+ comprintf("\t mov_l_rr(r2,tmp);\n");
+ comprintf("\t } else {\n");
+ comprintf("\t mov_l_rr(r3,dst);\n"); /* operands now in r3 and r2 */
+ comprintf("\t if (extra & 0x0800) { \n"); /* signed */
+ comprintf("\t jff_MULS64(r2,r3);\n");
+ comprintf("\t } else { \n");
+ comprintf("\t jff_MULU64(r2,r3);\n");
+ comprintf("\t } \n"); /* The result is in r2/r3, with r2 holding the lower 32 bits */
+ comprintf("\t }\n");
comprintf("\t } else {\n"); /* Only want 32 bit result */
/* operands in dst and r2, result goes into r2 */
/* shouldn't matter whether it's signed or unsigned?!? */
} else {
comprintf("\t if (extra & 0x0400) {\n"); /* Need full 64 bit result */
comprintf("\t int r3=(extra & 7);\n");
- comprintf("\t mov_l_rr(r3,dst);\n"); /* operands now in r3 and r2 */
- comprintf("\t if (extra & 0x0800) { \n"); /* signed */
- comprintf("\t\t jnf_MULS64(r2,r3);\n");
- comprintf("\t } else { \n");
- comprintf("\t\t jnf_MULU64(r2,r3);\n");
- comprintf("\t } \n"); /* The result is in r2/r3, with r2 holding the lower 32 bits */
+ comprintf("\t if (r2 == r3) {\n");
+ comprintf("\t mov_l_rr(tmp,r2);\n");
+ comprintf("\t mov_l_rr(r3,dst);\n"); /* operands now in r3 and tmp */
+ comprintf("\t if (extra & 0x0800) { \n"); /* signed */
+ comprintf("\t jnf_MULS64(tmp,r3);\n");
+ comprintf("\t } else { \n");
+ comprintf("\t jnf_MULU64(tmp,r3);\n");
+ comprintf("\t } \n");
+ comprintf("\t if (currprefs.cpu_model >= 68040)\n");
+ comprintf("\t mov_l_rr(r2,tmp);\n");
+ comprintf("\t } else {\n");
+ comprintf("\t mov_l_rr(r3,dst);\n"); /* operands now in r3 and r2 */
+ comprintf("\t if (extra & 0x0800) { \n"); /* signed */
+ comprintf("\t jnf_MULS64(r2,r3);\n");
+ comprintf("\t } else { \n");
+ comprintf("\t jnf_MULU64(r2,r3);\n");
+ comprintf("\t } \n"); /* The result is in r2/r3, with r2 holding the lower 32 bits */
+ comprintf("\t }\n");
comprintf("\t } else {\n"); /* Only want 32 bit result */
/* operands in dst and r2, result foes into r2 */
/* shouldn't matter whether it's signed or unsigned?!? */