Cygwin: access: Fix X_OK behaviour for backup operators and admins
[newlib-cygwin.git] / newlib / libc / machine / rx / strcmp.S
blob6a06e6c9d5e295c0cc65d4095c448dbefb01b14a
1         .file   "strcmp.S"
3         .section .text
4         
5         .global  _strcmp
6         .type    _strcmp,@function
7 _strcmp:
8 #ifdef __RX_DISALLOW_STRING_INSNS__
9 2:      mov.b   [r1+], r4
10         mov.b   [r2+], r5
11         cmp     #0, r4
12         beq     3f
13         cmp     #0, r5
14         beq     3f
15         cmp     r4, r5
16         beq     2b
18 3:      and     #0xff, r4       ; We need to perform an unsigned comparison of the bytes.
19         and     #0xff, r5
20         sub     r5, r4, r1
21         rts
22 #else
23         mov     #-1, r3         ; Strictly speaking this is incorrect, but I doubt if anyone will ever know.
24         scmpu                   ; Perform the string comparison
25         bnc     1f              ; If Carry is not set skip over
26         scne.L  r1              ; Set result based on Z flag
27         rts                     ;
28 1:                              ;
29         mov     #-1,r1          ; Carry not set, result should be negative
30         rts                     ;
31 #endif
32         .size _strcmp, . - _strcmp
33