Unified · Split
| @@ -26,6 +26,7 @@ · 25 unmodified lines | |||
| 26 | DEF_ASM_OP0(cwtl, 0x98) | 26 | DEF_ASM_OP0(cwtl, 0x98) |
| 27 | DEF_ASM_OP0(cwtd, 0x6699) | 27 | DEF_ASM_OP0(cwtd, 0x6699) |
| 28 | DEF_ASM_OP0(cltd, 0x99) | 28 | DEF_ASM_OP0(cltd, 0x99) |
| 29 | DEF_ASM_OP0(cqto, 0x4899) | ||
| 29 | DEF_ASM_OP0(int3, 0xcc) | 30 | DEF_ASM_OP0(int3, 0xcc) |
| 30 | DEF_ASM_OP0(into, 0xce) | 31 | DEF_ASM_OP0(into, 0xce) |
| 31 | DEF_ASM_OP0(iret, 0xcf) | 32 | DEF_ASM_OP0(iret, 0xcf) |
| @@ -1137,7 +1137,13 @@ void gen_opi(int op) · 1136 unmodified lines | |||
| 1137 | r = TREG_RAX; | 1137 | r = TREG_RAX; |
| 1138 | } else { | 1138 | } else { |
| 1139 | if (op == TOK_UDIV || op == TOK_UMOD) { | 1139 | if (op == TOK_UDIV || op == TOK_UMOD) { |
| 1140 | o(0xf7d231); /* xor %edx, %edx, div fr, %eax */ | 1140 | if ((vtop->type.t & VT_BTYPE) & VT_LLONG) { |
| 1141 | o(0xd23148); /* xor %rdx, %rdx */ | ||
| 1142 | o(0x48 + REX_BASE(fr)); | ||
| 1143 | } else { | ||
| 1144 | o(0xd231); /* xor %edx, %edx */ | ||
| 1145 | } | ||
| 1146 | o(0xf7); /* div fr, %eax */ | ||
| 1141 | o(0xf0 + fr); | 1147 | o(0xf0 + fr); |
| 1142 | } else { | 1148 | } else { |
| 1143 | if ((vtop->type.t & VT_BTYPE) & VT_LLONG) { | 1149 | if ((vtop->type.t & VT_BTYPE) & VT_LLONG) { |