OSDN Git Service

x86 mterp: reduce x86/x86-atom differences
[android-x86/dalvik.git] / vm / mterp / x86 / bindiv.S
1
2 %default {"result":"","special":""}
3     /*
4      * 32-bit binary div/rem operation.  Handles special case of op0=minint and
5      * op1=-1.
6      */
7     /* binop vAA, vBB, vCC */
8     movzbl   2(rPC),%eax            # eax<- BB
9     movzbl   3(rPC),%ecx            # ecx<- CC
10     GET_VREG_R %eax %eax            # eax<- vBB
11     GET_VREG_R %ecx %ecx            # eax<- vBB
12     cmpl     $$0,%ecx
13     je       common_errDivideByZero
14     cmpl     $$-1,%ecx
15     jne      .L${opcode}_continue_div
16     cmpl     $$0x80000000,%eax
17     jne      .L${opcode}_continue_div
18     movl     $special,$result
19     jmp      .L${opcode}_finish_div
20
21 %break
22 .L${opcode}_continue_div:
23     cltd
24     idivl   %ecx
25 .L${opcode}_finish_div:
26     SET_VREG $result rINST
27     FETCH_INST_OPCODE 2 %edx
28     ADVANCE_PC 2
29     GOTO_NEXT_R %edx