SystemC 3.0.0
Accellera SystemC proof-of-concept library
Namespaces | Macros | Functions
sc_signed_ops.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  sc_dt
 

Macros

#define OPS_MIN(A, B)   ( (A) <= (B) ? A : B )
 
#define OPS_MAX(A, B)   ( (A) >= (B) ? A : B )
 
#define ADD_BIG_BIG(RESULT_TYPE, LEFT_TYPE, RIGHT_TYPE)
 
#define ADD_BIG_NATIVE(RESULT_TYPE, BIG_TYPE, NATIVE_TYPE)
 
#define ADD_NATIVE_BIG(RESULT_TYPE, NATIVE_TYPE, BIG_TYPE)
 
#define DIVIDE_BIG_BIG(RESULT_TYPE, LEFT_TYPE, RIGHT_TYPE)
 
#define DIVIDE_BIG_NATIVE(RESULT_TYPE, BIG_TYPE, NATIVE_TYPE)
 
#define DIVIDE_NATIVE_BIG(RESULT_TYPE, NATIVE_TYPE, BIG_TYPE)
 
#define MODULO_BIG_BIG(RESULT_TYPE, LEFT_TYPE, RIGHT_TYPE)
 
#define MODULO_BIG_NATIVE(RESULT_TYPE, BIG_TYPE, NATIVE_TYPE)
 
#define MODULO_NATIVE_BIG(RESULT_TYPE, NATIVE_TYPE, BIG_TYPE)
 
#define MULTIPLY_BIG_BIG(RESULT_TYPE, LEFT_TYPE, RIGHT_TYPE)
 
#define MULTIPLY_BIG_NATIVE(RESULT_TYPE, BIG_TYPE, NATIVE_TYPE)
 
#define MULTIPLY_NATIVE_BIG(RESULT_TYPE, NATIVE_TYPE, BIG_TYPE)
 
#define SUBTRACT_BIG_BIG(LEFT_TYPE, RIGHT_TYPE)
 
#define SUBTRACT_BIG_NATIVE(BIG_TYPE, NATIVE_TYPE)
 
#define SUBTRACT_NATIVE_BIG(NATIVE_TYPE, BIG_TYPE)
 
#define BIT_OP_BIG_BIG(OP, BIT_OP_RTN, RESULT_TYPE, LEFT_TYPE, RIGHT_TYPE)
 
#define BIT_OP_BIG_NATIVE(OP, BIT_OP_RTN, RESULT_TYPE, BIG_TYPE, NATIVE_TYPE)
 
#define BIT_OP_NATIVE_BIG(OP, BIT_OP_RTN, RESULT_TYPE, NATIVE_TYPE, BIG_TYPE)
 
#define BIT_OPS_BIG(OPER, BIT_OP_RTN)
 
#define COMPARE_BIG_BIG(OP, LEFT_TYPE, RIGHT_TYPE)
 
#define COMPARE_BIG_NATIVE(OP, BIG_TYPE, NATIVE_TYPE)
 
#define COMPARE_NATIVE_BIG(OP, NATIVE_TYPE, BIG_TYPE)
 
#define COMPARE_BIG_OPS(OP)
 
#define BIG_OP_EQUALS(OPEQ, OP, BASE_TYPE, OTHER_TYPE)
 
#define BIG_OPS_EQUALS(OPEQ, OP)
 

Functions

