source: src/RTL/RTL.ma @ 2324

Last change on this file since 2324 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.5 KB
Line 
1include "joint/Joint.ma".
2
3inductive rtl_seq : Type[0] ≝
4  | rtl_stack_address: register → register → rtl_seq.
5 
6inductive rtl_call : Type[0] ≝
7  | rtl_call_ptr: register → register → list psd_argument → list register → rtl_call.
8
9inductive 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
13definition 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
32definition RTL ≝ mk_graph_params RTL_uns.
33definition rtl_program ≝ joint_program RTL.
34
35interpretation "move" 'mov r a = (MOVE RTL ? (mk_Prod ? psd_argument r a)).
36
37(* aid unification *)
38include "hints_declaration.ma".
39unification hint 0 ≔
40(*---------------*) ⊢
41acc_a_reg RTL ≡ register.
42unification hint 0 ≔
43(*---------------*) ⊢
44acc_b_reg RTL ≡ register.
45unification hint 0 ≔
46(*---------------*) ⊢
47acc_a_arg RTL ≡ psd_argument.
48unification hint 0 ≔
49(*---------------*) ⊢
50acc_b_arg RTL ≡ psd_argument.
51unification hint 0 ≔
52(*---------------*) ⊢
53dpl_reg RTL ≡ register.
54unification hint 0 ≔
55(*---------------*) ⊢
56dph_reg RTL ≡ register.
57unification hint 0 ≔
58(*---------------*) ⊢
59dpl_arg RTL ≡ psd_argument.
60unification hint 0 ≔
61(*---------------*) ⊢
62dph_arg RTL ≡ psd_argument.
63unification hint 0 ≔
64(*---------------*) ⊢
65snd_arg RTL ≡ psd_argument.
66unification hint 0 ≔
67(*---------------*) ⊢
68pair_move RTL ≡ register × psd_argument.
69unification hint 0 ≔
70(*---------------*) ⊢
71call_args RTL ≡ list psd_argument.
72unification hint 0 ≔
73(*---------------*) ⊢
74call_dest RTL ≡ list register.
75
76unification hint 0 ≔
77(*---------------*) ⊢
78ext_seq RTL ≡ rtl_seq.
79unification hint 0 ≔
80(*---------------*) ⊢
81ext_call RTL ≡ rtl_call.
82unification hint 0 ≔
83(*---------------*) ⊢
84ext_tailcall RTL ≡ rtl_tailcall.
85
86coercion reg_to_rtl_snd_argument : ∀r : register.snd_arg RTL ≝ psd_argument_from_reg
87  on _r : register to snd_arg RTL.
88coercion 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
94definition 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
113definition rtl_ntc_program ≝ joint_program RTL_ntc.
Note: See TracBrowser for help on using the repository browser.