MICRONOTES
================================================================================
Note 21.0                   MicroVAX I Floating Point                 No replies
JAWS::KAISER                                        106 lines  25-MAR-1985 09:24
--------------------------------------------------------------------------------
      +---------------+					   +-----------------+
      | d i g i t a l |					   |  uNOTE # 021    |
      +---------------+					   +-----------------+


      +----------------------------------------------------+-----------------+
      | Title: Floating Point Considerations on MicroVAX I | Date: 10-Jan-85 |
      +----------------------------------------------------+-----------------+
      | Originator: Christopher DeMers			   | Page 1 of 2     |
      +----------------------------------------------------+-----------------+


      The MicroVAX architecture implements a subset of VAX data	 types.	  Four
      that  are	 part  of  the	VAX  architecture but not part of the MicroVAX
      architecture are the D_floating, F_floating, G_floating  and  H_floating
      data  types.   Floating point instructions that use these data types are
      likewise not part of the architecture.

      The MicroVAX I system implements	a  proper  superset  of	 the  MicroVAX
      architecture;   that  is, MicroVAX I uses the MicroVAX architecture, but
      implements a few items that are not defined  as  part  of	 the  MicroVAX
      architecture.   Even though the architecture specifies emulation support
      for floating point,  the	following  data	 types	and  instructions  are
      supported in the MicroVAX I microcode:

		- F_float
		- D_float
		- G_float

      The F_float data type and instructions are standard on the  MicroVAX  I.
      In  addition,  the  user	may  specify  EITHER D_float or G_float as the
      double precision instruction  set.   The	decision  to  use  D_float  or
      G_float depends on the application.

      Both D_float and	G_float	 are  double  precision	 floating  point  data
      types/instructions.  D_float is compatible with the PDP-11 format and is
      the double precision  floating  point  default  for  many	 of  Digital's
      compilers	 including FORTRAN, PL/I, BASIC and Pascal.  Therefore, if the
      application has been compiled, say, on a VAX-11/780,  with  the  default
      (D_float)	 and is not to be re-compiled before being run on the MicroVAX
      I, then choose the D_float option.  The compilers mentioned above have a
      switch  that allows the generation of G_float instructions.  If you wish
      to choose the G_float option for your MicroVAX I, the program  needs  to
      be re-compiled with the G_float switch set.

      If Macro programs use a specific data type such  as  G_float,  then  the
      MicroVAX	I  will	 need to have the G_float option unless the program is
      modified so that the floating point instructions match the option chosen
      for the MicroVAX I.
									Page 2


      Note that even though a  program	uses  one  type	 of  double  precision
      floating	point  and  the	 MicroVAX  I  has  the other as an option, the
      program will run.	 A feature of the MicroVAX architecture	 is  that  all
      instructions  are	 executed.  The floating point instructions not chosen
      as a microcode option are emulated  in  software.	  An  instruction/data
      type mismatch could result in severe performance degradation.

      Another reason for choosing one double precision format over another  is
      the  size and accuracy of the data.  Both formats are 64 bits long.  The
      D_float range is 2.9E-37	to  1.7E38.   This  type  gives	 approximately
      sixteen  decimal digits precision.  G_float "steals" three bits from the
      fraction to give the exponent a larger  range.   The  G_float  range  is
      .56E-308	to  .9E308  and	 gives	approximately  fifteen	decimal digits
      precision.  The range of the number  is  increased  significantly	 while
      only reducing the precision by one decimal digit.

      H_float, the only other floating data type in the VAX  architecture,  is
      128  bits	 long  with  a	range  of  close to 10E5000 and a precision of
      thirty-three decimal digits.  H_float is not implemented as part of  the
      MicroVAX architecture.  It is, however, emulated in software.



			  Data Type Representations



				 F_Floating

			   15	      7 6	 0
			  +------------+----------+
			  |S| Exponent | Fraction |
			  +------------+----------+
			  |	  Fraction	  |
			  +-----------------------+
			   31			16




	       D_Floating				G_Floating


       15	  7 6	     0			 15	    4 3	       0
      +------------+----------+			+------------+----------+
      |S| Exponent | Fraction |			|S| Exponent | Fraction |
      +------------+----------+			+------------+----------+
      |	      Fraction	      |			|	Fraction	|
      +-----------------------+			+-----------------------+
      |	      Fraction	      |			|	Fraction	|
      +-----------------------+			+-----------------------+
      |	      Fraction	      |			|	Fraction	|
      +-----------------------+			+-----------------------+
       63		    48			 63		      48