/* __ucmpdi2.S: 64-bit unsigned compare1*2* Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.3* Written by David Howells ([email protected])4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public License7* as published by the Free Software Foundation; either version8* 2 of the License, or (at your option) any later version.9*/101112.text13.p2align 41415###############################################################################16#17# int __ucmpdi2(unsigned long long a [D0:D1],18# unsigned long long b [(SP,12),(SP,16)])19#20# - returns 0, 1, or 2 as a <, =, > b respectively.21#22###############################################################################23.globl __ucmpdi224.type __ucmpdi2,@function25__ucmpdi2:26mov (12,sp),a0 # b.lsw27mov (16,sp),a1 # b.msw2829sub a0,d030subc a1,d1 # may clear Z, never sets it31bne __ucmpdi2_differ # a.msw != b.msw32mov +1,d033rets3435__ucmpdi2_differ:36# C flag is set if LE, clear if GE37subc d0,d0 # -1 if LE, 0 if GE38add +1,d0 # 0 if LE, 1 if GE39add d0,d0 # 0 if LE, 2 if GE40rets4142.size __ucmpdi2, .-__ucmpdi2434445