DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T V

⟦641a9314d⟧ TextFile

    Length: 9946 (0x26da)
    Types: TextFile
    Names: »V«

Derivation

└─⟦afbc8121e⟧ Bits:30000532 8mm tape, Rational 1000, MC68020_OS2000 7_2_2
    └─ ⟦77aa8350c⟧ »DATA« 
        └─⟦f794ecd1d⟧ 
            └─⟦4c85d69e2⟧ 
                └─⟦this⟧ 

TextFile

--    The use of this system is subject to the software license terms and
--    conditions agreed upon between Rational and the Customer.
--
--                Copyright 1988 by Rational.
--
--                          RESTRICTED RIGHTS LEGEND
--
--    Use, duplication, or disclosure by the Government is subject to
--    restrictions as set forth in subdivision (b)(3)(ii) of the Rights in
--    Technical Data and Computer Software clause at 52.227-7013.
--
--
--                Rational
--                3320 Scott Boulevard
--                Santa Clara, California 95054-3197
--
--   PROPRIETARY AND CONFIDENTIAL INFORMATION OF RATIONAL;
--   USE OR COPYING WITHOUT EXPRESS WRITTEN AUTHORIZATION
--   IS STRICTLY PROHIBITED.  THIS MATERIAL IS PROTECTED AS
--   AN UNPUBLISHED WORK UNDER THE U.S. COPYRIGHT ACT OF
--   1976.  CREATED 1988.  ALL RIGHTS RESERVED.
--
--

with Unchecked_Conversion;

package M68k_Floats is

    subtype Single_Float is Float;

    type Single_Exponent is range 0 .. 2 ** 8 - 1;
    type Single_Fraction is range 0 .. 2 ** 23 - 1;

    type Single_Format is
        record
            Negative : Boolean;
            Exponent : Single_Exponent;
            Fraction : Single_Fraction;
        end record;

    for Single_Format use
        record at mod 4;
            Negative at 0 range 0 .. 0;
            Exponent at 0 range 1 .. 8;
            Fraction at 0 range 9 .. 31;
        end record;

    function Convert_Out is new Unchecked_Conversion (Source => Single_Float,
                                                      Target => Single_Format);
    function Convert_In  is new Unchecked_Conversion (Source => Single_Format,
                                                      Target => Single_Float);

\f

    subtype Double_Float is Long_Float;

    type Double_Exponent    is range 0 .. 2 ** 11 - 1;
    type Double_Fraction_Hi is range 0 .. 2 ** 20 - 1;
    type Double_Fraction_Lo is new Integer;

    type Double_Format is
        record
            Negative    : Boolean;
            Exponent    : Double_Exponent;
            Fraction_Hi : Double_Fraction_Hi;
            Fraction_Lo : Double_Fraction_Lo;
        end record;

    for Double_Format use
        record at mod 4;
            Negative    at 0 range 0 .. 0;
            Exponent    at 0 range 1 .. 11;
            Fraction_Hi at 0 range 12 .. 31;
            Fraction_Lo at 0 range 32 .. 63;
        end record;

    function Convert_Out is new Unchecked_Conversion (Source => Double_Float,
                                                      Target => Double_Format);
    function Convert_In  is new Unchecked_Conversion (Source => Double_Format,
                                                      Target => Double_Float);

\f

    type Extended_Exponent is range 0 .. 2 ** 15 - 1;
    type Extended_Fraction is new Integer;

    type Extended_Format is
        record
            Negative    : Boolean;
            Exponent    : Extended_Exponent;
            Fraction_Hi : Extended_Fraction;
            Fraction_Lo : Extended_Fraction;
        end record;

    subtype Extended_Float is Extended_Format;

    procedure Single_To_Extended (Source :     Single_Float;
                                  Target : out Extended_Float);
    procedure Double_To_Extended (Source :     Double_Float;
                                  Target : out Extended_Float);

    function Extended_To_Single (F : Extended_Float) return Single_Float;
    function Extended_To_Double (F : Extended_Float) return Double_Float;



