From d2159e300b2d5e017a3144c747d34949b2ff2769 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 2 Feb 2021 10:21:17 +0100 Subject: begin implementing select --- riscV/Asm.v | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'riscV/Asm.v') diff --git a/riscV/Asm.v b/riscV/Asm.v index d1946a06..9a4b2a57 100644 --- a/riscV/Asm.v +++ b/riscV/Asm.v @@ -63,10 +63,10 @@ Inductive freg: Type := | F24: freg | F25: freg | F26: freg | F27: freg | F28: freg | F29: freg | F30: freg | F31: freg. -Lemma ireg_eq: forall (x y: ireg), {x=y} + {x<>y}. +Definition ireg_eq: forall (x y: ireg), {x=y} + {x<>y}. Proof. decide equality. Defined. -Lemma ireg0_eq: forall (x y: ireg0), {x=y} + {x<>y}. +Definition ireg0_eq: forall (x y: ireg0), {x=y} + {x<>y}. Proof. decide equality. apply ireg_eq. Defined. Lemma freg_eq: forall (x y: freg), {x=y} + {x<>y}. @@ -348,6 +348,7 @@ Inductive instruction : Type := | Pbtbl (r: ireg) (tbl: list label) (**r N-way branch through a jump table *) | Pbuiltin: external_function -> list (builtin_arg preg) -> builtin_res preg -> instruction (**r built-in function (pseudo) *) + | Pselectl (rd: ireg) (rb: ireg0) (rt: ireg0) (rf: ireg0) | Pnop : instruction. (**r nop instruction *) @@ -954,6 +955,9 @@ Definition exec_instr (f: function) (i: instruction) (rs: regset) (m: mem) : out | _ => Stuck end end + | Pselectl rd rb rt rf => + Next (nextinstr (rs#rd <- (ExtValues.select01_long + (rs###rb) (rs###rt) (rs###rf)))) m | Plabel lbl => Next (nextinstr rs) m | Ploadsymbol rd s ofs => -- cgit