diff options
Diffstat (limited to 'vm/compiler/template/armv5te/TEMPLATE_SHR_LONG.S')
-rw-r--r-- | vm/compiler/template/armv5te/TEMPLATE_SHR_LONG.S | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vm/compiler/template/armv5te/TEMPLATE_SHR_LONG.S b/vm/compiler/template/armv5te/TEMPLATE_SHR_LONG.S new file mode 100644 index 0000000..c737840 --- /dev/null +++ b/vm/compiler/template/armv5te/TEMPLATE_SHR_LONG.S @@ -0,0 +1,15 @@ + /* + * Long integer shift. This is different from the generic 32/64-bit + * binary operations because vAA/vBB are 64-bit but vCC (the shift + * distance) is 32-bit. Also, Dalvik requires us to ignore all but the low + * 6 bits. + */ + /* shr-long vAA, vBB, vCC */ + and r2, r2, #63 @ r0<- r0 & 0x3f + mov r0, r0, lsr r2 @ r0<- r2 >> r2 + rsb r3, r2, #32 @ r3<- 32 - r2 + orr r0, r0, r1, asl r3 @ r0<- r0 | (r1 << (32-r2)) + subs ip, r2, #32 @ ip<- r2 - 32 + movpl r0, r1, asr ip @ if r2 >= 32, r0<-r1 >> (r2-32) + mov r1, r1, asr r2 @ r1<- r1 >> r2 + bx lr |