blob: 46c2dd39b3c9bbd55d717f33a10a2364f6c2972c [file] [log] [blame]
buzbee54330722011-08-23 16:46:55 -07001#if defined(__arm__)
2
3 .balign 4
4 .global art_shl_long
5art_shl_long:
6 /*
7 * Long integer shift. This is different from the generic 32/64-bit
8 * binary operations because vAA/vBB are 64-bit but vCC (the shift
9 * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low
10 * 6 bits.
11 * On entry:
12 * r0: low word
13 * r1: high word
14 * r2: shift count
15 */
16 /* shl-long vAA, vBB, vCC */
17 and r2, r2, #63 @ r2<- r2 & 0x3f
18 mov r1, r1, asl r2 @ r1<- r1 << r2
19 rsb r3, r2, #32 @ r3<- 32 - r2
20 orr r1, r1, r0, lsr r3 @ r1<- r1 | (r0 << (32-r2))
21 subs ip, r2, #32 @ ip<- r2 - 32
22 movpl r1, r0, asl ip @ if r2 >= 32, r1<- r0 << (r2-32)
23 mov r0, r0, asl r2 @ r0<- r0 << r2
24 bx lr
25
26 .balign 4
27 .global art_shr_long
28art_shr_long:
29 /*
30 * Long integer shift. This is different from the generic 32/64-bit
31 * binary operations because vAA/vBB are 64-bit but vCC (the shift
32 * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low
33 * 6 bits.
34 * On entry:
35 * r0: low word
36 * r1: high word
37 * r2: shift count
38 */
39 /* shr-long vAA, vBB, vCC */
40 and r2, r2, #63 @ r0<- r0 & 0x3f
41 mov r0, r0, lsr r2 @ r0<- r2 >> r2
42 rsb r3, r2, #32 @ r3<- 32 - r2
43 orr r0, r0, r1, asl r3 @ r0<- r0 | (r1 << (32-r2))
44 subs ip, r2, #32 @ ip<- r2 - 32
45 movpl r0, r1, asr ip @ if r2 >= 32, r0<-r1 >> (r2-32)
46 mov r1, r1, asr r2 @ r1<- r1 >> r2
47 bx lr
48
49 .balign 4
50 .global art_ushr_long
51art_ushr_long:
52 /*
53 * Long integer shift. This is different from the generic 32/64-bit
54 * binary operations because vAA/vBB are 64-bit but vCC (the shift
55 * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low
56 * 6 bits.
57 * On entry:
58 * r0: low word
59 * r1: high word
60 * r2: shift count
61 */
62 /* ushr-long vAA, vBB, vCC */
63 and r2, r2, #63 @ r0<- r0 & 0x3f
64 mov r0, r0, lsr r2 @ r0<- r2 >> r2
65 rsb r3, r2, #32 @ r3<- 32 - r2
66 orr r0, r0, r1, asl r3 @ r0<- r0 | (r1 << (32-r2))
67 subs ip, r2, #32 @ ip<- r2 - 32
68 movpl r0, r1, lsr ip @ if r2 >= 32, r0<-r1 >>> (r2-32)
69 mov r1, r1, lsr r2 @ r1<- r1 >>> r2
70 bx lr
71
72#endif