1 //===-- cmpti2.c - Implement __cmpti2 -------------------------------------===//
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 __cmpti2 for the compiler_rt library.
11 //===----------------------------------------------------------------------===//
17 // Returns: if (a < b) returns 0
18 // if (a == b) returns 1
19 // if (a > b) returns 2
21 COMPILER_RT_ABI si_int
__cmpti2(ti_int a
, ti_int b
) {
26 if (x
.s
.high
< y
.s
.high
)
28 if (x
.s
.high
> y
.s
.high
)
30 if (x
.s
.low
< y
.s
.low
)
32 if (x
.s
.low
> y
.s
.low
)
37 #endif // CRT_HAS_128BIT