diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2015-09-16 01:49:49 +0300 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2015-10-08 20:31:24 +0200 |
commit | e78a0f58f23347c822c182d1c01f6eb9b9866d60 (patch) | |
tree | 723cfbcd2411d889fb4956adb7f2d11a6d766050 /libc/string/xtensa/strcmp.S | |
parent | 9fae2ad9937279c9f7f40975ac14cb7b57f4a36d (diff) |
xtensa: support call0 ABI
Most changes are mechanical replacement of 'retw' instruction with
'abi_ret' macro, defined to 'retw' or 'ret' according to ABI.
Assembly code that makes calls is duplicated for call0 ABI with changed
register numbers for parameters/return value and call instruction.
'entry' instructions are replaced with 'abi_entry' macro.
More interesting changes:
- non-leaf assembly functions (e.g. _dl_tlsdesc_dynamic,
_dl_linux_resolve, SYSCALL_ERROR_HANDLER, PSEUDO) now need to preserve
registers around intermediate calls they make, use temporary stack
frame for that;
- setjmp/longjmp only need to save and restore return address, stack
pointer and callee-saved registers in the jmpbuf;
- __clone and syscall functions had hardcoded offsets to parameter
passed on stack, on call0 ABI they don't need stack frame, so the
offset is different. Replace these offsets with FRAMESIZE macro.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'libc/string/xtensa/strcmp.S')
-rw-r--r-- | libc/string/xtensa/strcmp.S | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libc/string/xtensa/strcmp.S b/libc/string/xtensa/strcmp.S index 8ed1ed009..2dce590db 100644 --- a/libc/string/xtensa/strcmp.S +++ b/libc/string/xtensa/strcmp.S @@ -108,7 +108,7 @@ ENTRY (strcmp) #endif .Lretdiff: sub a2, a8, a9 - retw + abi_ret /* s1 is word-aligned; s2 is word-aligned. @@ -229,7 +229,7 @@ ENTRY (strcmp) /* Words are equal; some byte is zero. */ .Leq: movi a2, 0 /* return equal */ - retw + abi_ret .Lwne2: /* Words are not equal. On big-endian processors, if none of the bytes are zero, the return value can be determined by a simple @@ -239,10 +239,10 @@ ENTRY (strcmp) bnall a10, a7, .Lsomezero bgeu a8, a9, .Lposreturn movi a2, -1 - retw + abi_ret .Lposreturn: movi a2, 1 - retw + abi_ret .Lsomezero: /* There is probably some zero byte. */ #endif /* __XTENSA_EB__ */ .Lwne: /* Words are not equal. */ @@ -263,14 +263,14 @@ ENTRY (strcmp) byte. Just subtract words to get the return value. The high order equal bytes cancel, leaving room for the sign. */ sub a2, a8, a9 - retw + abi_ret .Ldiff0: /* Need to make room for the sign, so can't subtract whole words. */ extui a10, a8, 24, 8 extui a11, a9, 24, 8 sub a2, a10, a11 - retw + abi_ret #else /* !__XTENSA_EB__ */ /* Little-endian is a little more difficult because can't subtract @@ -281,28 +281,28 @@ ENTRY (strcmp) extui a10, a8, 24, 8 extui a11, a9, 24, 8 sub a2, a10, a11 - retw + abi_ret .Ldiff0: /* Byte 0 is different. */ extui a10, a8, 0, 8 extui a11, a9, 0, 8 sub a2, a10, a11 - retw + abi_ret .Ldiff1: /* Byte 0 is equal; byte 1 is different. */ extui a10, a8, 8, 8 extui a11, a9, 8, 8 sub a2, a10, a11 - retw + abi_ret .Ldiff2: /* Bytes 0-1 are equal; byte 2 is different. */ extui a10, a8, 16, 8 extui a11, a9, 16, 8 sub a2, a10, a11 - retw + abi_ret #endif /* !__XTENSA_EB */ |