const sc_signed sc_dt::operator+ (const sc_signed &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator+ (const sc_signed &left, const sc_uint_base &right)
 
const sc_signed sc_dt::operator+ (const sc_int_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator+ (const sc_uint_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator+ (const sc_unsigned &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator+ (const sc_int_base &left, const sc_unsigned &right)
 
const sc_unsigned sc_dt::operator+ (const sc_unsigned &left, const sc_uint_base &right)
 
const sc_unsigned sc_dt::operator+ (const sc_uint_base &left, const sc_unsigned &right)
 
const sc_signed sc_dt::operator/ (const sc_signed &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator/ (const sc_signed &left, const sc_uint_base &right)
 
const sc_signed sc_dt::operator/ (const sc_int_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator/ (const sc_uint_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator/ (const sc_unsigned &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator/ (const sc_int_base &left, const sc_unsigned &right)
 
const sc_unsigned sc_dt::operator/ (const sc_unsigned &left, const sc_uint_base &right)
 
const sc_unsigned sc_dt::operator/ (const sc_uint_base &left, const sc_unsigned &right)
 
const sc_signed sc_dt::operator% (const sc_signed &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator% (const sc_signed &left, const sc_uint_base &right)
 
const sc_signed sc_dt::operator% (const sc_int_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator% (const sc_uint_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator% (const sc_unsigned &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator% (const sc_int_base &left, const sc_unsigned &right)
 
const sc_unsigned sc_dt::operator% (const sc_unsigned &left, const sc_uint_base &right)
 
const sc_unsigned sc_dt::operator% (const sc_uint_base &left, const sc_unsigned &right)
 
const sc_signed sc_dt::operator* (const sc_signed &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator* (const sc_signed &left, const sc_uint_base &right)
 
const sc_signed sc_dt::operator* (const sc_int_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator* (const sc_uint_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator* (const sc_unsigned &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator* (const sc_int_base &left, const sc_unsigned &right)
 
const sc_unsigned sc_dt::operator* (const sc_unsigned &left, const sc_uint_base &right)
 
const sc_unsigned sc_dt::operator* (const sc_uint_base &left, const sc_unsigned &right)
 
const sc_signed sc_dt::operator- (const sc_signed &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator- (const sc_signed &left, const sc_uint_base &right)
 
const sc_signed sc_dt::operator- (const sc_int_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator- (const sc_uint_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator- (const sc_unsigned &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator- (const sc_int_base &left, const sc_unsigned &right)
 
const sc_signed sc_dt::operator- (const sc_unsigned &left, const sc_uint_base &right)
 
const sc_signed sc_dt::operator- (const sc_uint_base &left, const sc_unsigned &right)
 
const sc_signed sc_dt::operator& (const sc_signed &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator& (const sc_signed &left, const sc_uint_base &right)
 
const sc_signed sc_dt::operator& (const sc_int_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator& (const sc_uint_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator& (const sc_unsigned &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator& (const sc_int_base &left, const sc_unsigned &right)
 
const sc_unsigned sc_dt::operator& (const sc_unsigned &left, const sc_uint_base &right)
 
const sc_unsigned sc_dt::operator& (const sc_uint_base &left, const sc_unsigned &right)
 
const sc_signed sc_dt::operator| (const sc_signed &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator| (const sc_signed &left, const sc_uint_base &right)
 
const sc_signed sc_dt::operator| (const sc_int_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator| (const sc_uint_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator| (const sc_unsigned &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator| (const sc_int_base &left, const sc_unsigned &right)
 
const sc_unsigned sc_dt::operator| (const sc_unsigned &left, const sc_uint_base &right)
 
const sc_unsigned sc_dt::operator| (const sc_uint_base &left, const sc_unsigned &right)
 
const sc_signed sc_dt::operator^ (const sc_signed &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator^ (const sc_signed &left, const sc_uint_base &right)
 
const sc_signed sc_dt::operator^ (const sc_int_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator^ (const sc_uint_base &left, const sc_signed &right)
 
const sc_signed sc_dt::operator^ (const sc_unsigned &left, const sc_int_base &right)
 
const sc_signed sc_dt::operator^ (const sc_int_base &left, const sc_unsigned &right)
 
const sc_unsigned sc_dt::operator^ (const sc_unsigned &left, const sc_uint_base &right)
 
const sc_unsigned sc_dt::operator^ (const sc_uint_base &left, const sc_unsigned &right)
 
SC_API sc_signed sc_dt::operator~ (const sc_signed &u)
 
sc_signed sc_dt::operator~ (const sc_unsigned &u)
 

Macro Definition Documentation

◆ ADD_BIG_BIG

#define ADD_BIG_BIG (   RESULT_TYPE,
  LEFT_TYPE,
  RIGHT_TYPE 
)
Value:
inline \
operator+(const LEFT_TYPE& left, const RIGHT_TYPE& right) \
{ \
const int left_n = left.get_actual_length(); \
const int right_n = right.get_actual_length(); \
\
if ( left_n >= right_n ) { \
RESULT_TYPE result(left_n+1, false); \
vector_add( left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
} \
else { \
RESULT_TYPE result(right_n+1, false); \
vector_add( right.get_hod(), \
right.get_digits(), \
left.get_hod(), \
left.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
} \
}
const sc_unsigned operator+(const sc_uint_base &left, const sc_unsigned &right)
int get_actual_length() const
Definition: sc_unsigned.h:1185

Definition at line 50 of file sc_signed_ops.h.

◆ ADD_BIG_NATIVE

#define ADD_BIG_NATIVE (   RESULT_TYPE,
  BIG_TYPE,
  NATIVE_TYPE 
)
Value:
inline \
operator+(const BIG_TYPE &left, NATIVE_TYPE native) \
{ \
ScNativeDigits<NATIVE_TYPE> right( native ); \
const int left_n = left.get_actual_length(); \
const int right_n = right.get_actual_length(); \
\
if ( left_n > right_n ) { \
RESULT_TYPE result( left_n+1, false ); \
vector_add( left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
} \
else { \
RESULT_TYPE result( right_n+1, false ); \
vector_add( right.get_hod(), \
right.get_digits(), \
left.get_hod(), \
left.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
} \
}

Definition at line 80 of file sc_signed_ops.h.

◆ ADD_NATIVE_BIG

#define ADD_NATIVE_BIG (   RESULT_TYPE,
  NATIVE_TYPE,
  BIG_TYPE 
)

Definition at line 111 of file sc_signed_ops.h.

◆ BIG_OP_EQUALS

#define BIG_OP_EQUALS (   OPEQ,
  OP,
  BASE_TYPE,
  OTHER_TYPE 
)
Value:
inline \
BASE_TYPE& \
BASE_TYPE::operator OPEQ (OTHER_TYPE right) \
{ \
*this = *this OP right; \
return *this; \
}

Definition at line 1464 of file sc_signed_ops.h.

◆ BIG_OPS_EQUALS

#define BIG_OPS_EQUALS (   OPEQ,
  OP 
)
Value:
BIG_OP_EQUALS(OPEQ,OP,sc_signed,const sc_signed&) \
BIG_OP_EQUALS(OPEQ,OP,sc_signed,const sc_unsigned&) \
BIG_OP_EQUALS(OPEQ,OP,sc_signed,int64) \
BIG_OP_EQUALS(OPEQ,OP,sc_signed,long) \
BIG_OP_EQUALS(OPEQ,OP,sc_signed,int) \
BIG_OP_EQUALS(OPEQ,OP,sc_signed,uint64) \
BIG_OP_EQUALS(OPEQ,OP,sc_signed,unsigned long) \
BIG_OP_EQUALS(OPEQ,OP,sc_signed,unsigned int) \
BIG_OP_EQUALS(OPEQ,OP,sc_unsigned,const sc_signed&) \
BIG_OP_EQUALS(OPEQ,OP,sc_unsigned,const sc_unsigned&) \
BIG_OP_EQUALS(OPEQ,OP,sc_unsigned,int64) \
BIG_OP_EQUALS(OPEQ,OP,sc_unsigned,long) \
BIG_OP_EQUALS(OPEQ,OP,sc_unsigned,int) \
BIG_OP_EQUALS(OPEQ,OP,sc_unsigned,uint64) \
BIG_OP_EQUALS(OPEQ,OP,sc_unsigned,unsigned long) \
BIG_OP_EQUALS(OPEQ,OP,sc_unsigned,unsigned int) \
inline sc_signed& sc_signed::operator OPEQ (const sc_int_base& right) \
{ return *this OPEQ (int64)right; } \
inline sc_signed& sc_signed::operator OPEQ (const sc_uint_base& right) \
{ return *this OPEQ (uint64)right; } \
inline sc_unsigned& sc_unsigned::operator OPEQ (const sc_int_base& right) \
{ return *this OPEQ (int64)right; } \
inline sc_unsigned& sc_unsigned::operator OPEQ (const sc_uint_base& right) \
{ return *this OPEQ (uint64)right; }
#define BIG_OP_EQUALS(OPEQ, OP, BASE_TYPE, OTHER_TYPE)
unsigned long long uint64
Definition: sc_nbdefs.h:216
long long int64
Definition: sc_nbdefs.h:215

Definition at line 1473 of file sc_signed_ops.h.

◆ BIT_OP_BIG_BIG

#define BIT_OP_BIG_BIG (   OP,
  BIT_OP_RTN,
  RESULT_TYPE,
  LEFT_TYPE,
  RIGHT_TYPE 
)

Definition at line 921 of file sc_signed_ops.h.

◆ BIT_OP_BIG_NATIVE

#define BIT_OP_BIG_NATIVE (   OP,
  BIT_OP_RTN,
  RESULT_TYPE,
  BIG_TYPE,
  NATIVE_TYPE 
)

Definition at line 961 of file sc_signed_ops.h.

◆ BIT_OP_NATIVE_BIG

#define BIT_OP_NATIVE_BIG (   OP,
  BIT_OP_RTN,
  RESULT_TYPE,
  NATIVE_TYPE,
  BIG_TYPE 
)

Definition at line 1002 of file sc_signed_ops.h.

◆ BIT_OPS_BIG

#define BIT_OPS_BIG (   OPER,
  BIT_OP_RTN 
)

Definition at line 1044 of file sc_signed_ops.h.

◆ COMPARE_BIG_BIG

#define COMPARE_BIG_BIG (   OP,
  LEFT_TYPE,
  RIGHT_TYPE 
)
Value:
inline \
bool \
operator OP(const LEFT_TYPE& left, const RIGHT_TYPE& right) \
{ \
\
return vector_compare<LEFT_TYPE::SIGNED,RIGHT_TYPE::SIGNED>( \
left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits() ) OP 0; \
}

Definition at line 1266 of file sc_signed_ops.h.

◆ COMPARE_BIG_NATIVE

#define COMPARE_BIG_NATIVE (   OP,
  BIG_TYPE,
  NATIVE_TYPE 
)
Value:
inline \
bool \
operator OP(const BIG_TYPE &left, NATIVE_TYPE native) \
{ \
ScNativeDigits<NATIVE_TYPE> right( native ); \
\
return \
vector_compare<BIG_TYPE::SIGNED,ScNativeDigits<NATIVE_TYPE>::SIGNED>( \
left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits() ) OP 0; \
} \

Definition at line 1279 of file sc_signed_ops.h.

◆ COMPARE_BIG_OPS

#define COMPARE_BIG_OPS (   OP)

Definition at line 1310 of file sc_signed_ops.h.

◆ COMPARE_NATIVE_BIG

#define COMPARE_NATIVE_BIG (   OP,
  NATIVE_TYPE,
  BIG_TYPE 
)
Value:
inline \
bool \
operator OP(NATIVE_TYPE native, const BIG_TYPE &right) \
{ \
\
ScNativeDigits<NATIVE_TYPE> left(native); \
\
return \
vector_compare<ScNativeDigits<NATIVE_TYPE>::SIGNED,BIG_TYPE::SIGNED>( \
left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits() ) OP 0; \
}

Definition at line 1294 of file sc_signed_ops.h.

◆ DIVIDE_BIG_BIG

#define DIVIDE_BIG_BIG (   RESULT_TYPE,
  LEFT_TYPE,
  RIGHT_TYPE 
)
Value:
inline \
operator/(const LEFT_TYPE& left, const RIGHT_TYPE& right) \
{ \
int left_n = left.get_actual_length(); \
\
RESULT_TYPE quotient(left_n+right.SIGNED); \
bool ok = vector_divide<LEFT_TYPE::SIGNED,RIGHT_TYPE::SIGNED>( \
left.get_digits_n(), \
left.get_digits(), \
right.get_digits_n(), \
right.get_digits(), \
quotient.get_digits_n(), \
quotient.get_digits(), \
0, \
NULL ); \
if ( !ok ) { \
"division by zero detected" ); \
} \
return quotient; \
}
const char SC_ID_OPERATION_FAILED_[]
const sc_unsigned operator/(const sc_uint_base &left, const sc_unsigned &right)

Definition at line 241 of file sc_signed_ops.h.

◆ DIVIDE_BIG_NATIVE

#define DIVIDE_BIG_NATIVE (   RESULT_TYPE,
  BIG_TYPE,
  NATIVE_TYPE 
)
Value:
inline \
operator/(const BIG_TYPE &left, NATIVE_TYPE native) \
{ \
ScNativeDigits<NATIVE_TYPE> right( native ); \
const int left_n = left.get_actual_length(); \
\
RESULT_TYPE quotient(left_n+right.SIGNED, false); \
bool ok = \
vector_divide<BIG_TYPE::SIGNED,ScNativeDigits<NATIVE_TYPE>::SIGNED>( \
left.get_digits_n(), \
left.get_digits(), \
right.get_digits_n(), \
right.get_digits(), \
quotient.get_digits_n(), \
quotient.get_digits(), \
0, \
NULL ); \
if ( !ok ) { \
"division by zero detected" ); \
} \
return quotient; \
}

Definition at line 265 of file sc_signed_ops.h.

◆ DIVIDE_NATIVE_BIG

#define DIVIDE_NATIVE_BIG (   RESULT_TYPE,
  NATIVE_TYPE,
  BIG_TYPE 
)
Value:
inline \
operator/(NATIVE_TYPE native, const BIG_TYPE &right) \
{ \
\
ScNativeDigits<NATIVE_TYPE> left(native); \
const int left_n = left.get_actual_length(); \
\
RESULT_TYPE quotient(left_n+right.SIGNED, false); \
bool ok = \
vector_divide<ScNativeDigits<NATIVE_TYPE>::SIGNED,BIG_TYPE::SIGNED>( \
left.get_digits_n(), \
left.get_digits(), \
right.get_digits_n(), \
right.get_digits(), \
quotient.get_digits_n(), \
quotient.get_digits(), \
0, \
NULL ); \
if ( !ok ) { \
"division by zero detected" ); \
} \
return quotient; \
}

Definition at line 291 of file sc_signed_ops.h.

◆ MODULO_BIG_BIG

#define MODULO_BIG_BIG (   RESULT_TYPE,
  LEFT_TYPE,
  RIGHT_TYPE 
)
Value:
inline \
operator%(const LEFT_TYPE& left, const RIGHT_TYPE& right) \
{ \
const int left_n = left.get_actual_length(); \
const int right_n = right.get_actual_length(); \
const int width_n = OPS_MIN( left_n,right_n+right.SIGNED ); \
\
RESULT_TYPE result(width_n); \
vector_divide<LEFT_TYPE::SIGNED,RIGHT_TYPE::SIGNED>( \
left.get_digits_n(), \
left.get_digits(), \
right.get_digits_n(), \
right.get_digits(), \
0, \
NULL, \
result.get_digits_n(), \
result.get_digits() ); \
return result; \
}
#define OPS_MIN(A, B)
Definition: sc_signed_ops.h:37
const sc_unsigned operator%(const sc_uint_base &left, const sc_unsigned &right)

Definition at line 415 of file sc_signed_ops.h.

◆ MODULO_BIG_NATIVE

#define MODULO_BIG_NATIVE (   RESULT_TYPE,
  BIG_TYPE,
  NATIVE_TYPE 
)
Value:
inline \
operator%(const BIG_TYPE &left, NATIVE_TYPE native) \
{ \
ScNativeDigits<NATIVE_TYPE> right( native ); \
const int left_n = left.get_actual_length(); \
const int right_n = right.get_actual_length(); \
const int width_n = OPS_MIN( left_n,right_n+right.SIGNED ); \
\
RESULT_TYPE result(width_n); \
vector_divide<BIG_TYPE::SIGNED,ScNativeDigits<NATIVE_TYPE>::SIGNED>(\
left.get_digits_n(), \
left.get_digits(), \
right.get_digits_n(), \
right.get_digits(), \
0, \
NULL, \
result.get_digits_n(), \
result.get_digits() ); \
return result; \
}

Definition at line 437 of file sc_signed_ops.h.

◆ MODULO_NATIVE_BIG

#define MODULO_NATIVE_BIG (   RESULT_TYPE,
  NATIVE_TYPE,
  BIG_TYPE 
)
Value:
inline \
operator%(NATIVE_TYPE native, const BIG_TYPE &right) \
{ \
\
ScNativeDigits<NATIVE_TYPE> left(native); \
const int left_n = left.get_actual_length(); \
const int right_n = right.get_actual_length(); \
const int width_n = OPS_MIN( left_n,right_n+right.SIGNED ); \
\
RESULT_TYPE result(width_n); \
vector_divide<ScNativeDigits<NATIVE_TYPE>::SIGNED,BIG_TYPE::SIGNED>(\
left.get_digits_n(), \
left.get_digits(), \
right.get_digits_n(), \
right.get_digits(), \
0, \
NULL, \
result.get_digits_n(), \
result.get_digits() ); \
return result; \
}

Definition at line 460 of file sc_signed_ops.h.

◆ MULTIPLY_BIG_BIG

#define MULTIPLY_BIG_BIG (   RESULT_TYPE,
  LEFT_TYPE,
  RIGHT_TYPE 
)
Value:
inline \
operator*(const LEFT_TYPE& left, const RIGHT_TYPE& right) \
{ \
int left_n = left.get_actual_length(); \
int right_n = right.get_actual_length(); \
\
RESULT_TYPE result(left_n+right_n, false); \
vector_multiply( left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
}
const sc_unsigned operator*(const sc_uint_base &left, const sc_unsigned &right)

Definition at line 582 of file sc_signed_ops.h.

◆ MULTIPLY_BIG_NATIVE

#define MULTIPLY_BIG_NATIVE (   RESULT_TYPE,
  BIG_TYPE,
  NATIVE_TYPE 
)
Value:
inline \
operator*(const BIG_TYPE &left, NATIVE_TYPE native) \
{ \
ScNativeDigits<NATIVE_TYPE> right( native ); \
const int left_n = left.get_actual_length(); \
const int right_n = right.get_actual_length(); \
\
RESULT_TYPE result(left_n+right_n, false); \
vector_multiply( left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
}

Definition at line 600 of file sc_signed_ops.h.

◆ MULTIPLY_NATIVE_BIG

#define MULTIPLY_NATIVE_BIG (   RESULT_TYPE,
  NATIVE_TYPE,
  BIG_TYPE 
)
Value:
inline \
operator*(NATIVE_TYPE native, const BIG_TYPE &right) \
{ \
\
ScNativeDigits<NATIVE_TYPE> left(native); \
const int left_n = left.get_actual_length(); \
const int right_n = right.get_actual_length(); \
\
RESULT_TYPE result(left_n+right_n, false); \
vector_multiply( left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
}

Definition at line 619 of file sc_signed_ops.h.

◆ OPS_MAX

#define OPS_MAX (   A,
 
)    ( (A) >= (B) ? A : B )

Definition at line 38 of file sc_signed_ops.h.

◆ OPS_MIN

#define OPS_MIN (   A,
 
)    ( (A) <= (B) ? A : B )

Definition at line 37 of file sc_signed_ops.h.

◆ SUBTRACT_BIG_BIG

#define SUBTRACT_BIG_BIG (   LEFT_TYPE,
  RIGHT_TYPE 
)
Value:
inline \
operator-(const LEFT_TYPE& left, const RIGHT_TYPE& right) \
{ \
int left_n = left.get_actual_length(); \
int right_n = right.get_actual_length(); \
\
if ( left_n >= right_n ) { \
sc_signed result(left_n+1, false); \
vector_subtract_shorter( left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
} \
else { \
sc_signed result(right_n+1, false); \
vector_subtract_longer( right.get_hod(), \
right.get_digits(), \
left.get_hod(), \
left.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
} \
}
const sc_signed operator-(const sc_uint_base &left, const sc_unsigned &right)
int get_actual_length() const
Definition: sc_signed.h:1197

Definition at line 736 of file sc_signed_ops.h.

◆ SUBTRACT_BIG_NATIVE

#define SUBTRACT_BIG_NATIVE (   BIG_TYPE,
  NATIVE_TYPE 
)
Value:
inline \
operator-(const BIG_TYPE &left, NATIVE_TYPE native) \
{ \
ScNativeDigits<NATIVE_TYPE> right( native ); \
const int left_n = left.get_actual_length(); \
const int right_n = right.get_actual_length(); \
\
if ( left_n > right_n ) { \
sc_signed result( left_n+1, false ); \
vector_subtract_shorter( left.get_hod(), \
left.get_digits(), \
right.get_hod(), \
right.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
} \
else { \
sc_signed result( right_n+1, false ); \
vector_subtract_longer( right.get_hod(), \
right.get_digits(), \
left.get_hod(), \
left.get_digits(), \
result.get_hod(), \
result.get_digits() ); \
return result; \
} \
}

Definition at line 766 of file sc_signed_ops.h.

◆ SUBTRACT_NATIVE_BIG

#define SUBTRACT_NATIVE_BIG (   NATIVE_TYPE,
  BIG_TYPE 
)

Definition at line 797 of file sc_signed_ops.h.