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 - metrics - download
Index: B T

⟦64283019b⟧ TextFile

    Length: 2422 (0x976)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Instrument;
use Instrument;

-- This test evaluates the code efficiency of a call to a procedure
-- that has a single formal in out parameter of the constrained array
-- subtype TINY_T.  The bounds of the formal parameter are known at
-- compilation time.  (The test Constrained Parameter Association 01
-- MEDIUM uses the larger subtype MEDIUM_T.)

-- The procedure Param_Assoc is called in the test version using the
-- Outer array as the actual parameter.  The Outer array is referenced
-- inside the procedure through the formal parameter to ensure that the
-- required parameter passing is performed.  In the noise version, the
-- procedure Param_Assoc is parameterless and references only the Local
-- array so that there is no parameter passing overhead incurred.
-- Both the test and noise versions of the procedure perform the same
-- camouflaged assignment to Outer and Local, respectively.

-- The purpose of using local variables in the noise version is to
-- avoid uplevel referencing of the outer variables.  To prevent the
-- elimination of the local variables in the test version, the values
-- of the locals are used in the assignments just as they are in the
-- noise version.  The same number of assignments are performed in both
-- versions.

-- The test does not preclude the opportunity for the compiler to
-- optimize each version of the procedure call since this would not
-- compromise the code efficiency metrics.

procedure Capaa2 is
    package Pc_Cs is new Procs (Integer);
    use Pc_Cs;

    -- Array types

    type T_Array is array (Integer range <>) of T; -- unconstrained
    subtype Tiny_T is T_Array (-1 .. 1);           -- constrained

    Outer : Tiny_T := (others => Init);

    procedure Param_Assoc (Formal : in out Tiny_T)  -- included in test version
                  is

        Local : Tiny_T := (others => Init);
        I : Integer := Tiny_T'First;

    begin
        Let (Formal (I), Ident (Local (I)));  -- included in test version
        --Let(Local(I),  Ident(Local(I)));  -- included in noise version
    end Param_Assoc;

begin
    Start ("CAPAA2", "Constrained Array Param. Assoc. w/3 elements (test)");
    for I in 1 .. 10000 loop

        Param_Assoc (Formal => Outer);     -- included in test version
        --Param_Assoc;                        -- included in noise version
        Let (Global, Outer (Outer'First));

    end loop;
    Stop;

end Capaa2;