[1270] | 1 | include "joint/Joint.ma". |
---|
[754] | 2 | |
---|
[2286] | 3 | inductive rtl_seq : Type[0] ≝ |
---|
| 4 | | rtl_stack_address: register → register → rtl_seq. |
---|
| 5 | |
---|
[2681] | 6 | definition RTL_uns ≝ mk_unserialized_params |
---|
[2286] | 7 | (* acc_a_reg ≝ *) register |
---|
| 8 | (* acc_b_reg ≝ *) register |
---|
| 9 | (* acc_a_arg ≝ *) psd_argument |
---|
| 10 | (* acc_b_arg ≝ *) psd_argument |
---|
| 11 | (* dpl_reg ≝ *) register |
---|
| 12 | (* dph_reg ≝ *) register |
---|
| 13 | (* dpl_arg ≝ *) psd_argument |
---|
| 14 | (* dph_arg ≝ *) psd_argument |
---|
| 15 | (* snd_arg ≝ *) psd_argument |
---|
| 16 | (* pair_move ≝ *) (register × psd_argument) |
---|
| 17 | (* call_args ≝ *) (list psd_argument) |
---|
| 18 | (* call_dest ≝ *) (list register) |
---|
| 19 | (* ext_seq ≝ *) rtl_seq |
---|
[2640] | 20 | (* ext_seq_labels ≝ *) (λ_.[]) |
---|
[2681] | 21 | (* has_tailcalls ≝ *) false |
---|
[2640] | 22 | (* paramsT ≝ *) (list register). |
---|
[754] | 23 | |
---|
[2783] | 24 | definition RTL_functs ≝ mk_get_pseudo_reg_functs RTL_uns |
---|
| 25 | (* acc_a_regs *) (λr.[r]) |
---|
| 26 | (* acc_b_regs *) (λr.[r]) |
---|
| 27 | (* acc_a_args *) (λa. match a with [Reg r ⇒ [r] |Imm _ ⇒ [ ]]) |
---|
| 28 | (* acc_b_args *) (λa. match a with [Reg r ⇒ [r] |Imm _ ⇒ [ ]]) |
---|
| 29 | (* dpl_regs *) (λr.[r]) |
---|
| 30 | (* dph_regs *) (λr.[r]) |
---|
| 31 | (* dpl_args *) (λa. match a with [Reg r ⇒ [r] |Imm _ ⇒ [ ]]) |
---|
| 32 | (* dph_args *) (λa. match a with [Reg r ⇒ [r] |Imm _ ⇒ [ ]]) |
---|
| 33 | (* snd_args *) (λa. match a with [Reg r ⇒ [r] |Imm _ ⇒ [ ]]) |
---|
| 34 | (* pair_move_regs *) (λx.[\fst x] @ (match \snd x with [Reg r ⇒ [r] |Imm _ ⇒ [ ]])) |
---|
| 35 | (* f_call_args *) (λl.foldl ?? (λl1.λa.l1@(match a with [Reg r ⇒ [r] |Imm _ ⇒ [ ]])) [ ] l) |
---|
| 36 | (* f_call_dest *) (λx.x) |
---|
| 37 | (* ext_seq_regs *) (λext.match ext with [rtl_stack_address r1 r2 ⇒ [r1;r2]]) |
---|
| 38 | (* params_regs *) (λx.x). |
---|
| 39 | |
---|
| 40 | definition RTL ≝ mk_graph_params (mk_uns_params RTL_uns RTL_functs). |
---|
[2286] | 41 | definition rtl_program ≝ joint_program RTL. |
---|
[1270] | 42 | |
---|
[2286] | 43 | interpretation "move" 'mov r a = (MOVE RTL ? (mk_Prod ? psd_argument r a)). |
---|
[1275] | 44 | |
---|
[2286] | 45 | (* aid unification *) |
---|
| 46 | include "hints_declaration.ma". |
---|
| 47 | unification hint 0 ≔ |
---|
| 48 | (*---------------*) ⊢ |
---|
| 49 | acc_a_reg RTL ≡ register. |
---|
| 50 | unification hint 0 ≔ |
---|
| 51 | (*---------------*) ⊢ |
---|
| 52 | acc_b_reg RTL ≡ register. |
---|
| 53 | unification hint 0 ≔ |
---|
| 54 | (*---------------*) ⊢ |
---|
| 55 | acc_a_arg RTL ≡ psd_argument. |
---|
| 56 | unification hint 0 ≔ |
---|
| 57 | (*---------------*) ⊢ |
---|
| 58 | acc_b_arg RTL ≡ psd_argument. |
---|
| 59 | unification hint 0 ≔ |
---|
| 60 | (*---------------*) ⊢ |
---|
| 61 | dpl_reg RTL ≡ register. |
---|
| 62 | unification hint 0 ≔ |
---|
| 63 | (*---------------*) ⊢ |
---|
| 64 | dph_reg RTL ≡ register. |
---|
| 65 | unification hint 0 ≔ |
---|
| 66 | (*---------------*) ⊢ |
---|
| 67 | dpl_arg RTL ≡ psd_argument. |
---|
| 68 | unification hint 0 ≔ |
---|
| 69 | (*---------------*) ⊢ |
---|
| 70 | dph_arg RTL ≡ psd_argument. |
---|
| 71 | unification hint 0 ≔ |
---|
| 72 | (*---------------*) ⊢ |
---|
| 73 | snd_arg RTL ≡ psd_argument. |
---|
| 74 | unification hint 0 ≔ |
---|
| 75 | (*---------------*) ⊢ |
---|
| 76 | pair_move RTL ≡ register × psd_argument. |
---|
| 77 | unification hint 0 ≔ |
---|
| 78 | (*---------------*) ⊢ |
---|
| 79 | call_args RTL ≡ list psd_argument. |
---|
| 80 | unification hint 0 ≔ |
---|
| 81 | (*---------------*) ⊢ |
---|
| 82 | call_dest RTL ≡ list register. |
---|
[1275] | 83 | |
---|
[2286] | 84 | unification hint 0 ≔ |
---|
| 85 | (*---------------*) ⊢ |
---|
| 86 | ext_seq RTL ≡ rtl_seq. |
---|
[1275] | 87 | |
---|
[2286] | 88 | coercion reg_to_rtl_snd_argument : ∀r : register.snd_arg RTL ≝ psd_argument_from_reg |
---|
| 89 | on _r : register to snd_arg RTL. |
---|
| 90 | coercion byte_to_rtl_snd_argument : ∀b : Byte.snd_arg RTL ≝ psd_argument_from_byte |
---|
| 91 | on _b : Byte to snd_arg RTL. |
---|