summaryrefslogtreecommitdiff
path: root/vm/mterp/x86/OP_USHR_LONG_2ADDR.S
blob: d4396b4219c715be1b8d00ee9c483c18581f00bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
%verify "executed"
    /*
     * Long integer shift, 2addr version.  vA is 64-bit value/result, vB is
     * 32-bit shift distance.
     */
    /* shl-long/2addr vA, vB */
    /* ecx gets shift count */
    /* Need to spill rIBASE */
    /* rINSTw gets AA */
    movzbl    rINSTbl,%ecx             # ecx<- BA
    andb      $$0xf,rINSTbl            # rINST<- A
    GET_VREG_WORD %eax rINST 0         # eax<- v[AA+0]
    sarl      $$4,%ecx                 # ecx<- B
    SPILL(rIBASE)
    GET_VREG_WORD rIBASE rINST 1       # rIBASE<- v[AA+1]
    GET_VREG_R %ecx %ecx               # ecx<- vBB
    shrdl     rIBASE,%eax
    shrl      %cl,rIBASE
    testb     $$32,%cl
    je        2f
    movl      rIBASE,%eax
    xorl      rIBASE,rIBASE
2:
    SET_VREG_WORD rIBASE rINST 1       # v[AA+1]<- rIBASE
    FETCH_INST_OPCODE 1 %ecx
    UNSPILL(rIBASE)
    SET_VREG_WORD %eax rINST 0         # v[AA+0]<- eax
    ADVANCE_PC 1
    GOTO_NEXT_R %ecx