\f

    type Decimal_Digit is range 0 .. 9;

    type Decimal_Array is array (Natural range <>) of Decimal_Digit;
    pragma Pack (Decimal_Array);

    type Packed_Format is
        record
            Negative_Mantissa : Boolean;
            Negative_Exponent : Boolean;
            Exponent          : Decimal_Array (0 .. 2);
            Expspare          : Decimal_Digit;
            Integral          : Decimal_Digit;
            Fraction          : Decimal_Array (0 .. 15);
        end record;

    subtype Packed_Float is Packed_Format;

    subtype K_Factor is Integer range -64 .. 17;

    procedure Single_To_Packed  (Source :     Single_Float;
                                 Target : out Packed_Float;
                                 K      :     K_Factor := K_Factor'Last);
    procedure Double_To_Packed  (Source :     Double_Float;
                                 Target : out Packed_Float;
                                 K      :     K_Factor := K_Factor'Last);
    procedure Integer_To_Packed (Source :     Integer;
                                 Target : out Packed_Float;
                                 K      :     K_Factor := K_Factor'Last);

    function Packed_To_Single (F : Packed_Float) return Single_Float;
    function Packed_To_Double (F : Packed_Float) return Double_Float;

    procedure Extended_To_Packed (Source :     Extended_Float;
                                  Target : out Packed_Float;
                                  K      :     K_Factor := K_Factor'Last);
    procedure Packed_To_Extended (Source :     Packed_Float;
                                  Target : out Extended_Float);
\f

    -- Support for converting based floating point literals

    procedure Integer_To_Extended
                 (Value : Integer; Result : out Extended_Float);
    --
    -- Computes  Result := Extended_Float Value)


    procedure Accumulate_Digit (Digit :        Natural;
                                Fbase :        Extended_Float;
                                Value : in out Extended_Float);
    --
    -- Computes  Value := (Value * Fbase) + Float (Digit)


    procedure Binary_Exponentiate (Exponent :        Integer;
                                   Value    : in out Extended_Float);
    --
    -- Computes  Value := Value * (2 ** Exponent)


    procedure Based_Exponentiate (Exponent :        Integer;
                                  Fbase    :        Extended_Float;
                                  Value    : in out Extended_Float);
    --
    -- Computes  Value := Value * (Fbase ** Exponent)


    procedure Packed_Exponentiate (Exponent :     Integer;
                                   Value    :     Packed_Float;
                                   Result   : out Extended_Float);
    --
    -- Computes  Value := Value * (10 ** Exponent)

\f

private

    for Extended_Format use
        record at mod 4;
            Negative    at 0 range 0 .. 0;
            Exponent    at 0 range 1 .. 15;
            Fraction_Hi at 0 range 32 .. 63;
            Fraction_Lo at 0 range 64 .. 95;
        end record;

    for Packed_Format use
        record at mod 4;
            Negative_Mantissa at 0 range 0 .. 0;
            Negative_Exponent at 0 range 1 .. 1;
            Exponent          at 0 range 4 .. 15;
            Expspare          at 0 range 16 .. 19;
            Integral          at 0 range 28 .. 31;
            Fraction          at 0 range 32 .. 95;
        end record;

    pragma Interface (Asm, Single_To_Extended);
    pragma Import_Procedure (Single_To_Extended, "__SINGLE_TO_EXTENDED",
                             Mechanism => (Value, Reference));
    pragma Interface (Asm, Double_To_Extended);
    pragma Import_Procedure (Double_To_Extended, "__DOUBLE_TO_EXTENDED",
                             Mechanism => (Value, Reference));

    pragma Interface (Asm, Extended_To_Single);
    pragma Import_Function (Extended_To_Single, "__EXTENDED_TO_SINGLE",
                            Mechanism => (Reference));
    pragma Interface (Asm, Extended_To_Double);
    pragma Import_Function (Extended_To_Double, "__EXTENDED_TO_DOUBLE",
                            Mechanism => (Reference));

    pragma Interface (Asm, Integer_To_Extended);
    pragma Import_Procedure (Integer_To_Extended, "__INTEGER_TO_EXTENDED",
                             Mechanism => (Value, Reference));

    pragma Interface (Asm, Accumulate_Digit);
    pragma Import_Procedure (Accumulate_Digit, "__ACCUMULATE_DIGIT",
                             Mechanism => (Value, Reference, Reference));

    pragma Interface (Asm, Binary_Exponentiate);
    pragma Import_Procedure (Binary_Exponentiate, "__BINARY_EXPONENTIATE",
                             Mechanism => (Value, Reference));

    pragma Interface (Asm, Based_Exponentiate);
    pragma Import_Procedure (Based_Exponentiate, "__BASED_EXPONENTIATE",
                             Mechanism => (Value, Reference, Reference));

    pragma Interface (Asm, Packed_Exponentiate);
    pragma Import_Procedure (Packed_Exponentiate, "__PACKED_EXPONENTIATE",
                             Mechanism => (Value, Reference, Reference));


    pragma Interface (Asm, Single_To_Packed);
    pragma Import_Procedure (Single_To_Packed, "__SINGLE_TO_PACKED",
                             Mechanism => (Value, Reference, Value));
    pragma Interface (Asm, Double_To_Packed);
    pragma Import_Procedure (Double_To_Packed, "__DOUBLE_TO_PACKED",
                             Mechanism => (Value, Reference, Value));
    pragma Interface (Asm, Integer_To_Packed);
    pragma Import_Procedure (Integer_To_Packed, "__INTEGER_TO_PACKED",
                             Mechanism => (Value, Reference, Value));

    pragma Interface (Asm, Packed_To_Single);
    pragma Import_Function (Packed_To_Single, "__PACKED_TO_SINGLE",
                            Mechanism => (Reference));
    pragma Interface (Asm, Packed_To_Double);
    pragma Import_Function (Packed_To_Double, "__PACKED_TO_DOUBLE",
                            Mechanism => (Reference));

    pragma Interface (Asm, Extended_To_Packed);
    pragma Import_Procedure (Extended_To_Packed, "__EXTENDED_TO_PACKED",
                             Mechanism => (Reference, Reference, Value));
    pragma Interface (Asm, Packed_To_Extended);
    pragma Import_Procedure (Packed_To_Extended, "__PACKED_TO_EXTENDED",
                             Mechanism => (Reference, Reference));


end M68k_Floats;