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