es40_float.h File Reference


Detailed Description

Contains floating point conversion code used by AlphaCPU.cpp.

We've chosen to keep the floating point values as 64-bit integers in the floating point registers, and to convert them to/from the host's native floating point format when required.

Id
es40_float.h,v 1.21 2008/03/14 15:30:52 iamcamiel Exp

X-1.19 Camiel Vanderhoeven 14-MAR-2008 1. More meaningful exceptions replace throwing (int) 1. 2. U64 macro replaces X64 macro.

X-1.18 Camiel Vanderhoeven 06-FEB-2008 Check for FPEN in old floating point code.

X-1.17 Camiel Vanderhoeven 05-FEB-2008 File restored. Only use new floating-point code when HAVE_NEW_FP has been defined.

X-1.16 Camiel Vanderhoeven 02-JAN-2008 Comments.

X-1.15 Camiel Vanderhoeven 28-DEC-2007 Keep the compiler happy.

X-1.14 Camiel Vanderhoeven 28-DEC-2007 Avoid compiler warnings.

X-1.13 Camiel Vanderhoeven 18-DEC-2007 Removed some messages.

X-1.12 Camiel Vanderhoeven 18-DEC-2007 Conversion to/from IEEE through a union on IEEE-machined.

X-1.11 Camiel Vanderhoeven 10-NOV-2007 Corrected IEEE conversion problem; made really sure no endless loops can occur in any of the host2xxx conversions.

X-1.10 Camiel Vanderhoeven 08-NOV-2007 Added itof_f for ITOFF instruction (load_f without VAX-swapping).

X-1.9 Camiel Vanderhoeven 08-NOV-2007 Restructured conversion routines. There now is a real difference between 32-bit and 64-bit floating point operations.

X-1.8 Camiel Vanderhoeven 07-NOV-2007 Fixed f2v to avoid endless loop.

X-1.7 Camiel Vanderhoeven 07-NOV-2007 Disabled some printf statements.

X-1.6 Eduardo Marcelo Serrat 31-OCT-2007 Fixed conversion routines.

X-1.5 Camiel Vanderhoeven 11-APR-2007 Explicitly convert integers to double for calls to log/pow.

X-1.4 Brian Wheeler 30-MAR-2007 Added a couple of typecasts to avoid compiler warnings

X-1.3 Camiel Vanderhoeven 30-MAR-2007 Added old changelog comments.

X-1.2 Camiel Vanderhoeven 28-MAR-2007 Properly put in all 64-bit constants as X64(...) instead of 0x...

X-1.1 Camiel Vanderhoeven 18-MAR-2007 File created to support basic floating point operations.

