TEMPLATE_USHR_LONG.S revision a8b91c52fd8a90b784835dfe1f8898035266c4dd
1    /*
2     * Long integer shift.  This is different from the generic 32/64-bit
3     * binary operations because vAA/vBB are 64-bit but vCC (the shift
4     * distance) is 32-bit.  Also, Dalvik requires us to ignore all but the low
5     * 6 bits.
6     */
7    /* ushr-long vAA:vBB(rARG1:rARG0), vCC(a2) - result in (rRESULT1:rRESULT0) */
8    srl     rRESULT1, rARG1, a2		#  rhi<- ahi >> (shift&31)
9    srl     rRESULT0, rARG0, a2		#  rlo<- alo >> (shift&31)
10    not     rARG0, a2			#  alo<- 31-n  (shift is 5b)
11    sll     rARG1, 1
12    sll     rARG1, rARG0		#  ahi<- ahi << (32-(shift&31))
13    or      rRESULT0, rARG1		#  rlo<- rlo | ahi
14    andi    a2, 0x20			#  shift & 0x20
15    movn    rRESULT0, rRESULT1, a2	#  rlo<- rhi (if shift&0x20)
16    movn    rRESULT1, zero, a2		#  rhi<- 0 (if shift&0x20)
17    RETURN
18