Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / metag / lib / cmpdi2.S
blobab70bd94fd81e06e27a3ffad667d7848b6a40923
1 ! SPDX-License-Identifier: GPL-2.0
2 ! Copyright (C) 2012 by Imagination Technologies Ltd.
4 ! 64-bit signed compare routine.
7         .text
8         .global ___cmpdi2
9         .type   ___cmpdi2,function
11 !         low    high
12 ! s64 a  (D0Ar2, D1Ar1)
13 ! s64 b  (D0Ar4, D1Ar3)
14 ___cmpdi2:
15         ! start at 1 (equal) and conditionally increment or decrement
16         MOV     D0Re0,#1
18         ! high words differ?
19         CMP     D1Ar1,D1Ar3
20         BNE     $Lhigh_differ
22         ! unsigned compare low words
23         CMP     D0Ar2,D0Ar4
24         SUBLO   D0Re0,D0Re0,#1
25         ADDHI   D0Re0,D0Re0,#1
26         MOV     PC,D1RtP
28 $Lhigh_differ:
29         ! signed compare high words
30         SUBLT   D0Re0,D0Re0,#1
31         ADDGT   D0Re0,D0Re0,#1
32         MOV     PC,D1RtP
33         .size ___cmpdi2,.-___cmpdi2