Author:
Camiel Vanderhoeven (camiel@camicom.com / http://www.camicom.com)

Definition in file es40_float.h.

#include <math.h>

Go to the source code of this file.

Defines

#define FLOAT_IS_IEEE   1
#define g2host   f2host
#define t2host   s2host

Functions

double f2host (u64 val)
 VAX (G or F) floating point to host conversion.
double d2host (u64 val)
 VAX (D) floating point to host conversion.
double s2host (u64 val)
 IEEE (S or T) floating point to host conversion.
bool i_isnan (u64 val)
 Check IEEE floating point value for NaN.
u64 host2f (double val)
 Host to VAX F floating point conversion.
u64 host2g (double val)
 Host to VAX G floating point conversion.
u64 host2d (double val)
 Host to VAX D floating point conversion.
u32 map_s (u32 val)
 Map an 8-bit IEEE (S) exponent to an 11-bit IEEE (T) exponent.
u64 host2s (double val)
 Host to 32-bit IEEE (S) floating point conversion.
u64 host2t (double val)
 Host to 64-bit IEEE (T) floating point conversion.
u32 store_f (u64 val)
 Perform the VAX-byte ordering swap + the SEF mapping necessary to store 32-bit VAX (F) floating point values to memory.
u64 store_g (u64 val)
 Perform the VAX-byte ordering swap necessary to store 64-bit VAX (G) floating point values to memory.
u64 load_f (u32 val)
 Perform the VAX-byte ordering swap + the SEF mapping necessary to load 32-bit VAX (F) floating point values from memory.
u64 itof_f (u64 val)
 Perform the SEF mapping necessary to load 32-bit VAX (F) floating point values from an integer register.
u64 load_g (u64 val)
 Perform the VAX-byte ordering swap necessary to load 64-bit VAX (G) floating point values from memory.
u64 load_s (u32 val)
 Perform the the SEF mapping necessary to load 32-bit IEEE (S) floating point values from memory.
u32 store_s (u64 val)
 Perform the the SEF mapping necessary to store 32-bit IEEE (S) floating point values to memory.


Define Documentation

#define FLOAT_IS_IEEE   1

Definition at line 102 of file es40_float.h.

#define g2host   f2host

Definition at line 128 of file es40_float.h.

#define t2host   s2host

Definition at line 208 of file es40_float.h.


Function Documentation

double d2host ( u64  val  )  [inline]

VAX (D) floating point to host conversion.

Converts the register-form of D foating point values to a double.

Definition at line 134 of file es40_float.h.

References LL, and U64.

double f2host ( u64  val  )  [inline]

VAX (G or F) floating point to host conversion.

Converts the register-form of F and G foating point values to a double.

Definition at line 108 of file es40_float.h.

References LL, and U64.

u64 host2d ( double  val  )  [inline]

Host to VAX D floating point conversion.

Converts a double to the register-form of D foating point values.

Definition at line 315 of file es40_float.h.

References LL, and U64.

u64 host2f ( double  val  )  [inline]

Host to VAX F floating point conversion.

Converts a double to the register-form of F foating point values.

Definition at line 225 of file es40_float.h.

References LL, and U64.

u64 host2g ( double  val  )  [inline]

Host to VAX G floating point conversion.

Converts a double to the register-form of G foating point values.

Definition at line 270 of file es40_float.h.

References LL, and U64.

u64 host2s ( double  val  )  [inline]

Host to 32-bit IEEE (S) floating point conversion.

Converts a double to the register-form of S foating point values.

Definition at line 375 of file es40_float.h.

References LL, map_s(), and U64.

u64 host2t ( double  val  )  [inline]

Host to 64-bit IEEE (T) floating point conversion.

Converts a double to the register-form of T foating point values.

Definition at line 445 of file es40_float.h.

References LL, and U64.

bool i_isnan ( u64  val  )  [inline]

Check IEEE floating point value for NaN.

Definition at line 213 of file es40_float.h.

References U64.

u64 itof_f ( u64  val  )  [inline]

Perform the SEF mapping necessary to load 32-bit VAX (F) floating point values from an integer register.

Definition at line 562 of file es40_float.h.

References LL, and U64.

u64 load_f ( u32  val  )  [inline]

Perform the VAX-byte ordering swap + the SEF mapping necessary to load 32-bit VAX (F) floating point values from memory.

Definition at line 544 of file es40_float.h.

References LL, and U64.

u64 load_g ( u64  val  )  [inline]

Perform the VAX-byte ordering swap necessary to load 64-bit VAX (G) floating point values from memory.

Definition at line 579 of file es40_float.h.

References LL, and U64.

u64 load_s ( u32  val  )  [inline]

Perform the the SEF mapping necessary to load 32-bit IEEE (S) floating point values from memory.

Definition at line 596 of file es40_float.h.

References map_s(), and U64.

u32 map_s ( u32  val  )  [inline]

Map an 8-bit IEEE (S) exponent to an 11-bit IEEE (T) exponent.

Definition at line 359 of file es40_float.h.

Referenced by host2s(), and load_s().

double s2host ( u64  val  )  [inline]

IEEE (S or T) floating point to host conversion.

Converts the register-form of S and T foating point values to a double.

Definition at line 158 of file es40_float.h.

References LL, and U64.

u32 store_f ( u64  val  )  [inline]

Perform the VAX-byte ordering swap + the SEF mapping necessary to store 32-bit VAX (F) floating point values to memory.

Definition at line 511 of file es40_float.h.

References LL, and U64.

u64 store_g ( u64  val  )  [inline]

Perform the VAX-byte ordering swap necessary to store 64-bit VAX (G) floating point values to memory.

Definition at line 527 of file es40_float.h.

References LL, and U64.

u32 store_s ( u64  val  )  [inline]

Perform the the SEF mapping necessary to store 32-bit IEEE (S) floating point values to memory.

Definition at line 607 of file es40_float.h.


SourceForge.net Logo
Project space on SourceForge.net