(* *********************************************************************)
(*                                                                     *)
(*              The Compcert verified compiler                         *)
(*                                                                     *)
(*          Xavier Leroy, INRIA Paris-Rocquencourt                     *)
(*                                                                     *)
(*  Copyright Institut National de Recherche en Informatique et en     *)
(*  Automatique.  All rights reserved.  This file is distributed       *)
(*  under the terms of the INRIA Non-Commercial License Agreement.     *)
(*                                                                     *)
(* *********************************************************************)
(** ** Machine registers *)
(** The following type defines the machine registers that can be referenced as locations.  These include: - Integer registers that can be allocated to RTL pseudo-registers ([Rxx]). - Floating-point registers that can be allocated to RTL pseudo-registers ([Fxx]).  The type [mreg] does not include reserved machine registers such as the stack pointer, the link register, and the condition codes. *)
Inductive mreg: Type :=
(** Allocatable integer regs *)
| R0: mreg  | R1: mreg  | R2: mreg  | R3: mreg
| R4: mreg  | R5: mreg  | R6: mreg  | R7: mreg
| R8: mreg  | R9: mreg  | R10: mreg | R11: mreg
| R12: mreg
(** Allocatable double-precision float regs *)
| F0: mreg  | F1: mreg  | F2: mreg  | F3: mreg
| F4: mreg  | F5: mreg  | F6: mreg  | F7: mreg
| F8: mreg  | F9: mreg  | F10: mreg | F11: mreg
| F12: mreg | F13: mreg | F14: mreg | F15: mreg.

Lemma mreg_eq: forall (r1 r2: mreg), {r1 = r2} + {r1 <> r2}.
Instance Decidable_eq_mreg : forall (x y: mreg), Decidable (eq x y) := Decidable_eq mreg_eq.