Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / metag / lib / cmpdi2.S
CommitLineData
086e9dc0
JH
1! Copyright (C) 2012 by Imagination Technologies Ltd.
2!
3! 64-bit signed compare routine.
4!
5
6 .text
7 .global ___cmpdi2
8 .type ___cmpdi2,function
9
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
16
17 ! high words differ?
18 CMP D1Ar1,D1Ar3
19 BNE $Lhigh_differ
20
21 ! unsigned compare low words
22 CMP D0Ar2,D0Ar4
23 SUBLO D0Re0,D0Re0,#1
24 ADDHI D0Re0,D0Re0,#1
25 MOV PC,D1RtP
26
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