Permalink
Browse files

Unify definitions of INT64 and UINT64 across platforms

  • Loading branch information...
gklimowicz committed Dec 14, 2018
1 parent 92e26fa commit 08ed3b3feb4739024436fd03f91bc89567f8f0cf
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -69,28 +69,28 @@ void fperror(int errcode);
void xdtomd(IEEE64 d, double *md);
void xmdtod(double md, IEEE64 d);

int cmp64(INT64 arg1, INT64 arg2);
int ucmp64(UINT64 arg1, UINT64 arg2);
void add64(INT64 arg1, INT64 arg2, INT64 result);
void div64(INT64 arg1, INT64 arg2, INT64 result);
void exp64(INT64 base, int exp, INT64 result);
void mul64(INT64 arg1, INT64 arg2, INT64 result);
void mul64_10(INT64 arg1, INT64 result);
void neg64(INT64 arg, INT64 result);
void shf64(INT64 arg, int count, INT64 result);
void sub64(INT64 arg1, INT64 arg2, INT64 result);
void uadd64(UINT64 arg1, UINT64 arg2, UINT64 result);
void uneg64(UINT64 arg, UINT64 result);
void ushf64(UINT64 arg, int count, UINT64 result);
void usub64(UINT64 arg1, UINT64 arg2, UINT64 result);
void udiv64(UINT64 arg1, UINT64 arg2, UINT64 result);
void umul64(UINT64 arg1, UINT64 arg2, UINT64 result);
void umul64_10(UINT64 arg1, UINT64 result);
void and64(INT64 arg1, INT64 arg2, INT64 result);
void not64(INT64 arg, INT64 result);
void or64(INT64 arg1, INT64 arg2, INT64 result);
void xor64(INT64 arg1, INT64 arg2, INT64 result);
void mul128(INT64 arg1, INT64 arg2, INT result[4]);
int cmp64(DBLINT64 arg1, DBLINT64 arg2);
int ucmp64(DBLUINT64 arg1, DBLUINT64 arg2);
void add64(DBLINT64 arg1, DBLINT64 arg2, DBLINT64 result);
void div64(DBLINT64 arg1, DBLINT64 arg2, DBLINT64 result);
void exp64(DBLINT64 base, int exp, DBLINT64 result);
void mul64(DBLINT64 arg1, DBLINT64 arg2, DBLINT64 result);
void mul64_10(DBLINT64 arg1, DBLINT64 result);
void neg64(DBLINT64 arg, DBLINT64 result);
void shf64(DBLINT64 arg, int count, DBLINT64 result);
void sub64(DBLINT64 arg1, DBLINT64 arg2, DBLINT64 result);
void uadd64(DBLUINT64 arg1, DBLUINT64 arg2, DBLUINT64 result);
void uneg64(DBLUINT64 arg, DBLUINT64 result);
void ushf64(DBLUINT64 arg, int count, DBLUINT64 result);
void usub64(DBLUINT64 arg1, DBLUINT64 arg2, DBLUINT64 result);
void udiv64(DBLUINT64 arg1, DBLUINT64 arg2, DBLUINT64 result);
void umul64(DBLUINT64 arg1, DBLUINT64 arg2, DBLUINT64 result);
void umul64_10(DBLUINT64 arg1, DBLUINT64 result);
void and64(DBLINT64 arg1, DBLINT64 arg2, DBLINT64 result);
void not64(DBLINT64 arg, DBLINT64 result);
void or64(DBLINT64 arg1, DBLINT64 arg2, DBLINT64 result);
void xor64(DBLINT64 arg1, DBLINT64 arg2, DBLINT64 result);
void mul128(DBLINT64 arg1, DBLINT64 arg2, INT result[4]);
void shf128(INT arg[4], int count, INT result[4]);
void shf128_1(INT arg[4], INT result[4]);
void shf128_m1(INT arg[4], INT result[4]);
@@ -121,32 +121,32 @@ int hxatoxe(const char *s, IEEE80 e, int n);
int hxatoxdd(const char *s, IEEE6464 dd, int n);
int hxatoxq(const char *s, IEEE128 q, int n);
void cprintf(char *s, const char *format, INT *val);
int atoxi64(const char *s, INT64 ir, int n, int radix);
int atosi64(const char *, INT64, int, int);
void ui64toax(INT64 from, char *to, int count, int sign, int radix);
int atoxi64(const char *s, DBLINT64 ir, int n, int radix);
int atosi64(const char *, DBLINT64, int, int);
void ui64toax(DBLINT64 from, char *to, int count, int sign, int radix);

