source: src/ERTL/ERTL_paolo.ma @ 2208

Last change on this file since 2208 was 2208, checked in by tranquil, 8 years ago
  • moving some code around
  • changed immediates to hold beval in general, not only bytes
  • fixed RTLabsToRTL after redefinitions in front end
File size: 3.4 KB
Line 
1include "joint/Joint_paolo.ma".
2include "RTL/RTL_paolo.ma".
3
4inductive move_dst: Type[0] ≝
5  | PSD: register → move_dst
6  | HDW: Register → move_dst.
7
8definition move_src ≝ argument move_dst.
9
10definition move_src_from_dst : move_dst → move_src ≝ Reg move_dst.
11coercion move_dst_to_src : ∀r : move_dst.move_src ≝ move_src_from_dst on _r : move_dst to move_src.
12
13definition psd_argument_move_src : psd_argument → move_src ≝
14  λarg.match arg with
15  [ Imm b ⇒ Imm ? b
16  | Reg r ⇒ Reg ? (PSD r)
17  ].
18coercion psd_argument_to_move_src : ∀a:psd_argument.move_src ≝
19  psd_argument_move_src on _a : psd_argument to move_src.
20
21inductive ertl_seq : Type[0] ≝
22  | ertl_new_frame: ertl_seq
23  | ertl_del_frame: ertl_seq
24  | ertl_frame_size: register → ertl_seq.
25
26definition ertl_uns_params ≝ mk_unserialized_params
27  (mk_step_params
28    (* acc_a_reg ≝ *) register
29    (* acc_b_reg ≝ *) register
30    (* acc_a_arg ≝ *) psd_argument
31    (* acc_b_arg ≝ *) psd_argument
32    (* dpl_reg   ≝ *) register
33    (* dph_reg   ≝ *) register
34    (* dpl_arg   ≝ *) psd_argument
35    (* dph_arg   ≝ *) psd_argument
36    (* snd_arg   ≝ *) psd_argument
37    (* pair_move ≝ *) (move_dst × move_src)
38    (* call_args ≝ *) ℕ
39    (* call_dest ≝ *) unit
40    (* ext_seq ≝ *) ertl_seq
41    (* ext_call ≝ *) void
42    (* ext_tailcall ≝ *) void
43  )
44  (mk_local_params
45    (mk_funct_params
46      (* resultT ≝ *) unit
47      (* paramsT ≝ *) ℕ)
48      (* localsT ≝ *) register).
49
50definition ertl_params ≝ mk_graph_params ertl_uns_params.
51definition ertl_program ≝ joint_program ertl_params.
52
53interpretation "move" 'mov r a = (MOVE ?? (mk_Prod move_dst move_src r a)).
54
55(* aid unification *)
56unification hint 0 ≔
57(*---------------*) ⊢
58pair_move ertl_params ≡ move_dst × move_src.
59unification hint 0 ≔
60(*---------------*) ⊢
61acc_a_reg ertl_params ≡ register.
62unification hint 0 ≔
63(*---------------*) ⊢
64acc_b_reg ertl_params ≡ register.
65unification hint 0 ≔
66(*---------------*) ⊢
67acc_a_arg ertl_params ≡ psd_argument.
68unification hint 0 ≔
69(*---------------*) ⊢
70acc_b_arg ertl_params ≡ psd_argument.
71unification hint 0 ≔
72(*---------------*) ⊢
73dpl_reg ertl_params ≡ register.
74unification hint 0 ≔
75(*---------------*) ⊢
76dph_reg ertl_params ≡ register.
77unification hint 0 ≔
78(*---------------*) ⊢
79dpl_arg ertl_params ≡ psd_argument.
80unification hint 0 ≔
81(*---------------*) ⊢
82dph_arg ertl_params ≡ psd_argument.
83unification hint 0 ≔
84(*---------------*) ⊢
85snd_arg ertl_params ≡ psd_argument.
86unification hint 0 ≔
87(*---------------*) ⊢
88call_args ertl_params ≡ ℕ.
89unification hint 0 ≔
90(*---------------*) ⊢
91call_dest ertl_params ≡ unit.
92
93unification hint 0 ≔
94(*---------------*) ⊢
95ext_seq ertl_params ≡ ertl_seq.
96unification hint 0 ≔
97(*---------------*) ⊢
98ext_call ertl_params ≡ void.
99unification hint 0 ≔
100(*---------------*) ⊢
101ext_tailcall ertl_params ≡ void.
102
103coercion reg_to_ertl_snd_argument : ∀r : register.snd_arg ertl_params ≝
104  psd_argument_from_reg
105  on _r : register to snd_arg ertl_params.
106coercion byte_to_ertl_snd_argument : ∀b : Byte.snd_arg ertl_params ≝
107  psd_argument_from_byte
108  on _b : Byte to snd_arg ertl_params.
109 
110definition ertl_seq_joint ≝ extension_seq ertl_params.
111coercion ertl_seq_to_joint_seq : ∀globals.∀s : ertl_seq.joint_seq ertl_params globals ≝ ertl_seq_joint
112  on _s : ertl_seq to joint_seq ertl_params.
113
Note: See TracBrowser for help on using the repository browser.