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

⟦f80217b43⟧ TextFile

    Length: 3083 (0xc0b)
    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;

-----------------------
-- Identity Simplification
-----------------------

--  This test evaluates the code improvement potential  that  results
--  from  the elimination of arithmetic operations in the computation
--  of an expression when the  opportunity  is  provided  to  perform
--  identity simplification.

--  The test procedures define  global  information.   A  conditional
--  statement encloses an optimizable and nonoptimizable redefinition
--  of Global_1 and Global_3 using an expression  that  evaluates  to
--  the  value  Init.   In the optimized test procedure the evaluated
--  expression contains a subexpression that can be simplified, while
--  in  the  nonoptimized  test  procedure  the  evaluated expression
--  cannot be simplified.  Consequently, no difference in the size of
--  the  procedures  is  expected  but the effect of the optimization
--  should be evident from the difference in execution  time  of  the
--  two  procedures  by  reducing the simplified subexpression to the
--  value 1 at compile-time.

--  The constant values used to implement the  test  are  defined  so
--  that  the  expressions  are  evaluated consistently for different
--  numeric types.  Camouflaging the conditional expression  prevents
--  other   unexpected   optimizations   that  would  invalidate  the
--  benchmark.

procedure Opisa2 is

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

    Zero : constant T := Init - Init;
    One : constant T := T (Init / Init);
    Two : constant T := One + One;
    Three : constant T := One + Two;
    Value : constant T := Init / Init;

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

begin

    Start ("OPISA2", "Optimization Perf., Identity 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_1 := Ident (Init / Init) + One -
                           T (T ((Global_2 + Zero) * One) / T (Global_2 * One));
            -- included in test version
            --          Two - T(T((Global_4 + Value) * Three)/T(Global_5 * Three));
            -- included in control version
        else

            Global_3 := Ident (Init / Init) + Two -
                           T (T ((Global_4 + Value) * Three) /
                              T (Global_5 * Three));
            -- included in test version
            --          One - T(T((Global_2 + Zero) * One)/T(Global_2 * One));
            -- 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 Opisa2;