| %default {"result":"","second":"","wide":"","suffix":"","rem":"0","ext":"cdq"} |
| * 32-bit binary div/rem operation. Handles special case of op1=-1. |
| /* div/rem vAA, vBB, vCC */ |
| movzbq 2(rPC), %rax # rax <- BB |
| movzbq 3(rPC), %rcx # rcx <- CC |
| GET_WIDE_VREG %rax, %rax # eax <- vBB |
| GET_WIDE_VREG $second, %rcx # ecx <- vCC |
| GET_VREG %eax, %rax # eax <- vBB |
| GET_VREG $second, %rcx # ecx <- vCC |
| test${suffix} $second, $second |
| jz common_errDivideByZero |
| cmp${suffix} $$-1, $second |
| $ext # rdx:rax <- sign-extended of rax |
| SET_WIDE_VREG $result, rINSTq # eax <- vBB |
| SET_VREG $result, rINSTq # eax <- vBB |
| ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 |
| xor${suffix} $result, $result |