functions for 64bit operations

This module contains all the necessary function for 64bit operation in case the chosen compiler does not support long long.  Per default this module is linked.  This module is excluded only when the compiler supports long long

Summary
functions for 64bit operationsThis module contains all the necessary function for 64bit operation in case the chosen compiler does not support long long.
Functions
d2_cast32to64Cast an 32bit integer to 64bit variable
d2_cast64to32Cast an 64bit variable to a32bit variable
d2_add64Addition of 2 64bit value
d2_sub64Substraction of 2 64bit value
d2_mul3232to64multiply two 32-bit variables and return a 64bit value
d2_mul3264multiply two a 32bit varibales with a 64bit one and return a 64bit result
d2_div6432division of 64bit value by a 32bit.
d2_shiftleft64Shift left a variable of type d2_int64
d2_shiftright64Shift right a variable of type d2_int64

Functions

d2_cast32to64

void d2_cast32to64(d2_s32 par,
d2_int64 *res)

Cast an 32bit integer to 64bit variable

Parameters

par32bit integer to be casted

Return

d2_int64a 64bit value

d2_cast64to32

d2_s32 d2_cast64to32(const d2_int64 *par)

Cast an 64bit variable to a32bit variable

Parameters

par64bit variable of type d2_int64

Return

inta 32bit value

d2_add64

void d2_add64(const d2_int64 *a,
const d2_int64 *b,
d2_int64 *res)

Addition of 2 64bit value

Parameters

a64bit variable of type d2_int64
bpointer to a 64bit variable of type d2_int64
respointer to a 64bit variable of type d2_int64.  The result will be stored in that variable.

Return

none

d2_sub64

void d2_sub64(const d2_int64 *a,
const d2_int64 *b,
d2_int64 *res)

Substraction of 2 64bit value

Parameters

a64bit variable of type d2_int64
bpointer to a 64bit variable of type d2_int64
respointer to a 64bit variable of type d2_int64.  The result will be stored in that variable.

Return

none

d2_mul3232to64

multiply two 32-bit variables and return a 64bit value

Parameters

aint
bint
respointer to a variable of type d2_int64 The result will be stored in that variable.

Return

none

d2_mul3264

void d2_mul3264(d2_s32 a,
const d2_int64 *b,
d2_int64 *res)

multiply two a 32bit varibales with a 64bit one and return a 64bit result

Parameters

aint
bpointer to a 64bit variable of type d2_int64
respointer to a 64bit variable of type d2_int64.  The result will be stored in that variable.

Return

None

d2_div6432

void d2_div6432(const d2_int64 *dividend,
d2_s32 divisor,
d2_int64 *res)

division of 64bit value by a 32bit.  The return result is a 64bit value.

Parameters

dividendpointer to a 64bit variable of type d2_int64
divisor32bit variable of type int
respointer to a 64bit variable of type d2_int64 The result will be stored in this variable

Return

None

d2_shiftleft64

void d2_shiftleft64(const d2_int64 *var,
d2_s32 index,
d2_int64 *res)

Shift left a variable of type d2_int64

Parameters

varpointer to a 64bit variable of type d2_int64
indexinteger, number of bit to shift
respointer to a 64bit variable of type d2_int64 The result will be stored in this variable

Return

None

d2_shiftright64

void d2_shiftright64(const d2_int64 *var,
d2_s32 index,
d2_int64 *res)

Shift right a variable of type d2_int64

Parameters

varpointer to a 64bit variable of type d2_int64
indexinteger, number of bit to shift
respointer to a 64bit variable of type d2_int64 The result will be stored in this variable

Return

None

void d2_cast32to64(d2_s32 par,
d2_int64 *res)
Cast an 32bit integer to 64bit variable
d2_s32 d2_cast64to32(const d2_int64 *par)
Cast an 64bit variable to a32bit variable
void d2_add64(const d2_int64 *a,
const d2_int64 *b,
d2_int64 *res)
Addition of 2 64bit value
void d2_sub64(const d2_int64 *a,
const d2_int64 *b,
d2_int64 *res)
Substraction of 2 64bit value
void d2_mul3264(d2_s32 a,
const d2_int64 *b,
d2_int64 *res)
multiply two a 32bit varibales with a 64bit one and return a 64bit result
void d2_div6432(const d2_int64 *dividend,
d2_s32 divisor,
d2_int64 *res)
division of 64bit value by a 32bit.
void d2_shiftleft64(const d2_int64 *var,
d2_s32 index,
d2_int64 *res)
Shift left a variable of type d2_int64
void d2_shiftright64(const d2_int64 *var,
d2_s32 index,
d2_int64 *res)
Shift right a variable of type d2_int64
Close