1 | include "joint/Joint_paolo.ma". |
---|
2 | |
---|
3 | inductive rtl_seq : Type[0] ≝ |
---|
4 | | rtl_stack_address: register → register → rtl_seq. |
---|
5 | |
---|
6 | inductive rtl_call : Type[0] ≝ |
---|
7 | | rtl_call_ptr: register → register → list psd_argument → list register → rtl_call. |
---|
8 | |
---|
9 | inductive rtl_tailcall : Type[0] ≝ |
---|
10 | | rtl_tailcall_id: ident → list psd_argument → rtl_tailcall |
---|
11 | | rtl_tailcall_ptr: register → register → list psd_argument → rtl_tailcall. |
---|
12 | |
---|
13 | definition RTL_uns ≝ mk_unserialized_params |
---|
14 | (* acc_a_reg ≝ *) register |
---|
15 | (* acc_b_reg ≝ *) register |
---|
16 | (* acc_a_arg ≝ *) psd_argument |
---|
17 | (* acc_b_arg ≝ *) psd_argument |
---|
18 | (* dpl_reg ≝ *) register |
---|
19 | (* dph_reg ≝ *) register |
---|
20 | (* dpl_arg ≝ *) psd_argument |
---|
21 | (* dph_arg ≝ *) psd_argument |
---|
22 | (* snd_arg ≝ *) psd_argument |
---|
23 | (* pair_move ≝ *) (register × psd_argument) |
---|
24 | (* call_args ≝ *) (list psd_argument) |
---|
25 | (* call_dest ≝ *) (list register) |
---|
26 | (* ext_seq ≝ *) rtl_seq |
---|
27 | (* ext_call ≝ *) rtl_call |
---|
28 | (* ext_tailcall ≝ *) rtl_tailcall |
---|
29 | (* paramsT ≝ *) (list register) |
---|
30 | (* localsT ≝ *) register. |
---|
31 | |
---|
32 | definition RTL ≝ mk_graph_params RTL_uns. |
---|
33 | definition rtl_program ≝ joint_program RTL. |
---|
34 | |
---|
35 | interpretation "move" 'mov r a = (MOVE RTL ? (mk_Prod ? psd_argument r a)). |
---|
36 | |
---|
37 | (* aid unification *) |
---|
38 | include "hints_declaration.ma". |
---|
39 | unification hint 0 ≔ |
---|
40 | (*---------------*) ⊢ |
---|
41 | acc_a_reg RTL ≡ register. |
---|
42 | unification hint 0 ≔ |
---|
43 | (*---------------*) ⊢ |
---|
44 | acc_b_reg RTL ≡ register. |
---|
45 | unification hint 0 ≔ |
---|
46 | (*---------------*) ⊢ |
---|
47 | acc_a_arg RTL ≡ psd_argument. |
---|
48 | unification hint 0 ≔ |
---|
49 | (*---------------*) ⊢ |
---|
50 | acc_b_arg RTL ≡ psd_argument. |
---|
51 | unification hint 0 ≔ |
---|
52 | (*---------------*) ⊢ |
---|
53 | dpl_reg RTL ≡ register. |
---|
54 | unification hint 0 ≔ |
---|
55 | (*---------------*) ⊢ |
---|
56 | dph_reg RTL ≡ register. |
---|
57 | unification hint 0 ≔ |
---|
58 | (*---------------*) ⊢ |
---|
59 | dpl_arg RTL ≡ psd_argument. |
---|
60 | unification hint 0 ≔ |
---|
61 | (*---------------*) ⊢ |
---|
62 | dph_arg RTL ≡ psd_argument. |
---|
63 | unification hint 0 ≔ |
---|
64 | (*---------------*) ⊢ |
---|
65 | snd_arg RTL ≡ psd_argument. |
---|
66 | unification hint 0 ≔ |
---|
67 | (*---------------*) ⊢ |
---|
68 | pair_move RTL ≡ register × psd_argument. |
---|
69 | unification hint 0 ≔ |
---|
70 | (*---------------*) ⊢ |
---|
71 | call_args RTL ≡ list psd_argument. |
---|
72 | unification hint 0 ≔ |
---|
73 | (*---------------*) ⊢ |
---|
74 | call_dest RTL ≡ list register. |
---|
75 | |
---|
76 | unification hint 0 ≔ |
---|
77 | (*---------------*) ⊢ |
---|
78 | ext_seq RTL ≡ rtl_seq. |
---|
79 | unification hint 0 ≔ |
---|
80 | (*---------------*) ⊢ |
---|
81 | ext_call RTL ≡ rtl_call. |
---|
82 | unification hint 0 ≔ |
---|
83 | (*---------------*) ⊢ |
---|
84 | ext_tailcall RTL ≡ rtl_tailcall. |
---|
85 | |
---|
86 | coercion reg_to_rtl_snd_argument : ∀r : register.snd_arg RTL ≝ psd_argument_from_reg |
---|
87 | on _r : register to snd_arg RTL. |
---|
88 | coercion byte_to_rtl_snd_argument : ∀b : Byte.snd_arg RTL ≝ psd_argument_from_byte |
---|
89 | on _b : Byte to snd_arg RTL. |
---|
90 | |
---|
91 | |
---|
92 | (************ Same without tail calls ****************) |
---|
93 | |
---|
94 | definition RTL_ntc ≝ mk_graph_params (mk_unserialized_params |
---|
95 | (* acc_a_reg ≝ *) register |
---|
96 | (* acc_b_reg ≝ *) register |
---|
97 | (* acc_a_arg ≝ *) psd_argument |
---|
98 | (* acc_b_arg ≝ *) psd_argument |
---|
99 | (* dpl_reg ≝ *) register |
---|
100 | (* dph_reg ≝ *) register |
---|
101 | (* dpl_arg ≝ *) psd_argument |
---|
102 | (* dph_arg ≝ *) psd_argument |
---|
103 | (* snd_arg ≝ *) psd_argument |
---|
104 | (* pair_move ≝ *) (register × psd_argument) |
---|
105 | (* call_args ≝ *) (list psd_argument) |
---|
106 | (* call_dest ≝ *) (list register) |
---|
107 | (* ext_seq ≝ *) rtl_seq |
---|
108 | (* ext_call ≝ *) rtl_call |
---|
109 | (* ext_tailcall ≝ *) void |
---|
110 | (* paramsT ≝ *) (list register) |
---|
111 | (* localsT ≝ *) register). |
---|
112 | |
---|
113 | definition rtl_ntc_program ≝ joint_program RTL_ntc. |
---|