Home | History | Annotate | Download | only in x86
      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     SPILL(rIBASE)
     13     cmpl     $$0,%ecx
     14     je       common_errDivideByZero
     15     cmpl     $$-1,%ecx
     16     jne      .L${opcode}_continue_div
     17     cmpl     $$0x80000000,%eax
     18     jne      .L${opcode}_continue_div
     19     movl     $special,$result
     20     SET_VREG $result rINST
     21     UNSPILL(rIBASE)
     22     FETCH_INST_OPCODE 2 %ecx
     23     ADVANCE_PC 2
     24     GOTO_NEXT_R %ecx
     25 
     26 .L${opcode}_continue_div:
     27     cltd
     28     idivl   %ecx
     29     SET_VREG $result rINST
     30     UNSPILL(rIBASE)
     31     FETCH_INST_OPCODE 2 %ecx
     32     ADVANCE_PC 2
     33     GOTO_NEXT_R %ecx
     34