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

⟦a91e60c6c⟧ TextFile

    Length: 3064 (0xbf8)
    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;

--------------------------
-- Distributed Simplification
--------------------------

--  This test evaluates a code  improvement  potential  that  results
--  from   the   elimination   of  an  arithmetic  operation  in  the
--  computation of an expression when the opportunity is provided for
--  expression   simplification   to  distribute  the  multiplication
--  operation.

--  The test procedures define  global  information.   A  conditional
--  statement encloses an optimizable and nonoptimizable redefinition
--  of Global_5 using an expression that evaluates to  the  value  of
--  Init.   In  the  optimized  test procedure the expression that is
--  evaluated contains a subexpression that can be simplified,  while
--  in  the  nonoptimized  test  procedure  the  expression  that  is
--  evaluated cannot be simplified.  Consequently, no  difference  in
--  the  size  of  the  procedures  is expected but the effect of the
--  expression simplification should be evident from  the  difference
--  in  execution  time of the two procedures by the elimination of a
--  redundant multiplication operation for a  subtraction  operation.
--  The  difference  should  be  more  significant  when the need for
--  numeric   conversion   is   only   required   for   the    single
--  multiplication;  i.e., T((Global_1 - Global_2) * Global_3).

--  Camouflaging the conditional expression prevents other unexpected
--  optimizations   that   would  invalidate  the  benchmark;   e.g.,
--  eliminating an unreachable arm of the conditional statement.

procedure Opdsa2 is

    package New_Procs is new Procs (Integer);
    use New_Procs;

    Global_1 : T;
    Global_2 : T;
    Global_3 : T;
    Global_4 : T;
    Global_5 : T;

begin

    Start ("OPDSA2", "Optimization Perf., Distributed Simp. (test)");
    for I in 1 .. 1000 loop

        Let (Global_1, Ident (Init / Init));
        Let (Global_2, Ident (Init / Init));
        Let (Global_3, Ident (Init / Init));
        Let (Global_4, Ident (Init / Init));
        Let (Global_5, Ident (Init / Init));

        if Ident (Init) = Init then

            --------optimize-------
            Global_5 := Ident (Init / Init) +
                           (T (Global_1 * Global_3) - T (Global_2 * Global_3));
            -- included in test version
            --                    (T(Global_1 * Global_2) -  T(Global_3 * Global_4));
            -- included in control version

        else

            Global_5 := Ident (Init / Init) +
                           (T (Global_1 * Global_2) - T (Global_3 * Global_4));
            -- included in test version
            --                    (T(Global_1 * Global_3) -  T(Global_2 * Global_3));
            -- included in control version

        end if;

        Let (Global_1, Ident (Init / Init));
        Let (Global_2, Ident (Init / Init));
        Let (Global_3, Ident (Init / Init));
        Let (Global_4, Ident (Init / Init));
        Let (Global_5, Ident (Init / Init));

    end loop;
    Stop;

end Opdsa2;