Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
miscmath.c File Reference
#include "arith.internal.h"
#include "int64.h"
#include <string.h>
Include dependency graph for miscmath.c:

Go to the source code of this file.

Defines

#define _fcdtocp(f)   ((char *)(((long)(f))&0xfc000000ffffffff))
#define _fcdlen(f)   ((unsigned)((((long)(f))>>35)&0x7fffff))

Typedefs

typedef AR_HOST_UINT64 an_mc_table [129]

Functions

int GETPMC (an_mc_table, char *)
long CHECKMC (const char *mcname, AR_HOST_SINT64 *pdtwrd, AR_HOST_SINT64 *pdtstrt, AR_HOST_SINT64 *pdtlen, AR_HOST_SINT64 *mcindx, AR_HOST_SINT64 *mctype, AR_HOST_SINT64 *mcdef, const char *pmtname,...)
AR_HOST_SINT64 AR_get_state_register ()
int AR_set_state_register (AR_HOST_SINT64 state_reg)
int AR_get_rounding_mode ()
int AR_set_rounding_mode (int rounding_mode)
int AR_get_underflow_mode ()
int AR_set_underflow_mode (int underflow_mode)
int AR_get_floating_point_format ()
int AR_get_128bit_format ()
int ar_decompose_complex (ar_data *real, ar_data *imag, AR_TYPE *parttype, const ar_data *cplx, const AR_TYPE *cplxtype)
int ar_compose_complex (ar_data *cplx, AR_TYPE *cplxtype, const ar_data *real, const ar_data *imag, const AR_TYPE *parttype)
int AR_creal (AR_DATA *result, const AR_TYPE *resulttype, const AR_DATA *opnd, const AR_TYPE *opndtype)
int AR_cimag (AR_DATA *result, const AR_TYPE *resulttype, const AR_DATA *opnd, const AR_TYPE *opndtype)
int AR_status (const AR_DATA *opd, const AR_TYPE *opndtype)
int AR_one (AR_DATA *res, const AR_TYPE *type)
int AR_abs (AR_DATA *res, const AR_TYPE *resulttype, const AR_DATA *opd, const AR_TYPE *opndtype)
int AR_conj (AR_DATA *res, const AR_TYPE *resulttype, const AR_DATA *opd, const AR_TYPE *opndtype)
int AR_make_imag (AR_DATA *result, const AR_TYPE *resulttype, const AR_DATA *opnd, const AR_TYPE *opndtype)
int AR_make_complex (AR_DATA *res, const AR_TYPE *resulttype, const AR_DATA *op1, const AR_TYPE *opnd1type, const AR_DATA *op2, const AR_TYPE *opnd2type)
void ar_clear_unused_bits (ar_data *opnd, const AR_TYPE *opndtype)
int AR_CRAY_64_trunc_bits (int truncbits)
void ar_CRAY_64_trunc (AR_CRAY_64 *opnd)
void ar_set_invalid_result (ar_data *result, const AR_TYPE *resulttype)
 AR_NOINTRIN_ERROR (char *intrin_name)
void ar_internal_error (int msgnum, char *file, int line)
AR_ARCHITECTURE ar_host (void)

Variables

AR_DATA AR_const_zero = { 0, 0, 0, 0 }
AR_DATA AR_const_one = { 1, 0, 0, 0 }
AR_DATA AR_const_two = { 2, 0, 0, 0 }
AR_DATA AR_const_false = { 0, 0, 0, 0 }
AR_DATA AR_const_true = {-1, 0, 0, 0 }
ar_state_info ar_state_register = { 0, 0, 0, 0, 0, 0, 0, 0 }
static char USMID [] = "\n%Z%%M% %I% %G% %U%\n"

Define Documentation

#define _fcdlen (   f)    ((unsigned)((((long)(f))>>35)&0x7fffff))

Definition at line 1006 of file miscmath.c.

#define _fcdtocp (   f)    ((char *)(((long)(f))&0xfc000000ffffffff))

Definition at line 1005 of file miscmath.c.


Typedef Documentation

Definition at line 44 of file miscmath.c.


Function Documentation

int AR_cimag ( AR_DATA result,
const AR_TYPE resulttype,
const AR_DATA opnd,
const AR_TYPE opndtype 
)

