# HG changeset patch # User Jaroslav Hajek # Date 1222884999 -7200 # Node ID 836df84b7997e30a3003debcee9db484239d827d # Parent 1651939a394bff5c65b5c9448d9dc2a9397ff017 implement 64-bit arithmetics diff -r 1651939a394b -r 836df84b7997 ChangeLog --- a/ChangeLog Wed Oct 01 11:34:45 2008 -0400 +++ b/ChangeLog Wed Oct 01 20:16:39 2008 +0200 @@ -0,0 +1,4 @@ +2008-10-01 Jaroslav Hajek + + * configure.in: Check for sizeof (long double) and randl. + diff -r 1651939a394b -r 836df84b7997 configure.in --- a/configure.in Wed Oct 01 11:34:45 2008 -0400 +++ b/configure.in Wed Oct 01 20:16:39 2008 +0200 @@ -1378,6 +1378,10 @@ OCTAVE_FAST_INT_OPS +### Check for long double type (for 64-bit integers) + +AC_CHECK_SIZEOF(long double) + ### Checks for header files. AC_HEADER_STDC @@ -1452,7 +1456,7 @@ getppid getpwent getpwuid gettimeofday getuid getwd _kbhit kill \ lgamma lgammaf lgamma_r lgammaf_r link localtime_r log1p log1pf lstat \ memmove mkdir mkfifo mkstemp on_exit pipe poll putenv raise readlink \ - realpath rename resolvepath rindex rmdir round select setgrent setlocale \ + realpath rename resolvepath rindex rmdir round roundl select setgrent setlocale \ setpwent setvbuf sigaction siglongjmp sigpending sigprocmask sigsuspend \ snprintf stat strcasecmp strdup strerror stricmp strncasecmp \ strnicmp strptime strsignal symlink tempnam tgamma tgammaf trunc umask \ diff -r 1651939a394b -r 836df84b7997 doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in Wed Oct 01 11:34:45 2008 -0400 +++ b/doc/interpreter/contributors.in Wed Oct 01 20:16:39 2008 +0200 @@ -193,7 +193,6 @@ Doug Stewart Jonathan Stickel Thomas Stuart -Ivan Sutoris John Swensen Ariel Tankus Georg Thimm diff -r 1651939a394b -r 836df84b7997 liboctave/ChangeLog --- a/liboctave/ChangeLog Wed Oct 01 11:34:45 2008 -0400 +++ b/liboctave/ChangeLog Wed Oct 01 20:16:39 2008 +0200 @@ -0,0 +1,10 @@ +2008-10-01 Jaroslav Hajek + + * oct-inttypes.h (octave_int::one, octave_int::zero): Declare + constants. + * oct-inttypes.cc: Define them. + * oct-inttypes.h: Define mixed operations via long double if possible. + * oct-inttypes.cc: Define alternative implementations for 64-bit + multiplication and mixed operations. + * mx-ops: Instantiate all 64-bit integer operations. + diff -r 1651939a394b -r 836df84b7997 liboctave/mx-ops --- a/liboctave/mx-ops Wed Oct 01 11:34:45 2008 -0400 +++ b/liboctave/mx-ops Wed Oct 01 20:16:39 2008 +0200 @@ -54,22 +54,22 @@ fm FloatMatrix M fMatrix.h YES static_cast(0.0) fnda FloatNDArray ND fNDArray.h YES static_cast(0.0) fs float S NONE NO static_cast(0.0) -i8 octave_int8 S oct-inttypes.h YES octave_int8(0) int8_t -ui8 octave_uint8 S oct-inttypes.h YES octave_uint8(0) uint8_t -i16 octave_int16 S oct-inttypes.h YES octave_int16(0) int16_t -ui16 octave_uint16 S oct-inttypes.h YES octave_uint16(0) uint16_t -i32 octave_int32 S oct-inttypes.h YES octave_int32(0) int32_t -ui32 octave_uint32 S oct-inttypes.h YES octave_uint32(0) uint32_t -i64 octave_int64 S oct-inttypes.h YES octave_int64(0) int64_t -ui64 octave_uint64 S oct-inttypes.h YES octave_uint64(0) uint64_t -i8nda int8NDArray ND int8NDArray.h YES octave_int8(0) int8_t -ui8nda uint8NDArray ND uint8NDArray.h YES octave_uint8(0) uint8_t -i16nda int16NDArray ND int16NDArray.h YES octave_int16(0) int16_t -ui16nda uint16NDArray ND uint16NDArray.h YES octave_uint16(0) uint16_t -i32nda int32NDArray ND int32NDArray.h YES octave_int32(0) int32_t -ui32nda uint32NDArray ND uint32NDArray.h YES octave_uint32(0) uint32_t -i64nda int64NDArray ND int64NDArray.h YES octave_int64(0) int64_t -ui64nda uint64NDArray ND uint64NDArray.h YES octave_uint64(0) uint64_t +i8 octave_int8 S oct-inttypes.h YES octave_int8::zero int8_t +ui8 octave_uint8 S oct-inttypes.h YES octave_uint8::zero uint8_t +i16 octave_int16 S oct-inttypes.h YES octave_int16::zero int16_t +ui16 octave_uint16 S oct-inttypes.h YES octave_uint16::zero uint16_t +i32 octave_int32 S oct-inttypes.h YES octave_int32::zero int32_t +ui32 octave_uint32 S oct-inttypes.h YES octave_uint32::zero uint32_t +i64 octave_int64 S oct-inttypes.h YES octave_int64::zero int64_t +ui64 octave_uint64 S oct-inttypes.h YES octave_uint64::zero uint64_t +i8nda int8NDArray ND int8NDArray.h YES octave_int8::zero int8_t +ui8nda uint8NDArray ND uint8NDArray.h YES octave_uint8::zero uint8_t +i16nda int16NDArray ND int16NDArray.h YES octave_int16::zero int16_t +ui16nda uint16NDArray ND uint16NDArray.h YES octave_uint16::zero uint16_t +i32nda int32NDArray ND int32NDArray.h YES octave_int32::zero int32_t +ui32nda uint32NDArray ND uint32NDArray.h YES octave_uint32::zero uint32_t +i64nda int64NDArray ND int64NDArray.h YES octave_int64::zero int64_t +ui64nda uint64NDArray ND uint64NDArray.h YES octave_uint64::zero uint64_t # ops # result_t lhs_t rhs_t op-type lhs_conv rhs_conv headers ... # @@ -153,10 +153,10 @@ i32nda i32nda s BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda s ui32nda BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda ui32nda s BCL NONE NONE boolMatrix.h boolNDArray.h -i64nda s i64nda CL NONE NONE boolMatrix.h boolNDArray.h -i64nda i64nda s CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda s ui64nda CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda ui64nda s CL NONE NONE boolMatrix.h boolNDArray.h +i64nda s i64nda BCL NONE NONE boolMatrix.h boolNDArray.h +i64nda i64nda s BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda s ui64nda BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda ui64nda s BCL NONE NONE boolMatrix.h boolNDArray.h i8nda fs i8nda BCL NONE NONE boolMatrix.h boolNDArray.h i8nda i8nda fs BCL NONE NONE boolMatrix.h boolNDArray.h ui8nda fs ui8nda BCL NONE NONE boolMatrix.h boolNDArray.h @@ -169,10 +169,10 @@ i32nda i32nda fs BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda fs ui32nda BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda ui32nda fs BCL NONE NONE boolMatrix.h boolNDArray.h -i64nda fs i64nda CL NONE NONE boolMatrix.h boolNDArray.h -i64nda i64nda fs CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda fs ui64nda CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda ui64nda fs CL NONE NONE boolMatrix.h boolNDArray.h +i64nda fs i64nda BCL NONE NONE boolMatrix.h boolNDArray.h +i64nda i64nda fs BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda fs ui64nda BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda ui64nda fs BCL NONE NONE boolMatrix.h boolNDArray.h # i8nda nda i8 BCL NONE NONE boolMatrix.h boolNDArray.h i8nda i8 nda BCL NONE NONE boolMatrix.h boolNDArray.h @@ -186,10 +186,10 @@ i32nda i32 nda BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda nda ui32 BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda ui32 nda BCL NONE NONE boolMatrix.h boolNDArray.h -i64nda nda i64 CL NONE NONE boolMatrix.h boolNDArray.h -i64nda i64 nda CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda nda ui64 CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda ui64 nda CL NONE NONE boolMatrix.h boolNDArray.h +i64nda nda i64 BCL NONE NONE boolMatrix.h boolNDArray.h +i64nda i64 nda BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda nda ui64 BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda ui64 nda BCL NONE NONE boolMatrix.h boolNDArray.h i8nda fnda i8 BCL NONE NONE boolMatrix.h boolNDArray.h i8nda i8 fnda BCL NONE NONE boolMatrix.h boolNDArray.h ui8nda fnda ui8 BCL NONE NONE boolMatrix.h boolNDArray.h @@ -202,10 +202,10 @@ i32nda i32 fnda BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda fnda ui32 BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda ui32 fnda BCL NONE NONE boolMatrix.h boolNDArray.h -i64nda fnda i64 CL NONE NONE boolMatrix.h boolNDArray.h -i64nda i64 fnda CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda fnda ui64 CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda ui64 fnda CL NONE NONE boolMatrix.h boolNDArray.h +i64nda fnda i64 BCL NONE NONE boolMatrix.h boolNDArray.h +i64nda i64 fnda BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda fnda ui64 BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda ui64 fnda BCL NONE NONE boolMatrix.h boolNDArray.h # i8nda nda i8nda BCL NONE NONE boolMatrix.h boolNDArray.h i8nda i8nda nda BCL NONE NONE boolMatrix.h boolNDArray.h @@ -219,10 +219,10 @@ i32nda i32nda nda BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda nda ui32nda BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda ui32nda nda BCL NONE NONE boolMatrix.h boolNDArray.h -i64nda nda i64nda CL NONE NONE boolMatrix.h boolNDArray.h -i64nda i64nda nda CL NONE NONE boolMatrix.h boolNDArray.h -ui6nda nda ui64nda CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda ui64nda nda CL NONE NONE boolMatrix.h boolNDArray.h +i64nda nda i64nda BCL NONE NONE boolMatrix.h boolNDArray.h +i64nda i64nda nda BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda nda ui64nda BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda ui64nda nda BCL NONE NONE boolMatrix.h boolNDArray.h i8nda fnda i8nda BCL NONE NONE boolMatrix.h boolNDArray.h i8nda i8nda fnda BCL NONE NONE boolMatrix.h boolNDArray.h ui8nda fnda ui8nda BCL NONE NONE boolMatrix.h boolNDArray.h @@ -235,10 +235,10 @@ i32nda i32nda fnda BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda fnda ui32nda BCL NONE NONE boolMatrix.h boolNDArray.h ui32nda ui32nda fnda BCL NONE NONE boolMatrix.h boolNDArray.h -i64nda fnda i64nda CL NONE NONE boolMatrix.h boolNDArray.h -i64nda i64nda fnda CL NONE NONE boolMatrix.h boolNDArray.h -ui6nda fnda ui64nda CL NONE NONE boolMatrix.h boolNDArray.h -ui64nda ui64nda fnda CL NONE NONE boolMatrix.h boolNDArray.h +i64nda fnda i64nda BCL NONE NONE boolMatrix.h boolNDArray.h +i64nda i64nda fnda BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda fnda ui64nda BCL NONE NONE boolMatrix.h boolNDArray.h +ui64nda ui64nda fnda BCL NONE NONE boolMatrix.h boolNDArray.h # x i8nda ui8 CL NONE NONE boolMatrix.h boolNDArray.h x i8nda i16 CL NONE NONE boolMatrix.h boolNDArray.h diff -r 1651939a394b -r 836df84b7997 liboctave/oct-inttypes.cc --- a/liboctave/oct-inttypes.cc Wed Oct 01 11:34:45 2008 -0400 +++ b/liboctave/oct-inttypes.cc Wed Oct 01 20:16:39 2008 +0200 @@ -28,6 +28,12 @@ #include "oct-inttypes.h" +template +const octave_int octave_int::zero (static_cast (0)); + +template +const octave_int octave_int::one (static_cast (1)); + // define type names. #define DECLARE_OCTAVE_INT_TYPENAME(TYPE, TYPENAME) \ template <> \ @@ -43,57 +49,238 @@ DECLARE_OCTAVE_INT_TYPENAME (uint32_t, "uint32") DECLARE_OCTAVE_INT_TYPENAME (uint64_t, "uint64") -static void -gripe_64bit_mul() -{ - (*current_liboctave_error_handler) - ("64-bit integer multiplication is not implemented"); +#ifndef OCTAVE_INT_USE_LONG_DOUBLE +// Define handlers for int64 multiplication + +template <> +uint64_t +octave_int_arith_base::mul (uint64_t x, uint64_t y) +{ + // Get upper words + uint64_t ux = x >> 32, uy = y >> 32; + uint64_t res; + if (ux) + { + if (uy) + goto overflow; + else + { + uint64_t ly = static_cast (y), uxly = ux*ly; + if (uxly >> 32) + goto overflow; + uxly <<= 32; // never overflows + uint64_t lx = static_cast (x), lxly = lx*ly; + res = add (uxly, lxly); + } + } + else if (uy) + { + uint64_t lx = static_cast (x), uylx = uy*lx; + if (uylx >> 32) + goto overflow; + uylx <<= 32; // never overflows + uint64_t ly = static_cast (y), lylx = ly*lx; + res = add (uylx, lylx); + } + else + { + uint64_t lx = static_cast (x); + uint64_t ly = static_cast (y); + res = lx*ly; + } + + return res; + +overflow: + ftrunc = true; + return max_val (); } template <> -uint64_t -octave_int_arith_base::mul (uint64_t, uint64_t) +int64_t +octave_int_arith_base::mul (int64_t x, int64_t y) { - gripe_64bit_mul (); - return static_cast (0); -} -template <> -int64_t -octave_int_arith_base::mul (int64_t, int64_t) -{ - gripe_64bit_mul (); - return static_cast (0); + // The signed case is far worse. The problem is that + // even if neither integer fits into signed 32-bit range, the result may + // still be OK. Uh oh. + + // TODO: Can we do something faster if we HAVE_FAST_INT_OPS? + + uint64_t usx = std::abs (x), usy = std::abs (y); + bool positive = x < 0 == y < 0; + + // Get upper words + uint64_t ux = usx >> 32, uy = usy >> 32; + uint64_t res; + if (ux) + { + if (uy) + goto overflow; + else + { + uint64_t ly = static_cast (usy), uxly = ux*ly; + if (uxly >> 32) + goto overflow; + uxly <<= 32; // never overflows + uint64_t lx = static_cast (usx), lxly = lx*ly; + res = uxly + lxly; + if (res < uxly) + goto overflow; + } + } + else if (uy) + { + uint64_t lx = static_cast (usx), uylx = uy*lx; + if (uylx >> 32) + goto overflow; + uylx <<= 32; // never overflows + uint64_t ly = static_cast (usy), lylx = ly*lx; + res = uylx + lylx; + if (res < uylx) + goto overflow; + } + else + { + uint64_t lx = static_cast (x); + uint64_t ly = static_cast (y); + res = lx*ly; + } + + if (positive) + { + if (res > static_cast (max_val ())) + { + ftrunc = true; + return max_val (); + } + else + return static_cast (res); + } + else + { + if (res > static_cast (-min_val ())) + { + ftrunc = true; + return min_val (); + } + else + return -static_cast (res); + } + + +overflow: + ftrunc = true; + return positive ? max_val () : min_val (); + } -static void -gripe_64bit_mixed() +#define INT_DOUBLE_BINOP_DECL(OP,SUFFIX) \ + template <> \ + OCTAVE_API octave_ ## SUFFIX \ + operator OP (const octave_ ## SUFFIX & x, const double& y) + +#define DOUBLE_INT_BINOP_DECL(OP,SUFFIX) \ + template <> \ + OCTAVE_API octave_ ## SUFFIX \ + operator OP (const double& x, const octave_ ## SUFFIX & y) + +INT_DOUBLE_BINOP_DECL (+, uint64) { - (*current_liboctave_error_handler) - ("mixed double - 64-bit integer operations are not implemented"); + return (y < 0) ? x - octave_uint64(-y) : x + octave_uint64(y); } -#define DEFINE_DOUBLE_INT64_OP0(OP,ARGT,RETT) \ +DOUBLE_INT_BINOP_DECL (+, uint64) +{ return y + x; } + +INT_DOUBLE_BINOP_DECL (+, int64) +{ + // XXX: This trick is to not lose precision for things like 3*2**63 + intmin('int64') + if (fabs (y) < static_cast (std::numeric_limits::max ())) + return x + octave_int64 (y); + else + { + octave_int64 y2 (y / 2); // no loss of precision here + return (x + y2) + y2; + } +} + +DOUBLE_INT_BINOP_DECL (+, int64) +{ return y + x; } + +INT_DOUBLE_BINOP_DECL (-, uint64) +{ + return x + (-y); +} + +DOUBLE_INT_BINOP_DECL (-, uint64) +{ + return octave_uint64(x) - y; // FIXME: does not handle all cases. +} + +INT_DOUBLE_BINOP_DECL (-, int64) +{ + return x + (-y); +} + +DOUBLE_INT_BINOP_DECL (-, int64) +{ + return -(y - x); // FIXME: corner cases? +} + +INT_DOUBLE_BINOP_DECL (*, uint64) +{ + // FIXME: This may result in a loss of precision. + return octave_uint64 (static_cast (x.value ()) * y); +} + +DOUBLE_INT_BINOP_DECL (*, uint64) +{ return y * x; } + +INT_DOUBLE_BINOP_DECL (*, int64) +{ + // FIXME: This may result in a loss of precision. + return octave_int64 (static_cast (x.value ()) * y); +} + +DOUBLE_INT_BINOP_DECL (*, int64) +{ return y * x; } + +DOUBLE_INT_BINOP_DECL (/, uint64) +{ + return octave_uint64 (x / static_cast (y.value ())); +} + +DOUBLE_INT_BINOP_DECL (/, int64) +{ + return octave_int64 (x / static_cast (y.value ())); +} + +INT_DOUBLE_BINOP_DECL (/, uint64) +{ + return x * (1.0/y); +} + +INT_DOUBLE_BINOP_DECL (/, int64) +{ + return x * (1.0/y); +} + +// FIXME: The following can yield slightly incorrect values in theory. + +#define DEFINE_DOUBLE_INT64_CMP_OP0(OP,ARGT) \ template <> \ - OCTAVE_API RETT \ - operator OP (const double&, const ARGT&) \ - { gripe_64bit_mixed (); return 0.0; } \ + OCTAVE_API bool \ + operator OP (const double& x, const ARGT& y) \ + { return x OP static_cast (y); } \ template <> \ - OCTAVE_API RETT \ - operator OP (const ARGT&, const double&) \ - { gripe_64bit_mixed (); return 0.0; } \ + OCTAVE_API bool \ + operator OP (const ARGT& x, const double& y) \ + { return static_cast (x) OP y; } -#define DEFINE_DOUBLE_INT64_BIN_OP(OP) \ - DEFINE_DOUBLE_INT64_OP0(OP,octave_int64,octave_int64) \ - DEFINE_DOUBLE_INT64_OP0(OP,octave_uint64,octave_uint64) - -DEFINE_DOUBLE_INT64_BIN_OP(+) -DEFINE_DOUBLE_INT64_BIN_OP(-) -DEFINE_DOUBLE_INT64_BIN_OP(*) -DEFINE_DOUBLE_INT64_BIN_OP(/) #define DEFINE_DOUBLE_INT64_CMP_OP(OP) \ - DEFINE_DOUBLE_INT64_OP0(OP,octave_int64,bool) \ - DEFINE_DOUBLE_INT64_OP0(OP,octave_uint64,bool) + DEFINE_DOUBLE_INT64_CMP_OP0(OP,octave_int64) \ + DEFINE_DOUBLE_INT64_CMP_OP0(OP,octave_uint64) DEFINE_DOUBLE_INT64_CMP_OP(<) DEFINE_DOUBLE_INT64_CMP_OP(<=) @@ -101,6 +288,8 @@ DEFINE_DOUBLE_INT64_CMP_OP(>=) DEFINE_DOUBLE_INT64_CMP_OP(==) DEFINE_DOUBLE_INT64_CMP_OP(!=) + +#endif //template //bool @@ -178,8 +367,6 @@ template OCTAVE_API octave_int pow (const octave_int&, const double&); \ template OCTAVE_API octave_int powf (const float&, const octave_int&); \ template OCTAVE_API octave_int powf (const octave_int&, const float&); \ - template OCTAVE_API std::ostream& operator << (std::ostream&, const octave_int&); \ - template OCTAVE_API std::istream& operator >> (std::istream&, octave_int&); \ template OCTAVE_API octave_int \ bitshift (const octave_int&, int, const octave_int&); \ diff -r 1651939a394b -r 836df84b7997 liboctave/oct-inttypes.h --- a/liboctave/oct-inttypes.h Wed Oct 01 11:34:45 2008 -0400 +++ b/liboctave/oct-inttypes.h Wed Oct 01 20:16:39 2008 +0200 @@ -24,6 +24,7 @@ #if !defined (octave_inttypes_h) #define octave_inttypes_h 1 +#include #include #include @@ -33,6 +34,13 @@ #include "oct-types.h" #include "lo-ieee.h" #include "lo-mappers.h" + +// To be able to use long doubles for 64-bit mixed arithmetics, we need them at least +// 80 bits wide and we need roundl declared in math.h +#if (SIZEOF_LONG_DOUBLE >= 10) && defined (HAVE_ROUNDL) +inline long double xround (long double x) { return roundl (x); } +#define OCTAVE_INT_USE_LONG_DOUBLE +#endif // Query for an integer type of certain sizeof, and signedness. template @@ -220,9 +228,9 @@ // types for integer arithmetics, e.g., 64-bit multiply via long double. template static T - truncate_real (const S& value) + truncate_real (const S& value, bool chk_lb = true) { - if (value < min_val ()) + if (chk_lb && value < min_val ()) { ftrunc = true; return min_val (); @@ -361,10 +369,8 @@ return u; } - // Multiplication is done using promotion to wider type. If there is no - // suitable promotion type, this operation *MUST* be specialized. But note - // that a real type can be used as the promotion type (e.g., long double for - // int64_t). + // Multiplication is done using promotion to wider integer type. If there is + // no suitable promotion type, this operation *MUST* be specialized. static T mul (T x, T y) { @@ -393,10 +399,21 @@ } }; +#ifdef OCTAVE_INT_USE_LONG_DOUBLE +// Handle 64-bit multiply using long double +template <> +inline uint64_t +octave_int_arith_base:: mul (uint64_t x, uint64_t y) +{ + return truncate_real (static_cast (x) + * static_cast (y), false); +} +#else // Special handler for 64-bit integer multiply. template <> OCTAVE_API uint64_t octave_int_arith_base::mul (uint64_t, uint64_t); +#endif // Signed integer arithmetics. // Rationale: If HAVE_FAST_INT_OPS is defined, the following conditions @@ -599,10 +616,8 @@ #endif } - // Multiplication is done using promotion to wider type. If there is no - // suitable promotion type, this operation *MUST* be specialized. But note - // that a real type can be used as the promotion type (e.g., long double for - // int64_t). + // Multiplication is done using promotion to wider integer type. If there is + // no suitable promotion type, this operation *MUST* be specialized. static T mul (T x, T y) { @@ -655,10 +670,21 @@ }; +#ifdef OCTAVE_INT_USE_LONG_DOUBLE +// Handle 64-bit multiply using long double +template <> +inline int64_t +octave_int_arith_base:: mul (int64_t x, int64_t y) +{ + return truncate_real (static_cast (x) + * static_cast (y)); +} +#else // Special handler for 64-bit integer multiply. template <> OCTAVE_API int64_t octave_int_arith_base::mul (int64_t, int64_t); +#endif // This class simply selects the proper arithmetics. template @@ -680,6 +706,10 @@ octave_int (double d) : ival (octave_int_base::convert_real (d)) { } octave_int (float d) : ival (octave_int_base::convert_real (d)) { } + +#ifdef OCTAVE_INT_USE_LONG_DOUBLE + octave_int (long double d) : ival (octave_int_base::convert_real (d)) { } +#endif octave_int (bool b) : ival (b) { } @@ -735,7 +765,7 @@ OCTAVE_INT_UN_OP(abs, abs) OCTAVE_INT_UN_OP(signum, signum) -# undef OCTAVE_INT_UN_OP +#undef OCTAVE_INT_UN_OP // Homogeneous binary integer operations. #define OCTAVE_INT_BIN_OP(OP, NAME, ARGT) \ @@ -756,7 +786,7 @@ OCTAVE_INT_BIN_OP(<<, lshift, int) OCTAVE_INT_BIN_OP(>>, rshift, int) -# undef OCTAVE_INT_BIN_OP +#undef OCTAVE_INT_BIN_OP octave_int min (void) const { return std::numeric_limits::min (); } octave_int max (void) const { return std::numeric_limits::max (); } @@ -767,6 +797,9 @@ static const char *type_name (); + // The following are provided for convenience. + static const octave_int zero, one; + // Unsafe. This function exists to support the MEX interface. // You should not use it anywhere else. void *mex_get_data (void) const { return const_cast (&ival); } @@ -821,7 +854,7 @@ OCTAVE_INT_CMP_OP (==, eq) OCTAVE_INT_CMP_OP (!=, ne) -# undef OCTAVE_INT_CMP_OP +#undef OCTAVE_INT_CMP_OP template inline std::ostream& @@ -853,7 +886,7 @@ OCTAVE_INT_BITCMP_OP (|) OCTAVE_INT_BITCMP_OP (^) -# undef OCTAVE_INT_BITCMP_OP +#undef OCTAVE_INT_BITCMP_OP // General bit shift. template @@ -879,58 +912,113 @@ typedef octave_int octave_uint32; typedef octave_int octave_uint64; -#define OCTAVE_INT_DOUBLE_BIN_OP(OP) \ +#define OCTAVE_INT_DOUBLE_BIN_OP0(OP) \ template \ inline octave_int \ operator OP (const octave_int& x, const double& y) \ { return octave_int (static_cast (x) OP y); } \ + template \ + inline octave_int \ + operator OP (const double& x, const octave_int& y) \ + { return octave_int (x OP static_cast (y)); } \ + +#ifdef OCTAVE_INT_USE_LONG_DOUBLE +// Handle mixed op using long double +#define OCTAVE_INT_DOUBLE_BIN_OP(OP) \ + OCTAVE_INT_DOUBLE_BIN_OP0(OP) \ + template <> \ + inline octave_int64 \ + operator OP (const double& x, const octave_int64& y) \ + { return octave_int64 (x OP static_cast (y.value ())); } \ + template <> \ + inline octave_uint64 \ + operator OP (const double& x, const octave_uint64& y) \ + { return octave_int64 (x OP static_cast (y.value ())); } \ + template <> \ + inline octave_int64 \ + operator OP (const octave_int64& x, const double& y) \ + { return octave_int64 (static_cast (x.value ()) OP y); } \ + template <> \ + inline octave_uint64 \ + operator OP (const octave_uint64& x, const double& y) \ + { return octave_int64 (static_cast (x.value ()) OP y); } + +#else +// external handlers +#define OCTAVE_INT_DOUBLE_BIN_OP(OP) \ + OCTAVE_INT_DOUBLE_BIN_OP0(OP) \ + template <> \ + OCTAVE_API octave_int64 \ + operator OP (const double&, const octave_int64&); \ + template <> \ + OCTAVE_API octave_uint64 \ + operator OP (const double&, const octave_uint64&); \ template <> \ OCTAVE_API octave_int64 \ operator OP (const octave_int64&, const double&); \ template <> \ OCTAVE_API octave_uint64 \ - operator OP (const octave_uint64&, const double&); \ - template \ - inline octave_int \ - operator OP (const double& x, const octave_int& y) \ - { return octave_int (x OP static_cast (y)); } \ - template <> \ - OCTAVE_API octave_int64 \ - operator OP (const double&, const octave_int64&); \ - template <> \ - OCTAVE_API octave_uint64 \ - operator OP (const double&, const octave_uint64&); + operator OP (const octave_uint64&, const double&); +#endif OCTAVE_INT_DOUBLE_BIN_OP (+) OCTAVE_INT_DOUBLE_BIN_OP (-) OCTAVE_INT_DOUBLE_BIN_OP (*) OCTAVE_INT_DOUBLE_BIN_OP (/) -# undef OCTAVE_INT_DOUBLE_BIN_OP +#undef OCTAVE_INT_DOUBLE_BIN_OP0 +#undef OCTAVE_INT_DOUBLE_BIN_OP -#define OCTAVE_INT_DOUBLE_CMP_OP(OP) \ +#define OCTAVE_INT_DOUBLE_CMP_OP0(OP) \ template \ inline bool \ operator OP (const octave_int& x, const double& y) \ { return static_cast (x.value ()) OP y; } \ + template \ + inline bool \ + operator OP (const double& x, const octave_int& y) \ + { return x OP static_cast (y.value ()); } + +#ifdef OCTAVE_INT_USE_LONG_DOUBLE +// Handle mixed op using long double +#define OCTAVE_INT_DOUBLE_CMP_OP(OP) \ + OCTAVE_INT_DOUBLE_CMP_OP0(OP) \ + template <> \ + inline bool \ + operator OP (const double& x, const octave_int64& y) \ + { return x OP static_cast (y.value ()); } \ + template <> \ + inline bool \ + operator OP (const double& x, const octave_uint64& y) \ + { return x OP static_cast (y.value ()); } \ + template <> \ + inline bool \ + operator OP (const octave_int64& x, const double& y) \ + { return static_cast (x.value ()) OP y; } \ + template <> \ + inline bool \ + operator OP (const octave_uint64& x, const double& y) \ + { return static_cast (x.value ()) OP y; } + +#else +// external handlers +#define OCTAVE_INT_DOUBLE_CMP_OP(OP) \ + OCTAVE_INT_DOUBLE_CMP_OP0(OP) \ + template <> \ + OCTAVE_API bool \ + operator OP (const double&, const octave_int64&); \ + template <> \ + OCTAVE_API bool \ + operator OP (const double&, const octave_uint64&); \ template <> \ OCTAVE_API bool \ operator OP (const octave_int64&, const double&); \ template <> \ OCTAVE_API bool \ - operator OP (const octave_uint64&, const double&); \ - template \ - inline bool \ - operator OP (const double& x, const octave_int& y) \ - { return x OP static_cast (y.value ()); } \ - template <> \ - OCTAVE_API bool \ - operator OP (const double&, const octave_int64&); \ - template <> \ - OCTAVE_API bool \ - operator OP (const double&, const octave_uint64&); + operator OP (const octave_uint64&, const double&); +#endif OCTAVE_INT_DOUBLE_CMP_OP (<) OCTAVE_INT_DOUBLE_CMP_OP (<=) @@ -939,7 +1027,7 @@ OCTAVE_INT_DOUBLE_CMP_OP (==) OCTAVE_INT_DOUBLE_CMP_OP (!=) -# undef OCTAVE_INT_DOUBLE_CMP_OP +#undef OCTAVE_INT_DOUBLE_CMP_OP // Floats are handled by simply converting to doubles. @@ -958,7 +1046,7 @@ OCTAVE_INT_FLOAT_BIN_OP (*) OCTAVE_INT_FLOAT_BIN_OP (/) -# undef OCTAVE_INT_FLOAT_BIN_OP +#undef OCTAVE_INT_FLOAT_BIN_OP #define OCTAVE_INT_FLOAT_CMP_OP(OP) \ template \ @@ -977,7 +1065,8 @@ OCTAVE_INT_FLOAT_CMP_OP (==) OCTAVE_INT_FLOAT_CMP_OP (!=) -# undef OCTAVE_INT_FLOAT_CMP_OP +#undef OCTAVE_INT_FLOAT_CMP_OP + #endif /* diff -r 1651939a394b -r 836df84b7997 src/ChangeLog --- a/src/ChangeLog Wed Oct 01 11:34:45 2008 -0400 +++ b/src/ChangeLog Wed Oct 01 20:16:39 2008 +0200 @@ -0,0 +1,5 @@ +2008-10-01 Jaroslav Hajek + + * OPERATORS/op-i64-i64.cc: Instantiate all 64-bit operations. + * OPERATORS/op-ui64-ui64.cc: Instantiate all unsigned 64-bit operations. + diff -r 1651939a394b -r 836df84b7997 src/OPERATORS/op-i64-i64.cc --- a/src/OPERATORS/op-i64-i64.cc Wed Oct 01 11:34:45 2008 -0400 +++ b/src/OPERATORS/op-i64-i64.cc Wed Oct 01 20:16:39 2008 +0200 @@ -84,41 +84,7 @@ #include "op-int.h" -OCTAVE_S_INT_UNOPS (int64) -OCTAVE_SS_INT_CMP_OPS (ss, int64_, int64_) -OCTAVE_SS_INT_CMP_OPS (sx, int64_, ) -OCTAVE_SS_INT_CMP_OPS (xs, , int64_) -OCTAVE_SS_INT_BOOL_OPS (ss, int64_, int64_, octave_int64 (0), octave_int64 (0)) -OCTAVE_SS_INT_BOOL_OPS (sx, int64_, , octave_int64 (0), 0) -OCTAVE_SS_INT_BOOL_OPS (xs, , int64_, 0, octave_int64 (0)) - -OCTAVE_SM_INT_CMP_OPS (sm, int64_, int64_) -OCTAVE_SM_INT_CMP_OPS (xm, , int64_) -OCTAVE_SM_INT_CMP_OPS (smx, int64_, ) -OCTAVE_SM_INT_BOOL_OPS (sm, int64_, int64_) -OCTAVE_SM_INT_BOOL_OPS (xm, , int64_) -OCTAVE_SM_INT_BOOL_OPS (smx, int64_, ) - -OCTAVE_MS_INT_CMP_OPS (ms, int64_, int64_) -OCTAVE_MS_INT_CMP_OPS (mx, int64_, ) -OCTAVE_MS_INT_CMP_OPS (mxs, , int64_) -OCTAVE_MS_INT_BOOL_OPS (ms, int64_, int64_) -OCTAVE_MS_INT_BOOL_OPS (mx, int64_, ) -OCTAVE_MS_INT_BOOL_OPS (mxs, , int64_) -OCTAVE_MS_INT_ASSIGN_OPS (ms, int64_, int64_, int64_) -OCTAVE_MS_INT_ASSIGN_OPS (mx, int64_, , ) -OCTAVE_MS_INT_ASSIGN_OPS (mc, int64_, complex_, ) - -OCTAVE_M_INT_UNOPS (int64) -OCTAVE_MM_INT_CMP_OPS (mm, int64_, int64_) -OCTAVE_MM_INT_CMP_OPS (mmx, int64_, ) -OCTAVE_MM_INT_CMP_OPS (mxm, , int64_) -OCTAVE_MM_INT_BOOL_OPS (mm, int64_, int64_) -OCTAVE_MM_INT_BOOL_OPS (mmx, int64_, ) -OCTAVE_MM_INT_BOOL_OPS (mxm, , int64_) -OCTAVE_MM_INT_ASSIGN_OPS (mm, int64_, int64_, int64_) -OCTAVE_MM_INT_ASSIGN_OPS (mmx, int64_, , ) -OCTAVE_MM_INT_ASSIGN_OPS (mmc, int64_, complex_, ) +OCTAVE_INT_OPS (int64) OCTAVE_MS_INT_ASSIGN_OPS (mi8, int64_, int8_, int8_) OCTAVE_MS_INT_ASSIGN_OPS (mui8, int64_, uint8_, uint8_) @@ -136,8 +102,6 @@ OCTAVE_MM_INT_ASSIGN_OPS (mmui32, int64_, uint32_, uint32_) OCTAVE_MM_INT_ASSIGN_OPS (mmui64, int64_, uint64_, uint64_) -OCTAVE_INT_NULL_ASSIGN_OPS (int64) - OCTAVE_MIXED_INT_CMP_OPS (int64, int8) OCTAVE_MIXED_INT_CMP_OPS (int64, uint8) OCTAVE_MIXED_INT_CMP_OPS (int64, int16) @@ -146,46 +110,10 @@ OCTAVE_MIXED_INT_CMP_OPS (int64, uint32) OCTAVE_MIXED_INT_CMP_OPS (int64, uint64) -OCTAVE_CONCAT_FN (int64); - void install_i64_i64_ops (void) { - OCTAVE_INSTALL_S_INT_UNOPS (int64); - OCTAVE_INSTALL_SS_INT_CMP_OPS (ss, int64_, int64_); - OCTAVE_INSTALL_SS_INT_CMP_OPS (sx, int64_, ); - OCTAVE_INSTALL_SS_INT_CMP_OPS (xs, , int64_); - OCTAVE_INSTALL_SS_INT_BOOL_OPS (ss, int64_, int64_); - OCTAVE_INSTALL_SS_INT_BOOL_OPS (sx, int64_, ); - OCTAVE_INSTALL_SS_INT_BOOL_OPS (xs, , int64_); - - OCTAVE_INSTALL_SM_INT_CMP_OPS (sm, int64_, int64_); - OCTAVE_INSTALL_SM_INT_CMP_OPS (xm, , int64_); - OCTAVE_INSTALL_SM_INT_CMP_OPS (smx, int64_, ); - OCTAVE_INSTALL_SM_INT_BOOL_OPS (sm, int64_, int64_); - OCTAVE_INSTALL_SM_INT_BOOL_OPS (xm, , int64_); - OCTAVE_INSTALL_SM_INT_BOOL_OPS (smx, int64_, ); - - OCTAVE_INSTALL_MS_INT_CMP_OPS (ms, int64_, int64_); - OCTAVE_INSTALL_MS_INT_CMP_OPS (mx, int64_, ); - OCTAVE_INSTALL_MS_INT_CMP_OPS (mxs, , int64_); - OCTAVE_INSTALL_MS_INT_BOOL_OPS (ms, int64_, int64_); - OCTAVE_INSTALL_MS_INT_BOOL_OPS (mx, int64_, ); - OCTAVE_INSTALL_MS_INT_BOOL_OPS (mxs, , int64_); - OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (ms, int64_, int64_); - OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mx, int64_, ); - OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mc, int64_, complex_); - - OCTAVE_INSTALL_M_INT_UNOPS (int64); - OCTAVE_INSTALL_MM_INT_CMP_OPS (mm, int64_, int64_); - OCTAVE_INSTALL_MM_INT_CMP_OPS (mmx, int64_, ); - OCTAVE_INSTALL_MM_INT_CMP_OPS (mxm, , int64_); - OCTAVE_INSTALL_MM_INT_BOOL_OPS (mm, int64_, int64_); - OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmx, int64_, ); - OCTAVE_INSTALL_MM_INT_BOOL_OPS (mxm, , int64_); - OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mm, int64_, int64_); - OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmx, int64_, ); - OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmc, int64_, complex_); + OCTAVE_INSTALL_INT_OPS (int64); OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mi8, int64_, int8_); OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mui8, int64_, uint8_); @@ -203,8 +131,6 @@ OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui32, int64_, uint32_); OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui64, int64_, uint64_); - OCTAVE_INSTALL_INT_NULL_ASSIGN_OPS (int64) - OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, int8); OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, uint8); OCTAVE_INSTALL_SM_INT_ASSIGNCONV (int64, int16); @@ -220,8 +146,6 @@ OCTAVE_INSTALL_MIXED_INT_CMP_OPS (int64, int32); OCTAVE_INSTALL_MIXED_INT_CMP_OPS (int64, uint32); OCTAVE_INSTALL_MIXED_INT_CMP_OPS (int64, uint64); - - OCTAVE_INSTALL_CONCAT_FN (int64); } /* diff -r 1651939a394b -r 836df84b7997 src/OPERATORS/op-ui64-ui64.cc --- a/src/OPERATORS/op-ui64-ui64.cc Wed Oct 01 11:34:45 2008 -0400 +++ b/src/OPERATORS/op-ui64-ui64.cc Wed Oct 01 20:16:39 2008 +0200 @@ -84,41 +84,7 @@ #include "op-int.h" -OCTAVE_S_INT_UNOPS (uint64) -OCTAVE_SS_INT_CMP_OPS (ss, uint64_, uint64_) -OCTAVE_SS_INT_CMP_OPS (sx, uint64_, ) -OCTAVE_SS_INT_CMP_OPS (xs, , uint64_) -OCTAVE_SS_INT_BOOL_OPS (ss, uint64_, uint64_, octave_uint64 (0), octave_uint64 (0)) -OCTAVE_SS_INT_BOOL_OPS (sx, uint64_, , octave_uint64 (0), 0) -OCTAVE_SS_INT_BOOL_OPS (xs, , uint64_, 0, octave_uint64 (0)) - -OCTAVE_SM_INT_CMP_OPS (sm, uint64_, uint64_) -OCTAVE_SM_INT_CMP_OPS (xm, , uint64_) -OCTAVE_SM_INT_CMP_OPS (smx, uint64_, ) -OCTAVE_SM_INT_BOOL_OPS (sm, uint64_, uint64_) -OCTAVE_SM_INT_BOOL_OPS (xm, , uint64_) -OCTAVE_SM_INT_BOOL_OPS (smx, uint64_, ) - -OCTAVE_MS_INT_CMP_OPS (ms, uint64_, uint64_) -OCTAVE_MS_INT_CMP_OPS (mx, uint64_, ) -OCTAVE_MS_INT_CMP_OPS (mxs, , uint64_) -OCTAVE_MS_INT_BOOL_OPS (ms, uint64_, uint64_) -OCTAVE_MS_INT_BOOL_OPS (mx, uint64_, ) -OCTAVE_MS_INT_BOOL_OPS (mxs, , uint64_) -OCTAVE_MS_INT_ASSIGN_OPS (ms, uint64_, uint64_, uint64_) -OCTAVE_MS_INT_ASSIGN_OPS (mx, uint64_, , ) -OCTAVE_MS_INT_ASSIGN_OPS (mc, uint64_, complex_, ) - -OCTAVE_M_INT_UNOPS (uint64) -OCTAVE_MM_INT_CMP_OPS (mm, uint64_, uint64_) -OCTAVE_MM_INT_CMP_OPS (mmx, uint64_, ) -OCTAVE_MM_INT_CMP_OPS (mxm, , uint64_) -OCTAVE_MM_INT_BOOL_OPS (mm, uint64_, uint64_) -OCTAVE_MM_INT_BOOL_OPS (mmx, uint64_, ) -OCTAVE_MM_INT_BOOL_OPS (mxm, , uint64_) -OCTAVE_MM_INT_ASSIGN_OPS (mm, uint64_, uint64_, uint64_) -OCTAVE_MM_INT_ASSIGN_OPS (mmx, uint64_, , ) -OCTAVE_MM_INT_ASSIGN_OPS (mmc, uint64_, complex_, ) +OCTAVE_INT_OPS (uint64) OCTAVE_MS_INT_ASSIGN_OPS (mi8, uint64_, int8_, int8_) OCTAVE_MS_INT_ASSIGN_OPS (mui8, uint64_, uint8_, uint8_) @@ -136,8 +102,6 @@ OCTAVE_MM_INT_ASSIGN_OPS (mmui32, uint64_, uint32_, uint32_) OCTAVE_MM_INT_ASSIGN_OPS (mmi64, uint64_, int64_, int64_) -OCTAVE_INT_NULL_ASSIGN_OPS (uint64) - OCTAVE_MIXED_INT_CMP_OPS (uint64, int8) OCTAVE_MIXED_INT_CMP_OPS (uint64, uint8) OCTAVE_MIXED_INT_CMP_OPS (uint64, int16) @@ -146,47 +110,11 @@ OCTAVE_MIXED_INT_CMP_OPS (uint64, uint32) OCTAVE_MIXED_INT_CMP_OPS (uint64, int64) -OCTAVE_CONCAT_FN (uint64) - void install_ui64_ui64_ops (void) { - OCTAVE_INSTALL_S_INT_UNOPS (uint64); - OCTAVE_INSTALL_SS_INT_CMP_OPS (ss, uint64_, uint64_); - OCTAVE_INSTALL_SS_INT_CMP_OPS (sx, uint64_, ); - OCTAVE_INSTALL_SS_INT_CMP_OPS (xs, , uint64_); - OCTAVE_INSTALL_SS_INT_BOOL_OPS (ss, uint64_, uint64_); - OCTAVE_INSTALL_SS_INT_BOOL_OPS (sx, uint64_, ); - OCTAVE_INSTALL_SS_INT_BOOL_OPS (xs, , uint64_); - - OCTAVE_INSTALL_SM_INT_CMP_OPS (sm, uint64_, uint64_); - OCTAVE_INSTALL_SM_INT_CMP_OPS (xm, , uint64_); - OCTAVE_INSTALL_SM_INT_CMP_OPS (smx, uint64_, ); - OCTAVE_INSTALL_SM_INT_BOOL_OPS (sm, uint64_, uint64_); - OCTAVE_INSTALL_SM_INT_BOOL_OPS (xm, , uint64_); - OCTAVE_INSTALL_SM_INT_BOOL_OPS (smx, uint64_, ); - - OCTAVE_INSTALL_MS_INT_CMP_OPS (ms, uint64_, uint64_); - OCTAVE_INSTALL_MS_INT_CMP_OPS (mx, uint64_, ); - OCTAVE_INSTALL_MS_INT_CMP_OPS (mxs, , uint64_); - OCTAVE_INSTALL_MS_INT_BOOL_OPS (ms, uint64_, uint64_); - OCTAVE_INSTALL_MS_INT_BOOL_OPS (mx, uint64_, ); - OCTAVE_INSTALL_MS_INT_BOOL_OPS (mxs, , uint64_); - OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (ms, uint64_, uint64_); - OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mx, uint64_, ); - OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mc, uint64_, complex_); - - OCTAVE_INSTALL_M_INT_UNOPS (uint64); - OCTAVE_INSTALL_MM_INT_CMP_OPS (mm, uint64_, uint64_); - OCTAVE_INSTALL_MM_INT_CMP_OPS (mmx, uint64_, ); - OCTAVE_INSTALL_MM_INT_CMP_OPS (mxm, , uint64_); - OCTAVE_INSTALL_MM_INT_BOOL_OPS (mm, uint64_, uint64_); - OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmx, uint64_, ); - OCTAVE_INSTALL_MM_INT_BOOL_OPS (mxm, , uint64_); - OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mm, uint64_, uint64_); - OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmx, uint64_, ); - OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmc, uint64_, complex_); - + OCTAVE_INSTALL_INT_OPS (uint64); + OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mi8, uint64_, int8_); OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mui8, uint64_, uint8_); OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mi16, uint64_, int16_); @@ -203,8 +131,6 @@ OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmui32, uint64_, uint32_); OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmi64, uint64_, int64_); - OCTAVE_INSTALL_INT_NULL_ASSIGN_OPS (uint64) - OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, int8); OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, uint8); OCTAVE_INSTALL_SM_INT_ASSIGNCONV (uint64, int16); @@ -220,8 +146,6 @@ OCTAVE_INSTALL_MIXED_INT_CMP_OPS (uint64, int32); OCTAVE_INSTALL_MIXED_INT_CMP_OPS (uint64, uint32); OCTAVE_INSTALL_MIXED_INT_CMP_OPS (uint64, int64); - - OCTAVE_INSTALL_CONCAT_FN (uint64); } /*