Home | History | Annotate | Download | only in x86
      1 %default {"result":"","special":""}
      2     /*
      3      * 32-bit div/rem "lit8" binary operation.  Handles special case of
      4      * op0=minint & op1=-1
      5      */
      6     /* div/rem/lit8 vAA, vBB, #+CC */
      7     movzbl    2(rPC),%eax        # eax<- BB
      8     movsbl    3(rPC),%ecx        # ecx<- ssssssCC
      9     SPILL(rIBASE)
     10     GET_VREG_R  %eax %eax        # eax<- rBB
     11     cmpl     $$0,%ecx
     12     je       common_errDivideByZero
     13     cmpl     $$0x80000000,%eax
     14     jne      .L${opcode}_continue_div
     15     cmpl     $$-1,%ecx
     16     jne      .L${opcode}_continue_div
     17     movl     $special,$result
     18     SET_VREG $result rINST
     19     UNSPILL(rIBASE)
     20     FETCH_INST_OPCODE 2 %ecx
     21     ADVANCE_PC 2
     22     GOTO_NEXT_R %ecx
     23 
     24 .L${opcode}_continue_div:
     25     cltd
     26     idivl   %ecx
     27     SET_VREG $result rINST
     28     UNSPILL(rIBASE)
     29     FETCH_INST_OPCODE 2 %ecx
     30     ADVANCE_PC 2
     31     GOTO_NEXT_R %ecx
     32