Definition at line 277 of file miscmath.c.

References ar_decompose_complex(), and AR_STAT_INVALID_TYPE.

Here is the call graph for this function:

int AR_conj ( AR_DATA res,
const AR_TYPE resulttype,
const AR_DATA opd,
const AR_TYPE opndtype 
)

Definition at line 765 of file miscmath.c.

References ar_compose_complex(), ar_decompose_complex(), ar_negate_float(), AR_STAT_NEGATIVE, AR_STAT_ZERO, AR_status(), and result.

Here is the call graph for this function:

void ar_CRAY_64_trunc ( AR_CRAY_64 opnd)

Definition at line 908 of file miscmath.c.

References ar_internal_error(), ar_state_info::ar_truncate_bits, AR_CRAY_64::coeff0, AR_CRAY_64::coeff1, and AR_CRAY_64::coeff2.

Referenced by AR_add(), ar_cfdiv64(), ar_multiply_float(), and AR_subtract().

Here is the call graph for this function:

int AR_CRAY_64_trunc_bits ( int  truncbits)
int AR_creal ( AR_DATA result,
const AR_TYPE resulttype,
const AR_DATA opnd,
const AR_TYPE opndtype 
)

Definition at line 261 of file miscmath.c.

References ar_decompose_complex(), and AR_STAT_INVALID_TYPE.

Here is the call graph for this function:

Definition at line 171 of file miscmath.c.

References ar_state_info::ar_128bit_format.

Definition at line 163 of file miscmath.c.

References ar_state_info::ar_float_format.

Definition at line 124 of file miscmath.c.

References ar_state_info::ar_rounding_mode.

Definition at line 143 of file miscmath.c.

References ar_state_info::ar_underflow_mode.

Definition at line 1031 of file miscmath.c.

References AR_Arch_MIPS, AR_Arch_PVP, AR_Arch_PVP_IEEE, AR_Arch_SPARC, AR_Arch_T3D, AR_Arch_T3E, AR_Arch_Unknown, ar_internal_error(), CHECKMC(), GETPMC(), and initialized.

Here is the call graph for this function:

int AR_make_imag ( AR_DATA result,
const AR_TYPE resulttype,
const AR_DATA opnd,
const AR_TYPE opndtype 
)

Definition at line 788 of file miscmath.c.

References AR_make_complex().

Here is the call graph for this function:

AR_NOINTRIN_ERROR ( char *  intrin_name)

Definition at line 1007 of file miscmath.c.

References _fcdlen, _fcdtocp, and ar_internal_error().

Here is the call graph for this function:

int AR_one ( AR_DATA res,
const AR_TYPE type 
)

Definition at line 513 of file miscmath.c.

