blob: 68aa0ee83712371f39c8c1fe302f85b23b71ab38 [file] [log] [blame]
Bill Buzbee7c58bd42016-01-20 20:46:01 +00001/*
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 mask off the low
5 * 6 bits of the shift distance. x86 shifts automatically mask off
6 * the low 5 bits of %cl, so have to handle the 64 > shiftcount > 31
7 * case specially.
8 */
9 /* shr-long vAA, vBB, vCC */
10 /* ecx gets shift count */
11 /* Need to spill rIBASE */
12 /* rINSTw gets AA */
13 movzbl 2(rPC), %eax # eax <- BB
14 movzbl 3(rPC), %ecx # ecx <- CC
15 movl rIBASE, LOCAL0(%esp)
Serguei Katkov05dfaaa2016-01-28 08:21:26 +060016 GET_VREG_HIGH rIBASE, %eax # rIBASE<- v[BB+1]
17 GET_VREG %ecx, %ecx # ecx <- vCC
18 GET_VREG %eax, %eax # eax <- v[BB+0]
Bill Buzbee7c58bd42016-01-20 20:46:01 +000019 shrdl rIBASE, %eax
20 sarl %cl, rIBASE
21 testb $$32, %cl
22 je 2f
23 movl rIBASE, %eax
24 sarl $$31, rIBASE
252:
Serguei Katkov05dfaaa2016-01-28 08:21:26 +060026 SET_VREG_HIGH rIBASE, rINST # v[AA+1] <- rIBASE
Bill Buzbee7c58bd42016-01-20 20:46:01 +000027 movl LOCAL0(%esp), rIBASE
Serguei Katkov05dfaaa2016-01-28 08:21:26 +060028 SET_VREG %eax, rINST # v[AA+0] <- eax
Bill Buzbee7c58bd42016-01-20 20:46:01 +000029 ADVANCE_PC_FETCH_AND_GOTO_NEXT 2