1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
/*
Copyright (c) 2009 Nick Clifton <nickc@redhat.com>
*/
#include <picolibc.h>
#ifdef __RX_ALLOW_STRING_INSNS__
.file "strcmp.S"
.section .text.strcmp
.global _strcmp
.type _strcmp,@function
_strcmp:
mov #-1, r3 ; Strictly speaking this is incorrect, but I doubt if anyone will ever know.
scmpu ; Perform the string comparison
bnc 1f ; If Carry is not set skip over
scne.L r1 ; Set result based on Z flag
rts ;
1: ;
mov #-1,r1 ; Carry not set, result should be negative
rts ;
.size _strcmp, . - _strcmp
#endif
|