powerpc/spufs: Fix coredump of SPU contexts
[linux/fpc-iii.git] / arch / metag / lib / cmpdi2.S
blob9c5c663c5aea2433d6eb1f9182e65f40abefc565
1 ! Copyright (C) 2012 by Imagination Technologies Ltd.
3 ! 64-bit signed compare routine.
6         .text
7         .global ___cmpdi2
8         .type   ___cmpdi2,function
10 !         low    high
11 ! s64 a  (D0Ar2, D1Ar1)
12 ! s64 b  (D0Ar4, D1Ar3)
13 ___cmpdi2:
14         ! start at 1 (equal) and conditionally increment or decrement
15         MOV     D0Re0,#1
17         ! high words differ?
18         CMP     D1Ar1,D1Ar3
19         BNE     $Lhigh_differ
21         ! unsigned compare low words
22         CMP     D0Ar2,D0Ar4
23         SUBLO   D0Re0,D0Re0,#1
24         ADDHI   D0Re0,D0Re0,#1
25         MOV     PC,D1RtP
27 $Lhigh_differ:
28         ! signed compare high words
29         SUBLT   D0Re0,D0Re0,#1
30         ADDGT   D0Re0,D0Re0,#1
31         MOV     PC,D1RtP
32         .size ___cmpdi2,.-___cmpdi2