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