1 //===-- ucmpdi2.c - Implement __ucmpdi2 -----------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file implements __ucmpdi2 for the compiler_rt library.
11 //===----------------------------------------------------------------------===//
15 // Returns: if (a < b) returns 0
16 // if (a == b) returns 1
17 // if (a > b) returns 2
19 COMPILER_RT_ABI si_int
__ucmpdi2(du_int a
, du_int b
) {
24 if (x
.s
.high
< y
.s
.high
)
26 if (x
.s
.high
> y
.s
.high
)
28 if (x
.s
.low
< y
.s
.low
)
30 if (x
.s
.low
> y
.s
.low
)
36 // Returns: if (a < b) returns -1
37 // if (a == b) returns 0
38 // if (a > b) returns 1
39 COMPILER_RT_ABI si_int
__aeabi_ulcmp(di_int a
, di_int b
) {
40 return __ucmpdi2(a
, b
) - 1;