References AR_Complex_Cray1_128, AR_Complex_Cray1_64, AR_Complex_Cray1_64_F, AR_Complex_IEEE_DN_128, AR_Complex_IEEE_DN_32, AR_Complex_IEEE_DN_64, AR_Complex_IEEE_NR_128, AR_Complex_IEEE_NR_32, AR_Complex_IEEE_NR_64, AR_Complex_IEEE_UP_128, AR_Complex_IEEE_UP_32, AR_Complex_IEEE_UP_64, AR_Complex_IEEE_ZE_128, AR_Complex_IEEE_ZE_32, AR_Complex_IEEE_ZE_64, ar_data::ar_cplx_f128, ar_data::ar_cplx_f64, ar_data::ar_cplx_ieee128, ar_data::ar_cplx_ieee32, ar_data::ar_cplx_ieee64, ar_data::ar_cplx_mips128, AR_CRAY_C0_BITS, AR_CRAY_EXPO_BIAS, ar_data::ar_f128, ar_data::ar_f64, AR_Float_Cray1_128, AR_Float_Cray1_64, AR_Float_Cray1_64_F, AR_Float_IEEE_DN_128, AR_Float_IEEE_DN_32, AR_Float_IEEE_DN_64, AR_Float_IEEE_NR_128, AR_Float_IEEE_NR_32, AR_Float_IEEE_NR_64, AR_Float_IEEE_UP_128, AR_Float_IEEE_UP_32, AR_Float_IEEE_UP_64, AR_Float_IEEE_ZE_128, AR_Float_IEEE_ZE_32, AR_Float_IEEE_ZE_64, ar_data::ar_i64, ar_data::ar_ieee128, AR_IEEE128_EXPO_BIAS, ar_data::ar_ieee32, AR_IEEE32_EXPO_BIAS, ar_data::ar_ieee64, AR_IEEE64_EXPO_BIAS, AR_Int_16_S, AR_Int_16_U, AR_Int_32_S, AR_Int_32_U, AR_Int_46_S, AR_Int_64_S, AR_Int_64_U, ar_data::ar_mips128, AR_MIPS128_EXPO_BIAS, AR_STAT_INVALID_TYPE, AR_STAT_OK, AR_CRAY_64::coeff0, AR_CRAY_128::coeff0, AR_IEEE_32::expo, AR_IEEE_64::expo, AR_IEEE_128::expo, AR_MIPS_128::expo, AR_CRAY_64::expo, AR_CRAY_128::expo, HOST_IS_MIPS, AR_CPLX_IEEE_32::icoeff0, AR_CPLX_IEEE_32::icoeff1, AR_CPLX_IEEE_32::iexpo, AR_CPLX_IEEE_64::imag, AR_CPLX_IEEE_128::imag, AR_CPLX_CRAY_64::imag, AR_CPLX_CRAY_128::imag, AR_CPLX_IEEE_32::isign, AR_INT_64::part1, AR_INT_64::part2, AR_INT_64::part3, AR_INT_64::part4, AR_CPLX_IEEE_32::rcoeff0, AR_CPLX_IEEE_32::rcoeff1, AR_CPLX_IEEE_64::real, AR_CPLX_IEEE_128::real, AR_CPLX_MIPS_128::real, AR_CPLX_CRAY_64::real, AR_CPLX_CRAY_128::real, result, AR_CPLX_IEEE_32::rexpo, AR_CPLX_IEEE_32::rsign, ZEROCRAY128, ZEROCRAY64, ZEROIEEE128, ZEROIEEE32, and ZEROIEEE64.

Referenced by ar_power().

int AR_set_rounding_mode ( int  rounding_mode)
int AR_set_underflow_mode ( int  underflow_mode)
int AR_status ( const AR_DATA opd,
const AR_TYPE opndtype 
)

Definition at line 294 of file miscmath.c.

References AR_CLASS, AR_CLASS_FLOAT, AR_CLASS_INT, AR_CLASS_LOGICAL, AR_CLASS_POINTER, AR_Complex_Cray1_128, AR_Complex_Cray1_64, AR_Complex_Cray1_64_F, AR_Complex_IEEE_DN_128, AR_Complex_IEEE_DN_32, AR_Complex_IEEE_DN_64, AR_Complex_IEEE_NR_128, AR_Complex_IEEE_NR_32, AR_Complex_IEEE_NR_64, AR_Complex_IEEE_UP_128, AR_Complex_IEEE_UP_32, AR_Complex_IEEE_UP_64, AR_Complex_IEEE_ZE_128, AR_Complex_IEEE_ZE_32, AR_Complex_IEEE_ZE_64, AR_CRAY_MAX_EXPO, AR_CRAY_MIN_EXPO, ar_decompose_complex(), ar_data::ar_f128, ar_data::ar_f64, AR_Float_Cray1_128, AR_Float_Cray1_64, AR_Float_Cray1_64_F, AR_Float_IEEE_DN_128, AR_Float_IEEE_DN_32, AR_Float_IEEE_DN_64, AR_Float_IEEE_NR_128, AR_Float_IEEE_NR_32, AR_Float_IEEE_NR_64, AR_Float_IEEE_UP_128, AR_Float_IEEE_UP_32, AR_Float_IEEE_UP_64, AR_Float_IEEE_ZE_128, AR_Float_IEEE_ZE_32, AR_Float_IEEE_ZE_64, ar_data::ar_i64, ar_data::ar_ieee128, AR_IEEE128_MAX_EXPO, ar_data::ar_ieee32, AR_IEEE32_MAX_EXPO, ar_data::ar_ieee64, AR_IEEE64_MAX_EXPO, AR_INT_SIZE, AR_INT_SIZE_16, AR_INT_SIZE_24, AR_INT_SIZE_32, AR_INT_SIZE_46, AR_INT_SIZE_64, AR_INT_SIZE_8, ar_data::ar_mips128, AR_MIPS128_MAX_EXPO, AR_SIGNED, AR_SIGNEDNESS, AR_STAT_INVALID_TYPE, AR_STAT_NEGATIVE, AR_STAT_OK, AR_STAT_OVERFLOW, AR_STAT_UNDEFINED, AR_STAT_UNDERFLOW, AR_STAT_ZERO, AR_status(), AR_CRAY_64::coeff0, AR_CRAY_128::coeff0, AR_CRAY_64::coeff1, AR_CRAY_128::coeff1, AR_CRAY_64::coeff2, AR_CRAY_128::coeff2, AR_CRAY_128::coeff3, AR_CRAY_128::coeff4, AR_CRAY_128::coeff5, AR_IEEE_32::expo, AR_IEEE_64::expo, AR_IEEE_128::expo, AR_MIPS_128::expo, AR_CRAY_64::expo, AR_CRAY_128::expo, AR_MIPS_128::expol, HOST_IS_MIPS, INT16_SIGN, INT24_SIGN, INT32_SIGN, INT64_SIGN, INT8_SIGN, IS_IEEE128_NZ_COEFF, IS_IEEE32_NZ_COEFF, IS_IEEE64_NZ_COEFF, IS_INT16_ZERO, IS_INT24_ZERO, IS_INT32_ZERO, IS_INT64_ZERO, IS_INT8_ZERO, IS_MIPS128_NZ_COEFF, AR_INT_64::part1, AR_INT_64::part2, AR_INT_64::part3, AR_INT_64::part4, AR_IEEE_32::sign, AR_IEEE_64::sign, AR_IEEE_128::sign, AR_MIPS_128::sign, AR_CRAY_64::sign, AR_CRAY_128::sign, and AR_CRAY_128::zero.