void xqfix64(IEEE128 q, INT64 i);
void xqfixu64(IEEE128 q, UINT64 i);
void xefix64(IEEE80 e, INT64 i);
void xefixu64(IEEE80 e, UINT64 i);
void xddfix64(IEEE6464 dd, INT64 i);
void xddfixu64(IEEE6464 dd, UINT64 i);
void xdfix64(IEEE64 d, INT64 i);
void xdfixu64(IEEE64 d, UINT64 i);
void xfix64(IEEE32 f, INT64 i);
void xfixu64(IEEE32 f, UINT64 i);
void xqfix64(IEEE128 q, DBLINT64 i);
void xqfixu64(IEEE128 q, DBLUINT64 i);
void xefix64(IEEE80 e, DBLINT64 i);
void xefixu64(IEEE80 e, DBLUINT64 i);
void xddfix64(IEEE6464 dd, DBLINT64 i);
void xddfixu64(IEEE6464 dd, DBLUINT64 i);
void xdfix64(IEEE64 d, DBLINT64 i);
void xdfixu64(IEEE64 d, DBLUINT64 i);
void xfix64(IEEE32 f, DBLINT64 i);
void xfixu64(IEEE32 f, DBLUINT64 i);
void xfixu(IEEE32 f, UINT *r);

void xqflt64(INT64 i, IEEE128 q);
void xqfltu64(UINT64 i, IEEE128 q);
void xeflt64(INT64 i, IEEE80 e);
void xefltu64(UINT64 i, IEEE80 e);
void xddflt64(INT64 i, IEEE6464 dd);
void xddfltu64(UINT64 i, IEEE6464 dd);
void xdflt64(INT64 i, IEEE64 d);
void xdfltu64(UINT64 i, IEEE64 d);
void xflt64(INT64 i, IEEE32 *f);
void xfltu64(UINT64 i, IEEE32 *f);
void xqflt64(DBLINT64 i, IEEE128 q);
void xqfltu64(DBLUINT64 i, IEEE128 q);
void xeflt64(DBLINT64 i, IEEE80 e);
void xefltu64(DBLUINT64 i, IEEE80 e);
void xddflt64(DBLINT64 i, IEEE6464 dd);
void xddfltu64(DBLUINT64 i, IEEE6464 dd);
void xdflt64(DBLINT64 i, IEEE64 d);
void xdfltu64(DBLUINT64 i, IEEE64 d);
void xflt64(DBLINT64 i, IEEE32 *f);
void xfltu64(DBLUINT64 i, IEEE32 *f);

void xfadd(IEEE32 f1, IEEE32 f2, IEEE32 *r);
void xdadd(IEEE64 d1, IEEE64 d2, IEEE64 r);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,15 +45,15 @@ typedef int64_t BIGINT64; /* 64-bit native integer */
typedef uint64_t BIGUINT64; /* 64-bit native unsigned integer */
typedef uint64_t BITMASK64; /* native 64-bit unsigned int */

typedef int32_t INT64[2]; /* signed 64-bit 2's complement integer: [0]
typedef int32_t DBLINT64[2]; /* signed 64-bit 2's complement integer: [0]
* - most significant 32 bits, including sign
* [1] - least significant 32 bits */
typedef uint32_t UINT64[2]; /* unsigned 64-bit integer: [0] - most
typedef uint32_t DBLUINT64[2]; /* unsigned 64-bit integer: [0] - most
* significant 32 bits [1] - least
* significant 32 bits */

void bgitoi64(int64_t x, INT64 res);
int64_t i64tobgi(INT64 x);
void bgitoi64(int64_t x, DBLINT64 res);
int64_t i64tobgi(DBLINT64 x);

#define BIGIPFSZ "l" /* used to define ISZ_PF */

Oops, something went wrong.

0 comments on commit 08ed3b3

Please sign in to comment.