License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[sfrench/cifs-2.6.git] / arch / metag / lib / cmpdi2.S
1 ! SPDX-License-Identifier: GPL-2.0
2 ! Copyright (C) 2012 by Imagination Technologies Ltd.
3 !
4 ! 64-bit signed compare routine.
5 !
6
7         .text
8         .global ___cmpdi2
9         .type   ___cmpdi2,function
10
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
17
18         ! high words differ?
19         CMP     D1Ar1,D1Ar3
20         BNE     $Lhigh_differ
21
22         ! unsigned compare low words
23         CMP     D0Ar2,D0Ar4
24         SUBLO   D0Re0,D0Re0,#1
25         ADDHI   D0Re0,D0Re0,#1
26         MOV     PC,D1RtP
27
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