Referenced by AR_abs(), AR_add_ptr_int(), AR_cabs(), ar_cabs(), AR_conj(), AR_convert_float_to_str(), ar_convert_str_to_float(), ar_convert_to_float(), ar_cvt_str_to_float(), AR_divide(), ar_divide_complex(), AR_dshiftl(), AR_dshiftr(), AR_exp(), ar_exp(), ar_i128to64(), ar_i64to128(), AR_ibits(), ar_ifadd128(), ar_ifdiv128(), ar_ifix128(), ar_iflt128(), ar_ifmul128(), AR_index(), AR_ishft(), AR_ishftc(), AR_leadz(), AR_log(), ar_log(), AR_make_complex(), AR_mask(), AR_mod(), AR_Modulo(), ar_negate_float(), AR_popcnt(), AR_poppar(), ar_power(), AR_scan(), AR_shiftl(), AR_shiftr(), AR_sqrt(), ar_sqrt(), AR_status(), ar_subtract_integer(), AR_verify(), bitoper(), and pvp_isnormal().

Here is the call graph for this function:

long CHECKMC ( const char *  mcname,
AR_HOST_SINT64 pdtwrd,
AR_HOST_SINT64 pdtstrt,
AR_HOST_SINT64 pdtlen,
AR_HOST_SINT64 mcindx,
AR_HOST_SINT64 mctype,
AR_HOST_SINT64 mcdef,
const char *  pmtname,
  ... 
)

Definition at line 65 of file miscmath.c.

Referenced by ar_host().

int GETPMC ( an_mc_table  a,
char *  b 
)

Definition at line 60 of file miscmath.c.

Referenced by ar_host(), get_machine_chars(), and init_cif().


Variable Documentation

AR_DATA AR_const_one = { 1, 0, 0, 0 }

Definition at line 79 of file miscmath.c.

Referenced by ar_isqrt64().

AR_DATA AR_const_two = { 2, 0, 0, 0 }

Definition at line 80 of file miscmath.c.

AR_DATA AR_const_zero = { 0, 0, 0, 0 }

Definition at line 78 of file miscmath.c.

Referenced by ar_convert_to_pointer(), ar_power(), and AR_subtract_ptr_ptr().

char USMID[] = "\n%Z%%M% %I% %G% %U%\n" [static]

Definition at line 1096 of file miscmath.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines