69 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
70 return __builtin_add_overflow(
a,
b, result);
87 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
88 return __builtin_sub_overflow(
a,
b, result);
105 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
106 return __builtin_mul_overflow(
a,
b, result);
137 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
138 return __builtin_add_overflow(
a,
b, result);
140 int64
res = (int64)
a + (int64)
b;
155 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
156 return __builtin_sub_overflow(
a,
b, result);
158 int64
res = (int64)
a - (int64)
b;
173 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
174 return __builtin_mul_overflow(
a,
b, result);
176 int64
res = (int64)
a * (int64)
b;
205 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
206 return __builtin_add_overflow(
a,
b, result);
207 #elif defined(HAVE_INT128)
208 int128
res = (int128)
a + (int128)
b;
215 *result = (int64)
res;
232 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
233 return __builtin_sub_overflow(
a,
b, result);
234 #elif defined(HAVE_INT128)
235 int128
res = (int128)
a - (int128)
b;
242 *result = (int64)
res;
263 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
264 return __builtin_mul_overflow(
a,
b, result);
265 #elif defined(HAVE_INT128)
266 int128
res = (int128)
a * (int128)
b;
273 *result = (int64)
res;
289 a != 0 &&
a != 1 &&
b != 0 &&
b != 1 &&
322 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
323 return __builtin_add_overflow(
a,
b, result);
340 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
341 return __builtin_sub_overflow(
a,
b, result);
356 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
357 return __builtin_mul_overflow(
a,
b, result);
374 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
375 return __builtin_sub_overflow(0,
a, result);
395 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
396 return __builtin_add_overflow(
a,
b, result);
413 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
414 return __builtin_sub_overflow(
a,
b, result);
429 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
430 return __builtin_mul_overflow(
a,
b, result);
432 uint64
res = (uint64)
a * (uint64)
b;
447 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
448 return __builtin_sub_overflow(0,
a, result);
450 int64
res = -((int64)
a);
468 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
469 return __builtin_add_overflow(
a,
b, result);
486 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
487 return __builtin_sub_overflow(
a,
b, result);
502 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
503 return __builtin_mul_overflow(
a,
b, result);
504 #elif defined(HAVE_INT128)
505 uint128
res = (uint128)
a * (uint128)
b;
512 *result = (uint64)
res;
517 if (
a != 0 &&
b !=
res /
a)
530 #if defined(HAVE__BUILTIN_OP_OVERFLOW)
531 return __builtin_sub_overflow(0,
a, result);
532 #elif defined(HAVE_INT128)
533 int128
res = -((int128)
a);
551 *result = -((int64)
a);
600 return (
a >
b) - (
a <
b);
606 return (
a >
b) - (
a <
b);
612 return (
a >
b) - (
a <
b);
618 return (
a >
b) - (
a <
b);
624 return (
a >
b) - (
a <
b);
static void PGresult * res
static bool pg_mul_s64_overflow(int64 a, int64 b, int64 *result)
static int pg_cmp_s16(int16 a, int16 b)
static uint64 pg_abs_s64(int64 a)
static bool pg_sub_u32_overflow(uint32 a, uint32 b, uint32 *result)
static int pg_cmp_u32(uint32 a, uint32 b)
static bool pg_add_u32_overflow(uint32 a, uint32 b, uint32 *result)
static bool pg_sub_s64_overflow(int64 a, int64 b, int64 *result)
static bool pg_add_u64_overflow(uint64 a, uint64 b, uint64 *result)
static int pg_cmp_u16(uint16 a, uint16 b)
static bool pg_neg_u32_overflow(uint32 a, int32 *result)
static bool pg_sub_s16_overflow(int16 a, int16 b, int16 *result)
static bool pg_neg_u16_overflow(uint16 a, int16 *result)
static bool pg_mul_s32_overflow(int32 a, int32 b, int32 *result)
static bool pg_mul_u16_overflow(uint16 a, uint16 b, uint16 *result)
static bool pg_mul_u32_overflow(uint32 a, uint32 b, uint32 *result)
static bool pg_mul_s16_overflow(int16 a, int16 b, int16 *result)
static int pg_cmp_s64(int64 a, int64 b)
static bool pg_mul_u64_overflow(uint64 a, uint64 b, uint64 *result)
static bool pg_sub_u16_overflow(uint16 a, uint16 b, uint16 *result)
static bool pg_add_u16_overflow(uint16 a, uint16 b, uint16 *result)
static bool pg_add_s16_overflow(int16 a, int16 b, int16 *result)
static uint32 pg_abs_s32(int32 a)
static int pg_cmp_s32(int32 a, int32 b)
static int pg_cmp_u64(uint64 a, uint64 b)
static int pg_cmp_size(size_t a, size_t b)
static uint16 pg_abs_s16(int16 a)
static bool pg_sub_s32_overflow(int32 a, int32 b, int32 *result)
static bool pg_neg_u64_overflow(uint64 a, int64 *result)
static bool pg_add_s64_overflow(int64 a, int64 b, int64 *result)
static bool pg_sub_u64_overflow(uint64 a, uint64 b, uint64 *result)
static bool pg_add_s32_overflow(int32 a, int32 b, int32 *result)