1/*
2 * Signed 64-bit integer multiply.
3 *
4 * We could definately use more free registers for
5 * this code.   We spill rINSTw (ebx),
6 * giving us eax, ebc, ecx and edx as computational
7 * temps.  On top of that, we'll spill edi (rFP)
8 * for use as the vB pointer and esi (rPC) for use
9 * as the vC pointer.  Yuck.
10 *
11 */
12    /* mul-long vAA, vBB, vCC */
13    movzbl  2(rPC), %eax                    # eax <- B
14    movzbl  3(rPC), %ecx                    # ecx <- C
15    mov     rPC, LOCAL0(%esp)               # save Interpreter PC
16    mov     rFP, LOCAL1(%esp)               # save FP
17    mov     rIBASE, LOCAL2(%esp)            # save rIBASE
18    leal    (rFP,%eax,4), %esi              # esi <- &v[B]
19    leal    (rFP,%ecx,4), rFP               # rFP <- &v[C]
20    movl    4(%esi), %ecx                   # ecx <- Bmsw
21    imull   (rFP), %ecx                     # ecx <- (Bmsw*Clsw)
22    movl    4(rFP), %eax                    # eax <- Cmsw
23    imull   (%esi), %eax                    # eax <- (Cmsw*Blsw)
24    addl    %eax, %ecx                      # ecx <- (Bmsw*Clsw)+(Cmsw*Blsw)
25    movl    (rFP), %eax                     # eax <- Clsw
26    mull    (%esi)                          # eax <- (Clsw*Alsw)
27    mov     LOCAL0(%esp), rPC               # restore Interpreter PC
28    mov     LOCAL1(%esp), rFP               # restore FP
29    leal    (%ecx,rIBASE), rIBASE           # full result now in rIBASE:%eax
30    SET_VREG_HIGH rIBASE, rINST             # v[B+1] <- rIBASE
31    mov     LOCAL2(%esp), rIBASE            # restore IBASE
32    SET_VREG %eax, rINST                    # v[B] <- eax
33    ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
34