Home | History | Annotate | Download | only in x86
      1 %verify "executed"
      2     /*
      3      * Signed 64-bit integer multiply, 2-addr version
      4      *
      5      * We could definately use more free registers for
      6      * this code.  We must spill %edx (rIBASE) because it
      7      * is used by imul.  We'll also spill rINST (ebx),
      8      * giving us eax, ebc, ecx and rIBASE as computational
      9      * temps.  On top of that, we'll spill %esi (edi)
     10      * for use as the vA pointer and rFP (esi) for use
     11      * as the vB pointer.  Yuck.
     12      */
     13     /* mul-long/2addr vA, vB */
     14     movzbl    rINSTbl,%eax             # eax<- BA
     15     andb      $$0xf,%al                # eax<- A
     16     sarl      $$4,rINST                # rINST<- B
     17     SPILL_TMP2(%esi)
     18     SPILL(rFP)
     19     SPILL(rIBASE)
     20     leal      (rFP,%eax,4),%esi        # %esi<- &v[A]
     21     leal      (rFP,rINST,4),rFP        # rFP<- &v[B]
     22     movl      4(%esi),%ecx             # ecx<- Amsw
     23     imull     (rFP),%ecx               # ecx<- (Amsw*Blsw)
     24     movl      4(rFP),%eax              # eax<- Bmsw
     25     imull     (%esi),%eax              # eax<- (Bmsw*Alsw)
     26     addl      %eax,%ecx                # ecx<- (Amsw*Blsw)+(Bmsw*Alsw)
     27     movl      (rFP),%eax               # eax<- Blsw
     28     mull      (%esi)                   # eax<- (Blsw*Alsw)
     29     leal      (%ecx,rIBASE),rIBASE     # full result now in %edx:%eax
     30     movl      rIBASE,4(%esi)           # v[A+1]<- rIBASE
     31     movl      %eax,(%esi)              # v[A]<- %eax
     32     UNSPILL_TMP2(%esi)
     33     FETCH_INST_OPCODE 1 %ecx
     34     UNSPILL(rIBASE)
     35     UNSPILL(rFP)
     36     ADVANCE_PC 1
     37     GOTO_NEXT_R %ecx
     38