source: src/ERTL/ERTL.ma @ 2466

Last change on this file since 2466 was 2286, checked in by tranquil, 8 years ago

Big update!

  • merge of all _paolo variants
  • reorganised some depends (in particular, Register and thus back-end laguages no longer have fake ASM dependency)
  • split I8051.ma spawning new BackEndOps?.ma

compiler.ma broken at the moment, but not by these changes as far as I can tell

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