More X86 fixes.
Fix bugs in a few long entrypoints and with object validation being
enabled.
Change-Id: I18884fbbe6829b584b9fc92e338549577f925f14
diff --git a/src/oat/runtime/x86/runtime_support_x86.S b/src/oat/runtime/x86/runtime_support_x86.S
index 0797da6..4f3d334 100644
--- a/src/oat/runtime/x86/runtime_support_x86.S
+++ b/src/oat/runtime/x86/runtime_support_x86.S
@@ -414,7 +414,7 @@
ret
DEFINE_FUNCTION art_ldiv_from_code
- addl LITERAL(12), %esp // alignment padding
+ subl LITERAL(12), %esp // alignment padding
pushl %ebx // pass arg4
pushl %edx // pass arg3
pushl %ecx // pass arg2
@@ -424,7 +424,7 @@
ret
DEFINE_FUNCTION art_ldivmod_from_code
- addl LITERAL(12), %esp // alignment padding
+ subl LITERAL(12), %esp // alignment padding
pushl %ebx // pass arg4
pushl %edx // pass arg3
pushl %ecx // pass arg2
@@ -433,6 +433,42 @@
addl LITERAL(28), %esp // pop arguments
ret
+DEFINE_FUNCTION art_lshl_from_code
+ // eax:ecx << edx
+ xchg %edx, %ecx
+ shld %cl,%eax,%edx
+ shl %cl,%eax
+ test LITERAL(32), %cl
+ jz 1f
+ mov %eax, %edx
+ xor %eax, %eax
+1:
+ ret
+
+DEFINE_FUNCTION art_lshr_from_code
+ // eax:ecx >> edx
+ xchg %edx, %ecx
+ shrd %cl,%eax,%edx
+ sar %cl,%eax
+ test LITERAL(32),%cl
+ jz 1f
+ mov %edx, %eax
+ sar LITERAL(31), %edx
+1:
+ ret
+
+DEFINE_FUNCTION art_lushr_from_code
+ // eax:ecx >>> edx
+ xchg %edx, %ecx
+ shrd %cl,%eax,%edx
+ shr %cl,%eax
+ test $0x20,%cl
+ jz 1f
+ mov %edx, %eax
+ xor %edx, %edx
+1:
+ ret
+
DEFINE_FUNCTION art_can_put_array_element_from_code
test %eax, %eax // Null is trivially storable
jz 1f