int test__cmpdi2(di_int a, di_int b, si_int expected) { si_int x = __cmpdi2(a, b); if (x != expected) printf("error in __cmpdi2(0x%llX, 0x%llX) = %d, expected %d\n", a, b, x, expected); return x != expected; }
main (int argc, const char *argv[]) { quad q, p; #if (0) /*******************************************************/ printf ("%d\n", __cmpdi2 ((quad)4, (quad)5)); printf ("%d\n", __cmpdi2 ((quad)5, (quad)5)); printf ("%d\n", __cmpdi2 ((quad)6, (quad)5)); printf ("%d\n", __cmpdi2 ((quad)-4, (quad)-5)); printf ("%d\n", __cmpdi2 ((quad)-5, (quad)-5)); printf ("%d\n", __cmpdi2 ((quad)-6, (quad)-5)); printf ("\n"); #endif /*******************************************************/ p = 5ll; q = 4ll; printf ("5 :: 4 => "); if (p > q) printf ("É maior\n"); elif (p < q) printf ("É menor\n"); else
/* Returns: if (a < b) returns -1 * if (a == b) returns 0 * if (a > b) returns 1 */ COMPILER_RT_ABI si_int __aeabi_lcmp(di_int a, di_int b) { return __cmpdi2(a, b) - 1; }
int _COM_CMPNE64 (long long a, long long b) { return __cmpdi2 (a, b) != 1; }
int _COM_CMPEQ64 (long long a, long long b) { return __cmpdi2 (a, b) == 1; }
int _COM_CMPGE64s (long long a, long long b) { return __cmpdi2 (a, b) != 0; }
int _COM_CMPLE64s (long long a, long long b) { return __cmpdi2 (a, b) != 2; }
int _COM_CMPGT64s (long long a, long long b) { return __cmpdi2 (a, b) == 2; }
int _COM_CMPLT64s (long long a, long long b) { return __cmpdi2 (a, b) == 0; }
int32_t __cmpdi2_internal (int64_t u, int64_t v) { return __cmpdi2 (u, v); }