Home | History | Annotate | Download | only in x86
      1 %verify "executed"
      2 %default {"routine":"__divdi3","special":"$0x80000000"}
      3     /* div/2addr vA, vB */
      4     movzbl    rINSTbl,%eax
      5     shrl      $$4,%eax                  # eax<- B
      6     andb      $$0xf,rINSTbl             # rINST<- A
      7     SPILL(rIBASE)                       # save rIBASE/%edx
      8     GET_VREG_WORD rIBASE %eax 0
      9     GET_VREG_WORD %eax %eax 1
     10     movl     rIBASE,OUT_ARG2(%esp)
     11     testl    %eax,%eax
     12     je       .L${opcode}_check_zero
     13     cmpl     $$-1,%eax
     14     je       .L${opcode}_check_neg1
     15 .L${opcode}_notSpecial:
     16     GET_VREG_WORD rIBASE rINST 0
     17     GET_VREG_WORD %ecx rINST 1
     18 .L${opcode}_notSpecial1:
     19     movl     %eax,OUT_ARG3(%esp)
     20     movl     rIBASE,OUT_ARG0(%esp)
     21     movl     %ecx,OUT_ARG1(%esp)
     22     call     $routine
     23 .L${opcode}_finish:
     24     SET_VREG_WORD rIBASE rINST 1
     25     UNSPILL(rIBASE)                    # restore rIBASE/%edx
     26     SET_VREG_WORD %eax rINST 0
     27     FETCH_INST_OPCODE 1 %ecx
     28     ADVANCE_PC 1
     29     GOTO_NEXT_R %ecx
     30 
     31 .L${opcode}_check_zero:
     32     testl   rIBASE,rIBASE
     33     jne     .L${opcode}_notSpecial
     34     jmp     common_errDivideByZero
     35 .L${opcode}_check_neg1:
     36     testl   rIBASE,%eax
     37     jne     .L${opcode}_notSpecial
     38     GET_VREG_WORD rIBASE rINST 0
     39     GET_VREG_WORD %ecx rINST 1
     40     testl    rIBASE,rIBASE
     41     jne      .L${opcode}_notSpecial1
     42     cmpl     $$0x80000000,%ecx
     43     jne      .L${opcode}_notSpecial1
     44     /* minint / -1, return minint on div, 0 on rem */
     45     xorl     %eax,%eax
     46     movl     $special,rIBASE
     47     jmp      .L${opcode}_finish
     48