@@ -20,32 +20,36 @@ let _ = if part = 1 then Run.script_cpp (fun () ->
2020 !! Loop.tile (int 32 ) ~index:" bi" ~bound:TileDivides [cFor " i" ];
2121
2222 (* LATER: !! Variable.local_name ~var:"s" ~local_var:"t" [tSpanSeq [cForBody "bi"]]; *)
23- !! Sequence.intro ~mark:" t_scope" ~start:[tFirst; cForBody " bi" ] ~stop:[tLast; cForBody " bi" ] ();
24- !! Variable.local_name ~var:" s" ~local_var:" t" [cMark " t_scope" ];
25- !! Sequence.elim [cMark " t_scope" ];
23+ !! (
24+ Sequence.intro ~mark:" t_scope" ~start:[tFirst; cForBody " bi" ] ~stop:[tLast; cForBody " bi" ] ();
25+ Variable.local_name ~var:" s" ~local_var:" t" [cMark " t_scope" ];
26+ Sequence.elim [cMark " t_scope" ];
27+ );
2628
2729 (* DEPRECATED? !! Sequence_basic.insert (trm_let (new_var "d", typ_f32) (trm_get (trm_find_var "s" []))) [tFirst; cForBody "bi"]; *)
28- !! Variable.insert ~name:" d" ~typ:typ_f32 ~value:(trm_get (trm_find_var " s" [])) [cForBody " bi" ; tFirst];
30+ !! (
31+ Variable.insert ~name:" d" ~typ:typ_f32 ~value:(trm_get (trm_find_var " s" [])) [cForBody " bi" ; tFirst];
2932
30- (* at this line, the output is the equivalent of vectvectmul0_gen .cpp,
33+ (* at this line, the output is the equivalent of dot0_gen .cpp,
3134 beware that "==" needs to be replaced with "=." and all the "__is_true" must be removed;
3235 some +. and + need to be fixed
33- ----> LATER: tweak display so that the output of _after.cpp is exactly vectvectmul0 .cpp *)
36+ ----> LATER: tweak display so that the output of _after.cpp is exactly dot0 .cpp *)
3437(* )
3538
3639(* Part 2: *)
3740let _ = if part = 2 then Run.script_cpp ~filename:"vv1.cpp" (fun () ->
3841*)
3942 (* Why nbMulti? !! Accesses.shift_var ~inv:true ~factor:(trm_find_var "d" []) [nbMulti; cVarDef "t"]; *)
40- !! Accesses.shift_var ~inv:true ~factor:(trm_find_var " d" []) [cFor " bi" ; cVarDef " t" ];
41- !! Variable.inline [cVarDef " d" ];
42- !! Arith.simpl_surrounding_expr Arith.gather_rec [nbMulti; cVar " s" ];
43+ Accesses.shift_var ~inv:true ~factor:(trm_find_var " d" []) [cFor " bi" ; cVarDef " t" ];
44+ Variable.inline [cVarDef " d" ];
45+ Arith.simpl_surrounding_expr Arith.gather_rec [nbMulti; cVar " s" ];
46+ );
4347(* )
4448
4549(* Part 3: *)
4650let _ = if part = 3 then Run.script_cpp ~filename:"vv2.cpp" (fun () ->
4751*)
48- !! Resources.loop_minimize [cFor " i" ];
52+ (* !! Resources.loop_minimize [cFor "i"]; *)
4953
5054 !! Loop.hoist [cVarDef " t" ];
5155 !! Loop.fission [tBefore; cFor " bi" ; cWriteVar " s" ];
0 commit comments