(*Generated by Lem from generated_definitions/lem/RV64/riscv.lem.*) open HolKernel Parse boolLib bossLib; open lem_pervasives_extraTheory sail2_instr_kindsTheory sail2_valuesTheory sail2_prompt_monadTheory sail2_operators_mwordsTheory sail2_promptTheory sail2_stringTheory riscv_typesTheory mem_metadataTheory riscv_extras_fdextTheory riscv_extrasTheory; val _ = numLib.prefer_num(); val _ = new_theory "riscv" (*Generated by Sail from riscv.*) (*open import Pervasives_extra*) (*open import Sail2_instr_kinds*) (*open import Sail2_values*) (*open import Sail2_string*) (*open import Sail2_operators_mwords*) (*open import Sail2_prompt_monad*) (*open import Sail2_prompt*) (*open import Riscv_types*) (*open import Mem_metadata*) (*open import Riscv_extras_fdext*) (*open import Riscv_extras*) (*val is_none : forall 'a. maybe 'a -> bool*) val _ = Define ` ((is_none:'a option -> bool) opt= ((case opt of SOME (_) => F | NONE => T )))`; (*val is_some : forall 'a. maybe 'a -> bool*) val _ = Define ` ((is_some:'a option -> bool) opt= ((case opt of SOME (_) => T | NONE => F )))`; (*val eq_unit : unit -> unit -> bool*) val _ = Define ` ((eq_unit:unit -> unit -> bool) _ _= T)`; (*val neq_bool : bool -> bool -> bool*) val _ = Define ` ((neq_bool:bool -> bool -> bool) x y= (~ (((x = y)))))`; (*val __id : integer -> integer*) val _ = Define ` ((id:int -> int) x= x)`; (*val _shl_int_general : ii -> ii -> ii*) val _ = Define ` ((shl_int_general:int -> int -> int) (m : ii) (n : ii)= (if ((n >= (( 0 : int):ii))) then shl_int m n else shr_int m ((~ n))))`; (*val _shr_int_general : ii -> ii -> ii*) val _ = Define ` ((shr_int_general:int -> int -> int) (m : ii) (n : ii)= (if ((n >= (( 0 : int):ii))) then shr_int m n else shl_int m ((~ n))))`; (*val fdiv_int : ii -> ii -> ii*) val _ = Define ` ((fdiv_int:int -> int -> int) (n : ii) (m : ii)= (if (((((n < (( 0 : int):ii))) /\ ((m > (( 0 : int):ii)))))) then ((tdiv_int ((n + (( 1 : int):ii))) m)) - (( 1 : int):ii) else if (((((n > (( 0 : int):ii))) /\ ((m < (( 0 : int):ii)))))) then ((tdiv_int ((n - (( 1 : int):ii))) m)) - (( 1 : int):ii) else tdiv_int n m))`; (*val fmod_int : ii -> ii -> ii*) val _ = Define ` ((fmod_int:int -> int -> int) (n : ii) (m : ii)= (n - ((m * ((fdiv_int n m))))))`; (*val concat_str_bits : forall 'n. Size 'n => string -> mword 'n -> string*) val _ = Define ` ((concat_str_bits:string -> 'n words$word -> string) str x= (STRCAT str ((string_of_bits x))))`; (*val concat_str_dec : string -> ii -> string*) val _ = Define ` ((concat_str_dec:string -> int -> string) str x= (STRCAT str ((dec_str x))))`; (*val sail_mask : forall 'len 'v. Size 'len, Size 'v => integer -> mword 'v -> mword 'len*) val _ = Define ` ((sail_mask:int -> 'v words$word -> 'len words$word) len v= (if ((len <= ((int_of_num (words$word_len v))))) then (vector_truncate v len : 'len words$word) else (zero_extend v len : 'len words$word)))`; (*val sail_ones : forall 'n. Size 'n => integer -> mword 'n*) val _ = Define ` ((sail_ones:int -> 'n words$word) n= ((not_vec ((zeros n : 'n words$word)) : 'n words$word)))`; (*val slice_mask : forall 'n. Size 'n => integer -> ii -> ii -> mword 'n*) val _ = Define ` ((slice_mask:int -> int -> int -> 'n words$word) n i l= (if ((l >= n)) then (shiftl ((sail_ones n : 'n words$word)) i : 'n words$word) else let (one1 : 'n words$word) = ((sail_mask n (0b1w : 1 words$word) : 'n words$word)) in (shiftl ((sub_vec ((shiftl one1 l : 'n words$word)) one1 : 'n words$word)) i : 'n words$word)))`; (*val read_kind_of_num : integer -> read_kind*) val _ = Define ` ((read_kind_of_num:int -> read_kind) arg_= (let l__292 = arg_ in if (((l__292 = (( 0 : int):ii)))) then Read_plain else if (((l__292 = (( 1 : int):ii)))) then Read_reserve else if (((l__292 = (( 2 : int):ii)))) then Read_acquire else if (((l__292 = (( 3 : int):ii)))) then Read_exclusive else if (((l__292 = (( 4 : int):ii)))) then Read_exclusive_acquire else if (((l__292 = (( 5 : int):ii)))) then Read_stream else if (((l__292 = (( 6 : int):ii)))) then Read_RISCV_acquire else if (((l__292 = (( 7 : int):ii)))) then Read_RISCV_strong_acquire else if (((l__292 = (( 8 : int):ii)))) then Read_RISCV_reserved else if (((l__292 = (( 9 : int):ii)))) then Read_RISCV_reserved_acquire else if (((l__292 = (( 10 : int):ii)))) then Read_RISCV_reserved_strong_acquire else Read_X86_locked))`; (*val num_of_read_kind : read_kind -> integer*) val _ = Define ` ((num_of_read_kind:read_kind -> int) arg_= ((case arg_ of Read_plain => (( 0 : int):ii) | Read_reserve => (( 1 : int):ii) | Read_acquire => (( 2 : int):ii) | Read_exclusive => (( 3 : int):ii) | Read_exclusive_acquire => (( 4 : int):ii) | Read_stream => (( 5 : int):ii) | Read_RISCV_acquire => (( 6 : int):ii) | Read_RISCV_strong_acquire => (( 7 : int):ii) | Read_RISCV_reserved => (( 8 : int):ii) | Read_RISCV_reserved_acquire => (( 9 : int):ii) | Read_RISCV_reserved_strong_acquire => (( 10 : int):ii) | Read_X86_locked => (( 11 : int):ii) )))`; (*val write_kind_of_num : integer -> write_kind*) val _ = Define ` ((write_kind_of_num:int -> write_kind) arg_= (let l__282 = arg_ in if (((l__282 = (( 0 : int):ii)))) then Write_plain else if (((l__282 = (( 1 : int):ii)))) then Write_conditional else if (((l__282 = (( 2 : int):ii)))) then Write_release else if (((l__282 = (( 3 : int):ii)))) then Write_exclusive else if (((l__282 = (( 4 : int):ii)))) then Write_exclusive_release else if (((l__282 = (( 5 : int):ii)))) then Write_RISCV_release else if (((l__282 = (( 6 : int):ii)))) then Write_RISCV_strong_release else if (((l__282 = (( 7 : int):ii)))) then Write_RISCV_conditional else if (((l__282 = (( 8 : int):ii)))) then Write_RISCV_conditional_release else if (((l__282 = (( 9 : int):ii)))) then Write_RISCV_conditional_strong_release else Write_X86_locked))`; (*val num_of_write_kind : write_kind -> integer*) val _ = Define ` ((num_of_write_kind:write_kind -> int) arg_= ((case arg_ of Write_plain => (( 0 : int):ii) | Write_conditional => (( 1 : int):ii) | Write_release => (( 2 : int):ii) | Write_exclusive => (( 3 : int):ii) | Write_exclusive_release => (( 4 : int):ii) | Write_RISCV_release => (( 5 : int):ii) | Write_RISCV_strong_release => (( 6 : int):ii) | Write_RISCV_conditional => (( 7 : int):ii) | Write_RISCV_conditional_release => (( 8 : int):ii) | Write_RISCV_conditional_strong_release => (( 9 : int):ii) | Write_X86_locked => (( 10 : int):ii) )))`; (*val a64_barrier_domain_of_num : integer -> a64_barrier_domain*) val _ = Define ` ((a64_barrier_domain_of_num:int -> a64_barrier_domain) arg_= (let l__279 = arg_ in if (((l__279 = (( 0 : int):ii)))) then A64_FullShare else if (((l__279 = (( 1 : int):ii)))) then A64_InnerShare else if (((l__279 = (( 2 : int):ii)))) then A64_OuterShare else A64_NonShare))`; (*val num_of_a64_barrier_domain : a64_barrier_domain -> integer*) val _ = Define ` ((num_of_a64_barrier_domain:a64_barrier_domain -> int) arg_= ((case arg_ of A64_FullShare => (( 0 : int):ii) | A64_InnerShare => (( 1 : int):ii) | A64_OuterShare => (( 2 : int):ii) | A64_NonShare => (( 3 : int):ii) )))`; (*val a64_barrier_type_of_num : integer -> a64_barrier_type*) val _ = Define ` ((a64_barrier_type_of_num:int -> a64_barrier_type) arg_= (let l__277 = arg_ in if (((l__277 = (( 0 : int):ii)))) then A64_barrier_all else if (((l__277 = (( 1 : int):ii)))) then A64_barrier_LD else A64_barrier_ST))`; (*val num_of_a64_barrier_type : a64_barrier_type -> integer*) val _ = Define ` ((num_of_a64_barrier_type:a64_barrier_type -> int) arg_= ((case arg_ of A64_barrier_all => (( 0 : int):ii) | A64_barrier_LD => (( 1 : int):ii) | A64_barrier_ST => (( 2 : int):ii) )))`; (*val trans_kind_of_num : integer -> trans_kind*) val _ = Define ` ((trans_kind_of_num:int -> trans_kind) arg_= (let l__275 = arg_ in if (((l__275 = (( 0 : int):ii)))) then Transaction_start else if (((l__275 = (( 1 : int):ii)))) then Transaction_commit else Transaction_abort))`; (*val num_of_trans_kind : trans_kind -> integer*) val _ = Define ` ((num_of_trans_kind:trans_kind -> int) arg_= ((case arg_ of Transaction_start => (( 0 : int):ii) | Transaction_commit => (( 1 : int):ii) | Transaction_abort => (( 2 : int):ii) )))`; (*val cache_op_kind_of_num : integer -> cache_op_kind*) val _ = Define ` ((cache_op_kind_of_num:int -> cache_op_kind) arg_= (let l__265 = arg_ in if (((l__265 = (( 0 : int):ii)))) then Cache_op_D_IVAC else if (((l__265 = (( 1 : int):ii)))) then Cache_op_D_ISW else if (((l__265 = (( 2 : int):ii)))) then Cache_op_D_CSW else if (((l__265 = (( 3 : int):ii)))) then Cache_op_D_CISW else if (((l__265 = (( 4 : int):ii)))) then Cache_op_D_ZVA else if (((l__265 = (( 5 : int):ii)))) then Cache_op_D_CVAC else if (((l__265 = (( 6 : int):ii)))) then Cache_op_D_CVAU else if (((l__265 = (( 7 : int):ii)))) then Cache_op_D_CIVAC else if (((l__265 = (( 8 : int):ii)))) then Cache_op_I_IALLUIS else if (((l__265 = (( 9 : int):ii)))) then Cache_op_I_IALLU else Cache_op_I_IVAU))`; (*val num_of_cache_op_kind : cache_op_kind -> integer*) val _ = Define ` ((num_of_cache_op_kind:cache_op_kind -> int) arg_= ((case arg_ of Cache_op_D_IVAC => (( 0 : int):ii) | Cache_op_D_ISW => (( 1 : int):ii) | Cache_op_D_CSW => (( 2 : int):ii) | Cache_op_D_CISW => (( 3 : int):ii) | Cache_op_D_ZVA => (( 4 : int):ii) | Cache_op_D_CVAC => (( 5 : int):ii) | Cache_op_D_CVAU => (( 6 : int):ii) | Cache_op_D_CIVAC => (( 7 : int):ii) | Cache_op_I_IALLUIS => (( 8 : int):ii) | Cache_op_I_IALLU => (( 9 : int):ii) | Cache_op_I_IVAU => (( 10 : int):ii) )))`; (*val not_bit : bitU -> bitU*) val _ = Define ` ((not_bit0:bitU -> bitU) b= (if (((b = B1))) then B0 else B1))`; (*val string_of_bit : bitU -> string*) val _ = Define ` ((string_of_bit:bitU -> string) b= ((case b of B0 => "0b0" | B1 => "0b1" )))`; (*val get_config_print_instr : unit -> bool*) (*val get_config_print_reg : unit -> bool*) (*val get_config_print_mem : unit -> bool*) (*val get_config_print_platform : unit -> bool*) val _ = Define ` ((get_config_print_instr:unit -> bool) () = F)`; val _ = Define ` ((get_config_print_reg:unit -> bool) () = F)`; val _ = Define ` ((get_config_print_mem:unit -> bool) () = F)`; val _ = Define ` ((get_config_print_platform:unit -> bool) () = F)`; (*val EXTS : forall 'm 'n. Size 'm, Size 'n => integer -> mword 'n -> mword 'm*) (*val EXTZ : forall 'm 'n. Size 'm, Size 'n => integer -> mword 'n -> mword 'm*) val _ = Define ` ((EXTS:int -> 'n words$word -> 'm words$word) m v= ((sign_extend v m : 'm words$word)))`; val _ = Define ` ((EXTZ:int -> 'n words$word -> 'm words$word) m v= ((zero_extend v m : 'm words$word)))`; (*val zeros_implicit : forall 'n. Size 'n => integer -> mword 'n*) val _ = Define ` ((zeros_implicit:int -> 'n words$word) n= ((zeros n : 'n words$word)))`; (*val ones : forall 'n. Size 'n => integer -> mword 'n*) val _ = Define ` ((ones:int -> 'n words$word) n= ((sail_ones n : 'n words$word)))`; (*val bool_to_bits : bool -> mword ty1*) val _ = Define ` ((bool_to_bits:bool ->(1)words$word) x= (if x then (0b1w : 1 words$word) else (0b0w : 1 words$word)))`; (*val bit_to_bool : bitU -> bool*) val _ = Define ` ((bit_to_bool:bitU -> bool) b= ((case b of B1 => T | B0 => F )))`; (*val to_bits : forall 'l. Size 'l => integer -> ii -> mword 'l*) val _ = Define ` ((to_bits:int -> int -> 'l words$word) l n= ((get_slice_int l n (( 0 : int):ii) : 'l words$word)))`; (*val zopz0zI_s : forall 'n. Size 'n => mword 'n -> mword 'n -> bool*) (*val zopz0zKzJ_s : forall 'n. Size 'n => mword 'n -> mword 'n -> bool*) (*val zopz0zI_u : forall 'n. Size 'n => mword 'n -> mword 'n -> bool*) (*val zopz0zKzJ_u : forall 'n. Size 'n => mword 'n -> mword 'n -> bool*) (*val zopz0zIzJ_u : forall 'n. Size 'n => mword 'n -> mword 'n -> bool*) val _ = Define ` ((zopz0zI_s:'n words$word -> 'n words$word -> bool) x y= (((integer_word$w2i x)) < ((integer_word$w2i y))))`; val _ = Define ` ((zopz0zKzJ_s:'n words$word -> 'n words$word -> bool) x y= (((integer_word$w2i x)) >= ((integer_word$w2i y))))`; val _ = Define ` ((zopz0zI_u:'n words$word -> 'n words$word -> bool) x y= (((lem$w2ui x)) < ((lem$w2ui y))))`; val _ = Define ` ((zopz0zKzJ_u:'n words$word -> 'n words$word -> bool) x y= (((lem$w2ui x)) >= ((lem$w2ui y))))`; val _ = Define ` ((zopz0zIzJ_u:'n words$word -> 'n words$word -> bool) x y= (((lem$w2ui x)) <= ((lem$w2ui y))))`; (*val shift_right_arith64 : mword ty64 -> mword ty6 -> mword ty64*) val _ = Define ` ((shift_right_arith64:(64)words$word ->(6)words$word ->(64)words$word) (v : 64 bits) (shift : 6 bits)= (let (v128 : 128 bits) = ((EXTS (( 128 : int):ii) v : 128 words$word)) in (subrange_vec_dec ((shift_bits_right v128 shift : 128 words$word)) (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; (*val shift_right_arith32 : mword ty32 -> mword ty5 -> mword ty32*) val _ = Define ` ((shift_right_arith32:(32)words$word ->(5)words$word ->(32)words$word) (v : 32 bits) (shift : 5 bits)= (let (v64 : 64 bits) = ((EXTS (( 64 : int):ii) v : 64 words$word)) in (subrange_vec_dec ((shift_bits_right v64 shift : 64 words$word)) (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)))`; (*val spc_forwards : unit -> string*) (*val spc_backwards : string -> unit*) (*val spc_forwards_matches : unit -> bool*) (*val spc_backwards_matches : string -> bool*) (*val spc_matches_prefix : string -> maybe ((unit * ii))*) (*val opt_spc_forwards : unit -> string*) (*val opt_spc_backwards : string -> unit*) (*val opt_spc_forwards_matches : unit -> bool*) (*val opt_spc_backwards_matches : string -> bool*) (*val opt_spc_matches_prefix : string -> maybe ((unit * ii))*) (*val def_spc_forwards : unit -> string*) (*val def_spc_backwards : string -> unit*) (*val def_spc_forwards_matches : unit -> bool*) (*val def_spc_backwards_matches : string -> bool*) (*val def_spc_matches_prefix : string -> maybe ((unit * ii))*) (*val hex_bits_forwards : forall 'n. Size 'n => (integer * mword 'n) -> string*) (*val hex_bits_backwards : forall 'n. Size 'n => string -> (integer * mword 'n)*) (*val hex_bits_forwards_matches : forall 'n. Size 'n => (integer * mword 'n) -> bool*) (*val hex_bits_backwards_matches : string -> bool*) (*val hex_bits_matches_prefix : forall 'n. Size 'n => string -> maybe (((integer * mword 'n) * ii))*) (*val n_leading_spaces : string -> ii*) val n_leading_spaces0_defn = Hol_defn "n_leading_spaces0" ` ((n_leading_spaces0:string -> int) s= (let p0_ = s in if (((p0_ = ""))) then (( 0 : int):ii) else let p0_ = (string_take s (( 1 : int):ii)) in if (((p0_ = " "))) then (( 1 : int):ii) + ((n_leading_spaces0 ((string_drop s (( 1 : int):ii))))) else (( 0 : int):ii)))`; val _ = Lib.with_flag (computeLib.auto_import_definitions, false) Defn.save_defn n_leading_spaces0_defn; val _ = Define ` ((spc_forwards:unit -> string) () = " ")`; val _ = Define ` ((spc_backwards:string -> unit) s= () )`; val _ = Define ` ((spc_matches_prefix0:string ->(unit#int)option) s= (let n = (n_leading_spaces0 s) in let l__264 = n in if (((l__264 = (( 0 : int):ii)))) then NONE else SOME (() , n)))`; val _ = Define ` ((opt_spc_forwards:unit -> string) () = "")`; val _ = Define ` ((opt_spc_backwards:string -> unit) s= () )`; val _ = Define ` ((opt_spc_matches_prefix0:string ->(unit#int)option) s= (SOME (() , n_leading_spaces0 s)))`; val _ = Define ` ((def_spc_forwards:unit -> string) () = " ")`; val _ = Define ` ((def_spc_backwards:string -> unit) s= () )`; val _ = Define ` ((def_spc_matches_prefix:string ->(unit#ii)option) s= (opt_spc_matches_prefix0 s))`; (*val hex_bits_1_backwards : string -> M (mword ty1)*) (*val hex_bits_1_forwards_matches : mword ty1 -> bool*) (*val hex_bits_1_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_1_forwards_matches:(1)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_1_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_1_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 1 words$word # ii)) option)) of SOME ((g__373, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_1_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((1)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_1_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 1 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 49:2 - 51:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 49:2 - 51:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_2_backwards : string -> M (mword ty2)*) (*val hex_bits_2_forwards_matches : mword ty2 -> bool*) (*val hex_bits_2_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_2_forwards_matches:(2)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_2_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_2_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 2 words$word # ii)) option)) of SOME ((g__372, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_2_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((2)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_2_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 2 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 68:2 - 70:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 68:2 - 70:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_3_backwards : string -> M (mword ty3)*) (*val hex_bits_3_forwards_matches : mword ty3 -> bool*) (*val hex_bits_3_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_3_forwards_matches:(3)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_3_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_3_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 3 words$word # ii)) option)) of SOME ((g__371, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_3_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((3)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_3_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 3 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 87:2 - 89:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 87:2 - 89:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_4_backwards : string -> M (mword ty4)*) (*val hex_bits_4_forwards_matches : mword ty4 -> bool*) (*val hex_bits_4_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_4_forwards_matches:(4)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_4_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_4_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 4 words$word # ii)) option)) of SOME ((g__370, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_4_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((4)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_4_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 4 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 106:2 - 108:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 106:2 - 108:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_5_backwards : string -> M (mword ty5)*) (*val hex_bits_5_forwards_matches : mword ty5 -> bool*) (*val hex_bits_5_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_5_forwards_matches:(5)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_5_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 5 words$word # ii)) option)) of SOME ((g__369, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_5_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 5 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 125:2 - 127:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 125:2 - 127:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_6_backwards : string -> M (mword ty6)*) (*val hex_bits_6_forwards_matches : mword ty6 -> bool*) (*val hex_bits_6_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_6_forwards_matches:(6)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_6_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 6 words$word # ii)) option)) of SOME ((g__368, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_6_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((6)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 6 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 144:2 - 146:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 144:2 - 146:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_7_backwards : string -> M (mword ty7)*) (*val hex_bits_7_forwards_matches : mword ty7 -> bool*) (*val hex_bits_7_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_7_forwards_matches:(7)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_7_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 7 words$word # ii)) option)) of SOME ((g__367, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_7_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((7)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 7 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 163:2 - 165:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 163:2 - 165:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_8_backwards : string -> M (mword ty8)*) (*val hex_bits_8_forwards_matches : mword ty8 -> bool*) (*val hex_bits_8_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_8_forwards_matches:(8)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_8_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 8 words$word # ii)) option)) of SOME ((g__366, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_8_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((8)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 8 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 182:2 - 184:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 182:2 - 184:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_9_backwards : string -> M (mword ty9)*) (*val hex_bits_9_forwards_matches : mword ty9 -> bool*) (*val hex_bits_9_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_9_forwards_matches:(9)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_9_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_9_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 9 words$word # ii)) option)) of SOME ((g__365, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_9_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((9)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_9_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 9 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 201:2 - 203:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 201:2 - 203:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_10_backwards : string -> M (mword ty10)*) (*val hex_bits_10_forwards_matches : mword ty10 -> bool*) (*val hex_bits_10_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_10_forwards_matches:(10)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_10_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_10_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 10 words$word # ii)) option)) of SOME ((g__364, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_10_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((10)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_10_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 10 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 220:2 - 222:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 220:2 - 222:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_11_backwards : string -> M (mword ty11)*) (*val hex_bits_11_forwards_matches : mword ty11 -> bool*) (*val hex_bits_11_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_11_forwards_matches:(11)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_11_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_11_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 11 words$word # ii)) option)) of SOME ((g__363, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_11_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((11)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_11_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 11 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 239:2 - 241:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 239:2 - 241:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_12_backwards : string -> M (mword ty12)*) (*val hex_bits_12_forwards_matches : mword ty12 -> bool*) (*val hex_bits_12_backwards_matches : string -> bool*) (*val hex_bits_12_matches_prefix : string -> maybe ((mword ty12 * ii))*) val _ = Define ` ((hex_bits_12_forwards_matches:(12)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_12_matches_prefix0:string ->((12)words$word#ii)option) s= NONE)`; val _ = Define ` ((hex_bits_12_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_12_matches_prefix0 s : (( 12 words$word # ii)) option)) of SOME ((g__362, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_12_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((12)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_12_matches_prefix0 s : (( 12 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 262:2 - 264:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 262:2 - 264:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_13_backwards : string -> M (mword ty13)*) (*val hex_bits_13_forwards_matches : mword ty13 -> bool*) (*val hex_bits_13_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_13_forwards_matches:(13)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_13_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_13_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 13 words$word # ii)) option)) of SOME ((g__361, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_13_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((13)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_13_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 13 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 281:2 - 283:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 281:2 - 283:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_14_backwards : string -> M (mword ty14)*) (*val hex_bits_14_forwards_matches : mword ty14 -> bool*) (*val hex_bits_14_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_14_forwards_matches:(14)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_14_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_14_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 14 words$word # ii)) option)) of SOME ((g__360, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_14_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((14)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_14_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 14 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 300:2 - 302:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 300:2 - 302:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_15_backwards : string -> M (mword ty15)*) (*val hex_bits_15_forwards_matches : mword ty15 -> bool*) (*val hex_bits_15_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_15_forwards_matches:(15)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_15_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_15_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 15 words$word # ii)) option)) of SOME ((g__359, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_15_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((15)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_15_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 15 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 319:2 - 321:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 319:2 - 321:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_16_backwards : string -> M (mword ty16)*) (*val hex_bits_16_forwards_matches : mword ty16 -> bool*) (*val hex_bits_16_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_16_forwards_matches:(16)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_16_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_16_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 16 words$word # ii)) option)) of SOME ((g__358, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_16_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_16_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 16 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 338:2 - 340:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 338:2 - 340:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_17_backwards : string -> M (mword ty17)*) (*val hex_bits_17_forwards_matches : mword ty17 -> bool*) (*val hex_bits_17_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_17_forwards_matches:(17)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_17_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_17_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 17 words$word # ii)) option)) of SOME ((g__357, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_17_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((17)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_17_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 17 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 357:2 - 359:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 357:2 - 359:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_18_backwards : string -> M (mword ty18)*) (*val hex_bits_18_forwards_matches : mword ty18 -> bool*) (*val hex_bits_18_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_18_forwards_matches:(18)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_18_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_18_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 18 words$word # ii)) option)) of SOME ((g__356, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_18_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((18)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_18_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 18 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 376:2 - 378:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 376:2 - 378:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_19_backwards : string -> M (mword ty19)*) (*val hex_bits_19_forwards_matches : mword ty19 -> bool*) (*val hex_bits_19_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_19_forwards_matches:(19)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_19_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_19_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 19 words$word # ii)) option)) of SOME ((g__355, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_19_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((19)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_19_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 19 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 395:2 - 397:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 395:2 - 397:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_20_backwards : string -> M (mword ty20)*) (*val hex_bits_20_forwards_matches : mword ty20 -> bool*) (*val hex_bits_20_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_20_forwards_matches:(20)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_20_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_20_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 20 words$word # ii)) option)) of SOME ((g__354, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_20_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((20)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_20_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 20 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 414:2 - 416:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 414:2 - 416:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_21_backwards : string -> M (mword ty21)*) (*val hex_bits_21_forwards_matches : mword ty21 -> bool*) (*val hex_bits_21_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_21_forwards_matches:(21)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_21_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_21_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 21 words$word # ii)) option)) of SOME ((g__353, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_21_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((21)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_21_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 21 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 433:2 - 435:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 433:2 - 435:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_22_backwards : string -> M (mword ty22)*) (*val hex_bits_22_forwards_matches : mword ty22 -> bool*) (*val hex_bits_22_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_22_forwards_matches:(22)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_22_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_22_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 22 words$word # ii)) option)) of SOME ((g__352, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_22_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((22)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_22_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 22 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 452:2 - 454:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 452:2 - 454:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_23_backwards : string -> M (mword ty23)*) (*val hex_bits_23_forwards_matches : mword ty23 -> bool*) (*val hex_bits_23_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_23_forwards_matches:(23)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_23_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_23_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 23 words$word # ii)) option)) of SOME ((g__351, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_23_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((23)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_23_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 23 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 471:2 - 473:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 471:2 - 473:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_24_backwards : string -> M (mword ty24)*) (*val hex_bits_24_forwards_matches : mword ty24 -> bool*) (*val hex_bits_24_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_24_forwards_matches:(24)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_24_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_24_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 24 words$word # ii)) option)) of SOME ((g__350, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_24_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((24)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_24_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 24 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 490:2 - 492:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 490:2 - 492:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_25_backwards : string -> M (mword ty25)*) (*val hex_bits_25_forwards_matches : mword ty25 -> bool*) (*val hex_bits_25_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_25_forwards_matches:(25)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_25_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_25_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 25 words$word # ii)) option)) of SOME ((g__349, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_25_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((25)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_25_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 25 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 509:2 - 511:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 509:2 - 511:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_26_backwards : string -> M (mword ty26)*) (*val hex_bits_26_forwards_matches : mword ty26 -> bool*) (*val hex_bits_26_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_26_forwards_matches:(26)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_26_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_26_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 26 words$word # ii)) option)) of SOME ((g__348, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_26_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((26)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_26_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 26 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 528:2 - 530:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 528:2 - 530:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_27_backwards : string -> M (mword ty27)*) (*val hex_bits_27_forwards_matches : mword ty27 -> bool*) (*val hex_bits_27_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_27_forwards_matches:(27)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_27_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_27_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 27 words$word # ii)) option)) of SOME ((g__347, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_27_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((27)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_27_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 27 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 547:2 - 549:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 547:2 - 549:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_28_backwards : string -> M (mword ty28)*) (*val hex_bits_28_forwards_matches : mword ty28 -> bool*) (*val hex_bits_28_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_28_forwards_matches:(28)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_28_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_28_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 28 words$word # ii)) option)) of SOME ((g__346, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_28_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((28)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_28_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 28 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 566:2 - 568:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 566:2 - 568:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_29_backwards : string -> M (mword ty29)*) (*val hex_bits_29_forwards_matches : mword ty29 -> bool*) (*val hex_bits_29_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_29_forwards_matches:(29)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_29_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_29_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 29 words$word # ii)) option)) of SOME ((g__345, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_29_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((29)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_29_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 29 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 585:2 - 587:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 585:2 - 587:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_30_backwards : string -> M (mword ty30)*) (*val hex_bits_30_forwards_matches : mword ty30 -> bool*) (*val hex_bits_30_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_30_forwards_matches:(30)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_30_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_30_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 30 words$word # ii)) option)) of SOME ((g__344, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_30_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((30)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_30_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 30 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 604:2 - 606:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 604:2 - 606:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_31_backwards : string -> M (mword ty31)*) (*val hex_bits_31_forwards_matches : mword ty31 -> bool*) (*val hex_bits_31_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_31_forwards_matches:(31)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_31_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_31_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 31 words$word # ii)) option)) of SOME ((g__343, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_31_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((31)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_31_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 31 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 623:2 - 625:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 623:2 - 625:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_32_backwards : string -> M (mword ty32)*) (*val hex_bits_32_forwards_matches : mword ty32 -> bool*) (*val hex_bits_32_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_32_forwards_matches:(32)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_32_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_32_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 32 words$word # ii)) option)) of SOME ((g__342, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_32_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_32_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 32 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 642:2 - 644:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 642:2 - 644:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_33_backwards : string -> M (mword ty33)*) (*val hex_bits_33_forwards_matches : mword ty33 -> bool*) (*val hex_bits_33_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_33_forwards_matches:(33)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_33_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_33_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 33 words$word # ii)) option)) of SOME ((g__341, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_33_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((33)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_33_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 33 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 661:2 - 663:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 661:2 - 663:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_48_backwards : string -> M (mword ty48)*) (*val hex_bits_48_forwards_matches : mword ty48 -> bool*) (*val hex_bits_48_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_48_forwards_matches:(48)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_48_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_48_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 48 words$word # ii)) option)) of SOME ((g__340, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_48_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((48)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_48_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 48 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 680:2 - 682:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 680:2 - 682:3") (sail2_state_monad$exitS () ) )))`; (*val hex_bits_64_backwards : string -> M (mword ty64)*) (*val hex_bits_64_forwards_matches : mword ty64 -> bool*) (*val hex_bits_64_backwards_matches : string -> bool*) val _ = Define ` ((hex_bits_64_forwards_matches:(64)words$word -> bool) bv= T)`; val _ = Define ` ((hex_bits_64_backwards_matches:string -> bool) s= ((case s of s => if ((case ((hex_bits_64_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 64 words$word # ii)) option)) of SOME ((g__339, n)) => if (((n = ((string_length s))))) then T else F | _ => F )) then T else F )))`; val _ = Define ` ((hex_bits_64_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= ((case ((hex_bits_64_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s : (( 64 words$word # ii))option)) of SOME ((bv, n)) => if (((n = ((string_length s))))) then sail2_state_monad$returnS bv else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 699:2 - 701:3") (sail2_state_monad$exitS () ) | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/prelude_mapping.sail 699:2 - 701:3") (sail2_state_monad$exitS () ) )))`; val _ = Define ` ((default_meta:unit)= () )`; (*val __WriteRAM_Meta : mword ty64 -> integer -> unit -> M unit*) val _ = Define ` ((WriteRAM_Meta:(64)words$word -> int -> unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) addr width meta= (sail2_state_monad$returnS () ))`; (*val __ReadRAM_Meta : mword ty64 -> integer -> M unit*) val _ = Define ` ((ReadRAM_Meta:(64)words$word -> int ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) addr width= (sail2_state_monad$returnS () ))`; (*val write_ram_ea : write_kind -> mword ty64 -> integer -> M unit*) val _ = Define ` ((write_ram_ea:write_kind ->(64)words$word -> int ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) wk addr width= (sail2_state_monad$returnS () ))`; (*val __TraceMemoryWrite : forall 'm 'int8_times_n. Size 'm, Size 'int8_times_n => integer -> mword 'm -> mword 'int8_times_n -> unit*) (*val __TraceMemoryRead : forall 'm 'int8_times_n. Size 'm, Size 'int8_times_n => integer -> mword 'm -> mword 'int8_times_n -> unit*) val _ = Define ` ((init_ext_ptw:unit)= () )`; (*val ext_translate_exception : unit -> unit*) val _ = Define ` ((ext_translate_exception:unit -> unit) e= e)`; (*val ext_exc_type_to_bits : unit -> mword ty8*) val _ = Define ` ((ext_exc_type_to_bits:unit ->(8)words$word) e= ((0x18w : 8 words$word)))`; (*val num_of_ext_exc_type : unit -> integer*) val _ = Define ` ((num_of_ext_exc_type:unit -> int) e= ((( 24 : int):ii)))`; (*val ext_exc_type_to_str : unit -> string*) val _ = Define ` ((ext_exc_type_to_str:unit -> string) e= "extension-exception")`; val _ = Define ` ((xlen_val:int)= ((( 64 : int):ii)))`; val _ = Define ` ((xlen_max_unsigned:int)= ((( 18446744073709551615 : int):ii)))`; val _ = Define ` ((xlen_max_signed:int)= ((( 9223372036854775807 : int):ii)))`; val _ = Define ` ((xlen_min_signed:int)= (((( 0 : int)-( 9223372036854775808 : int)):ii)))`; (*val regidx_to_regno : mword ty5 -> integer*) val _ = Define ` ((regidx_to_regno:(5)words$word -> int) b= (let r = (lem$w2ui b) in r))`; (*val creg2reg_idx : mword ty3 -> mword ty5*) val _ = Define ` ((creg2reg_idx:(3)words$word ->(5)words$word) creg= ((concat_vec (0b01w : 2 words$word) creg : 5 words$word)))`; val _ = Define ` ((zreg:(5)words$word)= ((0b00000w : 5 words$word)))`; val _ = Define ` ((ra:(5)words$word)= ((0b00001w : 5 words$word)))`; val _ = Define ` ((sp:(5)words$word)= ((0b00010w : 5 words$word)))`; (*val Architecture_of_num : integer -> Architecture*) val _ = Define ` ((Architecture_of_num:int -> Architecture) arg_= (let l__262 = arg_ in if (((l__262 = (( 0 : int):ii)))) then RV32 else if (((l__262 = (( 1 : int):ii)))) then RV64 else RV128))`; (*val num_of_Architecture : Architecture -> integer*) val _ = Define ` ((num_of_Architecture:Architecture -> int) arg_= ((case arg_ of RV32 => (( 0 : int):ii) | RV64 => (( 1 : int):ii) | RV128 => (( 2 : int):ii) )))`; (*val architecture : mword ty2 -> maybe Architecture*) val _ = Define ` ((architecture:(2)words$word ->(Architecture)option) a= (let b__0 = a in if (((b__0 = (0b01w : 2 words$word)))) then SOME RV32 else if (((b__0 = (0b10w : 2 words$word)))) then SOME RV64 else if (((b__0 = (0b11w : 2 words$word)))) then SOME RV128 else NONE))`; (*val arch_to_bits : Architecture -> mword ty2*) val _ = Define ` ((arch_to_bits:Architecture ->(2)words$word) a= ((case a of RV32 => (0b01w : 2 words$word) | RV64 => (0b10w : 2 words$word) | RV128 => (0b11w : 2 words$word) )))`; (*val Privilege_of_num : integer -> Privilege*) val _ = Define ` ((Privilege_of_num:int -> Privilege) arg_= (let l__260 = arg_ in if (((l__260 = (( 0 : int):ii)))) then User else if (((l__260 = (( 1 : int):ii)))) then Supervisor else Machine))`; (*val num_of_Privilege : Privilege -> integer*) val _ = Define ` ((num_of_Privilege:Privilege -> int) arg_= ((case arg_ of User => (( 0 : int):ii) | Supervisor => (( 1 : int):ii) | Machine => (( 2 : int):ii) )))`; (*val privLevel_to_bits : Privilege -> mword ty2*) val _ = Define ` ((privLevel_to_bits:Privilege ->(2)words$word) p= ((case p of User => (0b00w : 2 words$word) | Supervisor => (0b01w : 2 words$word) | Machine => (0b11w : 2 words$word) )))`; (*val privLevel_of_bits : mword ty2 -> M Privilege*) val _ = Define ` ((privLevel_of_bits:(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Privilege),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) p= (let b__0 = p in if (((b__0 = (0b00w : 2 words$word)))) then sail2_state_monad$returnS User else if (((b__0 = (0b01w : 2 words$word)))) then sail2_state_monad$returnS Supervisor else if (((b__0 = (0b11w : 2 words$word)))) then sail2_state_monad$returnS Machine else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_types.sail 78:2 - 82:3") (sail2_state_monad$exitS () )))`; (*val privLevel_to_str : Privilege -> string*) val _ = Define ` ((privLevel_to_str:Privilege -> string) p= ((case p of User => "U" | Supervisor => "S" | Machine => "M" )))`; (*val accessType_to_str : AccessType unit -> string*) (*val csr_name : mword ty12 -> string*) (*val exceptionType_to_str : ExceptionType -> string*) (*val print_insn : ast -> M string*) (*val ptw_error_to_str : PTW_Error -> string*) (*val reg_name_abi : mword ty5 -> M string*) (*val Retired_of_num : integer -> Retired*) val _ = Define ` ((Retired_of_num:int -> Retired) arg_= (let l__259 = arg_ in if (((l__259 = (( 0 : int):ii)))) then RETIRE_SUCCESS else RETIRE_FAIL))`; (*val num_of_Retired : Retired -> integer*) val _ = Define ` ((num_of_Retired:Retired -> int) arg_= ((case arg_ of RETIRE_SUCCESS => (( 0 : int):ii) | RETIRE_FAIL => (( 1 : int):ii) )))`; (*val word_width_of_num : integer -> word_width*) val _ = Define ` ((word_width_of_num:int -> word_width) arg_= (let l__256 = arg_ in if (((l__256 = (( 0 : int):ii)))) then BYTE else if (((l__256 = (( 1 : int):ii)))) then HALF else if (((l__256 = (( 2 : int):ii)))) then WORD else DOUBLE))`; (*val num_of_word_width : word_width -> integer*) val _ = Define ` ((num_of_word_width:word_width -> int) arg_= ((case arg_ of BYTE => (( 0 : int):ii) | HALF => (( 1 : int):ii) | WORD => (( 2 : int):ii) | DOUBLE => (( 3 : int):ii) )))`; (*val InterruptType_of_num : integer -> InterruptType*) val _ = Define ` ((InterruptType_of_num:int -> InterruptType) arg_= (let l__248 = arg_ in if (((l__248 = (( 0 : int):ii)))) then I_U_Software else if (((l__248 = (( 1 : int):ii)))) then I_S_Software else if (((l__248 = (( 2 : int):ii)))) then I_M_Software else if (((l__248 = (( 3 : int):ii)))) then I_U_Timer else if (((l__248 = (( 4 : int):ii)))) then I_S_Timer else if (((l__248 = (( 5 : int):ii)))) then I_M_Timer else if (((l__248 = (( 6 : int):ii)))) then I_U_External else if (((l__248 = (( 7 : int):ii)))) then I_S_External else I_M_External))`; (*val num_of_InterruptType : InterruptType -> integer*) val _ = Define ` ((num_of_InterruptType:InterruptType -> int) arg_= ((case arg_ of I_U_Software => (( 0 : int):ii) | I_S_Software => (( 1 : int):ii) | I_M_Software => (( 2 : int):ii) | I_U_Timer => (( 3 : int):ii) | I_S_Timer => (( 4 : int):ii) | I_M_Timer => (( 5 : int):ii) | I_U_External => (( 6 : int):ii) | I_S_External => (( 7 : int):ii) | I_M_External => (( 8 : int):ii) )))`; (*val interruptType_to_bits : InterruptType -> mword ty8*) val _ = Define ` ((interruptType_to_bits:InterruptType ->(8)words$word) i= ((case i of I_U_Software => (0x00w : 8 words$word) | I_S_Software => (0x01w : 8 words$word) | I_M_Software => (0x03w : 8 words$word) | I_U_Timer => (0x04w : 8 words$word) | I_S_Timer => (0x05w : 8 words$word) | I_M_Timer => (0x07w : 8 words$word) | I_U_External => (0x08w : 8 words$word) | I_S_External => (0x09w : 8 words$word) | I_M_External => (0x0Bw : 8 words$word) )))`; (*val exceptionType_to_bits : ExceptionType -> mword ty8*) val _ = Define ` ((exceptionType_to_bits:ExceptionType ->(8)words$word) e= ((case e of E_Fetch_Addr_Align (() ) => (0x00w : 8 words$word) | E_Fetch_Access_Fault (() ) => (0x01w : 8 words$word) | E_Illegal_Instr (() ) => (0x02w : 8 words$word) | E_Breakpoint (() ) => (0x03w : 8 words$word) | E_Load_Addr_Align (() ) => (0x04w : 8 words$word) | E_Load_Access_Fault (() ) => (0x05w : 8 words$word) | E_SAMO_Addr_Align (() ) => (0x06w : 8 words$word) | E_SAMO_Access_Fault (() ) => (0x07w : 8 words$word) | E_U_EnvCall (() ) => (0x08w : 8 words$word) | E_S_EnvCall (() ) => (0x09w : 8 words$word) | E_Reserved_10 (() ) => (0x0Aw : 8 words$word) | E_M_EnvCall (() ) => (0x0Bw : 8 words$word) | E_Fetch_Page_Fault (() ) => (0x0Cw : 8 words$word) | E_Load_Page_Fault (() ) => (0x0Dw : 8 words$word) | E_Reserved_14 (() ) => (0x0Ew : 8 words$word) | E_SAMO_Page_Fault (() ) => (0x0Fw : 8 words$word) | E_Extension (e) => (ext_exc_type_to_bits e : 8 words$word) )))`; (*val num_of_ExceptionType : ExceptionType -> integer*) val _ = Define ` ((num_of_ExceptionType:ExceptionType -> int) e= ((case e of E_Fetch_Addr_Align (() ) => (( 0 : int):ii) | E_Fetch_Access_Fault (() ) => (( 1 : int):ii) | E_Illegal_Instr (() ) => (( 2 : int):ii) | E_Breakpoint (() ) => (( 3 : int):ii) | E_Load_Addr_Align (() ) => (( 4 : int):ii) | E_Load_Access_Fault (() ) => (( 5 : int):ii) | E_SAMO_Addr_Align (() ) => (( 6 : int):ii) | E_SAMO_Access_Fault (() ) => (( 7 : int):ii) | E_U_EnvCall (() ) => (( 8 : int):ii) | E_S_EnvCall (() ) => (( 9 : int):ii) | E_Reserved_10 (() ) => (( 10 : int):ii) | E_M_EnvCall (() ) => (( 11 : int):ii) | E_Fetch_Page_Fault (() ) => (( 12 : int):ii) | E_Load_Page_Fault (() ) => (( 13 : int):ii) | E_Reserved_14 (() ) => (( 14 : int):ii) | E_SAMO_Page_Fault (() ) => (( 15 : int):ii) | E_Extension (e) => num_of_ext_exc_type e )))`; val _ = Define ` ((exceptionType_to_str:ExceptionType -> string) e= ((case e of E_Fetch_Addr_Align (() ) => "misaligned-fetch" | E_Fetch_Access_Fault (() ) => "fetch-access-fault" | E_Illegal_Instr (() ) => "illegal-instruction" | E_Breakpoint (() ) => "breakpoint" | E_Load_Addr_Align (() ) => "misaligned-load" | E_Load_Access_Fault (() ) => "load-access-fault" | E_SAMO_Addr_Align (() ) => "misaliged-store/amo" | E_SAMO_Access_Fault (() ) => "store/amo-access-fault" | E_U_EnvCall (() ) => "u-call" | E_S_EnvCall (() ) => "s-call" | E_Reserved_10 (() ) => "reserved-0" | E_M_EnvCall (() ) => "m-call" | E_Fetch_Page_Fault (() ) => "fetch-page-fault" | E_Load_Page_Fault (() ) => "load-page-fault" | E_Reserved_14 (() ) => "reserved-1" | E_SAMO_Page_Fault (() ) => "store/amo-page-fault" | E_Extension (e) => ext_exc_type_to_str e )))`; (*val not_implemented : forall 'a. string -> M 'a*) val _ = Define ` ((not_implemented:string ->(regstate)sail2_state_monad$sequential_state ->(('a,(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) message= (sail2_state_monad$throwS (Error_not_implemented message)))`; (*val internal_error : forall 'a. string -> M 'a*) val _ = Define ` ((internal_error:string ->(regstate)sail2_state_monad$sequential_state ->(('a,(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= (sail2_state_monad$seqS (sail2_state_monad$assert_expS F s) (sail2_state_monad$exitS () )))`; (*val TrapVectorMode_of_num : integer -> TrapVectorMode*) val _ = Define ` ((TrapVectorMode_of_num:int -> TrapVectorMode) arg_= (let l__246 = arg_ in if (((l__246 = (( 0 : int):ii)))) then TV_Direct else if (((l__246 = (( 1 : int):ii)))) then TV_Vector else TV_Reserved))`; (*val num_of_TrapVectorMode : TrapVectorMode -> integer*) val _ = Define ` ((num_of_TrapVectorMode:TrapVectorMode -> int) arg_= ((case arg_ of TV_Direct => (( 0 : int):ii) | TV_Vector => (( 1 : int):ii) | TV_Reserved => (( 2 : int):ii) )))`; (*val trapVectorMode_of_bits : mword ty2 -> TrapVectorMode*) val _ = Define ` ((trapVectorMode_of_bits:(2)words$word -> TrapVectorMode) m= (let b__0 = m in if (((b__0 = (0b00w : 2 words$word)))) then TV_Direct else if (((b__0 = (0b01w : 2 words$word)))) then TV_Vector else TV_Reserved))`; (*val ExtStatus_of_num : integer -> ExtStatus*) val _ = Define ` ((ExtStatus_of_num:int -> ExtStatus) arg_= (let l__243 = arg_ in if (((l__243 = (( 0 : int):ii)))) then Off else if (((l__243 = (( 1 : int):ii)))) then Initial else if (((l__243 = (( 2 : int):ii)))) then Clean else Dirty))`; (*val num_of_ExtStatus : ExtStatus -> integer*) val _ = Define ` ((num_of_ExtStatus:ExtStatus -> int) arg_= ((case arg_ of Off => (( 0 : int):ii) | Initial => (( 1 : int):ii) | Clean => (( 2 : int):ii) | Dirty => (( 3 : int):ii) )))`; (*val extStatus_to_bits : ExtStatus -> mword ty2*) val _ = Define ` ((extStatus_to_bits:ExtStatus ->(2)words$word) e= ((case e of Off => (0b00w : 2 words$word) | Initial => (0b01w : 2 words$word) | Clean => (0b10w : 2 words$word) | Dirty => (0b11w : 2 words$word) )))`; (*val extStatus_of_bits : mword ty2 -> M ExtStatus*) val _ = Define ` ((extStatus_of_bits:(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((ExtStatus),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) e= (let b__0 = e in if (((b__0 = (0b00w : 2 words$word)))) then sail2_state_monad$returnS Off else if (((b__0 = (0b01w : 2 words$word)))) then sail2_state_monad$returnS Initial else if (((b__0 = (0b10w : 2 words$word)))) then sail2_state_monad$returnS Clean else if (((b__0 = (0b11w : 2 words$word)))) then sail2_state_monad$returnS Dirty else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_types.sail 281:2 - 286:3") (sail2_state_monad$exitS () )))`; (*val SATPMode_of_num : integer -> SATPMode*) val _ = Define ` ((SATPMode_of_num:int -> SATPMode) arg_= (let l__240 = arg_ in if (((l__240 = (( 0 : int):ii)))) then Sbare else if (((l__240 = (( 1 : int):ii)))) then Sv32 else if (((l__240 = (( 2 : int):ii)))) then Sv39 else Sv48))`; (*val num_of_SATPMode : SATPMode -> integer*) val _ = Define ` ((num_of_SATPMode:SATPMode -> int) arg_= ((case arg_ of Sbare => (( 0 : int):ii) | Sv32 => (( 1 : int):ii) | Sv39 => (( 2 : int):ii) | Sv48 => (( 3 : int):ii) )))`; (*val satp64Mode_of_bits : Architecture -> mword ty4 -> maybe SATPMode*) val _ = Define ` ((satp64Mode_of_bits:Architecture ->(4)words$word ->(SATPMode)option) (a : Architecture) (m : satp_mode)= ((case (a, m) of (g__338, b__0) => if (((b__0 = (0x0w : 4 words$word)))) then SOME Sbare else (case (g__338, b__0) of (RV32, b__0) => if (((b__0 = (0x1w : 4 words$word)))) then SOME Sv32 else (case (RV32, b__0) of (_, _) => NONE ) | (RV64, b__0) => if (((b__0 = (0x8w : 4 words$word)))) then SOME Sv39 else if (((b__0 = (0x9w : 4 words$word)))) then SOME Sv48 else (case (RV64, b__0) of (_, _) => NONE ) | (_, _) => NONE ) )))`; (*val uop_of_num : integer -> uop*) val _ = Define ` ((uop_of_num:int -> uop) arg_= (let l__239 = arg_ in if (((l__239 = (( 0 : int):ii)))) then RISCV_LUI else RISCV_AUIPC))`; (*val num_of_uop : uop -> integer*) val _ = Define ` ((num_of_uop:uop -> int) arg_= ((case arg_ of RISCV_LUI => (( 0 : int):ii) | RISCV_AUIPC => (( 1 : int):ii) )))`; (*val bop_of_num : integer -> bop*) val _ = Define ` ((bop_of_num:int -> bop) arg_= (let l__234 = arg_ in if (((l__234 = (( 0 : int):ii)))) then RISCV_BEQ else if (((l__234 = (( 1 : int):ii)))) then RISCV_BNE else if (((l__234 = (( 2 : int):ii)))) then RISCV_BLT else if (((l__234 = (( 3 : int):ii)))) then RISCV_BGE else if (((l__234 = (( 4 : int):ii)))) then RISCV_BLTU else RISCV_BGEU))`; (*val num_of_bop : bop -> integer*) val _ = Define ` ((num_of_bop:bop -> int) arg_= ((case arg_ of RISCV_BEQ => (( 0 : int):ii) | RISCV_BNE => (( 1 : int):ii) | RISCV_BLT => (( 2 : int):ii) | RISCV_BGE => (( 3 : int):ii) | RISCV_BLTU => (( 4 : int):ii) | RISCV_BGEU => (( 5 : int):ii) )))`; (*val iop_of_num : integer -> iop*) val _ = Define ` ((iop_of_num:int -> iop) arg_= (let l__229 = arg_ in if (((l__229 = (( 0 : int):ii)))) then RISCV_ADDI else if (((l__229 = (( 1 : int):ii)))) then RISCV_SLTI else if (((l__229 = (( 2 : int):ii)))) then RISCV_SLTIU else if (((l__229 = (( 3 : int):ii)))) then RISCV_XORI else if (((l__229 = (( 4 : int):ii)))) then RISCV_ORI else RISCV_ANDI))`; (*val num_of_iop : iop -> integer*) val _ = Define ` ((num_of_iop:iop -> int) arg_= ((case arg_ of RISCV_ADDI => (( 0 : int):ii) | RISCV_SLTI => (( 1 : int):ii) | RISCV_SLTIU => (( 2 : int):ii) | RISCV_XORI => (( 3 : int):ii) | RISCV_ORI => (( 4 : int):ii) | RISCV_ANDI => (( 5 : int):ii) )))`; (*val sop_of_num : integer -> sop*) val _ = Define ` ((sop_of_num:int -> sop) arg_= (let l__227 = arg_ in if (((l__227 = (( 0 : int):ii)))) then RISCV_SLLI else if (((l__227 = (( 1 : int):ii)))) then RISCV_SRLI else RISCV_SRAI))`; (*val num_of_sop : sop -> integer*) val _ = Define ` ((num_of_sop:sop -> int) arg_= ((case arg_ of RISCV_SLLI => (( 0 : int):ii) | RISCV_SRLI => (( 1 : int):ii) | RISCV_SRAI => (( 2 : int):ii) )))`; (*val rop_of_num : integer -> rop*) val _ = Define ` ((rop_of_num:int -> rop) arg_= (let l__218 = arg_ in if (((l__218 = (( 0 : int):ii)))) then RISCV_ADD else if (((l__218 = (( 1 : int):ii)))) then RISCV_SUB else if (((l__218 = (( 2 : int):ii)))) then RISCV_SLL else if (((l__218 = (( 3 : int):ii)))) then RISCV_SLT else if (((l__218 = (( 4 : int):ii)))) then RISCV_SLTU else if (((l__218 = (( 5 : int):ii)))) then RISCV_XOR else if (((l__218 = (( 6 : int):ii)))) then RISCV_SRL else if (((l__218 = (( 7 : int):ii)))) then RISCV_SRA else if (((l__218 = (( 8 : int):ii)))) then RISCV_OR else RISCV_AND))`; (*val num_of_rop : rop -> integer*) val _ = Define ` ((num_of_rop:rop -> int) arg_= ((case arg_ of RISCV_ADD => (( 0 : int):ii) | RISCV_SUB => (( 1 : int):ii) | RISCV_SLL => (( 2 : int):ii) | RISCV_SLT => (( 3 : int):ii) | RISCV_SLTU => (( 4 : int):ii) | RISCV_XOR => (( 5 : int):ii) | RISCV_SRL => (( 6 : int):ii) | RISCV_SRA => (( 7 : int):ii) | RISCV_OR => (( 8 : int):ii) | RISCV_AND => (( 9 : int):ii) )))`; (*val ropw_of_num : integer -> ropw*) val _ = Define ` ((ropw_of_num:int -> ropw) arg_= (let l__214 = arg_ in if (((l__214 = (( 0 : int):ii)))) then RISCV_ADDW else if (((l__214 = (( 1 : int):ii)))) then RISCV_SUBW else if (((l__214 = (( 2 : int):ii)))) then RISCV_SLLW else if (((l__214 = (( 3 : int):ii)))) then RISCV_SRLW else RISCV_SRAW))`; (*val num_of_ropw : ropw -> integer*) val _ = Define ` ((num_of_ropw:ropw -> int) arg_= ((case arg_ of RISCV_ADDW => (( 0 : int):ii) | RISCV_SUBW => (( 1 : int):ii) | RISCV_SLLW => (( 2 : int):ii) | RISCV_SRLW => (( 3 : int):ii) | RISCV_SRAW => (( 4 : int):ii) )))`; (*val sopw_of_num : integer -> sopw*) val _ = Define ` ((sopw_of_num:int -> sopw) arg_= (let l__212 = arg_ in if (((l__212 = (( 0 : int):ii)))) then RISCV_SLLIW else if (((l__212 = (( 1 : int):ii)))) then RISCV_SRLIW else RISCV_SRAIW))`; (*val num_of_sopw : sopw -> integer*) val _ = Define ` ((num_of_sopw:sopw -> int) arg_= ((case arg_ of RISCV_SLLIW => (( 0 : int):ii) | RISCV_SRLIW => (( 1 : int):ii) | RISCV_SRAIW => (( 2 : int):ii) )))`; (*val amoop_of_num : integer -> amoop*) val _ = Define ` ((amoop_of_num:int -> amoop) arg_= (let l__204 = arg_ in if (((l__204 = (( 0 : int):ii)))) then AMOSWAP else if (((l__204 = (( 1 : int):ii)))) then AMOADD else if (((l__204 = (( 2 : int):ii)))) then AMOXOR else if (((l__204 = (( 3 : int):ii)))) then AMOAND else if (((l__204 = (( 4 : int):ii)))) then AMOOR else if (((l__204 = (( 5 : int):ii)))) then AMOMIN else if (((l__204 = (( 6 : int):ii)))) then AMOMAX else if (((l__204 = (( 7 : int):ii)))) then AMOMINU else AMOMAXU))`; (*val num_of_amoop : amoop -> integer*) val _ = Define ` ((num_of_amoop:amoop -> int) arg_= ((case arg_ of AMOSWAP => (( 0 : int):ii) | AMOADD => (( 1 : int):ii) | AMOXOR => (( 2 : int):ii) | AMOAND => (( 3 : int):ii) | AMOOR => (( 4 : int):ii) | AMOMIN => (( 5 : int):ii) | AMOMAX => (( 6 : int):ii) | AMOMINU => (( 7 : int):ii) | AMOMAXU => (( 8 : int):ii) )))`; (*val csrop_of_num : integer -> csrop*) val _ = Define ` ((csrop_of_num:int -> csrop) arg_= (let l__202 = arg_ in if (((l__202 = (( 0 : int):ii)))) then CSRRW else if (((l__202 = (( 1 : int):ii)))) then CSRRS else CSRRC))`; (*val num_of_csrop : csrop -> integer*) val _ = Define ` ((num_of_csrop:csrop -> int) arg_= ((case arg_ of CSRRW => (( 0 : int):ii) | CSRRS => (( 1 : int):ii) | CSRRC => (( 2 : int):ii) )))`; (*val sep_forwards : unit -> string*) (*val sep_backwards : string -> M unit*) (*val sep_forwards_matches : unit -> bool*) (*val sep_backwards_matches : string -> bool*) (*val sep_matches_prefix : string -> maybe ((unit * ii))*) val _ = Define ` ((sep_forwards:unit -> string) arg_= ((case arg_ of () => string_append ((opt_spc_forwards () )) ((string_append "," ((string_append ((def_spc_forwards () )) "")))) )))`; (*val _s0_ : string -> maybe unit*) val _ = Define ` ((s0_:string ->(unit)option) s1_0= ((case s1_0 of s2_0 => (case ((opt_spc_matches_prefix0 s2_0)) of SOME ((() , s3_0)) => let s4_0 = (string_drop s2_0 s3_0) in if ((string_startswith s4_0 ",")) then (case ((string_drop s4_0 ((string_length ",")))) of s5_0 => (case ((def_spc_matches_prefix s5_0)) of SOME ((() , s6_0)) => let p0_ = (string_drop s5_0 s6_0) in if (((p0_ = ""))) then SOME () else NONE | _ => NONE ) ) else NONE | _ => NONE ) )))`; val _ = Define ` ((sep_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let s7_0 = arg_ in if ((case ((s0_ s7_0)) of SOME (() ) => T | _ => F )) then (case s0_ s7_0 of (SOME (() )) => sail2_state_monad$returnS () ) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((sep_forwards_matches:unit -> bool) arg_= ((case arg_ of () => T )))`; (*val _s8_ : string -> maybe unit*) val _ = Define ` ((s8_:string ->(unit)option) s9_0= ((case s9_0 of s10_0 => (case ((opt_spc_matches_prefix0 s10_0)) of SOME ((() , s11_0)) => let s12_0 = (string_drop s10_0 s11_0) in if ((string_startswith s12_0 ",")) then (case ((string_drop s12_0 ((string_length ",")))) of s13_0 => (case ((def_spc_matches_prefix s13_0)) of SOME ((() , s14_0)) => let p0_ = (string_drop s13_0 s14_0) in if (((p0_ = ""))) then SOME () else NONE | _ => NONE ) ) else NONE | _ => NONE ) )))`; val _ = Define ` ((sep_backwards_matches:string -> bool) arg_= (let s15_0 = arg_ in if ((case ((s8_ s15_0)) of SOME (() ) => T | _ => F )) then (case s8_ s15_0 of (SOME (() )) => T ) else F))`; (*val _s16_ : string -> maybe string*) val _ = Define ` ((s16_:string ->(string)option) s17_0= ((case s17_0 of s18_0 => (case ((opt_spc_matches_prefix0 s18_0)) of SOME ((() , s19_0)) => let s20_0 = (string_drop s18_0 s19_0) in if ((string_startswith s20_0 ",")) then (case ((string_drop s20_0 ((string_length ",")))) of s21_0 => (case ((def_spc_matches_prefix s21_0)) of SOME ((() , s22_0)) => (case ((string_drop s21_0 s22_0)) of s_ => SOME s_ ) | _ => NONE ) ) else NONE | _ => NONE ) )))`; val _ = Define ` ((sep_matches_prefix:string ->(unit#int)option) arg_= (let s23_0 = arg_ in if ((case ((s16_ s23_0)) of SOME (s_) => T | _ => F )) then (case s16_ s23_0 of (SOME (s_)) => SOME (() , ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val bool_bits_forwards : bool -> mword ty1*) (*val bool_bits_backwards : mword ty1 -> M bool*) (*val bool_bits_forwards_matches : bool -> bool*) (*val bool_bits_backwards_matches : mword ty1 -> bool*) val _ = Define ` ((bool_bits_forwards:bool ->(1)words$word) arg_= ((case arg_ of T => (0b1w : 1 words$word) | F => (0b0w : 1 words$word) )))`; val _ = Define ` ((bool_bits_backwards:(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then sail2_state_monad$returnS T else if (((b__0 = (0b0w : 1 words$word)))) then sail2_state_monad$returnS F else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bool_bits_forwards_matches:bool -> bool) arg_= ((case arg_ of T => T | F => T )))`; val _ = Define ` ((bool_bits_backwards_matches:(1)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then T else if (((b__0 = (0b0w : 1 words$word)))) then T else F))`; (*val bool_not_bits_forwards : bool -> mword ty1*) (*val bool_not_bits_backwards : mword ty1 -> M bool*) (*val bool_not_bits_forwards_matches : bool -> bool*) (*val bool_not_bits_backwards_matches : mword ty1 -> bool*) val _ = Define ` ((bool_not_bits_forwards:bool ->(1)words$word) arg_= ((case arg_ of T => (0b0w : 1 words$word) | F => (0b1w : 1 words$word) )))`; val _ = Define ` ((bool_not_bits_backwards:(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b0w : 1 words$word)))) then sail2_state_monad$returnS T else if (((b__0 = (0b1w : 1 words$word)))) then sail2_state_monad$returnS F else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bool_not_bits_forwards_matches:bool -> bool) arg_= ((case arg_ of T => T | F => T )))`; val _ = Define ` ((bool_not_bits_backwards_matches:(1)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b0w : 1 words$word)))) then T else if (((b__0 = (0b1w : 1 words$word)))) then T else F))`; (*val size_bits_forwards : word_width -> mword ty2*) (*val size_bits_backwards : mword ty2 -> M word_width*) (*val size_bits_forwards_matches : word_width -> bool*) (*val size_bits_backwards_matches : mword ty2 -> bool*) val _ = Define ` ((size_bits_forwards:word_width ->(2)words$word) arg_= ((case arg_ of BYTE => (0b00w : 2 words$word) | HALF => (0b01w : 2 words$word) | WORD => (0b10w : 2 words$word) | DOUBLE => (0b11w : 2 words$word) )))`; val _ = Define ` ((size_bits_backwards:(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((word_width),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b00w : 2 words$word)))) then sail2_state_monad$returnS BYTE else if (((b__0 = (0b01w : 2 words$word)))) then sail2_state_monad$returnS HALF else if (((b__0 = (0b10w : 2 words$word)))) then sail2_state_monad$returnS WORD else if (((b__0 = (0b11w : 2 words$word)))) then sail2_state_monad$returnS DOUBLE else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((size_bits_forwards_matches:word_width -> bool) arg_= ((case arg_ of BYTE => T | HALF => T | WORD => T | DOUBLE => T )))`; val _ = Define ` ((size_bits_backwards_matches:(2)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b00w : 2 words$word)))) then T else if (((b__0 = (0b01w : 2 words$word)))) then T else if (((b__0 = (0b10w : 2 words$word)))) then T else if (((b__0 = (0b11w : 2 words$word)))) then T else F))`; (*val size_mnemonic_forwards : word_width -> string*) (*val size_mnemonic_backwards : string -> M word_width*) (*val size_mnemonic_forwards_matches : word_width -> bool*) (*val size_mnemonic_backwards_matches : string -> bool*) (*val size_mnemonic_matches_prefix : string -> maybe ((word_width * ii))*) val _ = Define ` ((size_mnemonic_forwards:word_width -> string) arg_= ((case arg_ of BYTE => "b" | HALF => "h" | WORD => "w" | DOUBLE => "d" )))`; val _ = Define ` ((size_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((word_width),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "b"))) then sail2_state_monad$returnS BYTE else if (((p0_ = "h"))) then sail2_state_monad$returnS HALF else if (((p0_ = "w"))) then sail2_state_monad$returnS WORD else if (((p0_ = "d"))) then sail2_state_monad$returnS DOUBLE else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((size_mnemonic_forwards_matches:word_width -> bool) arg_= ((case arg_ of BYTE => T | HALF => T | WORD => T | DOUBLE => T )))`; val _ = Define ` ((size_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "b"))) then T else if (((p0_ = "h"))) then T else if (((p0_ = "w"))) then T else if (((p0_ = "d"))) then T else F))`; (*val _s36_ : string -> maybe string*) val _ = Define ` ((s36_:string ->(string)option) s37_0= (let s38_0 = s37_0 in if ((string_startswith s38_0 "d")) then (case ((string_drop s38_0 ((string_length "d")))) of s_ => SOME s_ ) else NONE))`; (*val _s32_ : string -> maybe string*) val _ = Define ` ((s32_:string ->(string)option) s33_0= (let s34_0 = s33_0 in if ((string_startswith s34_0 "w")) then (case ((string_drop s34_0 ((string_length "w")))) of s_ => SOME s_ ) else NONE))`; (*val _s28_ : string -> maybe string*) val _ = Define ` ((s28_:string ->(string)option) s29_0= (let s30_0 = s29_0 in if ((string_startswith s30_0 "h")) then (case ((string_drop s30_0 ((string_length "h")))) of s_ => SOME s_ ) else NONE))`; (*val _s24_ : string -> maybe string*) val _ = Define ` ((s24_:string ->(string)option) s25_0= (let s26_0 = s25_0 in if ((string_startswith s26_0 "b")) then (case ((string_drop s26_0 ((string_length "b")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((size_mnemonic_matches_prefix:string ->(word_width#int)option) arg_= (let s27_0 = arg_ in if ((case ((s24_ s27_0)) of SOME (s_) => T | _ => F )) then (case s24_ s27_0 of (SOME (s_)) => SOME (BYTE, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s28_ s27_0)) of SOME (s_) => T | _ => F )) then (case s28_ s27_0 of (SOME (s_)) => SOME (HALF, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s32_ s27_0)) of SOME (s_) => T | _ => F )) then (case s32_ s27_0 of (SOME (s_)) => SOME (WORD, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s36_ s27_0)) of SOME (s_) => T | _ => F )) then (case s36_ s27_0 of (SOME (s_)) => SOME (DOUBLE, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val word_width_bytes : word_width -> integer*) val _ = Define ` ((word_width_bytes:word_width -> int) width= ((case width of BYTE => (( 1 : int):ii) | HALF => (( 2 : int):ii) | WORD => (( 4 : int):ii) | DOUBLE => (( 8 : int):ii) )))`; val _ = Define ` ((Data:unit)= () )`; val _ = Define ` ((default_write_acc:unit)= () )`; val _ = Define ` ((accessType_to_str:(unit)AccessType -> string) a= ((case a of Read (_) => "R" | Write (_) => "W" | ReadWrite ((_, _)) => "RW" | Execute (() ) => "X" )))`; val _ = Define ` ((zero_reg:(64)words$word)= ((0x0000000000000000w : 64 words$word)))`; (*val RegStr : mword ty64 -> string*) val _ = Define ` ((RegStr:(64)words$word -> string) r= (string_of_bits r))`; (*val regval_from_reg : mword ty64 -> mword ty64*) val _ = Define ` ((regval_from_reg:(64)words$word ->(64)words$word) r= r)`; (*val regval_into_reg : mword ty64 -> mword ty64*) val _ = Define ` ((regval_into_reg:(64)words$word ->(64)words$word) v= v)`; val _ = Define ` ((zero_freg:(64)words$word)= ((0x0000000000000000w : 64 words$word)))`; (*val FRegStr : mword ty64 -> string*) val _ = Define ` ((FRegStr:(64)words$word -> string) r= (string_of_bits r))`; (*val fregval_from_freg : mword ty64 -> mword ty64*) val _ = Define ` ((fregval_from_freg:(64)words$word ->(64)words$word) r= r)`; (*val fregval_into_freg : mword ty64 -> mword ty64*) val _ = Define ` ((fregval_into_freg:(64)words$word ->(64)words$word) v= v)`; (*val rounding_mode_of_num : integer -> rounding_mode*) val _ = Define ` ((rounding_mode_of_num:int -> rounding_mode) arg_= (let l__197 = arg_ in if (((l__197 = (( 0 : int):ii)))) then RM_RNE else if (((l__197 = (( 1 : int):ii)))) then RM_RTZ else if (((l__197 = (( 2 : int):ii)))) then RM_RDN else if (((l__197 = (( 3 : int):ii)))) then RM_RUP else if (((l__197 = (( 4 : int):ii)))) then RM_RMM else RM_DYN))`; (*val num_of_rounding_mode : rounding_mode -> integer*) val _ = Define ` ((num_of_rounding_mode:rounding_mode -> int) arg_= ((case arg_ of RM_RNE => (( 0 : int):ii) | RM_RTZ => (( 1 : int):ii) | RM_RDN => (( 2 : int):ii) | RM_RUP => (( 3 : int):ii) | RM_RMM => (( 4 : int):ii) | RM_DYN => (( 5 : int):ii) )))`; (*val f_madd_op_S_of_num : integer -> f_madd_op_S*) val _ = Define ` ((f_madd_op_S_of_num:int -> f_madd_op_S) arg_= (let l__194 = arg_ in if (((l__194 = (( 0 : int):ii)))) then FMADD_S else if (((l__194 = (( 1 : int):ii)))) then FMSUB_S else if (((l__194 = (( 2 : int):ii)))) then FNMSUB_S else FNMADD_S))`; (*val num_of_f_madd_op_S : f_madd_op_S -> integer*) val _ = Define ` ((num_of_f_madd_op_S:f_madd_op_S -> int) arg_= ((case arg_ of FMADD_S => (( 0 : int):ii) | FMSUB_S => (( 1 : int):ii) | FNMSUB_S => (( 2 : int):ii) | FNMADD_S => (( 3 : int):ii) )))`; (*val f_bin_rm_op_S_of_num : integer -> f_bin_rm_op_S*) val _ = Define ` ((f_bin_rm_op_S_of_num:int -> f_bin_rm_op_S) arg_= (let l__191 = arg_ in if (((l__191 = (( 0 : int):ii)))) then FADD_S else if (((l__191 = (( 1 : int):ii)))) then FSUB_S else if (((l__191 = (( 2 : int):ii)))) then FMUL_S else FDIV_S))`; (*val num_of_f_bin_rm_op_S : f_bin_rm_op_S -> integer*) val _ = Define ` ((num_of_f_bin_rm_op_S:f_bin_rm_op_S -> int) arg_= ((case arg_ of FADD_S => (( 0 : int):ii) | FSUB_S => (( 1 : int):ii) | FMUL_S => (( 2 : int):ii) | FDIV_S => (( 3 : int):ii) )))`; (*val f_un_rm_op_S_of_num : integer -> f_un_rm_op_S*) val _ = Define ` ((f_un_rm_op_S_of_num:int -> f_un_rm_op_S) arg_= (let l__183 = arg_ in if (((l__183 = (( 0 : int):ii)))) then FSQRT_S else if (((l__183 = (( 1 : int):ii)))) then FCVT_W_S else if (((l__183 = (( 2 : int):ii)))) then FCVT_WU_S else if (((l__183 = (( 3 : int):ii)))) then FCVT_S_W else if (((l__183 = (( 4 : int):ii)))) then FCVT_S_WU else if (((l__183 = (( 5 : int):ii)))) then FCVT_L_S else if (((l__183 = (( 6 : int):ii)))) then FCVT_LU_S else if (((l__183 = (( 7 : int):ii)))) then FCVT_S_L else FCVT_S_LU))`; (*val num_of_f_un_rm_op_S : f_un_rm_op_S -> integer*) val _ = Define ` ((num_of_f_un_rm_op_S:f_un_rm_op_S -> int) arg_= ((case arg_ of FSQRT_S => (( 0 : int):ii) | FCVT_W_S => (( 1 : int):ii) | FCVT_WU_S => (( 2 : int):ii) | FCVT_S_W => (( 3 : int):ii) | FCVT_S_WU => (( 4 : int):ii) | FCVT_L_S => (( 5 : int):ii) | FCVT_LU_S => (( 6 : int):ii) | FCVT_S_L => (( 7 : int):ii) | FCVT_S_LU => (( 8 : int):ii) )))`; (*val f_un_op_S_of_num : integer -> f_un_op_S*) val _ = Define ` ((f_un_op_S_of_num:int -> f_un_op_S) arg_= (let l__181 = arg_ in if (((l__181 = (( 0 : int):ii)))) then FCLASS_S else if (((l__181 = (( 1 : int):ii)))) then FMV_X_W else FMV_W_X))`; (*val num_of_f_un_op_S : f_un_op_S -> integer*) val _ = Define ` ((num_of_f_un_op_S:f_un_op_S -> int) arg_= ((case arg_ of FCLASS_S => (( 0 : int):ii) | FMV_X_W => (( 1 : int):ii) | FMV_W_X => (( 2 : int):ii) )))`; (*val f_bin_op_S_of_num : integer -> f_bin_op_S*) val _ = Define ` ((f_bin_op_S_of_num:int -> f_bin_op_S) arg_= (let l__174 = arg_ in if (((l__174 = (( 0 : int):ii)))) then FSGNJ_S else if (((l__174 = (( 1 : int):ii)))) then FSGNJN_S else if (((l__174 = (( 2 : int):ii)))) then FSGNJX_S else if (((l__174 = (( 3 : int):ii)))) then FMIN_S else if (((l__174 = (( 4 : int):ii)))) then FMAX_S else if (((l__174 = (( 5 : int):ii)))) then FEQ_S else if (((l__174 = (( 6 : int):ii)))) then FLT_S else FLE_S))`; (*val num_of_f_bin_op_S : f_bin_op_S -> integer*) val _ = Define ` ((num_of_f_bin_op_S:f_bin_op_S -> int) arg_= ((case arg_ of FSGNJ_S => (( 0 : int):ii) | FSGNJN_S => (( 1 : int):ii) | FSGNJX_S => (( 2 : int):ii) | FMIN_S => (( 3 : int):ii) | FMAX_S => (( 4 : int):ii) | FEQ_S => (( 5 : int):ii) | FLT_S => (( 6 : int):ii) | FLE_S => (( 7 : int):ii) )))`; (*val f_madd_op_D_of_num : integer -> f_madd_op_D*) val _ = Define ` ((f_madd_op_D_of_num:int -> f_madd_op_D) arg_= (let l__171 = arg_ in if (((l__171 = (( 0 : int):ii)))) then FMADD_D else if (((l__171 = (( 1 : int):ii)))) then FMSUB_D else if (((l__171 = (( 2 : int):ii)))) then FNMSUB_D else FNMADD_D))`; (*val num_of_f_madd_op_D : f_madd_op_D -> integer*) val _ = Define ` ((num_of_f_madd_op_D:f_madd_op_D -> int) arg_= ((case arg_ of FMADD_D => (( 0 : int):ii) | FMSUB_D => (( 1 : int):ii) | FNMSUB_D => (( 2 : int):ii) | FNMADD_D => (( 3 : int):ii) )))`; (*val f_bin_rm_op_D_of_num : integer -> f_bin_rm_op_D*) val _ = Define ` ((f_bin_rm_op_D_of_num:int -> f_bin_rm_op_D) arg_= (let l__168 = arg_ in if (((l__168 = (( 0 : int):ii)))) then FADD_D else if (((l__168 = (( 1 : int):ii)))) then FSUB_D else if (((l__168 = (( 2 : int):ii)))) then FMUL_D else FDIV_D))`; (*val num_of_f_bin_rm_op_D : f_bin_rm_op_D -> integer*) val _ = Define ` ((num_of_f_bin_rm_op_D:f_bin_rm_op_D -> int) arg_= ((case arg_ of FADD_D => (( 0 : int):ii) | FSUB_D => (( 1 : int):ii) | FMUL_D => (( 2 : int):ii) | FDIV_D => (( 3 : int):ii) )))`; (*val f_un_rm_op_D_of_num : integer -> f_un_rm_op_D*) val _ = Define ` ((f_un_rm_op_D_of_num:int -> f_un_rm_op_D) arg_= (let l__158 = arg_ in if (((l__158 = (( 0 : int):ii)))) then FSQRT_D else if (((l__158 = (( 1 : int):ii)))) then FCVT_W_D else if (((l__158 = (( 2 : int):ii)))) then FCVT_WU_D else if (((l__158 = (( 3 : int):ii)))) then FCVT_D_W else if (((l__158 = (( 4 : int):ii)))) then FCVT_D_WU else if (((l__158 = (( 5 : int):ii)))) then FCVT_S_D else if (((l__158 = (( 6 : int):ii)))) then FCVT_D_S else if (((l__158 = (( 7 : int):ii)))) then FCVT_L_D else if (((l__158 = (( 8 : int):ii)))) then FCVT_LU_D else if (((l__158 = (( 9 : int):ii)))) then FCVT_D_L else FCVT_D_LU))`; (*val num_of_f_un_rm_op_D : f_un_rm_op_D -> integer*) val _ = Define ` ((num_of_f_un_rm_op_D:f_un_rm_op_D -> int) arg_= ((case arg_ of FSQRT_D => (( 0 : int):ii) | FCVT_W_D => (( 1 : int):ii) | FCVT_WU_D => (( 2 : int):ii) | FCVT_D_W => (( 3 : int):ii) | FCVT_D_WU => (( 4 : int):ii) | FCVT_S_D => (( 5 : int):ii) | FCVT_D_S => (( 6 : int):ii) | FCVT_L_D => (( 7 : int):ii) | FCVT_LU_D => (( 8 : int):ii) | FCVT_D_L => (( 9 : int):ii) | FCVT_D_LU => (( 10 : int):ii) )))`; (*val f_bin_op_D_of_num : integer -> f_bin_op_D*) val _ = Define ` ((f_bin_op_D_of_num:int -> f_bin_op_D) arg_= (let l__151 = arg_ in if (((l__151 = (( 0 : int):ii)))) then FSGNJ_D else if (((l__151 = (( 1 : int):ii)))) then FSGNJN_D else if (((l__151 = (( 2 : int):ii)))) then FSGNJX_D else if (((l__151 = (( 3 : int):ii)))) then FMIN_D else if (((l__151 = (( 4 : int):ii)))) then FMAX_D else if (((l__151 = (( 5 : int):ii)))) then FEQ_D else if (((l__151 = (( 6 : int):ii)))) then FLT_D else FLE_D))`; (*val num_of_f_bin_op_D : f_bin_op_D -> integer*) val _ = Define ` ((num_of_f_bin_op_D:f_bin_op_D -> int) arg_= ((case arg_ of FSGNJ_D => (( 0 : int):ii) | FSGNJN_D => (( 1 : int):ii) | FSGNJX_D => (( 2 : int):ii) | FMIN_D => (( 3 : int):ii) | FMAX_D => (( 4 : int):ii) | FEQ_D => (( 5 : int):ii) | FLT_D => (( 6 : int):ii) | FLE_D => (( 7 : int):ii) )))`; (*val f_un_op_D_of_num : integer -> f_un_op_D*) val _ = Define ` ((f_un_op_D_of_num:int -> f_un_op_D) arg_= (let l__149 = arg_ in if (((l__149 = (( 0 : int):ii)))) then FCLASS_D else if (((l__149 = (( 1 : int):ii)))) then FMV_X_D else FMV_D_X))`; (*val num_of_f_un_op_D : f_un_op_D -> integer*) val _ = Define ` ((num_of_f_un_op_D:f_un_op_D -> int) arg_= ((case arg_ of FCLASS_D => (( 0 : int):ii) | FMV_X_D => (( 1 : int):ii) | FMV_D_X => (( 2 : int):ii) )))`; (*val rX : integer -> M (mword ty64)*) val _ = Define ` ((rX:int ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r= (let l__117 = r in sail2_state_monad$bindS (if (((l__117 = (( 0 : int):ii)))) then sail2_state_monad$returnS zero_reg else if (((l__117 = (( 1 : int):ii)))) then (sail2_state_monad$read_regS x1_ref : ( 64 words$word) M) else if (((l__117 = (( 2 : int):ii)))) then (sail2_state_monad$read_regS x2_ref : ( 64 words$word) M) else if (((l__117 = (( 3 : int):ii)))) then (sail2_state_monad$read_regS x3_ref : ( 64 words$word) M) else if (((l__117 = (( 4 : int):ii)))) then (sail2_state_monad$read_regS x4_ref : ( 64 words$word) M) else if (((l__117 = (( 5 : int):ii)))) then (sail2_state_monad$read_regS x5_ref : ( 64 words$word) M) else if (((l__117 = (( 6 : int):ii)))) then (sail2_state_monad$read_regS x6_ref : ( 64 words$word) M) else if (((l__117 = (( 7 : int):ii)))) then (sail2_state_monad$read_regS x7_ref : ( 64 words$word) M) else if (((l__117 = (( 8 : int):ii)))) then (sail2_state_monad$read_regS x8_ref : ( 64 words$word) M) else if (((l__117 = (( 9 : int):ii)))) then (sail2_state_monad$read_regS x9_ref : ( 64 words$word) M) else if (((l__117 = (( 10 : int):ii)))) then (sail2_state_monad$read_regS x10_ref : ( 64 words$word) M) else if (((l__117 = (( 11 : int):ii)))) then (sail2_state_monad$read_regS x11_ref : ( 64 words$word) M) else if (((l__117 = (( 12 : int):ii)))) then (sail2_state_monad$read_regS x12_ref : ( 64 words$word) M) else if (((l__117 = (( 13 : int):ii)))) then (sail2_state_monad$read_regS x13_ref : ( 64 words$word) M) else if (((l__117 = (( 14 : int):ii)))) then (sail2_state_monad$read_regS x14_ref : ( 64 words$word) M) else if (((l__117 = (( 15 : int):ii)))) then (sail2_state_monad$read_regS x15_ref : ( 64 words$word) M) else if (((l__117 = (( 16 : int):ii)))) then (sail2_state_monad$read_regS x16_ref : ( 64 words$word) M) else if (((l__117 = (( 17 : int):ii)))) then (sail2_state_monad$read_regS x17_ref : ( 64 words$word) M) else if (((l__117 = (( 18 : int):ii)))) then (sail2_state_monad$read_regS x18_ref : ( 64 words$word) M) else if (((l__117 = (( 19 : int):ii)))) then (sail2_state_monad$read_regS x19_ref : ( 64 words$word) M) else if (((l__117 = (( 20 : int):ii)))) then (sail2_state_monad$read_regS x20_ref : ( 64 words$word) M) else if (((l__117 = (( 21 : int):ii)))) then (sail2_state_monad$read_regS x21_ref : ( 64 words$word) M) else if (((l__117 = (( 22 : int):ii)))) then (sail2_state_monad$read_regS x22_ref : ( 64 words$word) M) else if (((l__117 = (( 23 : int):ii)))) then (sail2_state_monad$read_regS x23_ref : ( 64 words$word) M) else if (((l__117 = (( 24 : int):ii)))) then (sail2_state_monad$read_regS x24_ref : ( 64 words$word) M) else if (((l__117 = (( 25 : int):ii)))) then (sail2_state_monad$read_regS x25_ref : ( 64 words$word) M) else if (((l__117 = (( 26 : int):ii)))) then (sail2_state_monad$read_regS x26_ref : ( 64 words$word) M) else if (((l__117 = (( 27 : int):ii)))) then (sail2_state_monad$read_regS x27_ref : ( 64 words$word) M) else if (((l__117 = (( 28 : int):ii)))) then (sail2_state_monad$read_regS x28_ref : ( 64 words$word) M) else if (((l__117 = (( 29 : int):ii)))) then (sail2_state_monad$read_regS x29_ref : ( 64 words$word) M) else if (((l__117 = (( 30 : int):ii)))) then (sail2_state_monad$read_regS x30_ref : ( 64 words$word) M) else if (((l__117 = (( 31 : int):ii)))) then (sail2_state_monad$read_regS x31_ref : ( 64 words$word) M) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "invalid register number") (sail2_state_monad$exitS () )) (\ (v : regtype) . sail2_state_monad$returnS ((regval_from_reg v : 64 words$word)))))`; (*val rvfi_wX : integer -> mword ty64 -> unit*) val _ = Define ` ((rvfi_wX:int ->(64)words$word -> unit) r v= () )`; (*val wX : integer -> mword ty64 -> M unit*) val _ = Define ` ((wX:int ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r in_v= (let v = ((regval_into_reg in_v : 64 words$word)) in let l__85 = r in sail2_state_monad$seqS (if (((l__85 = (( 0 : int):ii)))) then sail2_state_monad$returnS () else if (((l__85 = (( 1 : int):ii)))) then sail2_state_monad$write_regS x1_ref v else if (((l__85 = (( 2 : int):ii)))) then sail2_state_monad$write_regS x2_ref v else if (((l__85 = (( 3 : int):ii)))) then sail2_state_monad$write_regS x3_ref v else if (((l__85 = (( 4 : int):ii)))) then sail2_state_monad$write_regS x4_ref v else if (((l__85 = (( 5 : int):ii)))) then sail2_state_monad$write_regS x5_ref v else if (((l__85 = (( 6 : int):ii)))) then sail2_state_monad$write_regS x6_ref v else if (((l__85 = (( 7 : int):ii)))) then sail2_state_monad$write_regS x7_ref v else if (((l__85 = (( 8 : int):ii)))) then sail2_state_monad$write_regS x8_ref v else if (((l__85 = (( 9 : int):ii)))) then sail2_state_monad$write_regS x9_ref v else if (((l__85 = (( 10 : int):ii)))) then sail2_state_monad$write_regS x10_ref v else if (((l__85 = (( 11 : int):ii)))) then sail2_state_monad$write_regS x11_ref v else if (((l__85 = (( 12 : int):ii)))) then sail2_state_monad$write_regS x12_ref v else if (((l__85 = (( 13 : int):ii)))) then sail2_state_monad$write_regS x13_ref v else if (((l__85 = (( 14 : int):ii)))) then sail2_state_monad$write_regS x14_ref v else if (((l__85 = (( 15 : int):ii)))) then sail2_state_monad$write_regS x15_ref v else if (((l__85 = (( 16 : int):ii)))) then sail2_state_monad$write_regS x16_ref v else if (((l__85 = (( 17 : int):ii)))) then sail2_state_monad$write_regS x17_ref v else if (((l__85 = (( 18 : int):ii)))) then sail2_state_monad$write_regS x18_ref v else if (((l__85 = (( 19 : int):ii)))) then sail2_state_monad$write_regS x19_ref v else if (((l__85 = (( 20 : int):ii)))) then sail2_state_monad$write_regS x20_ref v else if (((l__85 = (( 21 : int):ii)))) then sail2_state_monad$write_regS x21_ref v else if (((l__85 = (( 22 : int):ii)))) then sail2_state_monad$write_regS x22_ref v else if (((l__85 = (( 23 : int):ii)))) then sail2_state_monad$write_regS x23_ref v else if (((l__85 = (( 24 : int):ii)))) then sail2_state_monad$write_regS x24_ref v else if (((l__85 = (( 25 : int):ii)))) then sail2_state_monad$write_regS x25_ref v else if (((l__85 = (( 26 : int):ii)))) then sail2_state_monad$write_regS x26_ref v else if (((l__85 = (( 27 : int):ii)))) then sail2_state_monad$write_regS x27_ref v else if (((l__85 = (( 28 : int):ii)))) then sail2_state_monad$write_regS x28_ref v else if (((l__85 = (( 29 : int):ii)))) then sail2_state_monad$write_regS x29_ref v else if (((l__85 = (( 30 : int):ii)))) then sail2_state_monad$write_regS x30_ref v else if (((l__85 = (( 31 : int):ii)))) then sail2_state_monad$write_regS x31_ref v else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "invalid register number") (sail2_state_monad$exitS () )) (sail2_state_monad$returnS (if (((r <> (( 0 : int):ii)))) then let (_ : unit) = (rvfi_wX r in_v) in if ((get_config_print_reg () )) then print_dbg ((STRCAT "x" ((STRCAT ((stringFromInteger r)) ((STRCAT " <- " ((RegStr v)))))))) else () else () ))))`; (*val rX_bits : mword ty5 -> M (mword ty64)*) val _ = Define ` ((rX_bits:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) i= ((rX ((lem$w2ui i)) : ( 64 words$word) M)))`; (*val wX_bits : mword ty5 -> mword ty64 -> M unit*) val _ = Define ` ((wX_bits:(5)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (i : 5 bits) (data : xlenbits)= (wX ((lem$w2ui i)) data))`; val _ = Define ` ((reg_name_abi:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r= (let b__0 = r in if (((b__0 = (0b00000w : 5 words$word)))) then sail2_state_monad$returnS "zero" else if (((b__0 = (0b00001w : 5 words$word)))) then sail2_state_monad$returnS "ra" else if (((b__0 = (0b00010w : 5 words$word)))) then sail2_state_monad$returnS "sp" else if (((b__0 = (0b00011w : 5 words$word)))) then sail2_state_monad$returnS "gp" else if (((b__0 = (0b00100w : 5 words$word)))) then sail2_state_monad$returnS "tp" else if (((b__0 = (0b00101w : 5 words$word)))) then sail2_state_monad$returnS "t0" else if (((b__0 = (0b00110w : 5 words$word)))) then sail2_state_monad$returnS "t1" else if (((b__0 = (0b00111w : 5 words$word)))) then sail2_state_monad$returnS "t2" else if (((b__0 = (0b01000w : 5 words$word)))) then sail2_state_monad$returnS "fp" else if (((b__0 = (0b01001w : 5 words$word)))) then sail2_state_monad$returnS "s1" else if (((b__0 = (0b01010w : 5 words$word)))) then sail2_state_monad$returnS "a0" else if (((b__0 = (0b01011w : 5 words$word)))) then sail2_state_monad$returnS "a1" else if (((b__0 = (0b01100w : 5 words$word)))) then sail2_state_monad$returnS "a2" else if (((b__0 = (0b01101w : 5 words$word)))) then sail2_state_monad$returnS "a3" else if (((b__0 = (0b01110w : 5 words$word)))) then sail2_state_monad$returnS "a4" else if (((b__0 = (0b01111w : 5 words$word)))) then sail2_state_monad$returnS "a5" else if (((b__0 = (0b10000w : 5 words$word)))) then sail2_state_monad$returnS "a6" else if (((b__0 = (0b10001w : 5 words$word)))) then sail2_state_monad$returnS "a7" else if (((b__0 = (0b10010w : 5 words$word)))) then sail2_state_monad$returnS "s2" else if (((b__0 = (0b10011w : 5 words$word)))) then sail2_state_monad$returnS "s3" else if (((b__0 = (0b10100w : 5 words$word)))) then sail2_state_monad$returnS "s4" else if (((b__0 = (0b10101w : 5 words$word)))) then sail2_state_monad$returnS "s5" else if (((b__0 = (0b10110w : 5 words$word)))) then sail2_state_monad$returnS "s6" else if (((b__0 = (0b10111w : 5 words$word)))) then sail2_state_monad$returnS "s7" else if (((b__0 = (0b11000w : 5 words$word)))) then sail2_state_monad$returnS "s8" else if (((b__0 = (0b11001w : 5 words$word)))) then sail2_state_monad$returnS "s9" else if (((b__0 = (0b11010w : 5 words$word)))) then sail2_state_monad$returnS "s10" else if (((b__0 = (0b11011w : 5 words$word)))) then sail2_state_monad$returnS "s11" else if (((b__0 = (0b11100w : 5 words$word)))) then sail2_state_monad$returnS "t3" else if (((b__0 = (0b11101w : 5 words$word)))) then sail2_state_monad$returnS "t4" else if (((b__0 = (0b11110w : 5 words$word)))) then sail2_state_monad$returnS "t5" else if (((b__0 = (0b11111w : 5 words$word)))) then sail2_state_monad$returnS "t6" else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_regs.sail 154:2 - 187:3") (sail2_state_monad$exitS () )))`; (*val reg_name_forwards : mword ty5 -> M string*) (*val reg_name_backwards : string -> M (mword ty5)*) (*val reg_name_forwards_matches : mword ty5 -> bool*) (*val reg_name_backwards_matches : string -> bool*) (*val reg_name_matches_prefix : string -> maybe ((mword ty5 * ii))*) val _ = Define ` ((reg_name_forwards:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b00000w : 5 words$word)))) then sail2_state_monad$returnS "zero" else if (((b__0 = (0b00001w : 5 words$word)))) then sail2_state_monad$returnS "ra" else if (((b__0 = (0b00010w : 5 words$word)))) then sail2_state_monad$returnS "sp" else if (((b__0 = (0b00011w : 5 words$word)))) then sail2_state_monad$returnS "gp" else if (((b__0 = (0b00100w : 5 words$word)))) then sail2_state_monad$returnS "tp" else if (((b__0 = (0b00101w : 5 words$word)))) then sail2_state_monad$returnS "t0" else if (((b__0 = (0b00110w : 5 words$word)))) then sail2_state_monad$returnS "t1" else if (((b__0 = (0b00111w : 5 words$word)))) then sail2_state_monad$returnS "t2" else if (((b__0 = (0b01000w : 5 words$word)))) then sail2_state_monad$returnS "fp" else if (((b__0 = (0b01001w : 5 words$word)))) then sail2_state_monad$returnS "s1" else if (((b__0 = (0b01010w : 5 words$word)))) then sail2_state_monad$returnS "a0" else if (((b__0 = (0b01011w : 5 words$word)))) then sail2_state_monad$returnS "a1" else if (((b__0 = (0b01100w : 5 words$word)))) then sail2_state_monad$returnS "a2" else if (((b__0 = (0b01101w : 5 words$word)))) then sail2_state_monad$returnS "a3" else if (((b__0 = (0b01110w : 5 words$word)))) then sail2_state_monad$returnS "a4" else if (((b__0 = (0b01111w : 5 words$word)))) then sail2_state_monad$returnS "a5" else if (((b__0 = (0b10000w : 5 words$word)))) then sail2_state_monad$returnS "a6" else if (((b__0 = (0b10001w : 5 words$word)))) then sail2_state_monad$returnS "a7" else if (((b__0 = (0b10010w : 5 words$word)))) then sail2_state_monad$returnS "s2" else if (((b__0 = (0b10011w : 5 words$word)))) then sail2_state_monad$returnS "s3" else if (((b__0 = (0b10100w : 5 words$word)))) then sail2_state_monad$returnS "s4" else if (((b__0 = (0b10101w : 5 words$word)))) then sail2_state_monad$returnS "s5" else if (((b__0 = (0b10110w : 5 words$word)))) then sail2_state_monad$returnS "s6" else if (((b__0 = (0b10111w : 5 words$word)))) then sail2_state_monad$returnS "s7" else if (((b__0 = (0b11000w : 5 words$word)))) then sail2_state_monad$returnS "s8" else if (((b__0 = (0b11001w : 5 words$word)))) then sail2_state_monad$returnS "s9" else if (((b__0 = (0b11010w : 5 words$word)))) then sail2_state_monad$returnS "s10" else if (((b__0 = (0b11011w : 5 words$word)))) then sail2_state_monad$returnS "s11" else if (((b__0 = (0b11100w : 5 words$word)))) then sail2_state_monad$returnS "t3" else if (((b__0 = (0b11101w : 5 words$word)))) then sail2_state_monad$returnS "t4" else if (((b__0 = (0b11110w : 5 words$word)))) then sail2_state_monad$returnS "t5" else if (((b__0 = (0b11111w : 5 words$word)))) then sail2_state_monad$returnS "t6" else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((reg_name_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "zero"))) then sail2_state_monad$returnS (0b00000w : 5 words$word) else if (((p0_ = "ra"))) then sail2_state_monad$returnS (0b00001w : 5 words$word) else if (((p0_ = "sp"))) then sail2_state_monad$returnS (0b00010w : 5 words$word) else if (((p0_ = "gp"))) then sail2_state_monad$returnS (0b00011w : 5 words$word) else if (((p0_ = "tp"))) then sail2_state_monad$returnS (0b00100w : 5 words$word) else if (((p0_ = "t0"))) then sail2_state_monad$returnS (0b00101w : 5 words$word) else if (((p0_ = "t1"))) then sail2_state_monad$returnS (0b00110w : 5 words$word) else if (((p0_ = "t2"))) then sail2_state_monad$returnS (0b00111w : 5 words$word) else if (((p0_ = "fp"))) then sail2_state_monad$returnS (0b01000w : 5 words$word) else if (((p0_ = "s1"))) then sail2_state_monad$returnS (0b01001w : 5 words$word) else if (((p0_ = "a0"))) then sail2_state_monad$returnS (0b01010w : 5 words$word) else if (((p0_ = "a1"))) then sail2_state_monad$returnS (0b01011w : 5 words$word) else if (((p0_ = "a2"))) then sail2_state_monad$returnS (0b01100w : 5 words$word) else if (((p0_ = "a3"))) then sail2_state_monad$returnS (0b01101w : 5 words$word) else if (((p0_ = "a4"))) then sail2_state_monad$returnS (0b01110w : 5 words$word) else if (((p0_ = "a5"))) then sail2_state_monad$returnS (0b01111w : 5 words$word) else if (((p0_ = "a6"))) then sail2_state_monad$returnS (0b10000w : 5 words$word) else if (((p0_ = "a7"))) then sail2_state_monad$returnS (0b10001w : 5 words$word) else if (((p0_ = "s2"))) then sail2_state_monad$returnS (0b10010w : 5 words$word) else if (((p0_ = "s3"))) then sail2_state_monad$returnS (0b10011w : 5 words$word) else if (((p0_ = "s4"))) then sail2_state_monad$returnS (0b10100w : 5 words$word) else if (((p0_ = "s5"))) then sail2_state_monad$returnS (0b10101w : 5 words$word) else if (((p0_ = "s6"))) then sail2_state_monad$returnS (0b10110w : 5 words$word) else if (((p0_ = "s7"))) then sail2_state_monad$returnS (0b10111w : 5 words$word) else if (((p0_ = "s8"))) then sail2_state_monad$returnS (0b11000w : 5 words$word) else if (((p0_ = "s9"))) then sail2_state_monad$returnS (0b11001w : 5 words$word) else if (((p0_ = "s10"))) then sail2_state_monad$returnS (0b11010w : 5 words$word) else if (((p0_ = "s11"))) then sail2_state_monad$returnS (0b11011w : 5 words$word) else if (((p0_ = "t3"))) then sail2_state_monad$returnS (0b11100w : 5 words$word) else if (((p0_ = "t4"))) then sail2_state_monad$returnS (0b11101w : 5 words$word) else if (((p0_ = "t5"))) then sail2_state_monad$returnS (0b11110w : 5 words$word) else if (((p0_ = "t6"))) then sail2_state_monad$returnS (0b11111w : 5 words$word) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((reg_name_forwards_matches:(5)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b00000w : 5 words$word)))) then T else if (((b__0 = (0b00001w : 5 words$word)))) then T else if (((b__0 = (0b00010w : 5 words$word)))) then T else if (((b__0 = (0b00011w : 5 words$word)))) then T else if (((b__0 = (0b00100w : 5 words$word)))) then T else if (((b__0 = (0b00101w : 5 words$word)))) then T else if (((b__0 = (0b00110w : 5 words$word)))) then T else if (((b__0 = (0b00111w : 5 words$word)))) then T else if (((b__0 = (0b01000w : 5 words$word)))) then T else if (((b__0 = (0b01001w : 5 words$word)))) then T else if (((b__0 = (0b01010w : 5 words$word)))) then T else if (((b__0 = (0b01011w : 5 words$word)))) then T else if (((b__0 = (0b01100w : 5 words$word)))) then T else if (((b__0 = (0b01101w : 5 words$word)))) then T else if (((b__0 = (0b01110w : 5 words$word)))) then T else if (((b__0 = (0b01111w : 5 words$word)))) then T else if (((b__0 = (0b10000w : 5 words$word)))) then T else if (((b__0 = (0b10001w : 5 words$word)))) then T else if (((b__0 = (0b10010w : 5 words$word)))) then T else if (((b__0 = (0b10011w : 5 words$word)))) then T else if (((b__0 = (0b10100w : 5 words$word)))) then T else if (((b__0 = (0b10101w : 5 words$word)))) then T else if (((b__0 = (0b10110w : 5 words$word)))) then T else if (((b__0 = (0b10111w : 5 words$word)))) then T else if (((b__0 = (0b11000w : 5 words$word)))) then T else if (((b__0 = (0b11001w : 5 words$word)))) then T else if (((b__0 = (0b11010w : 5 words$word)))) then T else if (((b__0 = (0b11011w : 5 words$word)))) then T else if (((b__0 = (0b11100w : 5 words$word)))) then T else if (((b__0 = (0b11101w : 5 words$word)))) then T else if (((b__0 = (0b11110w : 5 words$word)))) then T else if (((b__0 = (0b11111w : 5 words$word)))) then T else F))`; val _ = Define ` ((reg_name_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "zero"))) then T else if (((p0_ = "ra"))) then T else if (((p0_ = "sp"))) then T else if (((p0_ = "gp"))) then T else if (((p0_ = "tp"))) then T else if (((p0_ = "t0"))) then T else if (((p0_ = "t1"))) then T else if (((p0_ = "t2"))) then T else if (((p0_ = "fp"))) then T else if (((p0_ = "s1"))) then T else if (((p0_ = "a0"))) then T else if (((p0_ = "a1"))) then T else if (((p0_ = "a2"))) then T else if (((p0_ = "a3"))) then T else if (((p0_ = "a4"))) then T else if (((p0_ = "a5"))) then T else if (((p0_ = "a6"))) then T else if (((p0_ = "a7"))) then T else if (((p0_ = "s2"))) then T else if (((p0_ = "s3"))) then T else if (((p0_ = "s4"))) then T else if (((p0_ = "s5"))) then T else if (((p0_ = "s6"))) then T else if (((p0_ = "s7"))) then T else if (((p0_ = "s8"))) then T else if (((p0_ = "s9"))) then T else if (((p0_ = "s10"))) then T else if (((p0_ = "s11"))) then T else if (((p0_ = "t3"))) then T else if (((p0_ = "t4"))) then T else if (((p0_ = "t5"))) then T else if (((p0_ = "t6"))) then T else F))`; (*val _s164_ : string -> maybe string*) val _ = Define ` ((s164_:string ->(string)option) s165_0= (let s166_0 = s165_0 in if ((string_startswith s166_0 "t6")) then (case ((string_drop s166_0 ((string_length "t6")))) of s_ => SOME s_ ) else NONE))`; (*val _s160_ : string -> maybe string*) val _ = Define ` ((s160_:string ->(string)option) s161_0= (let s162_0 = s161_0 in if ((string_startswith s162_0 "t5")) then (case ((string_drop s162_0 ((string_length "t5")))) of s_ => SOME s_ ) else NONE))`; (*val _s156_ : string -> maybe string*) val _ = Define ` ((s156_:string ->(string)option) s157_0= (let s158_0 = s157_0 in if ((string_startswith s158_0 "t4")) then (case ((string_drop s158_0 ((string_length "t4")))) of s_ => SOME s_ ) else NONE))`; (*val _s152_ : string -> maybe string*) val _ = Define ` ((s152_:string ->(string)option) s153_0= (let s154_0 = s153_0 in if ((string_startswith s154_0 "t3")) then (case ((string_drop s154_0 ((string_length "t3")))) of s_ => SOME s_ ) else NONE))`; (*val _s148_ : string -> maybe string*) val _ = Define ` ((s148_:string ->(string)option) s149_0= (let s150_0 = s149_0 in if ((string_startswith s150_0 "s11")) then (case ((string_drop s150_0 ((string_length "s11")))) of s_ => SOME s_ ) else NONE))`; (*val _s144_ : string -> maybe string*) val _ = Define ` ((s144_:string ->(string)option) s145_0= (let s146_0 = s145_0 in if ((string_startswith s146_0 "s10")) then (case ((string_drop s146_0 ((string_length "s10")))) of s_ => SOME s_ ) else NONE))`; (*val _s140_ : string -> maybe string*) val _ = Define ` ((s140_:string ->(string)option) s141_0= (let s142_0 = s141_0 in if ((string_startswith s142_0 "s9")) then (case ((string_drop s142_0 ((string_length "s9")))) of s_ => SOME s_ ) else NONE))`; (*val _s136_ : string -> maybe string*) val _ = Define ` ((s136_:string ->(string)option) s137_0= (let s138_0 = s137_0 in if ((string_startswith s138_0 "s8")) then (case ((string_drop s138_0 ((string_length "s8")))) of s_ => SOME s_ ) else NONE))`; (*val _s132_ : string -> maybe string*) val _ = Define ` ((s132_:string ->(string)option) s133_0= (let s134_0 = s133_0 in if ((string_startswith s134_0 "s7")) then (case ((string_drop s134_0 ((string_length "s7")))) of s_ => SOME s_ ) else NONE))`; (*val _s128_ : string -> maybe string*) val _ = Define ` ((s128_:string ->(string)option) s129_0= (let s130_0 = s129_0 in if ((string_startswith s130_0 "s6")) then (case ((string_drop s130_0 ((string_length "s6")))) of s_ => SOME s_ ) else NONE))`; (*val _s124_ : string -> maybe string*) val _ = Define ` ((s124_:string ->(string)option) s125_0= (let s126_0 = s125_0 in if ((string_startswith s126_0 "s5")) then (case ((string_drop s126_0 ((string_length "s5")))) of s_ => SOME s_ ) else NONE))`; (*val _s120_ : string -> maybe string*) val _ = Define ` ((s120_:string ->(string)option) s121_0= (let s122_0 = s121_0 in if ((string_startswith s122_0 "s4")) then (case ((string_drop s122_0 ((string_length "s4")))) of s_ => SOME s_ ) else NONE))`; (*val _s116_ : string -> maybe string*) val _ = Define ` ((s116_:string ->(string)option) s117_0= (let s118_0 = s117_0 in if ((string_startswith s118_0 "s3")) then (case ((string_drop s118_0 ((string_length "s3")))) of s_ => SOME s_ ) else NONE))`; (*val _s112_ : string -> maybe string*) val _ = Define ` ((s112_:string ->(string)option) s113_0= (let s114_0 = s113_0 in if ((string_startswith s114_0 "s2")) then (case ((string_drop s114_0 ((string_length "s2")))) of s_ => SOME s_ ) else NONE))`; (*val _s108_ : string -> maybe string*) val _ = Define ` ((s108_:string ->(string)option) s109_0= (let s110_0 = s109_0 in if ((string_startswith s110_0 "a7")) then (case ((string_drop s110_0 ((string_length "a7")))) of s_ => SOME s_ ) else NONE))`; (*val _s104_ : string -> maybe string*) val _ = Define ` ((s104_:string ->(string)option) s105_0= (let s106_0 = s105_0 in if ((string_startswith s106_0 "a6")) then (case ((string_drop s106_0 ((string_length "a6")))) of s_ => SOME s_ ) else NONE))`; (*val _s100_ : string -> maybe string*) val _ = Define ` ((s100_:string ->(string)option) s101_0= (let s102_0 = s101_0 in if ((string_startswith s102_0 "a5")) then (case ((string_drop s102_0 ((string_length "a5")))) of s_ => SOME s_ ) else NONE))`; (*val _s96_ : string -> maybe string*) val _ = Define ` ((s96_:string ->(string)option) s97_0= (let s98_0 = s97_0 in if ((string_startswith s98_0 "a4")) then (case ((string_drop s98_0 ((string_length "a4")))) of s_ => SOME s_ ) else NONE))`; (*val _s92_ : string -> maybe string*) val _ = Define ` ((s92_:string ->(string)option) s93_0= (let s94_0 = s93_0 in if ((string_startswith s94_0 "a3")) then (case ((string_drop s94_0 ((string_length "a3")))) of s_ => SOME s_ ) else NONE))`; (*val _s88_ : string -> maybe string*) val _ = Define ` ((s88_:string ->(string)option) s89_0= (let s90_0 = s89_0 in if ((string_startswith s90_0 "a2")) then (case ((string_drop s90_0 ((string_length "a2")))) of s_ => SOME s_ ) else NONE))`; (*val _s84_ : string -> maybe string*) val _ = Define ` ((s84_:string ->(string)option) s85_0= (let s86_0 = s85_0 in if ((string_startswith s86_0 "a1")) then (case ((string_drop s86_0 ((string_length "a1")))) of s_ => SOME s_ ) else NONE))`; (*val _s80_ : string -> maybe string*) val _ = Define ` ((s80_:string ->(string)option) s81_0= (let s82_0 = s81_0 in if ((string_startswith s82_0 "a0")) then (case ((string_drop s82_0 ((string_length "a0")))) of s_ => SOME s_ ) else NONE))`; (*val _s76_ : string -> maybe string*) val _ = Define ` ((s76_:string ->(string)option) s77_0= (let s78_0 = s77_0 in if ((string_startswith s78_0 "s1")) then (case ((string_drop s78_0 ((string_length "s1")))) of s_ => SOME s_ ) else NONE))`; (*val _s72_ : string -> maybe string*) val _ = Define ` ((s72_:string ->(string)option) s73_0= (let s74_0 = s73_0 in if ((string_startswith s74_0 "fp")) then (case ((string_drop s74_0 ((string_length "fp")))) of s_ => SOME s_ ) else NONE))`; (*val _s68_ : string -> maybe string*) val _ = Define ` ((s68_:string ->(string)option) s69_0= (let s70_0 = s69_0 in if ((string_startswith s70_0 "t2")) then (case ((string_drop s70_0 ((string_length "t2")))) of s_ => SOME s_ ) else NONE))`; (*val _s64_ : string -> maybe string*) val _ = Define ` ((s64_:string ->(string)option) s65_0= (let s66_0 = s65_0 in if ((string_startswith s66_0 "t1")) then (case ((string_drop s66_0 ((string_length "t1")))) of s_ => SOME s_ ) else NONE))`; (*val _s60_ : string -> maybe string*) val _ = Define ` ((s60_:string ->(string)option) s61_0= (let s62_0 = s61_0 in if ((string_startswith s62_0 "t0")) then (case ((string_drop s62_0 ((string_length "t0")))) of s_ => SOME s_ ) else NONE))`; (*val _s56_ : string -> maybe string*) val _ = Define ` ((s56_:string ->(string)option) s57_0= (let s58_0 = s57_0 in if ((string_startswith s58_0 "tp")) then (case ((string_drop s58_0 ((string_length "tp")))) of s_ => SOME s_ ) else NONE))`; (*val _s52_ : string -> maybe string*) val _ = Define ` ((s52_:string ->(string)option) s53_0= (let s54_0 = s53_0 in if ((string_startswith s54_0 "gp")) then (case ((string_drop s54_0 ((string_length "gp")))) of s_ => SOME s_ ) else NONE))`; (*val _s48_ : string -> maybe string*) val _ = Define ` ((s48_:string ->(string)option) s49_0= (let s50_0 = s49_0 in if ((string_startswith s50_0 "sp")) then (case ((string_drop s50_0 ((string_length "sp")))) of s_ => SOME s_ ) else NONE))`; (*val _s44_ : string -> maybe string*) val _ = Define ` ((s44_:string ->(string)option) s45_0= (let s46_0 = s45_0 in if ((string_startswith s46_0 "ra")) then (case ((string_drop s46_0 ((string_length "ra")))) of s_ => SOME s_ ) else NONE))`; (*val _s40_ : string -> maybe string*) val _ = Define ` ((s40_:string ->(string)option) s41_0= (let s42_0 = s41_0 in if ((string_startswith s42_0 "zero")) then (case ((string_drop s42_0 ((string_length "zero")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((reg_name_matches_prefix:string ->((5)words$word#int)option) arg_= (let s43_0 = arg_ in if ((case ((s40_ s43_0)) of SOME (s_) => T | _ => F )) then (case s40_ s43_0 of (SOME (s_)) => SOME ((0b00000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s44_ s43_0)) of SOME (s_) => T | _ => F )) then (case s44_ s43_0 of (SOME (s_)) => SOME ((0b00001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s48_ s43_0)) of SOME (s_) => T | _ => F )) then (case s48_ s43_0 of (SOME (s_)) => SOME ((0b00010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s52_ s43_0)) of SOME (s_) => T | _ => F )) then (case s52_ s43_0 of (SOME (s_)) => SOME ((0b00011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s56_ s43_0)) of SOME (s_) => T | _ => F )) then (case s56_ s43_0 of (SOME (s_)) => SOME ((0b00100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s60_ s43_0)) of SOME (s_) => T | _ => F )) then (case s60_ s43_0 of (SOME (s_)) => SOME ((0b00101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s64_ s43_0)) of SOME (s_) => T | _ => F )) then (case s64_ s43_0 of (SOME (s_)) => SOME ((0b00110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s68_ s43_0)) of SOME (s_) => T | _ => F )) then (case s68_ s43_0 of (SOME (s_)) => SOME ((0b00111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s72_ s43_0)) of SOME (s_) => T | _ => F )) then (case s72_ s43_0 of (SOME (s_)) => SOME ((0b01000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s76_ s43_0)) of SOME (s_) => T | _ => F )) then (case s76_ s43_0 of (SOME (s_)) => SOME ((0b01001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s80_ s43_0)) of SOME (s_) => T | _ => F )) then (case s80_ s43_0 of (SOME (s_)) => SOME ((0b01010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s84_ s43_0)) of SOME (s_) => T | _ => F )) then (case s84_ s43_0 of (SOME (s_)) => SOME ((0b01011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s88_ s43_0)) of SOME (s_) => T | _ => F )) then (case s88_ s43_0 of (SOME (s_)) => SOME ((0b01100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s92_ s43_0)) of SOME (s_) => T | _ => F )) then (case s92_ s43_0 of (SOME (s_)) => SOME ((0b01101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s96_ s43_0)) of SOME (s_) => T | _ => F )) then (case s96_ s43_0 of (SOME (s_)) => SOME ((0b01110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s100_ s43_0)) of SOME (s_) => T | _ => F )) then (case s100_ s43_0 of (SOME (s_)) => SOME ((0b01111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s104_ s43_0)) of SOME (s_) => T | _ => F )) then (case s104_ s43_0 of (SOME (s_)) => SOME ((0b10000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s108_ s43_0)) of SOME (s_) => T | _ => F )) then (case s108_ s43_0 of (SOME (s_)) => SOME ((0b10001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s112_ s43_0)) of SOME (s_) => T | _ => F )) then (case s112_ s43_0 of (SOME (s_)) => SOME ((0b10010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s116_ s43_0)) of SOME (s_) => T | _ => F )) then (case s116_ s43_0 of (SOME (s_)) => SOME ((0b10011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s120_ s43_0)) of SOME (s_) => T | _ => F )) then (case s120_ s43_0 of (SOME (s_)) => SOME ((0b10100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s124_ s43_0)) of SOME (s_) => T | _ => F )) then (case s124_ s43_0 of (SOME (s_)) => SOME ((0b10101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s128_ s43_0)) of SOME (s_) => T | _ => F )) then (case s128_ s43_0 of (SOME (s_)) => SOME ((0b10110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s132_ s43_0)) of SOME (s_) => T | _ => F )) then (case s132_ s43_0 of (SOME (s_)) => SOME ((0b10111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s136_ s43_0)) of SOME (s_) => T | _ => F )) then (case s136_ s43_0 of (SOME (s_)) => SOME ((0b11000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s140_ s43_0)) of SOME (s_) => T | _ => F )) then (case s140_ s43_0 of (SOME (s_)) => SOME ((0b11001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s144_ s43_0)) of SOME (s_) => T | _ => F )) then (case s144_ s43_0 of (SOME (s_)) => SOME ((0b11010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s148_ s43_0)) of SOME (s_) => T | _ => F )) then (case s148_ s43_0 of (SOME (s_)) => SOME ((0b11011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s152_ s43_0)) of SOME (s_) => T | _ => F )) then (case s152_ s43_0 of (SOME (s_)) => SOME ((0b11100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s156_ s43_0)) of SOME (s_) => T | _ => F )) then (case s156_ s43_0 of (SOME (s_)) => SOME ((0b11101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s160_ s43_0)) of SOME (s_) => T | _ => F )) then (case s160_ s43_0 of (SOME (s_)) => SOME ((0b11110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s164_ s43_0)) of SOME (s_) => T | _ => F )) then (case s164_ s43_0 of (SOME (s_)) => SOME ((0b11111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val creg_name_forwards : mword ty3 -> M string*) (*val creg_name_backwards : string -> M (mword ty3)*) (*val creg_name_forwards_matches : mword ty3 -> bool*) (*val creg_name_backwards_matches : string -> bool*) (*val creg_name_matches_prefix : string -> maybe ((mword ty3 * ii))*) val _ = Define ` ((creg_name_forwards:(3)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then sail2_state_monad$returnS "s0" else if (((b__0 = (0b001w : 3 words$word)))) then sail2_state_monad$returnS "s1" else if (((b__0 = (0b010w : 3 words$word)))) then sail2_state_monad$returnS "a0" else if (((b__0 = (0b011w : 3 words$word)))) then sail2_state_monad$returnS "a1" else if (((b__0 = (0b100w : 3 words$word)))) then sail2_state_monad$returnS "a2" else if (((b__0 = (0b101w : 3 words$word)))) then sail2_state_monad$returnS "a3" else if (((b__0 = (0b110w : 3 words$word)))) then sail2_state_monad$returnS "a4" else if (((b__0 = (0b111w : 3 words$word)))) then sail2_state_monad$returnS "a5" else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((creg_name_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((3)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "s0"))) then sail2_state_monad$returnS (0b000w : 3 words$word) else if (((p0_ = "s1"))) then sail2_state_monad$returnS (0b001w : 3 words$word) else if (((p0_ = "a0"))) then sail2_state_monad$returnS (0b010w : 3 words$word) else if (((p0_ = "a1"))) then sail2_state_monad$returnS (0b011w : 3 words$word) else if (((p0_ = "a2"))) then sail2_state_monad$returnS (0b100w : 3 words$word) else if (((p0_ = "a3"))) then sail2_state_monad$returnS (0b101w : 3 words$word) else if (((p0_ = "a4"))) then sail2_state_monad$returnS (0b110w : 3 words$word) else if (((p0_ = "a5"))) then sail2_state_monad$returnS (0b111w : 3 words$word) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((creg_name_forwards_matches:(3)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then T else if (((b__0 = (0b001w : 3 words$word)))) then T else if (((b__0 = (0b010w : 3 words$word)))) then T else if (((b__0 = (0b011w : 3 words$word)))) then T else if (((b__0 = (0b100w : 3 words$word)))) then T else if (((b__0 = (0b101w : 3 words$word)))) then T else if (((b__0 = (0b110w : 3 words$word)))) then T else if (((b__0 = (0b111w : 3 words$word)))) then T else F))`; val _ = Define ` ((creg_name_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "s0"))) then T else if (((p0_ = "s1"))) then T else if (((p0_ = "a0"))) then T else if (((p0_ = "a1"))) then T else if (((p0_ = "a2"))) then T else if (((p0_ = "a3"))) then T else if (((p0_ = "a4"))) then T else if (((p0_ = "a5"))) then T else F))`; (*val _s196_ : string -> maybe string*) val _ = Define ` ((s196_:string ->(string)option) s197_0= (let s198_0 = s197_0 in if ((string_startswith s198_0 "a5")) then (case ((string_drop s198_0 ((string_length "a5")))) of s_ => SOME s_ ) else NONE))`; (*val _s192_ : string -> maybe string*) val _ = Define ` ((s192_:string ->(string)option) s193_0= (let s194_0 = s193_0 in if ((string_startswith s194_0 "a4")) then (case ((string_drop s194_0 ((string_length "a4")))) of s_ => SOME s_ ) else NONE))`; (*val _s188_ : string -> maybe string*) val _ = Define ` ((s188_:string ->(string)option) s189_0= (let s190_0 = s189_0 in if ((string_startswith s190_0 "a3")) then (case ((string_drop s190_0 ((string_length "a3")))) of s_ => SOME s_ ) else NONE))`; (*val _s184_ : string -> maybe string*) val _ = Define ` ((s184_:string ->(string)option) s185_0= (let s186_0 = s185_0 in if ((string_startswith s186_0 "a2")) then (case ((string_drop s186_0 ((string_length "a2")))) of s_ => SOME s_ ) else NONE))`; (*val _s180_ : string -> maybe string*) val _ = Define ` ((s180_:string ->(string)option) s181_0= (let s182_0 = s181_0 in if ((string_startswith s182_0 "a1")) then (case ((string_drop s182_0 ((string_length "a1")))) of s_ => SOME s_ ) else NONE))`; (*val _s176_ : string -> maybe string*) val _ = Define ` ((s176_:string ->(string)option) s177_0= (let s178_0 = s177_0 in if ((string_startswith s178_0 "a0")) then (case ((string_drop s178_0 ((string_length "a0")))) of s_ => SOME s_ ) else NONE))`; (*val _s172_ : string -> maybe string*) val _ = Define ` ((s172_:string ->(string)option) s173_0= (let s174_0 = s173_0 in if ((string_startswith s174_0 "s1")) then (case ((string_drop s174_0 ((string_length "s1")))) of s_ => SOME s_ ) else NONE))`; (*val _s168_ : string -> maybe string*) val _ = Define ` ((s168_:string ->(string)option) s169_0= (let s170_0 = s169_0 in if ((string_startswith s170_0 "s0")) then (case ((string_drop s170_0 ((string_length "s0")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((creg_name_matches_prefix:string ->((3)words$word#int)option) arg_= (let s171_0 = arg_ in if ((case ((s168_ s171_0)) of SOME (s_) => T | _ => F )) then (case s168_ s171_0 of (SOME (s_)) => SOME ((0b000w : 3 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s172_ s171_0)) of SOME (s_) => T | _ => F )) then (case s172_ s171_0 of (SOME (s_)) => SOME ((0b001w : 3 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s176_ s171_0)) of SOME (s_) => T | _ => F )) then (case s176_ s171_0 of (SOME (s_)) => SOME ((0b010w : 3 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s180_ s171_0)) of SOME (s_) => T | _ => F )) then (case s180_ s171_0 of (SOME (s_)) => SOME ((0b011w : 3 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s184_ s171_0)) of SOME (s_) => T | _ => F )) then (case s184_ s171_0 of (SOME (s_)) => SOME ((0b100w : 3 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s188_ s171_0)) of SOME (s_) => T | _ => F )) then (case s188_ s171_0 of (SOME (s_)) => SOME ((0b101w : 3 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s192_ s171_0)) of SOME (s_) => T | _ => F )) then (case s192_ s171_0 of (SOME (s_)) => SOME ((0b110w : 3 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s196_ s171_0)) of SOME (s_) => T | _ => F )) then (case s196_ s171_0 of (SOME (s_)) => SOME ((0b111w : 3 words$word), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val init_base_regs : unit -> M unit*) val _ = Define ` ((init_base_regs:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS x1_ref zero_reg) (sail2_state_monad$write_regS x2_ref zero_reg)) (sail2_state_monad$write_regS x3_ref zero_reg)) (sail2_state_monad$write_regS x4_ref zero_reg)) (sail2_state_monad$write_regS x5_ref zero_reg)) (sail2_state_monad$write_regS x6_ref zero_reg)) (sail2_state_monad$write_regS x7_ref zero_reg)) (sail2_state_monad$write_regS x8_ref zero_reg)) (sail2_state_monad$write_regS x9_ref zero_reg)) (sail2_state_monad$write_regS x10_ref zero_reg)) (sail2_state_monad$write_regS x11_ref zero_reg)) (sail2_state_monad$write_regS x12_ref zero_reg)) (sail2_state_monad$write_regS x13_ref zero_reg)) (sail2_state_monad$write_regS x14_ref zero_reg)) (sail2_state_monad$write_regS x15_ref zero_reg)) (sail2_state_monad$write_regS x16_ref zero_reg)) (sail2_state_monad$write_regS x17_ref zero_reg)) (sail2_state_monad$write_regS x18_ref zero_reg)) (sail2_state_monad$write_regS x19_ref zero_reg)) (sail2_state_monad$write_regS x20_ref zero_reg)) (sail2_state_monad$write_regS x21_ref zero_reg)) (sail2_state_monad$write_regS x22_ref zero_reg)) (sail2_state_monad$write_regS x23_ref zero_reg)) (sail2_state_monad$write_regS x24_ref zero_reg)) (sail2_state_monad$write_regS x25_ref zero_reg)) (sail2_state_monad$write_regS x26_ref zero_reg)) (sail2_state_monad$write_regS x27_ref zero_reg)) (sail2_state_monad$write_regS x28_ref zero_reg)) (sail2_state_monad$write_regS x29_ref zero_reg)) (sail2_state_monad$write_regS x30_ref zero_reg)) (sail2_state_monad$write_regS x31_ref zero_reg)))`; (* Retrieves the architectural PC value. This is not necessarily the value found in the PC register as extensions may choose to override this function. The value in the PC register is the absolute virtual address of the instruction to fetch. *) (*val get_arch_pc : unit -> M (mword ty64)*) val _ = Define ` ((get_arch_pc:unit ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = ((sail2_state_monad$read_regS PC_ref : ( 64 words$word) M)))`; (*val get_next_pc : unit -> M (mword ty64)*) val _ = Define ` ((get_next_pc:unit ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = ((sail2_state_monad$read_regS nextPC_ref : ( 64 words$word) M)))`; (*val set_next_pc : mword ty64 -> M unit*) val _ = Define ` ((set_next_pc:(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) pc= (sail2_state_monad$write_regS nextPC_ref pc))`; (*val tick_pc : unit -> M unit*) val _ = Define ` ((tick_pc:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS nextPC_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$write_regS PC_ref w__0)))`; (*val Mk_Misa : mword ty64 -> Misa*) val _ = Define ` ((Mk_Misa:(64)words$word -> Misa) v= (<| Misa_Misa_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; (*val _get_Misa_bits : Misa -> mword ty64*) val _ = Define ` ((get_Misa_bits:Misa ->(64)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; (*val _set_Misa_bits : register_ref regstate register_value Misa -> mword ty64 -> M unit*) val _ = Define ` ((set_Misa_bits:((regstate),(register_value),(Misa))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_bits : Misa -> mword ty64 -> Misa*) val _ = Define ` ((update_Misa_bits:Misa ->(64)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; (*val _update_Counteren_bits : Counteren -> mword ty32 -> Counteren*) (*val _update_Counterin_bits : Counterin -> mword ty32 -> Counterin*) (*val _update_Fcsr_bits : Fcsr -> mword ty32 -> Fcsr*) (*val _update_Mcause_bits : Mcause -> mword ty64 -> Mcause*) (*val _update_Medeleg_bits : Medeleg -> mword ty64 -> Medeleg*) (*val _update_Minterrupts_bits : Minterrupts -> mword ty64 -> Minterrupts*) (*val _update_Mstatus_bits : Mstatus -> mword ty64 -> Mstatus*) (*val _update_Mstatush_bits : Mstatush -> mword ty32 -> Mstatush*) (*val _update_Mtvec_bits : Mtvec -> mword ty64 -> Mtvec*) (*val _update_PTE_Bits_bits : PTE_Bits -> mword ty8 -> PTE_Bits*) (*val _update_Pmpcfg_ent_bits : Pmpcfg_ent -> mword ty8 -> Pmpcfg_ent*) (*val _update_SV32_PTE_bits : SV32_PTE -> mword ty32 -> SV32_PTE*) (*val _update_SV32_Paddr_bits : SV32_Paddr -> mword ty34 -> SV32_Paddr*) (*val _update_SV32_Vaddr_bits : SV32_Vaddr -> mword ty32 -> SV32_Vaddr*) (*val _update_SV39_PTE_bits : SV39_PTE -> mword ty64 -> SV39_PTE*) (*val _update_SV39_Paddr_bits : SV39_Paddr -> mword ty56 -> SV39_Paddr*) (*val _update_SV39_Vaddr_bits : SV39_Vaddr -> mword ty39 -> SV39_Vaddr*) (*val _update_SV48_PTE_bits : SV48_PTE -> mword ty64 -> SV48_PTE*) (*val _update_SV48_Paddr_bits : SV48_Paddr -> mword ty56 -> SV48_Paddr*) (*val _update_SV48_Vaddr_bits : SV48_Vaddr -> mword ty48 -> SV48_Vaddr*) (*val _update_Satp32_bits : Satp32 -> mword ty32 -> Satp32*) (*val _update_Satp64_bits : Satp64 -> mword ty64 -> Satp64*) (*val _update_Sedeleg_bits : Sedeleg -> mword ty64 -> Sedeleg*) (*val _update_Sinterrupts_bits : Sinterrupts -> mword ty64 -> Sinterrupts*) (*val _update_Sstatus_bits : Sstatus -> mword ty64 -> Sstatus*) (*val _update_Uinterrupts_bits : Uinterrupts -> mword ty64 -> Uinterrupts*) (*val _update_Ustatus_bits : Ustatus -> mword ty64 -> Ustatus*) (*val _update_htif_cmd_bits : htif_cmd -> mword ty64 -> htif_cmd*) (*val _get_Counteren_bits : Counteren -> mword ty32*) (*val _get_Counterin_bits : Counterin -> mword ty32*) (*val _get_Fcsr_bits : Fcsr -> mword ty32*) (*val _get_Mcause_bits : Mcause -> mword ty64*) (*val _get_Medeleg_bits : Medeleg -> mword ty64*) (*val _get_Minterrupts_bits : Minterrupts -> mword ty64*) (*val _get_Mstatus_bits : Mstatus -> mword ty64*) (*val _get_Mstatush_bits : Mstatush -> mword ty32*) (*val _get_Mtvec_bits : Mtvec -> mword ty64*) (*val _get_PTE_Bits_bits : PTE_Bits -> mword ty8*) (*val _get_Pmpcfg_ent_bits : Pmpcfg_ent -> mword ty8*) (*val _get_SV32_PTE_bits : SV32_PTE -> mword ty32*) (*val _get_SV32_Paddr_bits : SV32_Paddr -> mword ty34*) (*val _get_SV32_Vaddr_bits : SV32_Vaddr -> mword ty32*) (*val _get_SV39_PTE_bits : SV39_PTE -> mword ty64*) (*val _get_SV39_Paddr_bits : SV39_Paddr -> mword ty56*) (*val _get_SV39_Vaddr_bits : SV39_Vaddr -> mword ty39*) (*val _get_SV48_PTE_bits : SV48_PTE -> mword ty64*) (*val _get_SV48_Paddr_bits : SV48_Paddr -> mword ty56*) (*val _get_SV48_Vaddr_bits : SV48_Vaddr -> mword ty48*) (*val _get_Satp32_bits : Satp32 -> mword ty32*) (*val _get_Satp64_bits : Satp64 -> mword ty64*) (*val _get_Sedeleg_bits : Sedeleg -> mword ty64*) (*val _get_Sinterrupts_bits : Sinterrupts -> mword ty64*) (*val _get_Sstatus_bits : Sstatus -> mword ty64*) (*val _get_Uinterrupts_bits : Uinterrupts -> mword ty64*) (*val _get_Ustatus_bits : Ustatus -> mword ty64*) (*val _get_htif_cmd_bits : htif_cmd -> mword ty64*) (*val _set_Counteren_bits : register_ref regstate register_value Counteren -> mword ty32 -> M unit*) (*val _set_Counterin_bits : register_ref regstate register_value Counterin -> mword ty32 -> M unit*) (*val _set_Fcsr_bits : register_ref regstate register_value Fcsr -> mword ty32 -> M unit*) (*val _set_Mcause_bits : register_ref regstate register_value Mcause -> mword ty64 -> M unit*) (*val _set_Medeleg_bits : register_ref regstate register_value Medeleg -> mword ty64 -> M unit*) (*val _set_Minterrupts_bits : register_ref regstate register_value Minterrupts -> mword ty64 -> M unit*) (*val _set_Mstatus_bits : register_ref regstate register_value Mstatus -> mword ty64 -> M unit*) (*val _set_Mstatush_bits : register_ref regstate register_value Mstatush -> mword ty32 -> M unit*) (*val _set_Mtvec_bits : register_ref regstate register_value Mtvec -> mword ty64 -> M unit*) (*val _set_PTE_Bits_bits : register_ref regstate register_value PTE_Bits -> mword ty8 -> M unit*) (*val _set_Pmpcfg_ent_bits : register_ref regstate register_value Pmpcfg_ent -> mword ty8 -> M unit*) (*val _set_SV32_PTE_bits : register_ref regstate register_value SV32_PTE -> mword ty32 -> M unit*) (*val _set_SV32_Paddr_bits : register_ref regstate register_value SV32_Paddr -> mword ty34 -> M unit*) (*val _set_SV32_Vaddr_bits : register_ref regstate register_value SV32_Vaddr -> mword ty32 -> M unit*) (*val _set_SV39_PTE_bits : register_ref regstate register_value SV39_PTE -> mword ty64 -> M unit*) (*val _set_SV39_Paddr_bits : register_ref regstate register_value SV39_Paddr -> mword ty56 -> M unit*) (*val _set_SV39_Vaddr_bits : register_ref regstate register_value SV39_Vaddr -> mword ty39 -> M unit*) (*val _set_SV48_PTE_bits : register_ref regstate register_value SV48_PTE -> mword ty64 -> M unit*) (*val _set_SV48_Paddr_bits : register_ref regstate register_value SV48_Paddr -> mword ty56 -> M unit*) (*val _set_SV48_Vaddr_bits : register_ref regstate register_value SV48_Vaddr -> mword ty48 -> M unit*) (*val _set_Satp32_bits : register_ref regstate register_value Satp32 -> mword ty32 -> M unit*) (*val _set_Satp64_bits : register_ref regstate register_value Satp64 -> mword ty64 -> M unit*) (*val _set_Sedeleg_bits : register_ref regstate register_value Sedeleg -> mword ty64 -> M unit*) (*val _set_Sinterrupts_bits : register_ref regstate register_value Sinterrupts -> mword ty64 -> M unit*) (*val _set_Sstatus_bits : register_ref regstate register_value Sstatus -> mword ty64 -> M unit*) (*val _set_Uinterrupts_bits : register_ref regstate register_value Uinterrupts -> mword ty64 -> M unit*) (*val _set_Ustatus_bits : register_ref regstate register_value Ustatus -> mword ty64 -> M unit*) (*val _set_htif_cmd_bits : register_ref regstate register_value htif_cmd -> mword ty64 -> M unit*) (*val _get_Misa_MXL : Misa -> mword ty2*) val _ = Define ` ((get_Misa_MXL:Misa ->(2)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 63 : int):ii) (( 62 : int):ii) : 2 words$word)))`; (*val _set_Misa_MXL : register_ref regstate register_value Misa -> mword ty2 -> M unit*) val _ = Define ` ((set_Misa_MXL:((regstate),(register_value),(Misa))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 63 : int):ii) (( 62 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_MXL : Misa -> mword ty2 -> Misa*) val _ = Define ` ((update_Misa_MXL:Misa ->(2)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 63 : int):ii) (( 62 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_Z : Misa -> mword ty1*) val _ = Define ` ((get_Misa_Z:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)))`; (*val _set_Misa_Z : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_Z:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 25 : int):ii) (( 25 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_Z : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_Z:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 25 : int):ii) (( 25 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_Y : Misa -> mword ty1*) val _ = Define ` ((get_Misa_Y:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 24 : int):ii) (( 24 : int):ii) : 1 words$word)))`; (*val _set_Misa_Y : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_Y:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 24 : int):ii) (( 24 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_Y : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_Y:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 24 : int):ii) (( 24 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_X : Misa -> mword ty1*) val _ = Define ` ((get_Misa_X:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 23 : int):ii) (( 23 : int):ii) : 1 words$word)))`; (*val _set_Misa_X : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_X:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 23 : int):ii) (( 23 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_X : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_X:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 23 : int):ii) (( 23 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_PTE_Bits_X : PTE_Bits -> mword ty1 -> PTE_Bits*) (*val _update_Pmpcfg_ent_X : Pmpcfg_ent -> mword ty1 -> Pmpcfg_ent*) (*val _get_PTE_Bits_X : PTE_Bits -> mword ty1*) (*val _get_Pmpcfg_ent_X : Pmpcfg_ent -> mword ty1*) (*val _set_PTE_Bits_X : register_ref regstate register_value PTE_Bits -> mword ty1 -> M unit*) (*val _set_Pmpcfg_ent_X : register_ref regstate register_value Pmpcfg_ent -> mword ty1 -> M unit*) (*val _get_Misa_W : Misa -> mword ty1*) val _ = Define ` ((get_Misa_W:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 22 : int):ii) (( 22 : int):ii) : 1 words$word)))`; (*val _set_Misa_W : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_W:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 22 : int):ii) (( 22 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_W : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_W:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 22 : int):ii) (( 22 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_PTE_Bits_W : PTE_Bits -> mword ty1 -> PTE_Bits*) (*val _update_Pmpcfg_ent_W : Pmpcfg_ent -> mword ty1 -> Pmpcfg_ent*) (*val _get_PTE_Bits_W : PTE_Bits -> mword ty1*) (*val _get_Pmpcfg_ent_W : Pmpcfg_ent -> mword ty1*) (*val _set_PTE_Bits_W : register_ref regstate register_value PTE_Bits -> mword ty1 -> M unit*) (*val _set_Pmpcfg_ent_W : register_ref regstate register_value Pmpcfg_ent -> mword ty1 -> M unit*) (*val _get_Misa_V : Misa -> mword ty1*) val _ = Define ` ((get_Misa_V:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 21 : int):ii) (( 21 : int):ii) : 1 words$word)))`; (*val _set_Misa_V : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_V:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 21 : int):ii) (( 21 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_V : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_V:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 21 : int):ii) (( 21 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_PTE_Bits_V : PTE_Bits -> mword ty1 -> PTE_Bits*) (*val _get_PTE_Bits_V : PTE_Bits -> mword ty1*) (*val _set_PTE_Bits_V : register_ref regstate register_value PTE_Bits -> mword ty1 -> M unit*) (*val _get_Misa_U : Misa -> mword ty1*) val _ = Define ` ((get_Misa_U:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 20 : int):ii) (( 20 : int):ii) : 1 words$word)))`; (*val _set_Misa_U : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_U:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 20 : int):ii) (( 20 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_U : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_U:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 20 : int):ii) (( 20 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_PTE_Bits_U : PTE_Bits -> mword ty1 -> PTE_Bits*) (*val _get_PTE_Bits_U : PTE_Bits -> mword ty1*) (*val _set_PTE_Bits_U : register_ref regstate register_value PTE_Bits -> mword ty1 -> M unit*) (*val _get_Misa_T : Misa -> mword ty1*) val _ = Define ` ((get_Misa_T:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 19 : int):ii) (( 19 : int):ii) : 1 words$word)))`; (*val _set_Misa_T : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_T:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 19 : int):ii) (( 19 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_T : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_T:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 19 : int):ii) (( 19 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_S : Misa -> mword ty1*) val _ = Define ` ((get_Misa_S:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 18 : int):ii) (( 18 : int):ii) : 1 words$word)))`; (*val _set_Misa_S : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_S:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 18 : int):ii) (( 18 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_S : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_S:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 18 : int):ii) (( 18 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_R : Misa -> mword ty1*) val _ = Define ` ((get_Misa_R:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 17 : int):ii) (( 17 : int):ii) : 1 words$word)))`; (*val _set_Misa_R : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_R:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 17 : int):ii) (( 17 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_R : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_R:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 17 : int):ii) (( 17 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_PTE_Bits_R : PTE_Bits -> mword ty1 -> PTE_Bits*) (*val _update_Pmpcfg_ent_R : Pmpcfg_ent -> mword ty1 -> Pmpcfg_ent*) (*val _get_PTE_Bits_R : PTE_Bits -> mword ty1*) (*val _get_Pmpcfg_ent_R : Pmpcfg_ent -> mword ty1*) (*val _set_PTE_Bits_R : register_ref regstate register_value PTE_Bits -> mword ty1 -> M unit*) (*val _set_Pmpcfg_ent_R : register_ref regstate register_value Pmpcfg_ent -> mword ty1 -> M unit*) (*val _get_Misa_Q : Misa -> mword ty1*) val _ = Define ` ((get_Misa_Q:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 16 : int):ii) (( 16 : int):ii) : 1 words$word)))`; (*val _set_Misa_Q : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_Q:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 16 : int):ii) (( 16 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_Q : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_Q:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 16 : int):ii) (( 16 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_P : Misa -> mword ty1*) val _ = Define ` ((get_Misa_P:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 15 : int):ii) (( 15 : int):ii) : 1 words$word)))`; (*val _set_Misa_P : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_P:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 15 : int):ii) (( 15 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_P : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_P:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 15 : int):ii) (( 15 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_O : Misa -> mword ty1*) val _ = Define ` ((get_Misa_O:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)))`; (*val _set_Misa_O : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_O:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 14 : int):ii) (( 14 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_O : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_O:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 14 : int):ii) (( 14 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_N : Misa -> mword ty1*) val _ = Define ` ((get_Misa_N:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 13 : int):ii) (( 13 : int):ii) : 1 words$word)))`; (*val _set_Misa_N : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_N:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 13 : int):ii) (( 13 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_N : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_N:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 13 : int):ii) (( 13 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_M : Misa -> mword ty1*) val _ = Define ` ((get_Misa_M:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)))`; (*val _set_Misa_M : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_M:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 12 : int):ii) (( 12 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_M : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_M:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 12 : int):ii) (( 12 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_L : Misa -> mword ty1*) val _ = Define ` ((get_Misa_L:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 11 : int):ii) (( 11 : int):ii) : 1 words$word)))`; (*val _set_Misa_L : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_L:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 11 : int):ii) (( 11 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_L : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_L:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 11 : int):ii) (( 11 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Pmpcfg_ent_L : Pmpcfg_ent -> mword ty1 -> Pmpcfg_ent*) (*val _get_Pmpcfg_ent_L : Pmpcfg_ent -> mword ty1*) (*val _set_Pmpcfg_ent_L : register_ref regstate register_value Pmpcfg_ent -> mword ty1 -> M unit*) (*val _get_Misa_K : Misa -> mword ty1*) val _ = Define ` ((get_Misa_K:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 10 : int):ii) (( 10 : int):ii) : 1 words$word)))`; (*val _set_Misa_K : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_K:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 10 : int):ii) (( 10 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_K : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_K:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 10 : int):ii) (( 10 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_J : Misa -> mword ty1*) val _ = Define ` ((get_Misa_J:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 9 : int):ii) (( 9 : int):ii) : 1 words$word)))`; (*val _set_Misa_J : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_J:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 9 : int):ii) (( 9 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_J : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_J:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 9 : int):ii) (( 9 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_I : Misa -> mword ty1*) val _ = Define ` ((get_Misa_I:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)))`; (*val _set_Misa_I : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_I:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_I : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_I:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_H : Misa -> mword ty1*) val _ = Define ` ((get_Misa_H:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)))`; (*val _set_Misa_H : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_H:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_H : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_H:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_G : Misa -> mword ty1*) val _ = Define ` ((get_Misa_G:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)))`; (*val _set_Misa_G : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_G:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 6 : int):ii) (( 6 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_G : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_G:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 6 : int):ii) (( 6 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_PTE_Bits_G : PTE_Bits -> mword ty1 -> PTE_Bits*) (*val _get_PTE_Bits_G : PTE_Bits -> mword ty1*) (*val _set_PTE_Bits_G : register_ref regstate register_value PTE_Bits -> mword ty1 -> M unit*) (*val _get_Misa_F : Misa -> mword ty1*) val _ = Define ` ((get_Misa_F:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)))`; (*val _set_Misa_F : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_F:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_F : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_F:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_E : Misa -> mword ty1*) val _ = Define ` ((get_Misa_E:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; (*val _set_Misa_E : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_E:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_E : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_E:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_D : Misa -> mword ty1*) val _ = Define ` ((get_Misa_D:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)))`; (*val _set_Misa_D : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_D:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_D : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_D:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_PTE_Bits_D : PTE_Bits -> mword ty1 -> PTE_Bits*) (*val _get_PTE_Bits_D : PTE_Bits -> mword ty1*) (*val _set_PTE_Bits_D : register_ref regstate register_value PTE_Bits -> mword ty1 -> M unit*) (*val _get_Misa_C : Misa -> mword ty1*) val _ = Define ` ((get_Misa_C:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)))`; (*val _set_Misa_C : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_C:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_C : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_C:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_B : Misa -> mword ty1*) val _ = Define ` ((get_Misa_B:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; (*val _set_Misa_B : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_B:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_B : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_B:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Misa_A : Misa -> mword ty1*) val _ = Define ` ((get_Misa_A:Misa ->(1)words$word) v= ((subrange_vec_dec v.Misa_Misa_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; (*val _set_Misa_A : register_ref regstate register_value Misa -> mword ty1 -> M unit*) val _ = Define ` ((set_Misa_A:((regstate),(register_value),(Misa))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec r.Misa_Misa_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Misa_A : Misa -> mword ty1 -> Misa*) val _ = Define ` ((update_Misa_A:Misa ->(1)words$word -> Misa) v x= (( v with<| Misa_Misa_chunk_0 := ((update_subrange_vec_dec v.Misa_Misa_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_PTE_Bits_A : PTE_Bits -> mword ty1 -> PTE_Bits*) (*val _update_Pmpcfg_ent_A : Pmpcfg_ent -> mword ty2 -> Pmpcfg_ent*) (*val _get_PTE_Bits_A : PTE_Bits -> mword ty1*) (*val _get_Pmpcfg_ent_A : Pmpcfg_ent -> mword ty2*) (*val _set_PTE_Bits_A : register_ref regstate register_value PTE_Bits -> mword ty1 -> M unit*) (*val _set_Pmpcfg_ent_A : register_ref regstate register_value Pmpcfg_ent -> mword ty2 -> M unit*) (*val ext_veto_disable_C : unit -> M bool*) (*val legalize_misa : Misa -> mword ty64 -> M Misa*) val _ = Define ` ((ext_veto_disable_C:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$returnS F))`; val _ = Define ` ((legalize_misa:Misa ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Misa),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (m : Misa) (v : xlenbits)= (if ((sys_enable_writable_misa () )) then let v = (Mk_Misa v) in sail2_state_monad$bindS (sail2_state$or_boolS (sail2_state$and_boolS (sail2_state_monad$returnS (((((get_Misa_C v : 1 words$word)) = (0b0w : 1 words$word))))) (sail2_state$or_boolS ( sail2_state_monad$bindS(sail2_state_monad$read_regS nextPC_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$returnS (((((access_vec_dec w__0 (( 1 : int):ii))) = B1))))) ((ext_veto_disable_C () )))) (sail2_state_monad$returnS ((~ ((sys_enable_rvc () )))))) (\ (w__4 : bool) . let m = (if w__4 then m else update_Misa_C m ((get_Misa_C v : 1 words$word))) in sail2_state_monad$returnS (if (((((~ ((sys_enable_fdext () )))) \/ ((((((((get_Misa_D v : 1 words$word)) = (0b1w : 1 words$word)))) /\ (((((get_Misa_F v : 1 words$word)) = (0b0w : 1 words$word)))))))))) then m else update_Misa_D ((update_Misa_F m ((get_Misa_F v : 1 words$word)))) ((get_Misa_D v : 1 words$word)))) else sail2_state_monad$returnS m))`; (*val haveAtomics : unit -> M bool*) val _ = Define ` ((haveAtomics:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS (((((get_Misa_A w__0 : 1 words$word)) = (0b1w : 1 words$word)))))))`; (*val haveRVC : unit -> M bool*) val _ = Define ` ((haveRVC:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS (((((get_Misa_C w__0 : 1 words$word)) = (0b1w : 1 words$word)))))))`; (*val haveMulDiv : unit -> M bool*) val _ = Define ` ((haveMulDiv:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS (((((get_Misa_M w__0 : 1 words$word)) = (0b1w : 1 words$word)))))))`; (*val haveSupMode : unit -> M bool*) val _ = Define ` ((haveSupMode:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS (((((get_Misa_S w__0 : 1 words$word)) = (0b1w : 1 words$word)))))))`; (*val haveUsrMode : unit -> M bool*) val _ = Define ` ((haveUsrMode:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS (((((get_Misa_U w__0 : 1 words$word)) = (0b1w : 1 words$word)))))))`; (*val haveNExt : unit -> M bool*) val _ = Define ` ((haveNExt:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS (((((get_Misa_N w__0 : 1 words$word)) = (0b1w : 1 words$word)))))))`; (*val Mk_Mstatush : mword ty32 -> Mstatush*) val _ = Define ` ((Mk_Mstatush:(32)words$word -> Mstatush) v= (<| Mstatush_Mstatush_chunk_0 := ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) |>))`; val _ = Define ` ((get_Mstatush_bits:Mstatush ->(32)words$word) v= ((subrange_vec_dec v.Mstatush_Mstatush_chunk_0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)))`; val _ = Define ` ((set_Mstatush_bits:((regstate),(register_value),(Mstatush))register_ref ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatush_Mstatush_chunk_0 := ((update_subrange_vec_dec r.Mstatush_Mstatush_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Mstatush_bits:Mstatush ->(32)words$word -> Mstatush) v x= (( v with<| Mstatush_Mstatush_chunk_0 := ((update_subrange_vec_dec v.Mstatush_Mstatush_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)))`; (*val _get_Mstatush_MBE : Mstatush -> mword ty1*) val _ = Define ` ((get_Mstatush_MBE:Mstatush ->(1)words$word) v= ((subrange_vec_dec v.Mstatush_Mstatush_chunk_0 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)))`; (*val _set_Mstatush_MBE : register_ref regstate register_value Mstatush -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatush_MBE:((regstate),(register_value),(Mstatush))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatush_Mstatush_chunk_0 := ((update_subrange_vec_dec r.Mstatush_Mstatush_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatush_MBE : Mstatush -> mword ty1 -> Mstatush*) val _ = Define ` ((update_Mstatush_MBE:Mstatush ->(1)words$word -> Mstatush) v x= (( v with<| Mstatush_Mstatush_chunk_0 := ((update_subrange_vec_dec v.Mstatush_Mstatush_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)))`; (*val _get_Mstatush_SBE : Mstatush -> mword ty1*) val _ = Define ` ((get_Mstatush_SBE:Mstatush ->(1)words$word) v= ((subrange_vec_dec v.Mstatush_Mstatush_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; (*val _set_Mstatush_SBE : register_ref regstate register_value Mstatush -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatush_SBE:((regstate),(register_value),(Mstatush))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatush_Mstatush_chunk_0 := ((update_subrange_vec_dec r.Mstatush_Mstatush_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatush_SBE : Mstatush -> mword ty1 -> Mstatush*) val _ = Define ` ((update_Mstatush_SBE:Mstatush ->(1)words$word -> Mstatush) v x= (( v with<| Mstatush_Mstatush_chunk_0 := ((update_subrange_vec_dec v.Mstatush_Mstatush_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)))`; (*val Mk_Mstatus : mword ty64 -> Mstatus*) val _ = Define ` ((Mk_Mstatus:(64)words$word -> Mstatus) v= (<| Mstatus_Mstatus_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Mstatus_bits:Mstatus ->(64)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Mstatus_bits:((regstate),(register_value),(Mstatus))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Mstatus_bits:Mstatus ->(64)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; (*val _get_Mstatus_SD : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_SD:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 63 : int):ii) (( 63 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_SD : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_SD:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 63 : int):ii) (( 63 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_SD : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_SD:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 63 : int):ii) (( 63 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_SD : Sstatus -> mword ty1 -> Sstatus*) (*val _get_Sstatus_SD : Sstatus -> mword ty1*) (*val _set_Sstatus_SD : register_ref regstate register_value Sstatus -> mword ty1 -> M unit*) (*val _get_Mstatus_TSR : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_TSR:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 22 : int):ii) (( 22 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_TSR : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_TSR:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 22 : int):ii) (( 22 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_TSR : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_TSR:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 22 : int):ii) (( 22 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Mstatus_TW : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_TW:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 21 : int):ii) (( 21 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_TW : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_TW:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 21 : int):ii) (( 21 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_TW : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_TW:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 21 : int):ii) (( 21 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Mstatus_TVM : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_TVM:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 20 : int):ii) (( 20 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_TVM : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_TVM:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 20 : int):ii) (( 20 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_TVM : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_TVM:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 20 : int):ii) (( 20 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Mstatus_MXR : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_MXR:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 19 : int):ii) (( 19 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_MXR : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_MXR:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 19 : int):ii) (( 19 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_MXR : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_MXR:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 19 : int):ii) (( 19 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_MXR : Sstatus -> mword ty1 -> Sstatus*) (*val _get_Sstatus_MXR : Sstatus -> mword ty1*) (*val _set_Sstatus_MXR : register_ref regstate register_value Sstatus -> mword ty1 -> M unit*) (*val _get_Mstatus_SUM : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_SUM:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 18 : int):ii) (( 18 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_SUM : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_SUM:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 18 : int):ii) (( 18 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_SUM : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_SUM:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 18 : int):ii) (( 18 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_SUM : Sstatus -> mword ty1 -> Sstatus*) (*val _get_Sstatus_SUM : Sstatus -> mword ty1*) (*val _set_Sstatus_SUM : register_ref regstate register_value Sstatus -> mword ty1 -> M unit*) (*val _get_Mstatus_MPRV : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_MPRV:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 17 : int):ii) (( 17 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_MPRV : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_MPRV:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 17 : int):ii) (( 17 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_MPRV : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_MPRV:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 17 : int):ii) (( 17 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Mstatus_XS : Mstatus -> mword ty2*) val _ = Define ` ((get_Mstatus_XS:Mstatus ->(2)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 16 : int):ii) (( 15 : int):ii) : 2 words$word)))`; (*val _set_Mstatus_XS : register_ref regstate register_value Mstatus -> mword ty2 -> M unit*) val _ = Define ` ((set_Mstatus_XS:((regstate),(register_value),(Mstatus))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 16 : int):ii) (( 15 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_XS : Mstatus -> mword ty2 -> Mstatus*) val _ = Define ` ((update_Mstatus_XS:Mstatus ->(2)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 16 : int):ii) (( 15 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_XS : Sstatus -> mword ty2 -> Sstatus*) (*val _get_Sstatus_XS : Sstatus -> mword ty2*) (*val _set_Sstatus_XS : register_ref regstate register_value Sstatus -> mword ty2 -> M unit*) (*val _get_Mstatus_FS : Mstatus -> mword ty2*) val _ = Define ` ((get_Mstatus_FS:Mstatus ->(2)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)))`; (*val _set_Mstatus_FS : register_ref regstate register_value Mstatus -> mword ty2 -> M unit*) val _ = Define ` ((set_Mstatus_FS:((regstate),(register_value),(Mstatus))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 14 : int):ii) (( 13 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_FS : Mstatus -> mword ty2 -> Mstatus*) val _ = Define ` ((update_Mstatus_FS:Mstatus ->(2)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 14 : int):ii) (( 13 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_FS : Sstatus -> mword ty2 -> Sstatus*) (*val _get_Sstatus_FS : Sstatus -> mword ty2*) (*val _set_Sstatus_FS : register_ref regstate register_value Sstatus -> mword ty2 -> M unit*) (*val _get_Mstatus_MPP : Mstatus -> mword ty2*) val _ = Define ` ((get_Mstatus_MPP:Mstatus ->(2)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 12 : int):ii) (( 11 : int):ii) : 2 words$word)))`; (*val _set_Mstatus_MPP : register_ref regstate register_value Mstatus -> mword ty2 -> M unit*) val _ = Define ` ((set_Mstatus_MPP:((regstate),(register_value),(Mstatus))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 12 : int):ii) (( 11 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_MPP : Mstatus -> mword ty2 -> Mstatus*) val _ = Define ` ((update_Mstatus_MPP:Mstatus ->(2)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 12 : int):ii) (( 11 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)))`; (*val _get_Mstatus_SPP : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_SPP:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_SPP : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_SPP:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_SPP : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_SPP:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_SPP : Sstatus -> mword ty1 -> Sstatus*) (*val _get_Sstatus_SPP : Sstatus -> mword ty1*) (*val _set_Sstatus_SPP : register_ref regstate register_value Sstatus -> mword ty1 -> M unit*) (*val _get_Mstatus_MPIE : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_MPIE:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_MPIE : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_MPIE:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_MPIE : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_MPIE:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Mstatus_SPIE : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_SPIE:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_SPIE : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_SPIE:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_SPIE : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_SPIE:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_SPIE : Sstatus -> mword ty1 -> Sstatus*) (*val _get_Sstatus_SPIE : Sstatus -> mword ty1*) (*val _set_Sstatus_SPIE : register_ref regstate register_value Sstatus -> mword ty1 -> M unit*) (*val _get_Mstatus_UPIE : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_UPIE:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_UPIE : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_UPIE:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_UPIE : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_UPIE:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_UPIE : Sstatus -> mword ty1 -> Sstatus*) (*val _update_Ustatus_UPIE : Ustatus -> mword ty1 -> Ustatus*) (*val _get_Sstatus_UPIE : Sstatus -> mword ty1*) (*val _get_Ustatus_UPIE : Ustatus -> mword ty1*) (*val _set_Sstatus_UPIE : register_ref regstate register_value Sstatus -> mword ty1 -> M unit*) (*val _set_Ustatus_UPIE : register_ref regstate register_value Ustatus -> mword ty1 -> M unit*) (*val _get_Mstatus_MIE : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_MIE:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_MIE : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_MIE:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_MIE : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_MIE:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Mstatus_SIE : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_SIE:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_SIE : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_SIE:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_SIE : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_SIE:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_SIE : Sstatus -> mword ty1 -> Sstatus*) (*val _get_Sstatus_SIE : Sstatus -> mword ty1*) (*val _set_Sstatus_SIE : register_ref regstate register_value Sstatus -> mword ty1 -> M unit*) (*val _get_Mstatus_UIE : Mstatus -> mword ty1*) val _ = Define ` ((get_Mstatus_UIE:Mstatus ->(1)words$word) v= ((subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; (*val _set_Mstatus_UIE : register_ref regstate register_value Mstatus -> mword ty1 -> M unit*) val _ = Define ` ((set_Mstatus_UIE:((regstate),(register_value),(Mstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec r.Mstatus_Mstatus_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mstatus_UIE : Mstatus -> mword ty1 -> Mstatus*) val _ = Define ` ((update_Mstatus_UIE:Mstatus ->(1)words$word -> Mstatus) v x= (( v with<| Mstatus_Mstatus_chunk_0 := ((update_subrange_vec_dec v.Mstatus_Mstatus_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sstatus_UIE : Sstatus -> mword ty1 -> Sstatus*) (*val _update_Ustatus_UIE : Ustatus -> mword ty1 -> Ustatus*) (*val _get_Sstatus_UIE : Sstatus -> mword ty1*) (*val _get_Ustatus_UIE : Ustatus -> mword ty1*) (*val _set_Sstatus_UIE : register_ref regstate register_value Sstatus -> mword ty1 -> M unit*) (*val _set_Ustatus_UIE : register_ref regstate register_value Ustatus -> mword ty1 -> M unit*) (*val effectivePrivilege : AccessType unit -> Mstatus -> Privilege -> M Privilege*) val _ = Define ` ((effectivePrivilege:(ext_access_type)AccessType -> Mstatus -> Privilege ->(regstate)sail2_state_monad$sequential_state ->(((Privilege),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (t : ext_access_type AccessType) (m : Mstatus) (priv : Privilege)= (if ((((((t <> (Execute () )))) /\ (((((get_Mstatus_MPRV m : 1 words$word)) = (0b1w : 1 words$word))))))) then privLevel_of_bits ((get_Mstatus_MPP m : 2 words$word)) else sail2_state_monad$returnS priv))`; (*val get_mstatus_SXL : Mstatus -> mword ty2*) val _ = Define ` ((get_mstatus_SXL:Mstatus ->(2)words$word) m= ((subrange_vec_dec ((get_Mstatus_bits m : 64 words$word)) (( 35 : int):ii) (( 34 : int):ii) : 2 words$word)))`; (*val set_mstatus_SXL : Mstatus -> mword ty2 -> Mstatus*) val _ = Define ` ((set_mstatus_SXL:Mstatus ->(2)words$word -> Mstatus) (m : Mstatus) (a : arch_xlen)= (let m = ((update_subrange_vec_dec ((get_Mstatus_bits m : 64 words$word)) (( 35 : int):ii) (( 34 : int):ii) a : 64 words$word)) in Mk_Mstatus m))`; (*val get_mstatus_UXL : Mstatus -> mword ty2*) val _ = Define ` ((get_mstatus_UXL:Mstatus ->(2)words$word) m= ((subrange_vec_dec ((get_Mstatus_bits m : 64 words$word)) (( 33 : int):ii) (( 32 : int):ii) : 2 words$word)))`; (*val set_mstatus_UXL : Mstatus -> mword ty2 -> Mstatus*) val _ = Define ` ((set_mstatus_UXL:Mstatus ->(2)words$word -> Mstatus) (m : Mstatus) (a : arch_xlen)= (let m = ((update_subrange_vec_dec ((get_Mstatus_bits m : 64 words$word)) (( 33 : int):ii) (( 32 : int):ii) a : 64 words$word)) in Mk_Mstatus m))`; (*val legalize_mstatus : Mstatus -> mword ty64 -> M Mstatus*) val _ = Define ` ((legalize_mstatus:Mstatus ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Mstatus),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (o1 : Mstatus) (v : xlenbits)= (let (m : Mstatus) = (Mk_Mstatus ((EXTZ (( 64 : int):ii) ((concat_vec ((subrange_vec_dec v (( 22 : int):ii) (( 11 : int):ii) : 12 words$word)) ((concat_vec (0b00w : 2 words$word) ((concat_vec ((subrange_vec_dec v (( 8 : int):ii) (( 7 : int):ii) : 2 words$word)) ((concat_vec (0b0w : 1 words$word) ((concat_vec ((subrange_vec_dec v (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) ((concat_vec (0b0w : 1 words$word) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 3 words$word)) : 6 words$word)) : 7 words$word)) : 9 words$word)) : 11 words$word)) : 23 words$word)) : 64 words$word))) in let m = (update_Mstatus_XS m ((extStatus_to_bits Off : 2 words$word))) in sail2_state_monad$bindS (sail2_state$or_boolS ( sail2_state_monad$bindS(extStatus_of_bits ((get_Mstatus_FS m : 2 words$word))) (\ (w__0 : ExtStatus) . sail2_state_monad$returnS (((w__0 = Dirty))))) ( sail2_state_monad$bindS(extStatus_of_bits ((get_Mstatus_XS m : 2 words$word))) (\ (w__1 : ExtStatus) . sail2_state_monad$returnS (((w__1 = Dirty)))))) (\ dirty . let m = (update_Mstatus_SD m ((bool_to_bits dirty : 1 words$word))) in let m = (set_mstatus_SXL m ((get_mstatus_SXL o1 : 2 words$word))) in let m = (set_mstatus_UXL m ((get_mstatus_UXL o1 : 2 words$word))) in let m = (Mk_Mstatus ((update_subrange_vec_dec ((get_Mstatus_bits m : 64 words$word)) (( 37 : int):ii) (( 36 : int):ii) (0b00w : 2 words$word) : 64 words$word))) in sail2_state_monad$bindS (haveNExt () ) (\ (w__2 : bool) . let m = (if ((~ w__2)) then let m = (update_Mstatus_UPIE m (0b0w : 1 words$word)) in update_Mstatus_UIE m (0b0w : 1 words$word) else m) in sail2_state_monad$bindS (haveUsrMode () ) (\ (w__3 : bool) . sail2_state_monad$returnS (if ((~ w__3)) then update_Mstatus_MPRV m (0b0w : 1 words$word) else m))))))`; (*val cur_Architecture : unit -> M Architecture*) val _ = Define ` ((cur_Architecture:unit ->(regstate)sail2_state_monad$sequential_state ->(((Architecture),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__0 : Privilege) . sail2_state_monad$bindS (case w__0 of Machine => sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__1 : Misa) . sail2_state_monad$returnS ((get_Misa_MXL w__1 : 2 words$word))) | Supervisor => sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__2 : Mstatus) . sail2_state_monad$returnS ((get_mstatus_SXL w__2 : 2 words$word))) | User => sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__3 : Mstatus) . sail2_state_monad$returnS ((get_mstatus_UXL w__3 : 2 words$word))) ) (\ (a : arch_xlen) . (case ((architecture a)) of SOME (a) => sail2_state_monad$returnS a | NONE => internal_error "Invalid current architecture" )))))`; (*val in32BitMode : unit -> M bool*) val _ = Define ` ((in32BitMode:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (cur_Architecture () ) (\ (w__0 : Architecture) . sail2_state_monad$returnS (((w__0 = RV32))))))`; (*val haveFExt : unit -> M bool*) val _ = Define ` ((haveFExt:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state$and_boolS ( sail2_state_monad$bindS(sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS (((((get_Misa_F w__0 : 1 words$word)) = (0b1w : 1 words$word)))))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS mstatus_ref) (\ (w__1 : Mstatus) . sail2_state_monad$returnS (((((get_Mstatus_FS w__1 : 2 words$word)) <> (0b00w : 2 words$word))))))))`; (*val haveDExt : unit -> M bool*) val _ = Define ` ((haveDExt:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state$and_boolS ( sail2_state_monad$bindS(sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS (((((get_Misa_D w__0 : 1 words$word)) = (0b1w : 1 words$word)))))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS mstatus_ref) (\ (w__1 : Mstatus) . sail2_state_monad$returnS (((((get_Mstatus_FS w__1 : 2 words$word)) <> (0b00w : 2 words$word))))))))`; (*val Mk_Minterrupts : mword ty64 -> Minterrupts*) val _ = Define ` ((Mk_Minterrupts:(64)words$word -> Minterrupts) v= (<| Minterrupts_Minterrupts_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Minterrupts_bits:Minterrupts ->(64)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Minterrupts_bits:((regstate),(register_value),(Minterrupts))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Minterrupts_bits:Minterrupts ->(64)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; (*val _get_Minterrupts_MEI : Minterrupts -> mword ty1*) val _ = Define ` ((get_Minterrupts_MEI:Minterrupts ->(1)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 11 : int):ii) (( 11 : int):ii) : 1 words$word)))`; (*val _set_Minterrupts_MEI : register_ref regstate register_value Minterrupts -> mword ty1 -> M unit*) val _ = Define ` ((set_Minterrupts_MEI:((regstate),(register_value),(Minterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 11 : int):ii) (( 11 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Minterrupts_MEI : Minterrupts -> mword ty1 -> Minterrupts*) val _ = Define ` ((update_Minterrupts_MEI:Minterrupts ->(1)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 11 : int):ii) (( 11 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Minterrupts_SEI : Minterrupts -> mword ty1*) val _ = Define ` ((get_Minterrupts_SEI:Minterrupts ->(1)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 9 : int):ii) (( 9 : int):ii) : 1 words$word)))`; (*val _set_Minterrupts_SEI : register_ref regstate register_value Minterrupts -> mword ty1 -> M unit*) val _ = Define ` ((set_Minterrupts_SEI:((regstate),(register_value),(Minterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 9 : int):ii) (( 9 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Minterrupts_SEI : Minterrupts -> mword ty1 -> Minterrupts*) val _ = Define ` ((update_Minterrupts_SEI:Minterrupts ->(1)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 9 : int):ii) (( 9 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sinterrupts_SEI : Sinterrupts -> mword ty1 -> Sinterrupts*) (*val _get_Sinterrupts_SEI : Sinterrupts -> mword ty1*) (*val _set_Sinterrupts_SEI : register_ref regstate register_value Sinterrupts -> mword ty1 -> M unit*) (*val _get_Minterrupts_UEI : Minterrupts -> mword ty1*) val _ = Define ` ((get_Minterrupts_UEI:Minterrupts ->(1)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)))`; (*val _set_Minterrupts_UEI : register_ref regstate register_value Minterrupts -> mword ty1 -> M unit*) val _ = Define ` ((set_Minterrupts_UEI:((regstate),(register_value),(Minterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Minterrupts_UEI : Minterrupts -> mword ty1 -> Minterrupts*) val _ = Define ` ((update_Minterrupts_UEI:Minterrupts ->(1)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sinterrupts_UEI : Sinterrupts -> mword ty1 -> Sinterrupts*) (*val _update_Uinterrupts_UEI : Uinterrupts -> mword ty1 -> Uinterrupts*) (*val _get_Sinterrupts_UEI : Sinterrupts -> mword ty1*) (*val _get_Uinterrupts_UEI : Uinterrupts -> mword ty1*) (*val _set_Sinterrupts_UEI : register_ref regstate register_value Sinterrupts -> mword ty1 -> M unit*) (*val _set_Uinterrupts_UEI : register_ref regstate register_value Uinterrupts -> mword ty1 -> M unit*) (*val _get_Minterrupts_MTI : Minterrupts -> mword ty1*) val _ = Define ` ((get_Minterrupts_MTI:Minterrupts ->(1)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)))`; (*val _set_Minterrupts_MTI : register_ref regstate register_value Minterrupts -> mword ty1 -> M unit*) val _ = Define ` ((set_Minterrupts_MTI:((regstate),(register_value),(Minterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Minterrupts_MTI : Minterrupts -> mword ty1 -> Minterrupts*) val _ = Define ` ((update_Minterrupts_MTI:Minterrupts ->(1)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Minterrupts_STI : Minterrupts -> mword ty1*) val _ = Define ` ((get_Minterrupts_STI:Minterrupts ->(1)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)))`; (*val _set_Minterrupts_STI : register_ref regstate register_value Minterrupts -> mword ty1 -> M unit*) val _ = Define ` ((set_Minterrupts_STI:((regstate),(register_value),(Minterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Minterrupts_STI : Minterrupts -> mword ty1 -> Minterrupts*) val _ = Define ` ((update_Minterrupts_STI:Minterrupts ->(1)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sinterrupts_STI : Sinterrupts -> mword ty1 -> Sinterrupts*) (*val _get_Sinterrupts_STI : Sinterrupts -> mword ty1*) (*val _set_Sinterrupts_STI : register_ref regstate register_value Sinterrupts -> mword ty1 -> M unit*) (*val _get_Minterrupts_UTI : Minterrupts -> mword ty1*) val _ = Define ` ((get_Minterrupts_UTI:Minterrupts ->(1)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; (*val _set_Minterrupts_UTI : register_ref regstate register_value Minterrupts -> mword ty1 -> M unit*) val _ = Define ` ((set_Minterrupts_UTI:((regstate),(register_value),(Minterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Minterrupts_UTI : Minterrupts -> mword ty1 -> Minterrupts*) val _ = Define ` ((update_Minterrupts_UTI:Minterrupts ->(1)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sinterrupts_UTI : Sinterrupts -> mword ty1 -> Sinterrupts*) (*val _update_Uinterrupts_UTI : Uinterrupts -> mword ty1 -> Uinterrupts*) (*val _get_Sinterrupts_UTI : Sinterrupts -> mword ty1*) (*val _get_Uinterrupts_UTI : Uinterrupts -> mword ty1*) (*val _set_Sinterrupts_UTI : register_ref regstate register_value Sinterrupts -> mword ty1 -> M unit*) (*val _set_Uinterrupts_UTI : register_ref regstate register_value Uinterrupts -> mword ty1 -> M unit*) (*val _get_Minterrupts_MSI : Minterrupts -> mword ty1*) val _ = Define ` ((get_Minterrupts_MSI:Minterrupts ->(1)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)))`; (*val _set_Minterrupts_MSI : register_ref regstate register_value Minterrupts -> mword ty1 -> M unit*) val _ = Define ` ((set_Minterrupts_MSI:((regstate),(register_value),(Minterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Minterrupts_MSI : Minterrupts -> mword ty1 -> Minterrupts*) val _ = Define ` ((update_Minterrupts_MSI:Minterrupts ->(1)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Minterrupts_SSI : Minterrupts -> mword ty1*) val _ = Define ` ((get_Minterrupts_SSI:Minterrupts ->(1)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; (*val _set_Minterrupts_SSI : register_ref regstate register_value Minterrupts -> mword ty1 -> M unit*) val _ = Define ` ((set_Minterrupts_SSI:((regstate),(register_value),(Minterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Minterrupts_SSI : Minterrupts -> mword ty1 -> Minterrupts*) val _ = Define ` ((update_Minterrupts_SSI:Minterrupts ->(1)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sinterrupts_SSI : Sinterrupts -> mword ty1 -> Sinterrupts*) (*val _get_Sinterrupts_SSI : Sinterrupts -> mword ty1*) (*val _set_Sinterrupts_SSI : register_ref regstate register_value Sinterrupts -> mword ty1 -> M unit*) (*val _get_Minterrupts_USI : Minterrupts -> mword ty1*) val _ = Define ` ((get_Minterrupts_USI:Minterrupts ->(1)words$word) v= ((subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; (*val _set_Minterrupts_USI : register_ref regstate register_value Minterrupts -> mword ty1 -> M unit*) val _ = Define ` ((set_Minterrupts_USI:((regstate),(register_value),(Minterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec r.Minterrupts_Minterrupts_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Minterrupts_USI : Minterrupts -> mword ty1 -> Minterrupts*) val _ = Define ` ((update_Minterrupts_USI:Minterrupts ->(1)words$word -> Minterrupts) v x= (( v with<| Minterrupts_Minterrupts_chunk_0 := ((update_subrange_vec_dec v.Minterrupts_Minterrupts_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sinterrupts_USI : Sinterrupts -> mword ty1 -> Sinterrupts*) (*val _update_Uinterrupts_USI : Uinterrupts -> mword ty1 -> Uinterrupts*) (*val _get_Sinterrupts_USI : Sinterrupts -> mword ty1*) (*val _get_Uinterrupts_USI : Uinterrupts -> mword ty1*) (*val _set_Sinterrupts_USI : register_ref regstate register_value Sinterrupts -> mword ty1 -> M unit*) (*val _set_Uinterrupts_USI : register_ref regstate register_value Uinterrupts -> mword ty1 -> M unit*) (*val legalize_mip : Minterrupts -> mword ty64 -> M Minterrupts*) val _ = Define ` ((legalize_mip:Minterrupts ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Minterrupts),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (o1 : Minterrupts) (v : xlenbits)= (let v = (Mk_Minterrupts v) in let m = (update_Minterrupts_SEI o1 ((get_Minterrupts_SEI v : 1 words$word))) in let m = (update_Minterrupts_STI m ((get_Minterrupts_STI v : 1 words$word))) in let m = (update_Minterrupts_SSI m ((get_Minterrupts_SSI v : 1 words$word))) in sail2_state_monad$bindS (sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () ))) (\ (w__2 : bool) . sail2_state_monad$returnS (if w__2 then let m = (update_Minterrupts_UEI m ((get_Minterrupts_UEI v : 1 words$word))) in let m = (update_Minterrupts_UTI m ((get_Minterrupts_UTI v : 1 words$word))) in update_Minterrupts_USI m ((get_Minterrupts_USI v : 1 words$word)) else m))))`; (*val legalize_mie : Minterrupts -> mword ty64 -> M Minterrupts*) val _ = Define ` ((legalize_mie:Minterrupts ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Minterrupts),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (o1 : Minterrupts) (v : xlenbits)= (let v = (Mk_Minterrupts v) in let m = (update_Minterrupts_MEI o1 ((get_Minterrupts_MEI v : 1 words$word))) in let m = (update_Minterrupts_MTI m ((get_Minterrupts_MTI v : 1 words$word))) in let m = (update_Minterrupts_MSI m ((get_Minterrupts_MSI v : 1 words$word))) in let m = (update_Minterrupts_SEI m ((get_Minterrupts_SEI v : 1 words$word))) in let m = (update_Minterrupts_STI m ((get_Minterrupts_STI v : 1 words$word))) in let m = (update_Minterrupts_SSI m ((get_Minterrupts_SSI v : 1 words$word))) in sail2_state_monad$bindS (sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () ))) (\ (w__2 : bool) . sail2_state_monad$returnS (if w__2 then let m = (update_Minterrupts_UEI m ((get_Minterrupts_UEI v : 1 words$word))) in let m = (update_Minterrupts_UTI m ((get_Minterrupts_UTI v : 1 words$word))) in update_Minterrupts_USI m ((get_Minterrupts_USI v : 1 words$word)) else m))))`; (*val legalize_mideleg : Minterrupts -> mword ty64 -> Minterrupts*) val _ = Define ` ((legalize_mideleg:Minterrupts ->(64)words$word -> Minterrupts) (o1 : Minterrupts) (v : xlenbits)= (let m = (Mk_Minterrupts v) in let m = (update_Minterrupts_MEI m (0b0w : 1 words$word)) in let m = (update_Minterrupts_MTI m (0b0w : 1 words$word)) in update_Minterrupts_MSI m (0b0w : 1 words$word)))`; (*val Mk_Medeleg : mword ty64 -> Medeleg*) val _ = Define ` ((Mk_Medeleg:(64)words$word -> Medeleg) v= (<| Medeleg_Medeleg_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Medeleg_bits:Medeleg ->(64)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Medeleg_bits:((regstate),(register_value),(Medeleg))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Medeleg_bits:Medeleg ->(64)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; (*val _get_Medeleg_SAMO_Page_Fault : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_SAMO_Page_Fault:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 15 : int):ii) (( 15 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_SAMO_Page_Fault : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_SAMO_Page_Fault:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 15 : int):ii) (( 15 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_SAMO_Page_Fault : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_SAMO_Page_Fault:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 15 : int):ii) (( 15 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Medeleg_Load_Page_Fault : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_Load_Page_Fault:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 13 : int):ii) (( 13 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_Load_Page_Fault : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_Load_Page_Fault:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 13 : int):ii) (( 13 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_Load_Page_Fault : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_Load_Page_Fault:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 13 : int):ii) (( 13 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Medeleg_Fetch_Page_Fault : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_Fetch_Page_Fault:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_Fetch_Page_Fault : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_Fetch_Page_Fault:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 12 : int):ii) (( 12 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_Fetch_Page_Fault : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_Fetch_Page_Fault:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 12 : int):ii) (( 12 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Medeleg_MEnvCall : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_MEnvCall:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 10 : int):ii) (( 10 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_MEnvCall : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_MEnvCall:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 10 : int):ii) (( 10 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_MEnvCall : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_MEnvCall:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 10 : int):ii) (( 10 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Medeleg_SEnvCall : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_SEnvCall:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 9 : int):ii) (( 9 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_SEnvCall : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_SEnvCall:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 9 : int):ii) (( 9 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_SEnvCall : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_SEnvCall:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 9 : int):ii) (( 9 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Medeleg_UEnvCall : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_UEnvCall:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_UEnvCall : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_UEnvCall:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_UEnvCall : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_UEnvCall:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sedeleg_UEnvCall : Sedeleg -> mword ty1 -> Sedeleg*) (*val _get_Sedeleg_UEnvCall : Sedeleg -> mword ty1*) (*val _set_Sedeleg_UEnvCall : register_ref regstate register_value Sedeleg -> mword ty1 -> M unit*) (*val _get_Medeleg_SAMO_Access_Fault : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_SAMO_Access_Fault:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_SAMO_Access_Fault : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_SAMO_Access_Fault:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_SAMO_Access_Fault : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_SAMO_Access_Fault:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sedeleg_SAMO_Access_Fault : Sedeleg -> mword ty1 -> Sedeleg*) (*val _get_Sedeleg_SAMO_Access_Fault : Sedeleg -> mword ty1*) (*val _set_Sedeleg_SAMO_Access_Fault : register_ref regstate register_value Sedeleg -> mword ty1 -> M unit*) (*val _get_Medeleg_SAMO_Addr_Align : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_SAMO_Addr_Align:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_SAMO_Addr_Align : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_SAMO_Addr_Align:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 6 : int):ii) (( 6 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_SAMO_Addr_Align : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_SAMO_Addr_Align:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 6 : int):ii) (( 6 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sedeleg_SAMO_Addr_Align : Sedeleg -> mword ty1 -> Sedeleg*) (*val _get_Sedeleg_SAMO_Addr_Align : Sedeleg -> mword ty1*) (*val _set_Sedeleg_SAMO_Addr_Align : register_ref regstate register_value Sedeleg -> mword ty1 -> M unit*) (*val _get_Medeleg_Load_Access_Fault : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_Load_Access_Fault:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_Load_Access_Fault : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_Load_Access_Fault:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_Load_Access_Fault : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_Load_Access_Fault:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sedeleg_Load_Access_Fault : Sedeleg -> mword ty1 -> Sedeleg*) (*val _get_Sedeleg_Load_Access_Fault : Sedeleg -> mword ty1*) (*val _set_Sedeleg_Load_Access_Fault : register_ref regstate register_value Sedeleg -> mword ty1 -> M unit*) (*val _get_Medeleg_Load_Addr_Align : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_Load_Addr_Align:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_Load_Addr_Align : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_Load_Addr_Align:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_Load_Addr_Align : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_Load_Addr_Align:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sedeleg_Load_Addr_Align : Sedeleg -> mword ty1 -> Sedeleg*) (*val _get_Sedeleg_Load_Addr_Align : Sedeleg -> mword ty1*) (*val _set_Sedeleg_Load_Addr_Align : register_ref regstate register_value Sedeleg -> mword ty1 -> M unit*) (*val _get_Medeleg_Breakpoint : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_Breakpoint:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_Breakpoint : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_Breakpoint:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_Breakpoint : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_Breakpoint:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sedeleg_Breakpoint : Sedeleg -> mword ty1 -> Sedeleg*) (*val _get_Sedeleg_Breakpoint : Sedeleg -> mword ty1*) (*val _set_Sedeleg_Breakpoint : register_ref regstate register_value Sedeleg -> mword ty1 -> M unit*) (*val _get_Medeleg_Illegal_Instr : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_Illegal_Instr:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_Illegal_Instr : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_Illegal_Instr:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_Illegal_Instr : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_Illegal_Instr:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sedeleg_Illegal_Instr : Sedeleg -> mword ty1 -> Sedeleg*) (*val _get_Sedeleg_Illegal_Instr : Sedeleg -> mword ty1*) (*val _set_Sedeleg_Illegal_Instr : register_ref regstate register_value Sedeleg -> mword ty1 -> M unit*) (*val _get_Medeleg_Fetch_Access_Fault : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_Fetch_Access_Fault:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_Fetch_Access_Fault : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_Fetch_Access_Fault:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_Fetch_Access_Fault : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_Fetch_Access_Fault:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sedeleg_Fetch_Access_Fault : Sedeleg -> mword ty1 -> Sedeleg*) (*val _get_Sedeleg_Fetch_Access_Fault : Sedeleg -> mword ty1*) (*val _set_Sedeleg_Fetch_Access_Fault : register_ref regstate register_value Sedeleg -> mword ty1 -> M unit*) (*val _get_Medeleg_Fetch_Addr_Align : Medeleg -> mword ty1*) val _ = Define ` ((get_Medeleg_Fetch_Addr_Align:Medeleg ->(1)words$word) v= ((subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; (*val _set_Medeleg_Fetch_Addr_Align : register_ref regstate register_value Medeleg -> mword ty1 -> M unit*) val _ = Define ` ((set_Medeleg_Fetch_Addr_Align:((regstate),(register_value),(Medeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec r.Medeleg_Medeleg_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Medeleg_Fetch_Addr_Align : Medeleg -> mword ty1 -> Medeleg*) val _ = Define ` ((update_Medeleg_Fetch_Addr_Align:Medeleg ->(1)words$word -> Medeleg) v x= (( v with<| Medeleg_Medeleg_chunk_0 := ((update_subrange_vec_dec v.Medeleg_Medeleg_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _update_Sedeleg_Fetch_Addr_Align : Sedeleg -> mword ty1 -> Sedeleg*) (*val _get_Sedeleg_Fetch_Addr_Align : Sedeleg -> mword ty1*) (*val _set_Sedeleg_Fetch_Addr_Align : register_ref regstate register_value Sedeleg -> mword ty1 -> M unit*) (*val legalize_medeleg : Medeleg -> mword ty64 -> Medeleg*) val _ = Define ` ((legalize_medeleg:Medeleg ->(64)words$word -> Medeleg) (o1 : Medeleg) (v : xlenbits)= (let m = (Mk_Medeleg v) in update_Medeleg_MEnvCall m (0b0w : 1 words$word)))`; (*val Mk_Mtvec : mword ty64 -> Mtvec*) val _ = Define ` ((Mk_Mtvec:(64)words$word -> Mtvec) v= (<| Mtvec_Mtvec_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Mtvec_bits:Mtvec ->(64)words$word) v= ((subrange_vec_dec v.Mtvec_Mtvec_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Mtvec_bits:((regstate),(register_value),(Mtvec))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mtvec_Mtvec_chunk_0 := ((update_subrange_vec_dec r.Mtvec_Mtvec_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Mtvec_bits:Mtvec ->(64)words$word -> Mtvec) v x= (( v with<| Mtvec_Mtvec_chunk_0 := ((update_subrange_vec_dec v.Mtvec_Mtvec_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; (*val _get_Mtvec_Base : Mtvec -> mword ty62*) val _ = Define ` ((get_Mtvec_Base:Mtvec ->(62)words$word) v= ((subrange_vec_dec v.Mtvec_Mtvec_chunk_0 (( 63 : int):ii) (( 2 : int):ii) : 62 words$word)))`; (*val _set_Mtvec_Base : register_ref regstate register_value Mtvec -> mword ty62 -> M unit*) val _ = Define ` ((set_Mtvec_Base:((regstate),(register_value),(Mtvec))register_ref ->(62)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mtvec_Mtvec_chunk_0 := ((update_subrange_vec_dec r.Mtvec_Mtvec_chunk_0 (( 63 : int):ii) (( 2 : int):ii) ((subrange_vec_dec v (( 61 : int):ii) (( 0 : int):ii) : 62 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mtvec_Base : Mtvec -> mword ty62 -> Mtvec*) val _ = Define ` ((update_Mtvec_Base:Mtvec ->(62)words$word -> Mtvec) v x= (( v with<| Mtvec_Mtvec_chunk_0 := ((update_subrange_vec_dec v.Mtvec_Mtvec_chunk_0 (( 63 : int):ii) (( 2 : int):ii) ((subrange_vec_dec x (( 61 : int):ii) (( 0 : int):ii) : 62 words$word)) : 64 words$word)) |>)))`; (*val _get_Mtvec_Mode : Mtvec -> mword ty2*) val _ = Define ` ((get_Mtvec_Mode:Mtvec ->(2)words$word) v= ((subrange_vec_dec v.Mtvec_Mtvec_chunk_0 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)))`; (*val _set_Mtvec_Mode : register_ref regstate register_value Mtvec -> mword ty2 -> M unit*) val _ = Define ` ((set_Mtvec_Mode:((regstate),(register_value),(Mtvec))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mtvec_Mtvec_chunk_0 := ((update_subrange_vec_dec r.Mtvec_Mtvec_chunk_0 (( 1 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mtvec_Mode : Mtvec -> mword ty2 -> Mtvec*) val _ = Define ` ((update_Mtvec_Mode:Mtvec ->(2)words$word -> Mtvec) v x= (( v with<| Mtvec_Mtvec_chunk_0 := ((update_subrange_vec_dec v.Mtvec_Mtvec_chunk_0 (( 1 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)))`; (*val _update_Satp32_Mode : Satp32 -> mword ty1 -> Satp32*) (*val _update_Satp64_Mode : Satp64 -> mword ty4 -> Satp64*) (*val _get_Satp32_Mode : Satp32 -> mword ty1*) (*val _get_Satp64_Mode : Satp64 -> mword ty4*) (*val _set_Satp32_Mode : register_ref regstate register_value Satp32 -> mword ty1 -> M unit*) (*val _set_Satp64_Mode : register_ref regstate register_value Satp64 -> mword ty4 -> M unit*) (*val legalize_tvec : Mtvec -> mword ty64 -> Mtvec*) val _ = Define ` ((legalize_tvec:Mtvec ->(64)words$word -> Mtvec) (o1 : Mtvec) (v : xlenbits)= (let v = (Mk_Mtvec v) in (case ((trapVectorMode_of_bits ((get_Mtvec_Mode v : 2 words$word)))) of TV_Direct => v | TV_Vector => v | _ => update_Mtvec_Mode v ((get_Mtvec_Mode o1 : 2 words$word)) )))`; (*val Mk_Mcause : mword ty64 -> Mcause*) val _ = Define ` ((Mk_Mcause:(64)words$word -> Mcause) v= (<| Mcause_Mcause_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Mcause_bits:Mcause ->(64)words$word) v= ((subrange_vec_dec v.Mcause_Mcause_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Mcause_bits:((regstate),(register_value),(Mcause))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mcause_Mcause_chunk_0 := ((update_subrange_vec_dec r.Mcause_Mcause_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Mcause_bits:Mcause ->(64)words$word -> Mcause) v x= (( v with<| Mcause_Mcause_chunk_0 := ((update_subrange_vec_dec v.Mcause_Mcause_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; (*val _get_Mcause_IsInterrupt : Mcause -> mword ty1*) val _ = Define ` ((get_Mcause_IsInterrupt:Mcause ->(1)words$word) v= ((subrange_vec_dec v.Mcause_Mcause_chunk_0 (( 63 : int):ii) (( 63 : int):ii) : 1 words$word)))`; (*val _set_Mcause_IsInterrupt : register_ref regstate register_value Mcause -> mword ty1 -> M unit*) val _ = Define ` ((set_Mcause_IsInterrupt:((regstate),(register_value),(Mcause))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mcause_Mcause_chunk_0 := ((update_subrange_vec_dec r.Mcause_Mcause_chunk_0 (( 63 : int):ii) (( 63 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mcause_IsInterrupt : Mcause -> mword ty1 -> Mcause*) val _ = Define ` ((update_Mcause_IsInterrupt:Mcause ->(1)words$word -> Mcause) v x= (( v with<| Mcause_Mcause_chunk_0 := ((update_subrange_vec_dec v.Mcause_Mcause_chunk_0 (( 63 : int):ii) (( 63 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val _get_Mcause_Cause : Mcause -> mword ty63*) val _ = Define ` ((get_Mcause_Cause:Mcause ->(63)words$word) v= ((subrange_vec_dec v.Mcause_Mcause_chunk_0 (( 62 : int):ii) (( 0 : int):ii) : 63 words$word)))`; (*val _set_Mcause_Cause : register_ref regstate register_value Mcause -> mword ty63 -> M unit*) val _ = Define ` ((set_Mcause_Cause:((regstate),(register_value),(Mcause))register_ref ->(63)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Mcause_Mcause_chunk_0 := ((update_subrange_vec_dec r.Mcause_Mcause_chunk_0 (( 62 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 62 : int):ii) (( 0 : int):ii) : 63 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Mcause_Cause : Mcause -> mword ty63 -> Mcause*) val _ = Define ` ((update_Mcause_Cause:Mcause ->(63)words$word -> Mcause) v x= (( v with<| Mcause_Mcause_chunk_0 := ((update_subrange_vec_dec v.Mcause_Mcause_chunk_0 (( 62 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 62 : int):ii) (( 0 : int):ii) : 63 words$word)) : 64 words$word)) |>)))`; (*val tvec_addr : Mtvec -> Mcause -> maybe (mword ty64)*) val _ = Define ` ((tvec_addr:Mtvec -> Mcause ->((64)words$word)option) (m : Mtvec) (c : Mcause)= (let (base : xlenbits) = ((concat_vec ((get_Mtvec_Base m : 62 words$word)) (0b00w : 2 words$word) : 64 words$word)) in (case ((trapVectorMode_of_bits ((get_Mtvec_Mode m : 2 words$word)))) of TV_Direct => SOME base | TV_Vector => if (((((get_Mcause_IsInterrupt c : 1 words$word)) = (0b1w : 1 words$word)))) then SOME ((add_vec base ((shiftl ((EXTZ (( 64 : int):ii) ((get_Mcause_Cause c : 63 words$word)) : 64 words$word)) (( 2 : int):ii) : 64 words$word)) : 64 words$word)) else SOME base | TV_Reserved => NONE )))`; (*val legalize_xepc : mword ty64 -> M (mword ty64)*) val _ = Define ` ((legalize_xepc:(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v= (sail2_state_monad$bindS (sail2_state$or_boolS (sail2_state_monad$returnS (((((sys_enable_writable_misa () )) /\ ((sys_enable_rvc () )))))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS (((((get_Misa_C w__0 : 1 words$word)) = (0b1w : 1 words$word))))))) (\ (w__1 : bool) . sail2_state_monad$returnS (if w__1 then (update_vec_dec v (( 0 : int):ii) B0 : 64 words$word) else (and_vec v ((EXTS (( 64 : int):ii) (0b100w : 3 words$word) : 64 words$word)) : 64 words$word)))))`; (*val pc_alignment_mask : unit -> M (mword ty64)*) val _ = Define ` ((pc_alignment_mask:unit ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__0 : Misa) . sail2_state_monad$returnS ((not_vec ((EXTZ (( 64 : int):ii) (if (((((get_Misa_C w__0 : 1 words$word)) = (0b1w : 1 words$word)))) then (0b00w : 2 words$word) else (0b10w : 2 words$word)) : 64 words$word)) : 64 words$word)))))`; (*val Mk_Counteren : mword ty32 -> Counteren*) val _ = Define ` ((Mk_Counteren:(32)words$word -> Counteren) v= (<| Counteren_Counteren_chunk_0 := ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) |>))`; val _ = Define ` ((get_Counteren_bits:Counteren ->(32)words$word) v= ((subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)))`; val _ = Define ` ((set_Counteren_bits:((regstate),(register_value),(Counteren))register_ref ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec r.Counteren_Counteren_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Counteren_bits:Counteren ->(32)words$word -> Counteren) v x= (( v with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)))`; (*val _get_Counteren_HPM : Counteren -> mword ty29*) val _ = Define ` ((get_Counteren_HPM:Counteren ->(29)words$word) v= ((subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 31 : int):ii) (( 3 : int):ii) : 29 words$word)))`; (*val _set_Counteren_HPM : register_ref regstate register_value Counteren -> mword ty29 -> M unit*) val _ = Define ` ((set_Counteren_HPM:((regstate),(register_value),(Counteren))register_ref ->(29)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec r.Counteren_Counteren_chunk_0 (( 31 : int):ii) (( 3 : int):ii) ((subrange_vec_dec v (( 28 : int):ii) (( 0 : int):ii) : 29 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Counteren_HPM : Counteren -> mword ty29 -> Counteren*) val _ = Define ` ((update_Counteren_HPM:Counteren ->(29)words$word -> Counteren) v x= (( v with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 31 : int):ii) (( 3 : int):ii) ((subrange_vec_dec x (( 28 : int):ii) (( 0 : int):ii) : 29 words$word)) : 32 words$word)) |>)))`; (*val _get_Counteren_IR : Counteren -> mword ty1*) val _ = Define ` ((get_Counteren_IR:Counteren ->(1)words$word) v= ((subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)))`; (*val _set_Counteren_IR : register_ref regstate register_value Counteren -> mword ty1 -> M unit*) val _ = Define ` ((set_Counteren_IR:((regstate),(register_value),(Counteren))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec r.Counteren_Counteren_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Counteren_IR : Counteren -> mword ty1 -> Counteren*) val _ = Define ` ((update_Counteren_IR:Counteren ->(1)words$word -> Counteren) v x= (( v with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)))`; (*val _update_Counterin_IR : Counterin -> mword ty1 -> Counterin*) (*val _get_Counterin_IR : Counterin -> mword ty1*) (*val _set_Counterin_IR : register_ref regstate register_value Counterin -> mword ty1 -> M unit*) (*val _get_Counteren_TM : Counteren -> mword ty1*) val _ = Define ` ((get_Counteren_TM:Counteren ->(1)words$word) v= ((subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; (*val _set_Counteren_TM : register_ref regstate register_value Counteren -> mword ty1 -> M unit*) val _ = Define ` ((set_Counteren_TM:((regstate),(register_value),(Counteren))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec r.Counteren_Counteren_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Counteren_TM : Counteren -> mword ty1 -> Counteren*) val _ = Define ` ((update_Counteren_TM:Counteren ->(1)words$word -> Counteren) v x= (( v with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)))`; (*val _get_Counteren_CY : Counteren -> mword ty1*) val _ = Define ` ((get_Counteren_CY:Counteren ->(1)words$word) v= ((subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; (*val _set_Counteren_CY : register_ref regstate register_value Counteren -> mword ty1 -> M unit*) val _ = Define ` ((set_Counteren_CY:((regstate),(register_value),(Counteren))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec r.Counteren_Counteren_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Counteren_CY : Counteren -> mword ty1 -> Counteren*) val _ = Define ` ((update_Counteren_CY:Counteren ->(1)words$word -> Counteren) v x= (( v with<| Counteren_Counteren_chunk_0 := ((update_subrange_vec_dec v.Counteren_Counteren_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)))`; (*val _update_Counterin_CY : Counterin -> mword ty1 -> Counterin*) (*val _get_Counterin_CY : Counterin -> mword ty1*) (*val _set_Counterin_CY : register_ref regstate register_value Counterin -> mword ty1 -> M unit*) (*val legalize_mcounteren : Counteren -> mword ty64 -> Counteren*) val _ = Define ` ((legalize_mcounteren:Counteren ->(64)words$word -> Counteren) (c : Counteren) (v : xlenbits)= (let c = (update_Counteren_IR c (vec_of_bits [access_vec_dec v (( 2 : int):ii)] : 1 words$word)) in let c = (update_Counteren_TM c (vec_of_bits [access_vec_dec v (( 1 : int):ii)] : 1 words$word)) in update_Counteren_CY c (vec_of_bits [access_vec_dec v (( 0 : int):ii)] : 1 words$word)))`; (*val legalize_scounteren : Counteren -> mword ty64 -> Counteren*) val _ = Define ` ((legalize_scounteren:Counteren ->(64)words$word -> Counteren) (c : Counteren) (v : xlenbits)= (let c = (update_Counteren_IR c (vec_of_bits [access_vec_dec v (( 2 : int):ii)] : 1 words$word)) in let c = (update_Counteren_TM c (vec_of_bits [access_vec_dec v (( 1 : int):ii)] : 1 words$word)) in update_Counteren_CY c (vec_of_bits [access_vec_dec v (( 0 : int):ii)] : 1 words$word)))`; (*val Mk_Counterin : mword ty32 -> Counterin*) val _ = Define ` ((Mk_Counterin:(32)words$word -> Counterin) v= (<| Counterin_Counterin_chunk_0 := ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) |>))`; val _ = Define ` ((get_Counterin_bits:Counterin ->(32)words$word) v= ((subrange_vec_dec v.Counterin_Counterin_chunk_0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)))`; val _ = Define ` ((set_Counterin_bits:((regstate),(register_value),(Counterin))register_ref ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Counterin_Counterin_chunk_0 := ((update_subrange_vec_dec r.Counterin_Counterin_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Counterin_bits:Counterin ->(32)words$word -> Counterin) v x= (( v with<| Counterin_Counterin_chunk_0 := ((update_subrange_vec_dec v.Counterin_Counterin_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)))`; val _ = Define ` ((get_Counterin_IR:Counterin ->(1)words$word) v= ((subrange_vec_dec v.Counterin_Counterin_chunk_0 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Counterin_IR:((regstate),(register_value),(Counterin))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Counterin_Counterin_chunk_0 := ((update_subrange_vec_dec r.Counterin_Counterin_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Counterin_IR:Counterin ->(1)words$word -> Counterin) v x= (( v with<| Counterin_Counterin_chunk_0 := ((update_subrange_vec_dec v.Counterin_Counterin_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)))`; val _ = Define ` ((get_Counterin_CY:Counterin ->(1)words$word) v= ((subrange_vec_dec v.Counterin_Counterin_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Counterin_CY:((regstate),(register_value),(Counterin))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Counterin_Counterin_chunk_0 := ((update_subrange_vec_dec r.Counterin_Counterin_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Counterin_CY:Counterin ->(1)words$word -> Counterin) v x= (( v with<| Counterin_Counterin_chunk_0 := ((update_subrange_vec_dec v.Counterin_Counterin_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)))`; (*val legalize_mcountinhibit : Counterin -> mword ty64 -> Counterin*) val _ = Define ` ((legalize_mcountinhibit:Counterin ->(64)words$word -> Counterin) (c : Counterin) (v : xlenbits)= (let c = (update_Counterin_IR c (vec_of_bits [access_vec_dec v (( 2 : int):ii)] : 1 words$word)) in update_Counterin_CY c (vec_of_bits [access_vec_dec v (( 0 : int):ii)] : 1 words$word)))`; (*val retire_instruction : unit -> M unit*) val _ = Define ` ((retire_instruction:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS minstret_written_ref) (\ (w__0 : bool) . if (((w__0 = T))) then sail2_state_monad$write_regS minstret_written_ref F else sail2_state_monad$bindS (sail2_state_monad$read_regS mcountinhibit_ref) (\ (w__1 : Counterin) . if (((((get_Counterin_IR w__1 : 1 words$word)) = (0b0w : 1 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS minstret_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . sail2_state_monad$write_regS minstret_ref ((add_vec_int w__2 (( 1 : int):ii) : 64 words$word))) else sail2_state_monad$returnS () ))))`; (*val Mk_Sstatus : mword ty64 -> Sstatus*) val _ = Define ` ((Mk_Sstatus:(64)words$word -> Sstatus) v= (<| Sstatus_Sstatus_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Sstatus_bits:Sstatus ->(64)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Sstatus_bits:((regstate),(register_value),(Sstatus))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_bits:Sstatus ->(64)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_SD:Sstatus ->(1)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 63 : int):ii) (( 63 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sstatus_SD:((regstate),(register_value),(Sstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 63 : int):ii) (( 63 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_SD:Sstatus ->(1)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 63 : int):ii) (( 63 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_MXR:Sstatus ->(1)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 19 : int):ii) (( 19 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sstatus_MXR:((regstate),(register_value),(Sstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 19 : int):ii) (( 19 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_MXR:Sstatus ->(1)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 19 : int):ii) (( 19 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_SUM:Sstatus ->(1)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 18 : int):ii) (( 18 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sstatus_SUM:((regstate),(register_value),(Sstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 18 : int):ii) (( 18 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_SUM:Sstatus ->(1)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 18 : int):ii) (( 18 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_XS:Sstatus ->(2)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 16 : int):ii) (( 15 : int):ii) : 2 words$word)))`; val _ = Define ` ((set_Sstatus_XS:((regstate),(register_value),(Sstatus))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 16 : int):ii) (( 15 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_XS:Sstatus ->(2)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 16 : int):ii) (( 15 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_FS:Sstatus ->(2)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)))`; val _ = Define ` ((set_Sstatus_FS:((regstate),(register_value),(Sstatus))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 14 : int):ii) (( 13 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_FS:Sstatus ->(2)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 14 : int):ii) (( 13 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_SPP:Sstatus ->(1)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sstatus_SPP:((regstate),(register_value),(Sstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_SPP:Sstatus ->(1)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_SPIE:Sstatus ->(1)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sstatus_SPIE:((regstate),(register_value),(Sstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_SPIE:Sstatus ->(1)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_UPIE:Sstatus ->(1)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sstatus_UPIE:((regstate),(register_value),(Sstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_UPIE:Sstatus ->(1)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_SIE:Sstatus ->(1)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sstatus_SIE:((regstate),(register_value),(Sstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_SIE:Sstatus ->(1)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sstatus_UIE:Sstatus ->(1)words$word) v= ((subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sstatus_UIE:((regstate),(register_value),(Sstatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec r.Sstatus_Sstatus_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sstatus_UIE:Sstatus ->(1)words$word -> Sstatus) v x= (( v with<| Sstatus_Sstatus_chunk_0 := ((update_subrange_vec_dec v.Sstatus_Sstatus_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val get_sstatus_UXL : Sstatus -> mword ty2*) val _ = Define ` ((get_sstatus_UXL:Sstatus ->(2)words$word) s= (let m = (Mk_Mstatus ((get_Sstatus_bits s : 64 words$word))) in (get_mstatus_UXL m : 2 words$word)))`; (*val set_sstatus_UXL : Sstatus -> mword ty2 -> Sstatus*) val _ = Define ` ((set_sstatus_UXL:Sstatus ->(2)words$word -> Sstatus) (s : Sstatus) (a : arch_xlen)= (let m = (Mk_Mstatus ((get_Sstatus_bits s : 64 words$word))) in let m = (set_mstatus_UXL m a) in Mk_Sstatus ((get_Mstatus_bits m : 64 words$word))))`; (*val lower_mstatus : Mstatus -> Sstatus*) val _ = Define ` ((lower_mstatus:Mstatus -> Sstatus) m= (let s = (Mk_Sstatus ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))) in let s = (update_Sstatus_SD s ((get_Mstatus_SD m : 1 words$word))) in let s = (set_sstatus_UXL s ((get_mstatus_UXL m : 2 words$word))) in let s = (update_Sstatus_MXR s ((get_Mstatus_MXR m : 1 words$word))) in let s = (update_Sstatus_SUM s ((get_Mstatus_SUM m : 1 words$word))) in let s = (update_Sstatus_XS s ((get_Mstatus_XS m : 2 words$word))) in let s = (update_Sstatus_FS s ((get_Mstatus_FS m : 2 words$word))) in let s = (update_Sstatus_SPP s ((get_Mstatus_SPP m : 1 words$word))) in let s = (update_Sstatus_SPIE s ((get_Mstatus_SPIE m : 1 words$word))) in let s = (update_Sstatus_UPIE s ((get_Mstatus_UPIE m : 1 words$word))) in let s = (update_Sstatus_SIE s ((get_Mstatus_SIE m : 1 words$word))) in update_Sstatus_UIE s ((get_Mstatus_UIE m : 1 words$word))))`; (*val lift_sstatus : Mstatus -> Sstatus -> M Mstatus*) val _ = Define ` ((lift_sstatus:Mstatus -> Sstatus ->(regstate)sail2_state_monad$sequential_state ->(((Mstatus),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (m : Mstatus) (s : Sstatus)= (let m = (update_Mstatus_MXR m ((get_Sstatus_MXR s : 1 words$word))) in let m = (update_Mstatus_SUM m ((get_Sstatus_SUM s : 1 words$word))) in let m = (update_Mstatus_XS m ((get_Sstatus_XS s : 2 words$word))) in let m = (update_Mstatus_FS m ((get_Sstatus_FS s : 2 words$word))) in sail2_state_monad$bindS (sail2_state$or_boolS ( sail2_state_monad$bindS(extStatus_of_bits ((get_Mstatus_FS m : 2 words$word))) (\ (w__0 : ExtStatus) . sail2_state_monad$returnS (((w__0 = Dirty))))) ( sail2_state_monad$bindS(extStatus_of_bits ((get_Mstatus_XS m : 2 words$word))) (\ (w__1 : ExtStatus) . sail2_state_monad$returnS (((w__1 = Dirty)))))) (\ dirty . let m = (update_Mstatus_SD m ((bool_to_bits dirty : 1 words$word))) in let m = (update_Mstatus_SPP m ((get_Sstatus_SPP s : 1 words$word))) in let m = (update_Mstatus_SPIE m ((get_Sstatus_SPIE s : 1 words$word))) in let m = (update_Mstatus_UPIE m ((get_Sstatus_UPIE s : 1 words$word))) in let m = (update_Mstatus_SIE m ((get_Sstatus_SIE s : 1 words$word))) in let m = (update_Mstatus_UIE m ((get_Sstatus_UIE s : 1 words$word))) in sail2_state_monad$returnS m)))`; (*val legalize_sstatus : Mstatus -> mword ty64 -> M Mstatus*) val _ = Define ` ((legalize_sstatus:Mstatus ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Mstatus),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (m : Mstatus) (v : xlenbits)= (sail2_state_monad$bindS (lift_sstatus m ((Mk_Sstatus v))) (\ (w__0 : Mstatus) . legalize_mstatus m ((get_Mstatus_bits w__0 : 64 words$word)))))`; (*val Mk_Sedeleg : mword ty64 -> Sedeleg*) val _ = Define ` ((Mk_Sedeleg:(64)words$word -> Sedeleg) v= (<| Sedeleg_Sedeleg_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Sedeleg_bits:Sedeleg ->(64)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Sedeleg_bits:((regstate),(register_value),(Sedeleg))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_bits:Sedeleg ->(64)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sedeleg_UEnvCall:Sedeleg ->(1)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sedeleg_UEnvCall:((regstate),(register_value),(Sedeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_UEnvCall:Sedeleg ->(1)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sedeleg_SAMO_Access_Fault:Sedeleg ->(1)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sedeleg_SAMO_Access_Fault:((regstate),(register_value),(Sedeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_SAMO_Access_Fault:Sedeleg ->(1)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sedeleg_SAMO_Addr_Align:Sedeleg ->(1)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sedeleg_SAMO_Addr_Align:((regstate),(register_value),(Sedeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 6 : int):ii) (( 6 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_SAMO_Addr_Align:Sedeleg ->(1)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 6 : int):ii) (( 6 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sedeleg_Load_Access_Fault:Sedeleg ->(1)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sedeleg_Load_Access_Fault:((regstate),(register_value),(Sedeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_Load_Access_Fault:Sedeleg ->(1)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sedeleg_Load_Addr_Align:Sedeleg ->(1)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sedeleg_Load_Addr_Align:((regstate),(register_value),(Sedeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_Load_Addr_Align:Sedeleg ->(1)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sedeleg_Breakpoint:Sedeleg ->(1)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sedeleg_Breakpoint:((regstate),(register_value),(Sedeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_Breakpoint:Sedeleg ->(1)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sedeleg_Illegal_Instr:Sedeleg ->(1)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sedeleg_Illegal_Instr:((regstate),(register_value),(Sedeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_Illegal_Instr:Sedeleg ->(1)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sedeleg_Fetch_Access_Fault:Sedeleg ->(1)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sedeleg_Fetch_Access_Fault:((regstate),(register_value),(Sedeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_Fetch_Access_Fault:Sedeleg ->(1)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sedeleg_Fetch_Addr_Align:Sedeleg ->(1)words$word) v= ((subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sedeleg_Fetch_Addr_Align:((regstate),(register_value),(Sedeleg))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec r.Sedeleg_Sedeleg_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sedeleg_Fetch_Addr_Align:Sedeleg ->(1)words$word -> Sedeleg) v x= (( v with<| Sedeleg_Sedeleg_chunk_0 := ((update_subrange_vec_dec v.Sedeleg_Sedeleg_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val legalize_sedeleg : Sedeleg -> mword ty64 -> Sedeleg*) val _ = Define ` ((legalize_sedeleg:Sedeleg ->(64)words$word -> Sedeleg) (s : Sedeleg) (v : xlenbits)= (Mk_Sedeleg ((EXTZ (( 64 : int):ii) ((subrange_vec_dec v (( 8 : int):ii) (( 0 : int):ii) : 9 words$word)) : 64 words$word))))`; (*val Mk_Sinterrupts : mword ty64 -> Sinterrupts*) val _ = Define ` ((Mk_Sinterrupts:(64)words$word -> Sinterrupts) v= (<| Sinterrupts_Sinterrupts_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Sinterrupts_bits:Sinterrupts ->(64)words$word) v= ((subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Sinterrupts_bits:((regstate),(register_value),(Sinterrupts))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec r.Sinterrupts_Sinterrupts_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sinterrupts_bits:Sinterrupts ->(64)words$word -> Sinterrupts) v x= (( v with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sinterrupts_SEI:Sinterrupts ->(1)words$word) v= ((subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 9 : int):ii) (( 9 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sinterrupts_SEI:((regstate),(register_value),(Sinterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec r.Sinterrupts_Sinterrupts_chunk_0 (( 9 : int):ii) (( 9 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sinterrupts_SEI:Sinterrupts ->(1)words$word -> Sinterrupts) v x= (( v with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 9 : int):ii) (( 9 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sinterrupts_UEI:Sinterrupts ->(1)words$word) v= ((subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sinterrupts_UEI:((regstate),(register_value),(Sinterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec r.Sinterrupts_Sinterrupts_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sinterrupts_UEI:Sinterrupts ->(1)words$word -> Sinterrupts) v x= (( v with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sinterrupts_STI:Sinterrupts ->(1)words$word) v= ((subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sinterrupts_STI:((regstate),(register_value),(Sinterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec r.Sinterrupts_Sinterrupts_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sinterrupts_STI:Sinterrupts ->(1)words$word -> Sinterrupts) v x= (( v with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sinterrupts_UTI:Sinterrupts ->(1)words$word) v= ((subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sinterrupts_UTI:((regstate),(register_value),(Sinterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec r.Sinterrupts_Sinterrupts_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sinterrupts_UTI:Sinterrupts ->(1)words$word -> Sinterrupts) v x= (( v with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sinterrupts_SSI:Sinterrupts ->(1)words$word) v= ((subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sinterrupts_SSI:((regstate),(register_value),(Sinterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec r.Sinterrupts_Sinterrupts_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sinterrupts_SSI:Sinterrupts ->(1)words$word -> Sinterrupts) v x= (( v with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Sinterrupts_USI:Sinterrupts ->(1)words$word) v= ((subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Sinterrupts_USI:((regstate),(register_value),(Sinterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec r.Sinterrupts_Sinterrupts_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Sinterrupts_USI:Sinterrupts ->(1)words$word -> Sinterrupts) v x= (( v with<| Sinterrupts_Sinterrupts_chunk_0 := ((update_subrange_vec_dec v.Sinterrupts_Sinterrupts_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val lower_mip : Minterrupts -> Minterrupts -> Sinterrupts*) val _ = Define ` ((lower_mip:Minterrupts -> Minterrupts -> Sinterrupts) (m : Minterrupts) (d : Minterrupts)= (let (s : Sinterrupts) = (Mk_Sinterrupts ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))) in let s = (update_Sinterrupts_SEI s ((and_vec ((get_Minterrupts_SEI m : 1 words$word)) ((get_Minterrupts_SEI d : 1 words$word)) : 1 words$word))) in let s = (update_Sinterrupts_STI s ((and_vec ((get_Minterrupts_STI m : 1 words$word)) ((get_Minterrupts_STI d : 1 words$word)) : 1 words$word))) in let s = (update_Sinterrupts_SSI s ((and_vec ((get_Minterrupts_SSI m : 1 words$word)) ((get_Minterrupts_SSI d : 1 words$word)) : 1 words$word))) in let s = (update_Sinterrupts_UEI s ((and_vec ((get_Minterrupts_UEI m : 1 words$word)) ((get_Minterrupts_UEI d : 1 words$word)) : 1 words$word))) in let s = (update_Sinterrupts_UTI s ((and_vec ((get_Minterrupts_UTI m : 1 words$word)) ((get_Minterrupts_UTI d : 1 words$word)) : 1 words$word))) in update_Sinterrupts_USI s ((and_vec ((get_Minterrupts_USI m : 1 words$word)) ((get_Minterrupts_USI d : 1 words$word)) : 1 words$word))))`; (*val lower_mie : Minterrupts -> Minterrupts -> Sinterrupts*) val _ = Define ` ((lower_mie:Minterrupts -> Minterrupts -> Sinterrupts) (m : Minterrupts) (d : Minterrupts)= (let (s : Sinterrupts) = (Mk_Sinterrupts ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))) in let s = (update_Sinterrupts_SEI s ((and_vec ((get_Minterrupts_SEI m : 1 words$word)) ((get_Minterrupts_SEI d : 1 words$word)) : 1 words$word))) in let s = (update_Sinterrupts_STI s ((and_vec ((get_Minterrupts_STI m : 1 words$word)) ((get_Minterrupts_STI d : 1 words$word)) : 1 words$word))) in let s = (update_Sinterrupts_SSI s ((and_vec ((get_Minterrupts_SSI m : 1 words$word)) ((get_Minterrupts_SSI d : 1 words$word)) : 1 words$word))) in let s = (update_Sinterrupts_UEI s ((and_vec ((get_Minterrupts_UEI m : 1 words$word)) ((get_Minterrupts_UEI d : 1 words$word)) : 1 words$word))) in let s = (update_Sinterrupts_UTI s ((and_vec ((get_Minterrupts_UTI m : 1 words$word)) ((get_Minterrupts_UTI d : 1 words$word)) : 1 words$word))) in update_Sinterrupts_USI s ((and_vec ((get_Minterrupts_USI m : 1 words$word)) ((get_Minterrupts_USI d : 1 words$word)) : 1 words$word))))`; (*val lift_sip : Minterrupts -> Minterrupts -> Sinterrupts -> M Minterrupts*) val _ = Define ` ((lift_sip:Minterrupts -> Minterrupts -> Sinterrupts ->(regstate)sail2_state_monad$sequential_state ->(((Minterrupts),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (o1 : Minterrupts) (d : Minterrupts) (s : Sinterrupts)= (let (m : Minterrupts) = o1 in let m = (if (((((get_Minterrupts_SSI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Minterrupts_SSI m ((get_Sinterrupts_SSI s : 1 words$word)) else m) in sail2_state_monad$bindS (haveNExt () ) (\ (w__0 : bool) . sail2_state_monad$returnS (if w__0 then let m = (if (((((get_Minterrupts_UEI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Minterrupts_UEI m ((get_Sinterrupts_UEI s : 1 words$word)) else m) in if (((((get_Minterrupts_USI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Minterrupts_USI m ((get_Sinterrupts_USI s : 1 words$word)) else m else m))))`; (*val legalize_sip : Minterrupts -> Minterrupts -> mword ty64 -> M Minterrupts*) val _ = Define ` ((legalize_sip:Minterrupts -> Minterrupts ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Minterrupts),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (m : Minterrupts) (d : Minterrupts) (v : xlenbits)= (lift_sip m d ((Mk_Sinterrupts v))))`; (*val lift_sie : Minterrupts -> Minterrupts -> Sinterrupts -> M Minterrupts*) val _ = Define ` ((lift_sie:Minterrupts -> Minterrupts -> Sinterrupts ->(regstate)sail2_state_monad$sequential_state ->(((Minterrupts),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (o1 : Minterrupts) (d : Minterrupts) (s : Sinterrupts)= (let (m : Minterrupts) = o1 in let m = (if (((((get_Minterrupts_SEI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Minterrupts_SEI m ((get_Sinterrupts_SEI s : 1 words$word)) else m) in let m = (if (((((get_Minterrupts_STI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Minterrupts_STI m ((get_Sinterrupts_STI s : 1 words$word)) else m) in let m = (if (((((get_Minterrupts_SSI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Minterrupts_SSI m ((get_Sinterrupts_SSI s : 1 words$word)) else m) in sail2_state_monad$bindS (haveNExt () ) (\ (w__0 : bool) . sail2_state_monad$returnS (if w__0 then let m = (if (((((get_Minterrupts_UEI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Minterrupts_UEI m ((get_Sinterrupts_UEI s : 1 words$word)) else m) in let m = (if (((((get_Minterrupts_UTI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Minterrupts_UTI m ((get_Sinterrupts_UTI s : 1 words$word)) else m) in if (((((get_Minterrupts_USI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Minterrupts_USI m ((get_Sinterrupts_USI s : 1 words$word)) else m else m))))`; (*val legalize_sie : Minterrupts -> Minterrupts -> mword ty64 -> M Minterrupts*) val _ = Define ` ((legalize_sie:Minterrupts -> Minterrupts ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Minterrupts),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (m : Minterrupts) (d : Minterrupts) (v : xlenbits)= (lift_sie m d ((Mk_Sinterrupts v))))`; (*val Mk_Satp64 : mword ty64 -> Satp64*) val _ = Define ` ((Mk_Satp64:(64)words$word -> Satp64) v= (<| Satp64_Satp64_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Satp64_bits:Satp64 ->(64)words$word) v= ((subrange_vec_dec v.Satp64_Satp64_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Satp64_bits:((regstate),(register_value),(Satp64))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Satp64_Satp64_chunk_0 := ((update_subrange_vec_dec r.Satp64_Satp64_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Satp64_bits:Satp64 ->(64)words$word -> Satp64) v x= (( v with<| Satp64_Satp64_chunk_0 := ((update_subrange_vec_dec v.Satp64_Satp64_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Satp64_Mode:Satp64 ->(4)words$word) v= ((subrange_vec_dec v.Satp64_Satp64_chunk_0 (( 63 : int):ii) (( 60 : int):ii) : 4 words$word)))`; val _ = Define ` ((set_Satp64_Mode:((regstate),(register_value),(Satp64))register_ref ->(4)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Satp64_Satp64_chunk_0 := ((update_subrange_vec_dec r.Satp64_Satp64_chunk_0 (( 63 : int):ii) (( 60 : int):ii) ((subrange_vec_dec v (( 3 : int):ii) (( 0 : int):ii) : 4 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Satp64_Mode:Satp64 ->(4)words$word -> Satp64) v x= (( v with<| Satp64_Satp64_chunk_0 := ((update_subrange_vec_dec v.Satp64_Satp64_chunk_0 (( 63 : int):ii) (( 60 : int):ii) ((subrange_vec_dec x (( 3 : int):ii) (( 0 : int):ii) : 4 words$word)) : 64 words$word)) |>)))`; (*val _get_Satp64_Asid : Satp64 -> mword ty16*) val _ = Define ` ((get_Satp64_Asid:Satp64 ->(16)words$word) v= ((subrange_vec_dec v.Satp64_Satp64_chunk_0 (( 59 : int):ii) (( 44 : int):ii) : 16 words$word)))`; (*val _set_Satp64_Asid : register_ref regstate register_value Satp64 -> mword ty16 -> M unit*) val _ = Define ` ((set_Satp64_Asid:((regstate),(register_value),(Satp64))register_ref ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Satp64_Satp64_chunk_0 := ((update_subrange_vec_dec r.Satp64_Satp64_chunk_0 (( 59 : int):ii) (( 44 : int):ii) ((subrange_vec_dec v (( 15 : int):ii) (( 0 : int):ii) : 16 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Satp64_Asid : Satp64 -> mword ty16 -> Satp64*) val _ = Define ` ((update_Satp64_Asid:Satp64 ->(16)words$word -> Satp64) v x= (( v with<| Satp64_Satp64_chunk_0 := ((update_subrange_vec_dec v.Satp64_Satp64_chunk_0 (( 59 : int):ii) (( 44 : int):ii) ((subrange_vec_dec x (( 15 : int):ii) (( 0 : int):ii) : 16 words$word)) : 64 words$word)) |>)))`; (*val _update_Satp32_Asid : Satp32 -> mword ty9 -> Satp32*) (*val _get_Satp32_Asid : Satp32 -> mword ty9*) (*val _set_Satp32_Asid : register_ref regstate register_value Satp32 -> mword ty9 -> M unit*) (*val _get_Satp64_PPN : Satp64 -> mword ty44*) val _ = Define ` ((get_Satp64_PPN:Satp64 ->(44)words$word) v= ((subrange_vec_dec v.Satp64_Satp64_chunk_0 (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)))`; (*val _set_Satp64_PPN : register_ref regstate register_value Satp64 -> mword ty44 -> M unit*) val _ = Define ` ((set_Satp64_PPN:((regstate),(register_value),(Satp64))register_ref ->(44)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Satp64_Satp64_chunk_0 := ((update_subrange_vec_dec r.Satp64_Satp64_chunk_0 (( 43 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Satp64_PPN : Satp64 -> mword ty44 -> Satp64*) val _ = Define ` ((update_Satp64_PPN:Satp64 ->(44)words$word -> Satp64) v x= (( v with<| Satp64_Satp64_chunk_0 := ((update_subrange_vec_dec v.Satp64_Satp64_chunk_0 (( 43 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 64 words$word)) |>)))`; (*val _update_Satp32_PPN : Satp32 -> mword ty22 -> Satp32*) (*val _get_Satp32_PPN : Satp32 -> mword ty22*) (*val _set_Satp32_PPN : register_ref regstate register_value Satp32 -> mword ty22 -> M unit*) (*val legalize_satp64 : Architecture -> mword ty64 -> mword ty64 -> mword ty64*) val _ = Define ` ((legalize_satp64:Architecture ->(64)words$word ->(64)words$word ->(64)words$word) (a : Architecture) (o1 : 64 bits) (v : 64 bits)= (let s = (Mk_Satp64 v) in (case ((satp64Mode_of_bits a ((get_Satp64_Mode s : 4 words$word)))) of NONE => o1 | SOME (Sv32) => o1 | SOME (_) => (get_Satp64_bits s : 64 words$word) )))`; (*val Mk_Satp32 : mword ty32 -> Satp32*) val _ = Define ` ((Mk_Satp32:(32)words$word -> Satp32) v= (<| Satp32_Satp32_chunk_0 := ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) |>))`; val _ = Define ` ((get_Satp32_bits:Satp32 ->(32)words$word) v= ((subrange_vec_dec v.Satp32_Satp32_chunk_0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)))`; val _ = Define ` ((set_Satp32_bits:((regstate),(register_value),(Satp32))register_ref ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Satp32_Satp32_chunk_0 := ((update_subrange_vec_dec r.Satp32_Satp32_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Satp32_bits:Satp32 ->(32)words$word -> Satp32) v x= (( v with<| Satp32_Satp32_chunk_0 := ((update_subrange_vec_dec v.Satp32_Satp32_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)))`; val _ = Define ` ((get_Satp32_Mode:Satp32 ->(1)words$word) v= ((subrange_vec_dec v.Satp32_Satp32_chunk_0 (( 31 : int):ii) (( 31 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Satp32_Mode:((regstate),(register_value),(Satp32))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Satp32_Satp32_chunk_0 := ((update_subrange_vec_dec r.Satp32_Satp32_chunk_0 (( 31 : int):ii) (( 31 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Satp32_Mode:Satp32 ->(1)words$word -> Satp32) v x= (( v with<| Satp32_Satp32_chunk_0 := ((update_subrange_vec_dec v.Satp32_Satp32_chunk_0 (( 31 : int):ii) (( 31 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 32 words$word)) |>)))`; val _ = Define ` ((get_Satp32_Asid:Satp32 ->(9)words$word) v= ((subrange_vec_dec v.Satp32_Satp32_chunk_0 (( 30 : int):ii) (( 22 : int):ii) : 9 words$word)))`; val _ = Define ` ((set_Satp32_Asid:((regstate),(register_value),(Satp32))register_ref ->(9)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Satp32_Satp32_chunk_0 := ((update_subrange_vec_dec r.Satp32_Satp32_chunk_0 (( 30 : int):ii) (( 22 : int):ii) ((subrange_vec_dec v (( 8 : int):ii) (( 0 : int):ii) : 9 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Satp32_Asid:Satp32 ->(9)words$word -> Satp32) v x= (( v with<| Satp32_Satp32_chunk_0 := ((update_subrange_vec_dec v.Satp32_Satp32_chunk_0 (( 30 : int):ii) (( 22 : int):ii) ((subrange_vec_dec x (( 8 : int):ii) (( 0 : int):ii) : 9 words$word)) : 32 words$word)) |>)))`; val _ = Define ` ((get_Satp32_PPN:Satp32 ->(22)words$word) v= ((subrange_vec_dec v.Satp32_Satp32_chunk_0 (( 21 : int):ii) (( 0 : int):ii) : 22 words$word)))`; val _ = Define ` ((set_Satp32_PPN:((regstate),(register_value),(Satp32))register_ref ->(22)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Satp32_Satp32_chunk_0 := ((update_subrange_vec_dec r.Satp32_Satp32_chunk_0 (( 21 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 21 : int):ii) (( 0 : int):ii) : 22 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Satp32_PPN:Satp32 ->(22)words$word -> Satp32) v x= (( v with<| Satp32_Satp32_chunk_0 := ((update_subrange_vec_dec v.Satp32_Satp32_chunk_0 (( 21 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 21 : int):ii) (( 0 : int):ii) : 22 words$word)) : 32 words$word)) |>)))`; (*val legalize_satp32 : Architecture -> mword ty32 -> mword ty32 -> mword ty32*) val _ = Define ` ((legalize_satp32:Architecture ->(32)words$word ->(32)words$word ->(32)words$word) (a : Architecture) (o1 : 32 bits) (v : 32 bits)= v)`; (*val PmpAddrMatchType_of_num : integer -> PmpAddrMatchType*) val _ = Define ` ((PmpAddrMatchType_of_num:int -> PmpAddrMatchType) arg_= (let l__82 = arg_ in if (((l__82 = (( 0 : int):ii)))) then OFF else if (((l__82 = (( 1 : int):ii)))) then TOR else if (((l__82 = (( 2 : int):ii)))) then NA4 else NAPOT))`; (*val num_of_PmpAddrMatchType : PmpAddrMatchType -> integer*) val _ = Define ` ((num_of_PmpAddrMatchType:PmpAddrMatchType -> int) arg_= ((case arg_ of OFF => (( 0 : int):ii) | TOR => (( 1 : int):ii) | NA4 => (( 2 : int):ii) | NAPOT => (( 3 : int):ii) )))`; (*val pmpAddrMatchType_of_bits : mword ty2 -> M PmpAddrMatchType*) val _ = Define ` ((pmpAddrMatchType_of_bits:(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((PmpAddrMatchType),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) bs= (let b__0 = bs in if (((b__0 = (0b00w : 2 words$word)))) then sail2_state_monad$returnS OFF else if (((b__0 = (0b01w : 2 words$word)))) then sail2_state_monad$returnS TOR else if (((b__0 = (0b10w : 2 words$word)))) then sail2_state_monad$returnS NA4 else if (((b__0 = (0b11w : 2 words$word)))) then sail2_state_monad$returnS NAPOT else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_pmp_regs.sail 7:2 - 12:3") (sail2_state_monad$exitS () )))`; (*val pmpAddrMatchType_to_bits : PmpAddrMatchType -> mword ty2*) val _ = Define ` ((pmpAddrMatchType_to_bits:PmpAddrMatchType ->(2)words$word) bs= ((case bs of OFF => (0b00w : 2 words$word) | TOR => (0b01w : 2 words$word) | NA4 => (0b10w : 2 words$word) | NAPOT => (0b11w : 2 words$word) )))`; (*val Mk_Pmpcfg_ent : mword ty8 -> Pmpcfg_ent*) val _ = Define ` ((Mk_Pmpcfg_ent:(8)words$word -> Pmpcfg_ent) v= (<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) |>))`; val _ = Define ` ((get_Pmpcfg_ent_bits:Pmpcfg_ent ->(8)words$word) v= ((subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)))`; val _ = Define ` ((set_Pmpcfg_ent_bits:((regstate),(register_value),(Pmpcfg_ent))register_ref ->(8)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec r.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Pmpcfg_ent_bits:Pmpcfg_ent ->(8)words$word -> Pmpcfg_ent) v x= (( v with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_Pmpcfg_ent_L:Pmpcfg_ent ->(1)words$word) v= ((subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Pmpcfg_ent_L:((regstate),(register_value),(Pmpcfg_ent))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec r.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Pmpcfg_ent_L:Pmpcfg_ent ->(1)words$word -> Pmpcfg_ent) v x= (( v with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_Pmpcfg_ent_A:Pmpcfg_ent ->(2)words$word) v= ((subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)))`; val _ = Define ` ((set_Pmpcfg_ent_A:((regstate),(register_value),(Pmpcfg_ent))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec r.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 4 : int):ii) (( 3 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Pmpcfg_ent_A:Pmpcfg_ent ->(2)words$word -> Pmpcfg_ent) v x= (( v with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 4 : int):ii) (( 3 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_Pmpcfg_ent_X:Pmpcfg_ent ->(1)words$word) v= ((subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Pmpcfg_ent_X:((regstate),(register_value),(Pmpcfg_ent))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec r.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Pmpcfg_ent_X:Pmpcfg_ent ->(1)words$word -> Pmpcfg_ent) v x= (( v with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_Pmpcfg_ent_W:Pmpcfg_ent ->(1)words$word) v= ((subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Pmpcfg_ent_W:((regstate),(register_value),(Pmpcfg_ent))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec r.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Pmpcfg_ent_W:Pmpcfg_ent ->(1)words$word -> Pmpcfg_ent) v x= (( v with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_Pmpcfg_ent_R:Pmpcfg_ent ->(1)words$word) v= ((subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Pmpcfg_ent_R:((regstate),(register_value),(Pmpcfg_ent))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec r.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Pmpcfg_ent_R:Pmpcfg_ent ->(1)words$word -> Pmpcfg_ent) v x= (( v with<| Pmpcfg_ent_Pmpcfg_ent_chunk_0 := ((update_subrange_vec_dec v.Pmpcfg_ent_Pmpcfg_ent_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; (*val pmpReadCfgReg : integer -> M (mword ty64)*) val _ = Define ` ((pmpReadCfgReg:int ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) n= (let l__80 = n in if (((l__80 = (( 0 : int):ii)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp7cfg_ref) (\ (w__0 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp6cfg_ref) (\ (w__1 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp5cfg_ref) (\ (w__2 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp4cfg_ref) (\ (w__3 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp3cfg_ref) (\ (w__4 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp2cfg_ref) (\ (w__5 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp1cfg_ref) (\ (w__6 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp0cfg_ref) (\ (w__7 : Pmpcfg_ent) . sail2_state_monad$returnS ((concat_vec ((get_Pmpcfg_ent_bits w__0 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__1 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__2 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__3 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__4 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__5 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__6 : 8 words$word)) ((get_Pmpcfg_ent_bits w__7 : 8 words$word)) : 16 words$word)) : 24 words$word)) : 32 words$word)) : 40 words$word)) : 48 words$word)) : 56 words$word)) : 64 words$word)))))))))) else if (((l__80 = (( 2 : int):ii)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp15cfg_ref) (\ (w__8 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp14cfg_ref) (\ (w__9 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp13cfg_ref) (\ (w__10 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp12cfg_ref) (\ (w__11 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp11cfg_ref) (\ (w__12 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp10cfg_ref) (\ (w__13 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp9cfg_ref) (\ (w__14 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp8cfg_ref) (\ (w__15 : Pmpcfg_ent) . sail2_state_monad$returnS ((concat_vec ((get_Pmpcfg_ent_bits w__8 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__9 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__10 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__11 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__12 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__13 : 8 words$word)) ((concat_vec ((get_Pmpcfg_ent_bits w__14 : 8 words$word)) ((get_Pmpcfg_ent_bits w__15 : 8 words$word)) : 16 words$word)) : 24 words$word)) : 32 words$word)) : 40 words$word)) : 48 words$word)) : 56 words$word)) : 64 words$word)))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_pmp_regs.sail 75:2 - 85:8") (sail2_state_monad$exitS () )))`; (*val pmpLocked : Pmpcfg_ent -> bool*) val _ = Define ` ((pmpLocked:Pmpcfg_ent -> bool) cfg= (((get_Pmpcfg_ent_L cfg : 1 words$word)) = (0b1w : 1 words$word)))`; (*val pmpTORLocked : Pmpcfg_ent -> M bool*) val _ = Define ` ((pmpTORLocked:Pmpcfg_ent ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) cfg= (sail2_state$and_boolS (sail2_state_monad$returnS (((((get_Pmpcfg_ent_L cfg : 1 words$word)) = (0b1w : 1 words$word))))) ( sail2_state_monad$bindS(pmpAddrMatchType_of_bits ((get_Pmpcfg_ent_A cfg : 2 words$word))) (\ (w__0 : PmpAddrMatchType) . sail2_state_monad$returnS (((w__0 = TOR)))))))`; (*val pmpWriteCfg : Pmpcfg_ent -> mword ty8 -> Pmpcfg_ent*) val _ = Define ` ((pmpWriteCfg:Pmpcfg_ent ->(8)words$word -> Pmpcfg_ent) (cfg : Pmpcfg_ent) (v : 8 bits)= (if ((pmpLocked cfg)) then cfg else Mk_Pmpcfg_ent ((and_vec v (0x9Fw : 8 words$word) : 8 words$word))))`; (*val pmpWriteCfgReg : integer -> mword ty64 -> M unit*) val _ = Define ` ((pmpWriteCfgReg:int ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) n v= (let l__78 = n in if (((l__78 = (( 0 : int):ii)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp0cfg_ref) (\ (w__0 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp0cfg_ref ((pmpWriteCfg w__0 ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp1cfg_ref)) (\ (w__1 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp1cfg_ref ((pmpWriteCfg w__1 ((subrange_vec_dec v (( 15 : int):ii) (( 8 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp2cfg_ref)) (\ (w__2 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp2cfg_ref ((pmpWriteCfg w__2 ((subrange_vec_dec v (( 23 : int):ii) (( 16 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp3cfg_ref)) (\ (w__3 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp3cfg_ref ((pmpWriteCfg w__3 ((subrange_vec_dec v (( 31 : int):ii) (( 24 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp4cfg_ref)) (\ (w__4 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp4cfg_ref ((pmpWriteCfg w__4 ((subrange_vec_dec v (( 39 : int):ii) (( 32 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp5cfg_ref)) (\ (w__5 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp5cfg_ref ((pmpWriteCfg w__5 ((subrange_vec_dec v (( 47 : int):ii) (( 40 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp6cfg_ref)) (\ (w__6 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp6cfg_ref ((pmpWriteCfg w__6 ((subrange_vec_dec v (( 55 : int):ii) (( 48 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp7cfg_ref)) (\ (w__7 : Pmpcfg_ent) . sail2_state_monad$write_regS pmp7cfg_ref ((pmpWriteCfg w__7 ((subrange_vec_dec v (( 63 : int):ii) (( 56 : int):ii) : 8 words$word)))))))))))) else if (((l__78 = (( 2 : int):ii)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp8cfg_ref) (\ (w__8 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp8cfg_ref ((pmpWriteCfg w__8 ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp9cfg_ref)) (\ (w__9 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp9cfg_ref ((pmpWriteCfg w__9 ((subrange_vec_dec v (( 15 : int):ii) (( 8 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp10cfg_ref)) (\ (w__10 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp10cfg_ref ((pmpWriteCfg w__10 ((subrange_vec_dec v (( 23 : int):ii) (( 16 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp11cfg_ref)) (\ (w__11 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp11cfg_ref ((pmpWriteCfg w__11 ((subrange_vec_dec v (( 31 : int):ii) (( 24 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp12cfg_ref)) (\ (w__12 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp12cfg_ref ((pmpWriteCfg w__12 ((subrange_vec_dec v (( 39 : int):ii) (( 32 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp13cfg_ref)) (\ (w__13 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp13cfg_ref ((pmpWriteCfg w__13 ((subrange_vec_dec v (( 47 : int):ii) (( 40 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp14cfg_ref)) (\ (w__14 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp14cfg_ref ((pmpWriteCfg w__14 ((subrange_vec_dec v (( 55 : int):ii) (( 48 : int):ii) : 8 words$word))))) (sail2_state_monad$read_regS pmp15cfg_ref)) (\ (w__15 : Pmpcfg_ent) . sail2_state_monad$write_regS pmp15cfg_ref ((pmpWriteCfg w__15 ((subrange_vec_dec v (( 63 : int):ii) (( 56 : int):ii) : 8 words$word)))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_pmp_regs.sail 101:2 - 144:8") (sail2_state_monad$exitS () )))`; (*val pmpWriteAddr : bool -> bool -> mword ty64 -> mword ty64 -> mword ty64*) val _ = Define ` ((pmpWriteAddr:bool -> bool ->(64)words$word ->(64)words$word ->(64)words$word) (locked : bool) (tor_locked : bool) (reg : xlenbits) (v : xlenbits)= (if (((locked \/ tor_locked))) then reg else (EXTZ (( 64 : int):ii) ((subrange_vec_dec v (( 53 : int):ii) (( 0 : int):ii) : 54 words$word)) : 64 words$word)))`; (*val pmpAddrRange : Pmpcfg_ent -> mword ty64 -> mword ty64 -> M (maybe ((mword ty64 * mword ty64)))*) val _ = Define ` ((pmpAddrRange:Pmpcfg_ent ->(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((((64)words$word#(64)words$word)option),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (cfg : Pmpcfg_ent) (pmpaddr : xlenbits) (prev_pmpaddr : xlenbits)= (sail2_state_monad$bindS (pmpAddrMatchType_of_bits ((get_Pmpcfg_ent_A cfg : 2 words$word))) (\ (w__0 : PmpAddrMatchType) . sail2_state_monad$returnS ((case w__0 of OFF => NONE | TOR => SOME ((shiftl prev_pmpaddr (( 2 : int):ii) : 64 words$word), (shiftl pmpaddr (( 2 : int):ii) : 64 words$word)) | NA4 => let lo = ((shiftl pmpaddr (( 2 : int):ii) : 64 words$word)) in SOME (lo, (add_vec_int lo (( 4 : int):ii) : 64 words$word)) | NAPOT => let mask = ((xor_vec pmpaddr ((add_vec_int pmpaddr (( 1 : int):ii) : 64 words$word)) : 64 words$word)) in let lo = ((and_vec pmpaddr ((not_vec mask : 64 words$word)) : 64 words$word)) in let len = ((add_vec_int mask (( 1 : int):ii) : 64 words$word)) in SOME ((shiftl lo (( 2 : int):ii) : 64 words$word), (shiftl ((add_vec lo len : 64 words$word)) (( 2 : int):ii) : 64 words$word)) )))))`; (*val pmpCheckRWX : Pmpcfg_ent -> AccessType unit -> bool*) val _ = Define ` ((pmpCheckRWX:Pmpcfg_ent ->(unit)AccessType -> bool) ent acc= ((case acc of Read (_) => (((get_Pmpcfg_ent_R ent : 1 words$word)) = (0b1w : 1 words$word)) | Write (_) => (((get_Pmpcfg_ent_W ent : 1 words$word)) = (0b1w : 1 words$word)) | ReadWrite (_) => ((((((get_Pmpcfg_ent_R ent : 1 words$word)) = (0b1w : 1 words$word)))) /\ (((((get_Pmpcfg_ent_W ent : 1 words$word)) = (0b1w : 1 words$word))))) | Execute (() ) => (((get_Pmpcfg_ent_X ent : 1 words$word)) = (0b1w : 1 words$word)) )))`; (*val pmpCheckPerms : Pmpcfg_ent -> AccessType unit -> Privilege -> bool*) val _ = Define ` ((pmpCheckPerms:Pmpcfg_ent ->(unit)AccessType -> Privilege -> bool) ent acc priv= ((case priv of Machine => if ((pmpLocked ent)) then pmpCheckRWX ent acc else T | _ => pmpCheckRWX ent acc )))`; (*val pmpAddrMatch_of_num : integer -> pmpAddrMatch*) val _ = Define ` ((pmpAddrMatch_of_num:int -> pmpAddrMatch) arg_= (let l__76 = arg_ in if (((l__76 = (( 0 : int):ii)))) then PMP_NoMatch else if (((l__76 = (( 1 : int):ii)))) then PMP_PartialMatch else PMP_Match))`; (*val num_of_pmpAddrMatch : pmpAddrMatch -> integer*) val _ = Define ` ((num_of_pmpAddrMatch:pmpAddrMatch -> int) arg_= ((case arg_ of PMP_NoMatch => (( 0 : int):ii) | PMP_PartialMatch => (( 1 : int):ii) | PMP_Match => (( 2 : int):ii) )))`; (*val pmpMatchAddr : mword ty64 -> mword ty64 -> maybe ((mword ty64 * mword ty64)) -> pmpAddrMatch*) val _ = Define ` ((pmpMatchAddr:(64)words$word ->(64)words$word ->(xlenbits#xlenbits)option -> pmpAddrMatch) (addr : xlenbits) (width : xlenbits) (rng : pmp_addr_range)= ((case rng of NONE => PMP_NoMatch | SOME ((lo, hi)) => if ((zopz0zI_u hi lo)) then PMP_NoMatch else if (((((zopz0zIzJ_u ((add_vec addr width : 64 words$word)) lo)) \/ ((zopz0zIzJ_u hi addr))))) then PMP_NoMatch else if (((((zopz0zIzJ_u lo addr)) /\ ((zopz0zIzJ_u ((add_vec addr width : 64 words$word)) hi))))) then PMP_Match else PMP_PartialMatch )))`; (*val pmpMatch_of_num : integer -> pmpMatch*) val _ = Define ` ((pmpMatch_of_num:int -> pmpMatch) arg_= (let l__74 = arg_ in if (((l__74 = (( 0 : int):ii)))) then PMP_Success else if (((l__74 = (( 1 : int):ii)))) then PMP_Continue else PMP_Fail))`; (*val num_of_pmpMatch : pmpMatch -> integer*) val _ = Define ` ((num_of_pmpMatch:pmpMatch -> int) arg_= ((case arg_ of PMP_Success => (( 0 : int):ii) | PMP_Continue => (( 1 : int):ii) | PMP_Fail => (( 2 : int):ii) )))`; (*val pmpMatchEntry : mword ty64 -> mword ty64 -> AccessType unit -> Privilege -> Pmpcfg_ent -> mword ty64 -> mword ty64 -> M pmpMatch*) val _ = Define ` ((pmpMatchEntry:(64)words$word ->(64)words$word ->(ext_access_type)AccessType -> Privilege -> Pmpcfg_ent ->(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((pmpMatch),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (addr : xlenbits) (width : xlenbits) (acc : ext_access_type AccessType) (priv : Privilege) (ent : Pmpcfg_ent) (pmpaddr : xlenbits) (prev_pmpaddr : xlenbits)= (sail2_state_monad$bindS (pmpAddrRange ent pmpaddr prev_pmpaddr : ( (( 64 words$word # 64 words$word))option) M) (\ rng . sail2_state_monad$returnS ((case ((pmpMatchAddr addr width rng)) of PMP_NoMatch => PMP_Continue | PMP_PartialMatch => PMP_Fail | PMP_Match => if ((pmpCheckPerms ent acc priv)) then PMP_Success else PMP_Fail )))))`; (*val pmpCheck : mword ty64 -> integer -> AccessType unit -> Privilege -> M (maybe ExceptionType)*) val _ = Define ` ((pmpCheck:(64)words$word -> int ->(ext_access_type)AccessType -> Privilege ->(regstate)sail2_state_monad$sequential_state ->((((ExceptionType)option),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (addr : xlenbits) (width : int) (acc : ext_access_type AccessType) (priv : Privilege)= (let (width : xlenbits) = ((to_bits (( 64 : int):ii) width : 64 words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS pmp0cfg_ref) (\ (w__0 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr0_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__0 w__1 ((zeros_implicit (( 64 : int):ii) : 64 words$word))) (\ (w__2 : pmpMatch) . sail2_state_monad$bindS (case w__2 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp1cfg_ref) (\ (w__3 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr1_ref : ( 64 words$word) M) (\ (w__4 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr0_ref : ( 64 words$word) M) (\ (w__5 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__3 w__4 w__5) (\ (w__6 : pmpMatch) . (case w__6 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp2cfg_ref) (\ (w__7 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr2_ref : ( 64 words$word) M) (\ (w__8 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr1_ref : ( 64 words$word) M) (\ (w__9 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__7 w__8 w__9) (\ (w__10 : pmpMatch) . (case w__10 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp3cfg_ref) (\ (w__11 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr3_ref : ( 64 words$word) M) (\ (w__12 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr2_ref : ( 64 words$word) M) (\ (w__13 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__11 w__12 w__13) (\ (w__14 : pmpMatch) . (case w__14 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp4cfg_ref) (\ (w__15 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr4_ref : ( 64 words$word) M) (\ (w__16 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr3_ref : ( 64 words$word) M) (\ (w__17 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__15 w__16 w__17) (\ (w__18 : pmpMatch) . (case w__18 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp5cfg_ref) (\ (w__19 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr5_ref : ( 64 words$word) M) (\ (w__20 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr4_ref : ( 64 words$word) M) (\ (w__21 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__19 w__20 w__21) (\ (w__22 : pmpMatch) . (case w__22 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp6cfg_ref) (\ (w__23 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr6_ref : ( 64 words$word) M) (\ (w__24 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr5_ref : ( 64 words$word) M) (\ (w__25 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__23 w__24 w__25) (\ (w__26 : pmpMatch) . (case w__26 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp7cfg_ref) (\ (w__27 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr7_ref : ( 64 words$word) M) (\ (w__28 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr6_ref : ( 64 words$word) M) (\ (w__29 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__27 w__28 w__29) (\ (w__30 : pmpMatch) . (case w__30 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp8cfg_ref) (\ (w__31 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr8_ref : ( 64 words$word) M) (\ (w__32 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr7_ref : ( 64 words$word) M) (\ (w__33 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__31 w__32 w__33) (\ (w__34 : pmpMatch) . (case w__34 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp9cfg_ref) (\ (w__35 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr9_ref : ( 64 words$word) M) (\ (w__36 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr8_ref : ( 64 words$word) M) (\ (w__37 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__35 w__36 w__37) (\ (w__38 : pmpMatch) . (case w__38 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp10cfg_ref) (\ (w__39 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr10_ref : ( 64 words$word) M) (\ (w__40 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr9_ref : ( 64 words$word) M) (\ (w__41 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__39 w__40 w__41) (\ (w__42 : pmpMatch) . (case w__42 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp11cfg_ref) (\ (w__43 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr11_ref : ( 64 words$word) M) (\ (w__44 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr10_ref : ( 64 words$word) M) (\ (w__45 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__43 w__44 w__45) (\ (w__46 : pmpMatch) . (case w__46 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp12cfg_ref) (\ (w__47 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr12_ref : ( 64 words$word) M) (\ (w__48 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr11_ref : ( 64 words$word) M) (\ (w__49 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__47 w__48 w__49) (\ (w__50 : pmpMatch) . (case w__50 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp13cfg_ref) (\ (w__51 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr13_ref : ( 64 words$word) M) (\ (w__52 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr12_ref : ( 64 words$word) M) (\ (w__53 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__51 w__52 w__53) (\ (w__54 : pmpMatch) . (case w__54 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp14cfg_ref) (\ (w__55 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr14_ref : ( 64 words$word) M) (\ (w__56 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr13_ref : ( 64 words$word) M) (\ (w__57 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__55 w__56 w__57) (\ (w__58 : pmpMatch) . (case w__58 of PMP_Success => sail2_state_monad$returnS T | PMP_Fail => sail2_state_monad$returnS F | PMP_Continue => sail2_state_monad$bindS (sail2_state_monad$read_regS pmp15cfg_ref) (\ (w__59 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr15_ref : ( 64 words$word) M) (\ (w__60 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr14_ref : ( 64 words$word) M) (\ (w__61 : 64 words$word) . sail2_state_monad$bindS (pmpMatchEntry addr width acc priv w__59 w__60 w__61) (\ (w__62 : pmpMatch) . sail2_state_monad$returnS ((case w__62 of PMP_Success => T | PMP_Fail => F | PMP_Continue => (case priv of Machine => T | _ => F ) )))))) ))))) ))))) ))))) ))))) ))))) ))))) ))))) ))))) ))))) ))))) ))))) ))))) ))))) ))))) ) (\ (check' : bool) . sail2_state_monad$returnS (if check' then NONE else (case acc of Read (_) => SOME (E_Load_Access_Fault () ) | Write (_) => SOME (E_SAMO_Access_Fault () ) | ReadWrite (_) => SOME (E_SAMO_Access_Fault () ) | Execute (() ) => SOME (E_Fetch_Access_Fault () ) ))))))))`; (*val init_pmp : unit -> M unit*) val _ = Define ` ((init_pmp:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS pmp0cfg_ref) (\ (w__0 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp0cfg_ref ((update_Pmpcfg_ent_A w__0 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp1cfg_ref)) (\ (w__1 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp1cfg_ref ((update_Pmpcfg_ent_A w__1 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp2cfg_ref)) (\ (w__2 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp2cfg_ref ((update_Pmpcfg_ent_A w__2 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp3cfg_ref)) (\ (w__3 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp3cfg_ref ((update_Pmpcfg_ent_A w__3 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp4cfg_ref)) (\ (w__4 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp4cfg_ref ((update_Pmpcfg_ent_A w__4 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp5cfg_ref)) (\ (w__5 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp5cfg_ref ((update_Pmpcfg_ent_A w__5 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp6cfg_ref)) (\ (w__6 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp6cfg_ref ((update_Pmpcfg_ent_A w__6 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp7cfg_ref)) (\ (w__7 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp7cfg_ref ((update_Pmpcfg_ent_A w__7 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp8cfg_ref)) (\ (w__8 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp8cfg_ref ((update_Pmpcfg_ent_A w__8 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp9cfg_ref)) (\ (w__9 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp9cfg_ref ((update_Pmpcfg_ent_A w__9 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp10cfg_ref)) (\ (w__10 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp10cfg_ref ((update_Pmpcfg_ent_A w__10 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp11cfg_ref)) (\ (w__11 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp11cfg_ref ((update_Pmpcfg_ent_A w__11 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp12cfg_ref)) (\ (w__12 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp12cfg_ref ((update_Pmpcfg_ent_A w__12 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp13cfg_ref)) (\ (w__13 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp13cfg_ref ((update_Pmpcfg_ent_A w__13 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp14cfg_ref)) (\ (w__14 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmp14cfg_ref ((update_Pmpcfg_ent_A w__14 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))) (sail2_state_monad$read_regS pmp15cfg_ref)) (\ (w__15 : Pmpcfg_ent) . sail2_state_monad$write_regS pmp15cfg_ref ((update_Pmpcfg_ent_A w__15 ((pmpAddrMatchType_to_bits OFF : 2 words$word))))))))))))))))))))))`; (*val ext_init_regs : unit -> M unit*) val _ = Define ` ((ext_init_regs:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$returnS () ))`; (* This function is called after above when running rvfi and allows the model to be initialised differently (e.g. CHERI cap regs are initialised to omnipotent instead of null). *) (*val ext_rvfi_init : unit -> M unit*) val _ = Define ` ((ext_rvfi_init:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS x1_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$write_regS x1_ref w__0)))`; (* THIS(csrno, priv, isWrite) allows an extension to block access to csrno, at Privilege level priv. It should return true if the access is allowed. *) (*val ext_check_CSR : mword ty12 -> Privilege -> bool -> bool*) val _ = Define ` ((ext_check_CSR:(12)words$word -> Privilege -> bool -> bool) csrno p isWrite= T)`; (* THIS is called if ext_check_CSR returns false. It should cause an appropriate RISCV exception. *) (*val ext_check_CSR_fail : unit -> unit*) val _ = Define ` ((ext_check_CSR_fail:unit -> unit) () = () )`; (* Validate a read from physical memory. THIS(access_type, paddr, size, aquire, release, reserved, read_meta) should return Some(exception) to abort the read or None to allow it to proceed. The check is performed after PMP checks and does not apply to MMIO memory. *) (*val ext_check_phys_mem_read : AccessType unit -> mword ty64 -> integer -> bool -> bool -> bool -> bool -> Ext_PhysAddr_Check*) (* Validate a write to physical memory. THIS(write_kind, paddr, size, data, metadata) should return Some(exception) to abort the write or None to allow it to proceed. The check is performed after PMP checks and does not apply to MMIO memory. *) (*val ext_check_phys_mem_write : forall 'int8_times_n. Size 'int8_times_n => write_kind -> mword ty64 -> integer -> mword 'int8_times_n -> unit -> Ext_PhysAddr_Check*) (*val ext_fetch_check_pc : mword ty64 -> mword ty64 -> Ext_FetchAddr_Check unit*) val _ = Define ` ((ext_fetch_check_pc:(64)words$word ->(64)words$word ->(unit)Ext_FetchAddr_Check) (start_pc : xlenbits) (pc : xlenbits)= (Ext_FetchAddr_OK pc))`; (*val ext_handle_fetch_check_error : unit -> unit*) val _ = Define ` ((ext_handle_fetch_check_error:unit -> unit) err= () )`; (*val ext_control_check_addr : mword ty64 -> Ext_ControlAddr_Check unit*) val _ = Define ` ((ext_control_check_addr:(64)words$word ->(unit)Ext_ControlAddr_Check) pc= (Ext_ControlAddr_OK pc))`; (*val ext_control_check_pc : mword ty64 -> Ext_ControlAddr_Check unit*) val _ = Define ` ((ext_control_check_pc:(64)words$word ->(unit)Ext_ControlAddr_Check) pc= (Ext_ControlAddr_OK pc))`; (*val ext_handle_control_check_error : unit -> unit*) val _ = Define ` ((ext_handle_control_check_error:unit -> unit) err= () )`; (*val ext_data_get_addr : mword ty5 -> mword ty64 -> AccessType unit -> word_width -> M (Ext_DataAddr_Check unit)*) val _ = Define ` ((ext_data_get_addr:(5)words$word ->(64)words$word ->(ext_access_type)AccessType -> word_width ->(regstate)sail2_state_monad$sequential_state ->((((unit)Ext_DataAddr_Check),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (base : regidx) (offset : xlenbits) (acc : ext_access_type AccessType) (width : word_width)= (sail2_state_monad$bindS (rX_bits base : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let addr = ((add_vec w__0 offset : 64 words$word)) in sail2_state_monad$returnS (Ext_DataAddr_OK addr))))`; (*val ext_handle_data_check_error : unit -> unit*) val _ = Define ` ((ext_handle_data_check_error:unit -> unit) err= () )`; val _ = Define ` ((ext_check_phys_mem_read:(unit)AccessType ->(64)words$word -> int -> bool -> bool -> bool -> bool -> Ext_PhysAddr_Check) access_type paddr size1 aquire release reserved read_meta= (Ext_PhysAddr_OK () ))`; val _ = Define ` ((ext_check_phys_mem_write:write_kind ->(64)words$word -> int -> 'int8_times_n words$word -> unit -> Ext_PhysAddr_Check) write_kind paddr size1 data metadata= (Ext_PhysAddr_OK () ))`; (*val csr_name_map_forwards : mword ty12 -> string*) (*val csr_name_map_backwards : string -> M (mword ty12)*) (*val csr_name_map_forwards_matches : mword ty12 -> bool*) (*val csr_name_map_backwards_matches : string -> M bool*) (*val csr_name_map_matches_prefix : string -> maybe ((mword ty12 * ii))*) (*val ext_is_CSR_defined : mword ty12 -> Privilege -> M bool*) (*val ext_read_CSR : mword ty12 -> M (maybe (mword ty64))*) (*val ext_write_CSR : mword ty12 -> mword ty64 -> M (maybe (mword ty64))*) (*val Mk_Ustatus : mword ty64 -> Ustatus*) val _ = Define ` ((Mk_Ustatus:(64)words$word -> Ustatus) v= (<| Ustatus_Ustatus_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Ustatus_bits:Ustatus ->(64)words$word) v= ((subrange_vec_dec v.Ustatus_Ustatus_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Ustatus_bits:((regstate),(register_value),(Ustatus))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Ustatus_Ustatus_chunk_0 := ((update_subrange_vec_dec r.Ustatus_Ustatus_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Ustatus_bits:Ustatus ->(64)words$word -> Ustatus) v x= (( v with<| Ustatus_Ustatus_chunk_0 := ((update_subrange_vec_dec v.Ustatus_Ustatus_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Ustatus_UPIE:Ustatus ->(1)words$word) v= ((subrange_vec_dec v.Ustatus_Ustatus_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Ustatus_UPIE:((regstate),(register_value),(Ustatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Ustatus_Ustatus_chunk_0 := ((update_subrange_vec_dec r.Ustatus_Ustatus_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Ustatus_UPIE:Ustatus ->(1)words$word -> Ustatus) v x= (( v with<| Ustatus_Ustatus_chunk_0 := ((update_subrange_vec_dec v.Ustatus_Ustatus_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Ustatus_UIE:Ustatus ->(1)words$word) v= ((subrange_vec_dec v.Ustatus_Ustatus_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Ustatus_UIE:((regstate),(register_value),(Ustatus))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Ustatus_Ustatus_chunk_0 := ((update_subrange_vec_dec r.Ustatus_Ustatus_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Ustatus_UIE:Ustatus ->(1)words$word -> Ustatus) v x= (( v with<| Ustatus_Ustatus_chunk_0 := ((update_subrange_vec_dec v.Ustatus_Ustatus_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val lower_sstatus : Sstatus -> Ustatus*) val _ = Define ` ((lower_sstatus:Sstatus -> Ustatus) s= (let u = (Mk_Ustatus ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))) in let u = (update_Ustatus_UPIE u ((get_Sstatus_UPIE s : 1 words$word))) in update_Ustatus_UIE u ((get_Sstatus_UIE s : 1 words$word))))`; (*val lift_ustatus : Sstatus -> Ustatus -> Sstatus*) val _ = Define ` ((lift_ustatus:Sstatus -> Ustatus -> Sstatus) (s : Sstatus) (u : Ustatus)= (let s = (update_Sstatus_UPIE s ((get_Ustatus_UPIE u : 1 words$word))) in update_Sstatus_UIE s ((get_Ustatus_UIE u : 1 words$word))))`; (*val legalize_ustatus : Mstatus -> mword ty64 -> M Mstatus*) val _ = Define ` ((legalize_ustatus:Mstatus ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Mstatus),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (m : Mstatus) (v : xlenbits)= (let u = (Mk_Ustatus v) in let s = (lower_mstatus m) in let s = (lift_ustatus s u) in lift_sstatus m s))`; (*val Mk_Uinterrupts : mword ty64 -> Uinterrupts*) val _ = Define ` ((Mk_Uinterrupts:(64)words$word -> Uinterrupts) v= (<| Uinterrupts_Uinterrupts_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_Uinterrupts_bits:Uinterrupts ->(64)words$word) v= ((subrange_vec_dec v.Uinterrupts_Uinterrupts_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_Uinterrupts_bits:((regstate),(register_value),(Uinterrupts))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Uinterrupts_Uinterrupts_chunk_0 := ((update_subrange_vec_dec r.Uinterrupts_Uinterrupts_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Uinterrupts_bits:Uinterrupts ->(64)words$word -> Uinterrupts) v x= (( v with<| Uinterrupts_Uinterrupts_chunk_0 := ((update_subrange_vec_dec v.Uinterrupts_Uinterrupts_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Uinterrupts_UEI:Uinterrupts ->(1)words$word) v= ((subrange_vec_dec v.Uinterrupts_Uinterrupts_chunk_0 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Uinterrupts_UEI:((regstate),(register_value),(Uinterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Uinterrupts_Uinterrupts_chunk_0 := ((update_subrange_vec_dec r.Uinterrupts_Uinterrupts_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Uinterrupts_UEI:Uinterrupts ->(1)words$word -> Uinterrupts) v x= (( v with<| Uinterrupts_Uinterrupts_chunk_0 := ((update_subrange_vec_dec v.Uinterrupts_Uinterrupts_chunk_0 (( 8 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Uinterrupts_UTI:Uinterrupts ->(1)words$word) v= ((subrange_vec_dec v.Uinterrupts_Uinterrupts_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Uinterrupts_UTI:((regstate),(register_value),(Uinterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Uinterrupts_Uinterrupts_chunk_0 := ((update_subrange_vec_dec r.Uinterrupts_Uinterrupts_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Uinterrupts_UTI:Uinterrupts ->(1)words$word -> Uinterrupts) v x= (( v with<| Uinterrupts_Uinterrupts_chunk_0 := ((update_subrange_vec_dec v.Uinterrupts_Uinterrupts_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_Uinterrupts_USI:Uinterrupts ->(1)words$word) v= ((subrange_vec_dec v.Uinterrupts_Uinterrupts_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_Uinterrupts_USI:((regstate),(register_value),(Uinterrupts))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Uinterrupts_Uinterrupts_chunk_0 := ((update_subrange_vec_dec r.Uinterrupts_Uinterrupts_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Uinterrupts_USI:Uinterrupts ->(1)words$word -> Uinterrupts) v x= (( v with<| Uinterrupts_Uinterrupts_chunk_0 := ((update_subrange_vec_dec v.Uinterrupts_Uinterrupts_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 64 words$word)) |>)))`; (*val lower_sip : Sinterrupts -> Sinterrupts -> Uinterrupts*) val _ = Define ` ((lower_sip:Sinterrupts -> Sinterrupts -> Uinterrupts) (s : Sinterrupts) (d : Sinterrupts)= (let (u : Uinterrupts) = (Mk_Uinterrupts ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))) in let u = (update_Uinterrupts_UEI u ((and_vec ((get_Sinterrupts_UEI s : 1 words$word)) ((get_Sinterrupts_UEI d : 1 words$word)) : 1 words$word))) in let u = (update_Uinterrupts_UTI u ((and_vec ((get_Sinterrupts_UTI s : 1 words$word)) ((get_Sinterrupts_UTI d : 1 words$word)) : 1 words$word))) in update_Uinterrupts_USI u ((and_vec ((get_Sinterrupts_USI s : 1 words$word)) ((get_Sinterrupts_USI d : 1 words$word)) : 1 words$word))))`; (*val lower_sie : Sinterrupts -> Sinterrupts -> Uinterrupts*) val _ = Define ` ((lower_sie:Sinterrupts -> Sinterrupts -> Uinterrupts) (s : Sinterrupts) (d : Sinterrupts)= (let (u : Uinterrupts) = (Mk_Uinterrupts ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))) in let u = (update_Uinterrupts_UEI u ((and_vec ((get_Sinterrupts_UEI s : 1 words$word)) ((get_Sinterrupts_UEI d : 1 words$word)) : 1 words$word))) in let u = (update_Uinterrupts_UTI u ((and_vec ((get_Sinterrupts_UTI s : 1 words$word)) ((get_Sinterrupts_UTI d : 1 words$word)) : 1 words$word))) in update_Uinterrupts_USI u ((and_vec ((get_Sinterrupts_USI s : 1 words$word)) ((get_Sinterrupts_USI d : 1 words$word)) : 1 words$word))))`; (*val lift_uip : Sinterrupts -> Sinterrupts -> Uinterrupts -> Sinterrupts*) val _ = Define ` ((lift_uip:Sinterrupts -> Sinterrupts -> Uinterrupts -> Sinterrupts) (o1 : Sinterrupts) (d : Sinterrupts) (u : Uinterrupts)= (let (s : Sinterrupts) = o1 in if (((((get_Sinterrupts_USI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Sinterrupts_USI s ((get_Uinterrupts_USI u : 1 words$word)) else s))`; (*val legalize_uip : Sinterrupts -> Sinterrupts -> mword ty64 -> Sinterrupts*) val _ = Define ` ((legalize_uip:Sinterrupts -> Sinterrupts ->(64)words$word -> Sinterrupts) (s : Sinterrupts) (d : Sinterrupts) (v : xlenbits)= (lift_uip s d ((Mk_Uinterrupts v))))`; (*val lift_uie : Sinterrupts -> Sinterrupts -> Uinterrupts -> Sinterrupts*) val _ = Define ` ((lift_uie:Sinterrupts -> Sinterrupts -> Uinterrupts -> Sinterrupts) (o1 : Sinterrupts) (d : Sinterrupts) (u : Uinterrupts)= (let (s : Sinterrupts) = o1 in let s = (if (((((get_Sinterrupts_UEI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Sinterrupts_UEI s ((get_Uinterrupts_UEI u : 1 words$word)) else s) in let s = (if (((((get_Sinterrupts_UTI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Sinterrupts_UTI s ((get_Uinterrupts_UTI u : 1 words$word)) else s) in if (((((get_Sinterrupts_USI d : 1 words$word)) = (0b1w : 1 words$word)))) then update_Sinterrupts_USI s ((get_Uinterrupts_USI u : 1 words$word)) else s))`; (*val legalize_uie : Sinterrupts -> Sinterrupts -> mword ty64 -> Sinterrupts*) val _ = Define ` ((legalize_uie:Sinterrupts -> Sinterrupts ->(64)words$word -> Sinterrupts) (s : Sinterrupts) (d : Sinterrupts) (v : xlenbits)= (lift_uie s d ((Mk_Uinterrupts v))))`; (*val ext_check_xret_priv : Privilege -> bool*) val _ = Define ` ((ext_check_xret_priv:Privilege -> bool) p= T)`; (*val ext_fail_xret_priv : unit -> unit*) val _ = Define ` ((ext_fail_xret_priv:unit -> unit) () = () )`; (*val handle_trap_extension : Privilege -> mword ty64 -> maybe unit -> unit*) val _ = Define ` ((handle_trap_extension:Privilege ->(64)words$word ->(unit)option -> unit) (p : Privilege) (pc : xlenbits) (u : unit option)= () )`; (*val prepare_trap_vector : Privilege -> Mcause -> M (mword ty64)*) val _ = Define ` ((prepare_trap_vector:Privilege -> Mcause ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (p : Privilege) (cause : Mcause)= (sail2_state_monad$bindS (case p of Machine => sail2_state_monad$read_regS mtvec_ref | Supervisor => sail2_state_monad$read_regS stvec_ref | User => sail2_state_monad$read_regS utvec_ref ) (\ (tvec : Mtvec) . (case ((tvec_addr tvec cause : ( 64 words$word)option)) of SOME (epc) => sail2_state_monad$returnS epc | NONE => (internal_error "Invalid tvec mode" : ( 64 words$word) M) ))))`; (*val get_xret_target : Privilege -> M (mword ty64)*) val _ = Define ` ((get_xret_target:Privilege ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) p= ((case p of Machine => (sail2_state_monad$read_regS mepc_ref : ( 64 words$word) M) | Supervisor => (sail2_state_monad$read_regS sepc_ref : ( 64 words$word) M) | User => (sail2_state_monad$read_regS uepc_ref : ( 64 words$word) M) )))`; (*val set_xret_target : Privilege -> mword ty64 -> M (mword ty64)*) val _ = Define ` ((set_xret_target:Privilege ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) p value= (sail2_state_monad$bindS (legalize_xepc value : ( 64 words$word) M) (\ target . sail2_state_monad$seqS (case p of Machine => sail2_state_monad$write_regS mepc_ref target | Supervisor => sail2_state_monad$write_regS sepc_ref target | User => sail2_state_monad$write_regS uepc_ref target ) (sail2_state_monad$returnS target))))`; (*val prepare_xret_target : Privilege -> M (mword ty64)*) val _ = Define ` ((prepare_xret_target:Privilege ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) p= ((get_xret_target p : ( 64 words$word) M)))`; (*val get_mtvec : unit -> M (mword ty64)*) val _ = Define ` ((get_mtvec:unit ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS mtvec_ref) (\ (w__0 : Mtvec) . sail2_state_monad$returnS ((get_Mtvec_bits w__0 : 64 words$word)))))`; (*val get_stvec : unit -> M (mword ty64)*) val _ = Define ` ((get_stvec:unit ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS stvec_ref) (\ (w__0 : Mtvec) . sail2_state_monad$returnS ((get_Mtvec_bits w__0 : 64 words$word)))))`; (*val get_utvec : unit -> M (mword ty64)*) val _ = Define ` ((get_utvec:unit ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS utvec_ref) (\ (w__0 : Mtvec) . sail2_state_monad$returnS ((get_Mtvec_bits w__0 : 64 words$word)))))`; (*val set_mtvec : mword ty64 -> M (mword ty64)*) val _ = Define ` ((set_mtvec:(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) value= (sail2_state_monad$bindS (sail2_state_monad$read_regS mtvec_ref) (\ (w__0 : Mtvec) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mtvec_ref ((legalize_tvec w__0 value))) (sail2_state_monad$read_regS mtvec_ref)) (\ (w__1 : Mtvec) . sail2_state_monad$returnS ((get_Mtvec_bits w__1 : 64 words$word))))))`; (*val set_stvec : mword ty64 -> M (mword ty64)*) val _ = Define ` ((set_stvec:(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) value= (sail2_state_monad$bindS (sail2_state_monad$read_regS stvec_ref) (\ (w__0 : Mtvec) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS stvec_ref ((legalize_tvec w__0 value))) (sail2_state_monad$read_regS stvec_ref)) (\ (w__1 : Mtvec) . sail2_state_monad$returnS ((get_Mtvec_bits w__1 : 64 words$word))))))`; (*val set_utvec : mword ty64 -> M (mword ty64)*) val _ = Define ` ((set_utvec:(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) value= (sail2_state_monad$bindS (sail2_state_monad$read_regS utvec_ref) (\ (w__0 : Mtvec) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS utvec_ref ((legalize_tvec w__0 value))) (sail2_state_monad$read_regS utvec_ref)) (\ (w__1 : Mtvec) . sail2_state_monad$returnS ((get_Mtvec_bits w__1 : 64 words$word))))))`; (*val update_softfloat_fflags : mword ty5 -> M unit*) val _ = Define ` ((update_softfloat_fflags:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) flags= (sail2_state_monad$write_regS float_fflags_ref ((zero_extend flags (( 64 : int):ii) : 64 words$word))))`; (*val riscv_f16Add : mword ty3 -> mword ty16 -> mword ty16 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f16Add:(3)words$word ->(16)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f16_add rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f16Sub : mword ty3 -> mword ty16 -> mword ty16 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f16Sub:(3)words$word ->(16)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f16_sub rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f16Mul : mword ty3 -> mword ty16 -> mword ty16 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f16Mul:(3)words$word ->(16)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f16_mul rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f16Div : mword ty3 -> mword ty16 -> mword ty16 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f16Div:(3)words$word ->(16)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f16_div rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f32Add : mword ty3 -> mword ty32 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32Add:(3)words$word ->(32)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f32_add rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f32Sub : mword ty3 -> mword ty32 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32Sub:(3)words$word ->(32)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f32_sub rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f32Mul : mword ty3 -> mword ty32 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32Mul:(3)words$word ->(32)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f32_mul rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f32Div : mword ty3 -> mword ty32 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32Div:(3)words$word ->(32)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f32_div rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f64Add : mword ty3 -> mword ty64 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64Add:(3)words$word ->(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f64_add rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f64Sub : mword ty3 -> mword ty64 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64Sub:(3)words$word ->(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f64_sub rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f64Mul : mword ty3 -> mword ty64 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64Mul:(3)words$word ->(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f64_mul rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f64Div : mword ty3 -> mword ty64 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64Div:(3)words$word ->(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2= (let (_ : unit) = (softfloat_f64_div rm v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f16MulAdd : mword ty3 -> mword ty16 -> mword ty16 -> mword ty16 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f16MulAdd:(3)words$word ->(16)words$word ->(16)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2 v3= (let (_ : unit) = (softfloat_f16_muladd rm v1 v2 v3) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f32MulAdd : mword ty3 -> mword ty32 -> mword ty32 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32MulAdd:(3)words$word ->(32)words$word ->(32)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2 v3= (let (_ : unit) = (softfloat_f32_muladd rm v1 v2 v3) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f64MulAdd : mword ty3 -> mword ty64 -> mword ty64 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64MulAdd:(3)words$word ->(64)words$word ->(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v1 v2 v3= (let (_ : unit) = (softfloat_f64_muladd rm v1 v2 v3) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f16Sqrt : mword ty3 -> mword ty16 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f16Sqrt:(3)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f16_sqrt rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f32Sqrt : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32Sqrt:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f32_sqrt rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f64Sqrt : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64Sqrt:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f64_sqrt rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f16ToI32 : mword ty3 -> mword ty16 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f16ToI32:(3)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f16_to_i32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f16ToUi32 : mword ty3 -> mword ty16 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f16ToUi32:(3)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f16_to_ui32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_i32ToF16 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_i32ToF16:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_i32_to_f16 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_ui32ToF16 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_ui32ToF16:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_ui32_to_f16 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f16ToI64 : mword ty3 -> mword ty16 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f16ToI64:(3)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f16_to_i64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f16ToUi64 : mword ty3 -> mword ty16 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f16ToUi64:(3)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f16_to_ui64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_i64ToF16 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_i64ToF15:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_i64_to_f16 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_ui64ToF16 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_ui64ToF16:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_ui64_to_f16 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f32ToI32 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32ToI32:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f32_to_i32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f32ToUi32 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32ToUi32:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f32_to_ui32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_i32ToF32 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_i32ToF32:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_i32_to_f32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_ui32ToF32 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_ui32ToF32:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_ui32_to_f32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f32ToI64 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f32ToI64:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f32_to_i64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f32ToUi64 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f32ToUi64:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f32_to_ui64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_i64ToF32 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_i64ToF32:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_i64_to_f32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_ui64ToF32 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_ui64ToF32:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_ui64_to_f32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f64ToI32 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f64ToI32:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f64_to_i32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f64ToUi32 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f64ToUi32:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f64_to_ui32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_i32ToF64 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_i32ToF64:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_i32_to_f64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_ui32ToF64 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_ui32ToF64:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_ui32_to_f64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f64ToI64 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64ToI64:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f64_to_i64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f64ToUi64 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64ToUi64:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f64_to_ui64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_i64ToF64 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_i64ToF64:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_i64_to_f64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_ui64ToF64 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_ui64ToF64:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_ui64_to_f64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f16ToF32 : mword ty3 -> mword ty16 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f16ToF32:(3)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f16_to_f32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f16ToF64 : mword ty3 -> mword ty16 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f16ToF64:(3)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f16_to_f64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f32ToF64 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f32ToF64:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f32_to_f64 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f32ToF16 : mword ty3 -> mword ty32 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f32ToF16:(3)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f32_to_f16 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f64ToF16 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f64ToF16:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f64_to_f16 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f64ToF32 : mword ty3 -> mword ty64 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f64ToF32:(3)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rm v= (let (_ : unit) = (softfloat_f64_to_f32 rm v) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f16Lt : mword ty16 -> mword ty16 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f16Lt:(16)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v1 v2= (let (_ : unit) = (softfloat_f16_lt v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f16Le : mword ty16 -> mword ty16 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f16Le:(16)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v1 v2= (let (_ : unit) = (softfloat_f16_le v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f16Eq : mword ty16 -> mword ty16 -> M (mword ty5 * mword ty16)*) val _ = Define ` ((riscv_f16Eq:(16)words$word ->(16)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v1 v2= (let (_ : unit) = (softfloat_f16_eq v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word))))))`; (*val riscv_f32Lt : mword ty32 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32Lt:(32)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v1 v2= (let (_ : unit) = (softfloat_f32_lt v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f32Le : mword ty32 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32Le:(32)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v1 v2= (let (_ : unit) = (softfloat_f32_le v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f32Eq : mword ty32 -> mword ty32 -> M (mword ty5 * mword ty32)*) val _ = Define ` ((riscv_f32Eq:(32)words$word ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v1 v2= (let (_ : unit) = (softfloat_f32_eq v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), (subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))`; (*val riscv_f64Lt : mword ty64 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64Lt:(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v1 v2= (let (_ : unit) = (softfloat_f64_lt v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f64Le : mword ty64 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64Le:(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v1 v2= (let (_ : unit) = (softfloat_f64_le v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val riscv_f64Eq : mword ty64 -> mword ty64 -> M (mword ty5 * mword ty64)*) val _ = Define ` ((riscv_f64Eq:(64)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word#(64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) v1 v2= (let (_ : unit) = (softfloat_f64_eq v1 v2) in sail2_state_monad$bindS (sail2_state_monad$read_regS float_fflags_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS float_result_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word), w__1)))))`; (*val dirty_fd_context : unit -> M unit*) val _ = Define ` ((dirty_fd_context:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$seqS (set_Mstatus_FS mstatus_ref ((extStatus_to_bits Dirty : 2 words$word))) (set_Mstatus_SD mstatus_ref (0b1w : 1 words$word))))`; (*val rF : integer -> M (mword ty64)*) val _ = Define ` ((rF:int ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r= (let l__42 = r in sail2_state_monad$bindS (if (((l__42 = (( 0 : int):ii)))) then (sail2_state_monad$read_regS f0_ref : ( 64 words$word) M) else if (((l__42 = (( 1 : int):ii)))) then (sail2_state_monad$read_regS f1_ref : ( 64 words$word) M) else if (((l__42 = (( 2 : int):ii)))) then (sail2_state_monad$read_regS f2_ref : ( 64 words$word) M) else if (((l__42 = (( 3 : int):ii)))) then (sail2_state_monad$read_regS f3_ref : ( 64 words$word) M) else if (((l__42 = (( 4 : int):ii)))) then (sail2_state_monad$read_regS f4_ref : ( 64 words$word) M) else if (((l__42 = (( 5 : int):ii)))) then (sail2_state_monad$read_regS f5_ref : ( 64 words$word) M) else if (((l__42 = (( 6 : int):ii)))) then (sail2_state_monad$read_regS f6_ref : ( 64 words$word) M) else if (((l__42 = (( 7 : int):ii)))) then (sail2_state_monad$read_regS f7_ref : ( 64 words$word) M) else if (((l__42 = (( 8 : int):ii)))) then (sail2_state_monad$read_regS f8_ref : ( 64 words$word) M) else if (((l__42 = (( 9 : int):ii)))) then (sail2_state_monad$read_regS f9_ref : ( 64 words$word) M) else if (((l__42 = (( 10 : int):ii)))) then (sail2_state_monad$read_regS f10_ref : ( 64 words$word) M) else if (((l__42 = (( 11 : int):ii)))) then (sail2_state_monad$read_regS f11_ref : ( 64 words$word) M) else if (((l__42 = (( 12 : int):ii)))) then (sail2_state_monad$read_regS f12_ref : ( 64 words$word) M) else if (((l__42 = (( 13 : int):ii)))) then (sail2_state_monad$read_regS f13_ref : ( 64 words$word) M) else if (((l__42 = (( 14 : int):ii)))) then (sail2_state_monad$read_regS f14_ref : ( 64 words$word) M) else if (((l__42 = (( 15 : int):ii)))) then (sail2_state_monad$read_regS f15_ref : ( 64 words$word) M) else if (((l__42 = (( 16 : int):ii)))) then (sail2_state_monad$read_regS f16_ref : ( 64 words$word) M) else if (((l__42 = (( 17 : int):ii)))) then (sail2_state_monad$read_regS f17_ref : ( 64 words$word) M) else if (((l__42 = (( 18 : int):ii)))) then (sail2_state_monad$read_regS f18_ref : ( 64 words$word) M) else if (((l__42 = (( 19 : int):ii)))) then (sail2_state_monad$read_regS f19_ref : ( 64 words$word) M) else if (((l__42 = (( 20 : int):ii)))) then (sail2_state_monad$read_regS f20_ref : ( 64 words$word) M) else if (((l__42 = (( 21 : int):ii)))) then (sail2_state_monad$read_regS f21_ref : ( 64 words$word) M) else if (((l__42 = (( 22 : int):ii)))) then (sail2_state_monad$read_regS f22_ref : ( 64 words$word) M) else if (((l__42 = (( 23 : int):ii)))) then (sail2_state_monad$read_regS f23_ref : ( 64 words$word) M) else if (((l__42 = (( 24 : int):ii)))) then (sail2_state_monad$read_regS f24_ref : ( 64 words$word) M) else if (((l__42 = (( 25 : int):ii)))) then (sail2_state_monad$read_regS f25_ref : ( 64 words$word) M) else if (((l__42 = (( 26 : int):ii)))) then (sail2_state_monad$read_regS f26_ref : ( 64 words$word) M) else if (((l__42 = (( 27 : int):ii)))) then (sail2_state_monad$read_regS f27_ref : ( 64 words$word) M) else if (((l__42 = (( 28 : int):ii)))) then (sail2_state_monad$read_regS f28_ref : ( 64 words$word) M) else if (((l__42 = (( 29 : int):ii)))) then (sail2_state_monad$read_regS f29_ref : ( 64 words$word) M) else if (((l__42 = (( 30 : int):ii)))) then (sail2_state_monad$read_regS f30_ref : ( 64 words$word) M) else if (((l__42 = (( 31 : int):ii)))) then (sail2_state_monad$read_regS f31_ref : ( 64 words$word) M) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "invalid floating point register number") (sail2_state_monad$exitS () )) (\ (v : fregtype) . sail2_state_monad$returnS ((fregval_from_freg v : 64 words$word)))))`; (*val wF : integer -> mword ty64 -> M unit*) val _ = Define ` ((wF:int ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r in_v= (let v = ((fregval_into_freg in_v : 64 words$word)) in let l__10 = r in sail2_state_monad$seqS (sail2_state_monad$seqS (if (((l__10 = (( 0 : int):ii)))) then sail2_state_monad$write_regS f0_ref v else if (((l__10 = (( 1 : int):ii)))) then sail2_state_monad$write_regS f1_ref v else if (((l__10 = (( 2 : int):ii)))) then sail2_state_monad$write_regS f2_ref v else if (((l__10 = (( 3 : int):ii)))) then sail2_state_monad$write_regS f3_ref v else if (((l__10 = (( 4 : int):ii)))) then sail2_state_monad$write_regS f4_ref v else if (((l__10 = (( 5 : int):ii)))) then sail2_state_monad$write_regS f5_ref v else if (((l__10 = (( 6 : int):ii)))) then sail2_state_monad$write_regS f6_ref v else if (((l__10 = (( 7 : int):ii)))) then sail2_state_monad$write_regS f7_ref v else if (((l__10 = (( 8 : int):ii)))) then sail2_state_monad$write_regS f8_ref v else if (((l__10 = (( 9 : int):ii)))) then sail2_state_monad$write_regS f9_ref v else if (((l__10 = (( 10 : int):ii)))) then sail2_state_monad$write_regS f10_ref v else if (((l__10 = (( 11 : int):ii)))) then sail2_state_monad$write_regS f11_ref v else if (((l__10 = (( 12 : int):ii)))) then sail2_state_monad$write_regS f12_ref v else if (((l__10 = (( 13 : int):ii)))) then sail2_state_monad$write_regS f13_ref v else if (((l__10 = (( 14 : int):ii)))) then sail2_state_monad$write_regS f14_ref v else if (((l__10 = (( 15 : int):ii)))) then sail2_state_monad$write_regS f15_ref v else if (((l__10 = (( 16 : int):ii)))) then sail2_state_monad$write_regS f16_ref v else if (((l__10 = (( 17 : int):ii)))) then sail2_state_monad$write_regS f17_ref v else if (((l__10 = (( 18 : int):ii)))) then sail2_state_monad$write_regS f18_ref v else if (((l__10 = (( 19 : int):ii)))) then sail2_state_monad$write_regS f19_ref v else if (((l__10 = (( 20 : int):ii)))) then sail2_state_monad$write_regS f20_ref v else if (((l__10 = (( 21 : int):ii)))) then sail2_state_monad$write_regS f21_ref v else if (((l__10 = (( 22 : int):ii)))) then sail2_state_monad$write_regS f22_ref v else if (((l__10 = (( 23 : int):ii)))) then sail2_state_monad$write_regS f23_ref v else if (((l__10 = (( 24 : int):ii)))) then sail2_state_monad$write_regS f24_ref v else if (((l__10 = (( 25 : int):ii)))) then sail2_state_monad$write_regS f25_ref v else if (((l__10 = (( 26 : int):ii)))) then sail2_state_monad$write_regS f26_ref v else if (((l__10 = (( 27 : int):ii)))) then sail2_state_monad$write_regS f27_ref v else if (((l__10 = (( 28 : int):ii)))) then sail2_state_monad$write_regS f28_ref v else if (((l__10 = (( 29 : int):ii)))) then sail2_state_monad$write_regS f29_ref v else if (((l__10 = (( 30 : int):ii)))) then sail2_state_monad$write_regS f30_ref v else if (((l__10 = (( 31 : int):ii)))) then sail2_state_monad$write_regS f31_ref v else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "invalid floating point register number") (sail2_state_monad$exitS () )) (dirty_fd_context () )) (sail2_state_monad$returnS (if ((get_config_print_reg () )) then print_dbg ((STRCAT "f" ((STRCAT ((stringFromInteger r)) ((STRCAT " <- " ((FRegStr v)))))))) else () ))))`; (*val rF_bits : mword ty5 -> M (mword ty64)*) val _ = Define ` ((rF_bits:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) i= ((rF ((lem$w2ui i)) : ( 64 words$word) M)))`; (*val wF_bits : mword ty5 -> mword ty64 -> M unit*) val _ = Define ` ((wF_bits:(5)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (i : 5 bits) (data : flenbits)= (wF ((lem$w2ui i)) data))`; (*val freg_name_abi_forwards : mword ty5 -> M string*) (*val freg_name_abi_backwards : string -> M (mword ty5)*) (*val freg_name_abi_forwards_matches : mword ty5 -> bool*) (*val freg_name_abi_backwards_matches : string -> bool*) (*val freg_name_abi_matches_prefix : string -> maybe ((mword ty5 * ii))*) val _ = Define ` ((freg_name_abi_forwards:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b00000w : 5 words$word)))) then sail2_state_monad$returnS "ft0" else if (((b__0 = (0b00001w : 5 words$word)))) then sail2_state_monad$returnS "ft1" else if (((b__0 = (0b00010w : 5 words$word)))) then sail2_state_monad$returnS "ft2" else if (((b__0 = (0b00011w : 5 words$word)))) then sail2_state_monad$returnS "ft3" else if (((b__0 = (0b00100w : 5 words$word)))) then sail2_state_monad$returnS "ft4" else if (((b__0 = (0b00101w : 5 words$word)))) then sail2_state_monad$returnS "ft5" else if (((b__0 = (0b00110w : 5 words$word)))) then sail2_state_monad$returnS "ft6" else if (((b__0 = (0b00111w : 5 words$word)))) then sail2_state_monad$returnS "ft7" else if (((b__0 = (0b01000w : 5 words$word)))) then sail2_state_monad$returnS "fs0" else if (((b__0 = (0b01001w : 5 words$word)))) then sail2_state_monad$returnS "fs1" else if (((b__0 = (0b01010w : 5 words$word)))) then sail2_state_monad$returnS "fa0" else if (((b__0 = (0b01011w : 5 words$word)))) then sail2_state_monad$returnS "fa1" else if (((b__0 = (0b01100w : 5 words$word)))) then sail2_state_monad$returnS "fa2" else if (((b__0 = (0b01101w : 5 words$word)))) then sail2_state_monad$returnS "fa3" else if (((b__0 = (0b01110w : 5 words$word)))) then sail2_state_monad$returnS "fa4" else if (((b__0 = (0b01111w : 5 words$word)))) then sail2_state_monad$returnS "fa5" else if (((b__0 = (0b10000w : 5 words$word)))) then sail2_state_monad$returnS "fa6" else if (((b__0 = (0b10001w : 5 words$word)))) then sail2_state_monad$returnS "fa7" else if (((b__0 = (0b10010w : 5 words$word)))) then sail2_state_monad$returnS "fs2" else if (((b__0 = (0b10011w : 5 words$word)))) then sail2_state_monad$returnS "fs3" else if (((b__0 = (0b10100w : 5 words$word)))) then sail2_state_monad$returnS "fs4" else if (((b__0 = (0b10101w : 5 words$word)))) then sail2_state_monad$returnS "fs5" else if (((b__0 = (0b10110w : 5 words$word)))) then sail2_state_monad$returnS "fs6" else if (((b__0 = (0b10111w : 5 words$word)))) then sail2_state_monad$returnS "fs7" else if (((b__0 = (0b11000w : 5 words$word)))) then sail2_state_monad$returnS "fs8" else if (((b__0 = (0b11001w : 5 words$word)))) then sail2_state_monad$returnS "fs9" else if (((b__0 = (0b11010w : 5 words$word)))) then sail2_state_monad$returnS "fs10" else if (((b__0 = (0b11011w : 5 words$word)))) then sail2_state_monad$returnS "fs11" else if (((b__0 = (0b11100w : 5 words$word)))) then sail2_state_monad$returnS "ft8" else if (((b__0 = (0b11101w : 5 words$word)))) then sail2_state_monad$returnS "ft9" else if (((b__0 = (0b11110w : 5 words$word)))) then sail2_state_monad$returnS "ft10" else if (((b__0 = (0b11111w : 5 words$word)))) then sail2_state_monad$returnS "ft11" else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((freg_name_abi_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "ft0"))) then sail2_state_monad$returnS (0b00000w : 5 words$word) else if (((p0_ = "ft1"))) then sail2_state_monad$returnS (0b00001w : 5 words$word) else if (((p0_ = "ft2"))) then sail2_state_monad$returnS (0b00010w : 5 words$word) else if (((p0_ = "ft3"))) then sail2_state_monad$returnS (0b00011w : 5 words$word) else if (((p0_ = "ft4"))) then sail2_state_monad$returnS (0b00100w : 5 words$word) else if (((p0_ = "ft5"))) then sail2_state_monad$returnS (0b00101w : 5 words$word) else if (((p0_ = "ft6"))) then sail2_state_monad$returnS (0b00110w : 5 words$word) else if (((p0_ = "ft7"))) then sail2_state_monad$returnS (0b00111w : 5 words$word) else if (((p0_ = "fs0"))) then sail2_state_monad$returnS (0b01000w : 5 words$word) else if (((p0_ = "fs1"))) then sail2_state_monad$returnS (0b01001w : 5 words$word) else if (((p0_ = "fa0"))) then sail2_state_monad$returnS (0b01010w : 5 words$word) else if (((p0_ = "fa1"))) then sail2_state_monad$returnS (0b01011w : 5 words$word) else if (((p0_ = "fa2"))) then sail2_state_monad$returnS (0b01100w : 5 words$word) else if (((p0_ = "fa3"))) then sail2_state_monad$returnS (0b01101w : 5 words$word) else if (((p0_ = "fa4"))) then sail2_state_monad$returnS (0b01110w : 5 words$word) else if (((p0_ = "fa5"))) then sail2_state_monad$returnS (0b01111w : 5 words$word) else if (((p0_ = "fa6"))) then sail2_state_monad$returnS (0b10000w : 5 words$word) else if (((p0_ = "fa7"))) then sail2_state_monad$returnS (0b10001w : 5 words$word) else if (((p0_ = "fs2"))) then sail2_state_monad$returnS (0b10010w : 5 words$word) else if (((p0_ = "fs3"))) then sail2_state_monad$returnS (0b10011w : 5 words$word) else if (((p0_ = "fs4"))) then sail2_state_monad$returnS (0b10100w : 5 words$word) else if (((p0_ = "fs5"))) then sail2_state_monad$returnS (0b10101w : 5 words$word) else if (((p0_ = "fs6"))) then sail2_state_monad$returnS (0b10110w : 5 words$word) else if (((p0_ = "fs7"))) then sail2_state_monad$returnS (0b10111w : 5 words$word) else if (((p0_ = "fs8"))) then sail2_state_monad$returnS (0b11000w : 5 words$word) else if (((p0_ = "fs9"))) then sail2_state_monad$returnS (0b11001w : 5 words$word) else if (((p0_ = "fs10"))) then sail2_state_monad$returnS (0b11010w : 5 words$word) else if (((p0_ = "fs11"))) then sail2_state_monad$returnS (0b11011w : 5 words$word) else if (((p0_ = "ft8"))) then sail2_state_monad$returnS (0b11100w : 5 words$word) else if (((p0_ = "ft9"))) then sail2_state_monad$returnS (0b11101w : 5 words$word) else if (((p0_ = "ft10"))) then sail2_state_monad$returnS (0b11110w : 5 words$word) else if (((p0_ = "ft11"))) then sail2_state_monad$returnS (0b11111w : 5 words$word) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((freg_name_abi_forwards_matches:(5)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b00000w : 5 words$word)))) then T else if (((b__0 = (0b00001w : 5 words$word)))) then T else if (((b__0 = (0b00010w : 5 words$word)))) then T else if (((b__0 = (0b00011w : 5 words$word)))) then T else if (((b__0 = (0b00100w : 5 words$word)))) then T else if (((b__0 = (0b00101w : 5 words$word)))) then T else if (((b__0 = (0b00110w : 5 words$word)))) then T else if (((b__0 = (0b00111w : 5 words$word)))) then T else if (((b__0 = (0b01000w : 5 words$word)))) then T else if (((b__0 = (0b01001w : 5 words$word)))) then T else if (((b__0 = (0b01010w : 5 words$word)))) then T else if (((b__0 = (0b01011w : 5 words$word)))) then T else if (((b__0 = (0b01100w : 5 words$word)))) then T else if (((b__0 = (0b01101w : 5 words$word)))) then T else if (((b__0 = (0b01110w : 5 words$word)))) then T else if (((b__0 = (0b01111w : 5 words$word)))) then T else if (((b__0 = (0b10000w : 5 words$word)))) then T else if (((b__0 = (0b10001w : 5 words$word)))) then T else if (((b__0 = (0b10010w : 5 words$word)))) then T else if (((b__0 = (0b10011w : 5 words$word)))) then T else if (((b__0 = (0b10100w : 5 words$word)))) then T else if (((b__0 = (0b10101w : 5 words$word)))) then T else if (((b__0 = (0b10110w : 5 words$word)))) then T else if (((b__0 = (0b10111w : 5 words$word)))) then T else if (((b__0 = (0b11000w : 5 words$word)))) then T else if (((b__0 = (0b11001w : 5 words$word)))) then T else if (((b__0 = (0b11010w : 5 words$word)))) then T else if (((b__0 = (0b11011w : 5 words$word)))) then T else if (((b__0 = (0b11100w : 5 words$word)))) then T else if (((b__0 = (0b11101w : 5 words$word)))) then T else if (((b__0 = (0b11110w : 5 words$word)))) then T else if (((b__0 = (0b11111w : 5 words$word)))) then T else F))`; val _ = Define ` ((freg_name_abi_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "ft0"))) then T else if (((p0_ = "ft1"))) then T else if (((p0_ = "ft2"))) then T else if (((p0_ = "ft3"))) then T else if (((p0_ = "ft4"))) then T else if (((p0_ = "ft5"))) then T else if (((p0_ = "ft6"))) then T else if (((p0_ = "ft7"))) then T else if (((p0_ = "fs0"))) then T else if (((p0_ = "fs1"))) then T else if (((p0_ = "fa0"))) then T else if (((p0_ = "fa1"))) then T else if (((p0_ = "fa2"))) then T else if (((p0_ = "fa3"))) then T else if (((p0_ = "fa4"))) then T else if (((p0_ = "fa5"))) then T else if (((p0_ = "fa6"))) then T else if (((p0_ = "fa7"))) then T else if (((p0_ = "fs2"))) then T else if (((p0_ = "fs3"))) then T else if (((p0_ = "fs4"))) then T else if (((p0_ = "fs5"))) then T else if (((p0_ = "fs6"))) then T else if (((p0_ = "fs7"))) then T else if (((p0_ = "fs8"))) then T else if (((p0_ = "fs9"))) then T else if (((p0_ = "fs10"))) then T else if (((p0_ = "fs11"))) then T else if (((p0_ = "ft8"))) then T else if (((p0_ = "ft9"))) then T else if (((p0_ = "ft10"))) then T else if (((p0_ = "ft11"))) then T else F))`; (*val _s324_ : string -> maybe string*) val _ = Define ` ((s324_:string ->(string)option) s325_0= (let s326_0 = s325_0 in if ((string_startswith s326_0 "ft11")) then (case ((string_drop s326_0 ((string_length "ft11")))) of s_ => SOME s_ ) else NONE))`; (*val _s320_ : string -> maybe string*) val _ = Define ` ((s320_:string ->(string)option) s321_0= (let s322_0 = s321_0 in if ((string_startswith s322_0 "ft10")) then (case ((string_drop s322_0 ((string_length "ft10")))) of s_ => SOME s_ ) else NONE))`; (*val _s316_ : string -> maybe string*) val _ = Define ` ((s316_:string ->(string)option) s317_0= (let s318_0 = s317_0 in if ((string_startswith s318_0 "ft9")) then (case ((string_drop s318_0 ((string_length "ft9")))) of s_ => SOME s_ ) else NONE))`; (*val _s312_ : string -> maybe string*) val _ = Define ` ((s312_:string ->(string)option) s313_0= (let s314_0 = s313_0 in if ((string_startswith s314_0 "ft8")) then (case ((string_drop s314_0 ((string_length "ft8")))) of s_ => SOME s_ ) else NONE))`; (*val _s308_ : string -> maybe string*) val _ = Define ` ((s308_:string ->(string)option) s309_0= (let s310_0 = s309_0 in if ((string_startswith s310_0 "fs11")) then (case ((string_drop s310_0 ((string_length "fs11")))) of s_ => SOME s_ ) else NONE))`; (*val _s304_ : string -> maybe string*) val _ = Define ` ((s304_:string ->(string)option) s305_0= (let s306_0 = s305_0 in if ((string_startswith s306_0 "fs10")) then (case ((string_drop s306_0 ((string_length "fs10")))) of s_ => SOME s_ ) else NONE))`; (*val _s300_ : string -> maybe string*) val _ = Define ` ((s300_:string ->(string)option) s301_0= (let s302_0 = s301_0 in if ((string_startswith s302_0 "fs9")) then (case ((string_drop s302_0 ((string_length "fs9")))) of s_ => SOME s_ ) else NONE))`; (*val _s296_ : string -> maybe string*) val _ = Define ` ((s296_:string ->(string)option) s297_0= (let s298_0 = s297_0 in if ((string_startswith s298_0 "fs8")) then (case ((string_drop s298_0 ((string_length "fs8")))) of s_ => SOME s_ ) else NONE))`; (*val _s292_ : string -> maybe string*) val _ = Define ` ((s292_:string ->(string)option) s293_0= (let s294_0 = s293_0 in if ((string_startswith s294_0 "fs7")) then (case ((string_drop s294_0 ((string_length "fs7")))) of s_ => SOME s_ ) else NONE))`; (*val _s288_ : string -> maybe string*) val _ = Define ` ((s288_:string ->(string)option) s289_0= (let s290_0 = s289_0 in if ((string_startswith s290_0 "fs6")) then (case ((string_drop s290_0 ((string_length "fs6")))) of s_ => SOME s_ ) else NONE))`; (*val _s284_ : string -> maybe string*) val _ = Define ` ((s284_:string ->(string)option) s285_0= (let s286_0 = s285_0 in if ((string_startswith s286_0 "fs5")) then (case ((string_drop s286_0 ((string_length "fs5")))) of s_ => SOME s_ ) else NONE))`; (*val _s280_ : string -> maybe string*) val _ = Define ` ((s280_:string ->(string)option) s281_0= (let s282_0 = s281_0 in if ((string_startswith s282_0 "fs4")) then (case ((string_drop s282_0 ((string_length "fs4")))) of s_ => SOME s_ ) else NONE))`; (*val _s276_ : string -> maybe string*) val _ = Define ` ((s276_:string ->(string)option) s277_0= (let s278_0 = s277_0 in if ((string_startswith s278_0 "fs3")) then (case ((string_drop s278_0 ((string_length "fs3")))) of s_ => SOME s_ ) else NONE))`; (*val _s272_ : string -> maybe string*) val _ = Define ` ((s272_:string ->(string)option) s273_0= (let s274_0 = s273_0 in if ((string_startswith s274_0 "fs2")) then (case ((string_drop s274_0 ((string_length "fs2")))) of s_ => SOME s_ ) else NONE))`; (*val _s268_ : string -> maybe string*) val _ = Define ` ((s268_:string ->(string)option) s269_0= (let s270_0 = s269_0 in if ((string_startswith s270_0 "fa7")) then (case ((string_drop s270_0 ((string_length "fa7")))) of s_ => SOME s_ ) else NONE))`; (*val _s264_ : string -> maybe string*) val _ = Define ` ((s264_:string ->(string)option) s265_0= (let s266_0 = s265_0 in if ((string_startswith s266_0 "fa6")) then (case ((string_drop s266_0 ((string_length "fa6")))) of s_ => SOME s_ ) else NONE))`; (*val _s260_ : string -> maybe string*) val _ = Define ` ((s260_:string ->(string)option) s261_0= (let s262_0 = s261_0 in if ((string_startswith s262_0 "fa5")) then (case ((string_drop s262_0 ((string_length "fa5")))) of s_ => SOME s_ ) else NONE))`; (*val _s256_ : string -> maybe string*) val _ = Define ` ((s256_:string ->(string)option) s257_0= (let s258_0 = s257_0 in if ((string_startswith s258_0 "fa4")) then (case ((string_drop s258_0 ((string_length "fa4")))) of s_ => SOME s_ ) else NONE))`; (*val _s252_ : string -> maybe string*) val _ = Define ` ((s252_:string ->(string)option) s253_0= (let s254_0 = s253_0 in if ((string_startswith s254_0 "fa3")) then (case ((string_drop s254_0 ((string_length "fa3")))) of s_ => SOME s_ ) else NONE))`; (*val _s248_ : string -> maybe string*) val _ = Define ` ((s248_:string ->(string)option) s249_0= (let s250_0 = s249_0 in if ((string_startswith s250_0 "fa2")) then (case ((string_drop s250_0 ((string_length "fa2")))) of s_ => SOME s_ ) else NONE))`; (*val _s244_ : string -> maybe string*) val _ = Define ` ((s244_:string ->(string)option) s245_0= (let s246_0 = s245_0 in if ((string_startswith s246_0 "fa1")) then (case ((string_drop s246_0 ((string_length "fa1")))) of s_ => SOME s_ ) else NONE))`; (*val _s240_ : string -> maybe string*) val _ = Define ` ((s240_:string ->(string)option) s241_0= (let s242_0 = s241_0 in if ((string_startswith s242_0 "fa0")) then (case ((string_drop s242_0 ((string_length "fa0")))) of s_ => SOME s_ ) else NONE))`; (*val _s236_ : string -> maybe string*) val _ = Define ` ((s236_:string ->(string)option) s237_0= (let s238_0 = s237_0 in if ((string_startswith s238_0 "fs1")) then (case ((string_drop s238_0 ((string_length "fs1")))) of s_ => SOME s_ ) else NONE))`; (*val _s232_ : string -> maybe string*) val _ = Define ` ((s232_:string ->(string)option) s233_0= (let s234_0 = s233_0 in if ((string_startswith s234_0 "fs0")) then (case ((string_drop s234_0 ((string_length "fs0")))) of s_ => SOME s_ ) else NONE))`; (*val _s228_ : string -> maybe string*) val _ = Define ` ((s228_:string ->(string)option) s229_0= (let s230_0 = s229_0 in if ((string_startswith s230_0 "ft7")) then (case ((string_drop s230_0 ((string_length "ft7")))) of s_ => SOME s_ ) else NONE))`; (*val _s224_ : string -> maybe string*) val _ = Define ` ((s224_:string ->(string)option) s225_0= (let s226_0 = s225_0 in if ((string_startswith s226_0 "ft6")) then (case ((string_drop s226_0 ((string_length "ft6")))) of s_ => SOME s_ ) else NONE))`; (*val _s220_ : string -> maybe string*) val _ = Define ` ((s220_:string ->(string)option) s221_0= (let s222_0 = s221_0 in if ((string_startswith s222_0 "ft5")) then (case ((string_drop s222_0 ((string_length "ft5")))) of s_ => SOME s_ ) else NONE))`; (*val _s216_ : string -> maybe string*) val _ = Define ` ((s216_:string ->(string)option) s217_0= (let s218_0 = s217_0 in if ((string_startswith s218_0 "ft4")) then (case ((string_drop s218_0 ((string_length "ft4")))) of s_ => SOME s_ ) else NONE))`; (*val _s212_ : string -> maybe string*) val _ = Define ` ((s212_:string ->(string)option) s213_0= (let s214_0 = s213_0 in if ((string_startswith s214_0 "ft3")) then (case ((string_drop s214_0 ((string_length "ft3")))) of s_ => SOME s_ ) else NONE))`; (*val _s208_ : string -> maybe string*) val _ = Define ` ((s208_:string ->(string)option) s209_0= (let s210_0 = s209_0 in if ((string_startswith s210_0 "ft2")) then (case ((string_drop s210_0 ((string_length "ft2")))) of s_ => SOME s_ ) else NONE))`; (*val _s204_ : string -> maybe string*) val _ = Define ` ((s204_:string ->(string)option) s205_0= (let s206_0 = s205_0 in if ((string_startswith s206_0 "ft1")) then (case ((string_drop s206_0 ((string_length "ft1")))) of s_ => SOME s_ ) else NONE))`; (*val _s200_ : string -> maybe string*) val _ = Define ` ((s200_:string ->(string)option) s201_0= (let s202_0 = s201_0 in if ((string_startswith s202_0 "ft0")) then (case ((string_drop s202_0 ((string_length "ft0")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((freg_name_abi_matches_prefix:string ->((5)words$word#int)option) arg_= (let s203_0 = arg_ in if ((case ((s200_ s203_0)) of SOME (s_) => T | _ => F )) then (case s200_ s203_0 of (SOME (s_)) => SOME ((0b00000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s204_ s203_0)) of SOME (s_) => T | _ => F )) then (case s204_ s203_0 of (SOME (s_)) => SOME ((0b00001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s208_ s203_0)) of SOME (s_) => T | _ => F )) then (case s208_ s203_0 of (SOME (s_)) => SOME ((0b00010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s212_ s203_0)) of SOME (s_) => T | _ => F )) then (case s212_ s203_0 of (SOME (s_)) => SOME ((0b00011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s216_ s203_0)) of SOME (s_) => T | _ => F )) then (case s216_ s203_0 of (SOME (s_)) => SOME ((0b00100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s220_ s203_0)) of SOME (s_) => T | _ => F )) then (case s220_ s203_0 of (SOME (s_)) => SOME ((0b00101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s224_ s203_0)) of SOME (s_) => T | _ => F )) then (case s224_ s203_0 of (SOME (s_)) => SOME ((0b00110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s228_ s203_0)) of SOME (s_) => T | _ => F )) then (case s228_ s203_0 of (SOME (s_)) => SOME ((0b00111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s232_ s203_0)) of SOME (s_) => T | _ => F )) then (case s232_ s203_0 of (SOME (s_)) => SOME ((0b01000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s236_ s203_0)) of SOME (s_) => T | _ => F )) then (case s236_ s203_0 of (SOME (s_)) => SOME ((0b01001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s240_ s203_0)) of SOME (s_) => T | _ => F )) then (case s240_ s203_0 of (SOME (s_)) => SOME ((0b01010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s244_ s203_0)) of SOME (s_) => T | _ => F )) then (case s244_ s203_0 of (SOME (s_)) => SOME ((0b01011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s248_ s203_0)) of SOME (s_) => T | _ => F )) then (case s248_ s203_0 of (SOME (s_)) => SOME ((0b01100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s252_ s203_0)) of SOME (s_) => T | _ => F )) then (case s252_ s203_0 of (SOME (s_)) => SOME ((0b01101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s256_ s203_0)) of SOME (s_) => T | _ => F )) then (case s256_ s203_0 of (SOME (s_)) => SOME ((0b01110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s260_ s203_0)) of SOME (s_) => T | _ => F )) then (case s260_ s203_0 of (SOME (s_)) => SOME ((0b01111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s264_ s203_0)) of SOME (s_) => T | _ => F )) then (case s264_ s203_0 of (SOME (s_)) => SOME ((0b10000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s268_ s203_0)) of SOME (s_) => T | _ => F )) then (case s268_ s203_0 of (SOME (s_)) => SOME ((0b10001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s272_ s203_0)) of SOME (s_) => T | _ => F )) then (case s272_ s203_0 of (SOME (s_)) => SOME ((0b10010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s276_ s203_0)) of SOME (s_) => T | _ => F )) then (case s276_ s203_0 of (SOME (s_)) => SOME ((0b10011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s280_ s203_0)) of SOME (s_) => T | _ => F )) then (case s280_ s203_0 of (SOME (s_)) => SOME ((0b10100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s284_ s203_0)) of SOME (s_) => T | _ => F )) then (case s284_ s203_0 of (SOME (s_)) => SOME ((0b10101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s288_ s203_0)) of SOME (s_) => T | _ => F )) then (case s288_ s203_0 of (SOME (s_)) => SOME ((0b10110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s292_ s203_0)) of SOME (s_) => T | _ => F )) then (case s292_ s203_0 of (SOME (s_)) => SOME ((0b10111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s296_ s203_0)) of SOME (s_) => T | _ => F )) then (case s296_ s203_0 of (SOME (s_)) => SOME ((0b11000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s300_ s203_0)) of SOME (s_) => T | _ => F )) then (case s300_ s203_0 of (SOME (s_)) => SOME ((0b11001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s304_ s203_0)) of SOME (s_) => T | _ => F )) then (case s304_ s203_0 of (SOME (s_)) => SOME ((0b11010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s308_ s203_0)) of SOME (s_) => T | _ => F )) then (case s308_ s203_0 of (SOME (s_)) => SOME ((0b11011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s312_ s203_0)) of SOME (s_) => T | _ => F )) then (case s312_ s203_0 of (SOME (s_)) => SOME ((0b11100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s316_ s203_0)) of SOME (s_) => T | _ => F )) then (case s316_ s203_0 of (SOME (s_)) => SOME ((0b11101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s320_ s203_0)) of SOME (s_) => T | _ => F )) then (case s320_ s203_0 of (SOME (s_)) => SOME ((0b11110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s324_ s203_0)) of SOME (s_) => T | _ => F )) then (case s324_ s203_0 of (SOME (s_)) => SOME ((0b11111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val freg_name_forwards : mword ty5 -> M string*) (*val freg_name_backwards : string -> M (mword ty5)*) (*val freg_name_forwards_matches : mword ty5 -> bool*) (*val freg_name_backwards_matches : string -> bool*) (*val freg_name_matches_prefix : string -> maybe ((mword ty5 * ii))*) val _ = Define ` ((freg_name_forwards:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b00000w : 5 words$word)))) then sail2_state_monad$returnS "ft0" else if (((b__0 = (0b00001w : 5 words$word)))) then sail2_state_monad$returnS "ft1" else if (((b__0 = (0b00010w : 5 words$word)))) then sail2_state_monad$returnS "ft2" else if (((b__0 = (0b00011w : 5 words$word)))) then sail2_state_monad$returnS "ft3" else if (((b__0 = (0b00100w : 5 words$word)))) then sail2_state_monad$returnS "ft4" else if (((b__0 = (0b00101w : 5 words$word)))) then sail2_state_monad$returnS "ft5" else if (((b__0 = (0b00110w : 5 words$word)))) then sail2_state_monad$returnS "ft6" else if (((b__0 = (0b00111w : 5 words$word)))) then sail2_state_monad$returnS "ft7" else if (((b__0 = (0b01000w : 5 words$word)))) then sail2_state_monad$returnS "fs0" else if (((b__0 = (0b01001w : 5 words$word)))) then sail2_state_monad$returnS "fs1" else if (((b__0 = (0b01010w : 5 words$word)))) then sail2_state_monad$returnS "fa0" else if (((b__0 = (0b01011w : 5 words$word)))) then sail2_state_monad$returnS "fa1" else if (((b__0 = (0b01100w : 5 words$word)))) then sail2_state_monad$returnS "fa2" else if (((b__0 = (0b01101w : 5 words$word)))) then sail2_state_monad$returnS "fa3" else if (((b__0 = (0b01110w : 5 words$word)))) then sail2_state_monad$returnS "fa4" else if (((b__0 = (0b01111w : 5 words$word)))) then sail2_state_monad$returnS "fa5" else if (((b__0 = (0b10000w : 5 words$word)))) then sail2_state_monad$returnS "fa6" else if (((b__0 = (0b10001w : 5 words$word)))) then sail2_state_monad$returnS "fa7" else if (((b__0 = (0b10010w : 5 words$word)))) then sail2_state_monad$returnS "fs2" else if (((b__0 = (0b10011w : 5 words$word)))) then sail2_state_monad$returnS "fs3" else if (((b__0 = (0b10100w : 5 words$word)))) then sail2_state_monad$returnS "fs4" else if (((b__0 = (0b10101w : 5 words$word)))) then sail2_state_monad$returnS "fs5" else if (((b__0 = (0b10110w : 5 words$word)))) then sail2_state_monad$returnS "fs6" else if (((b__0 = (0b10111w : 5 words$word)))) then sail2_state_monad$returnS "fs7" else if (((b__0 = (0b11000w : 5 words$word)))) then sail2_state_monad$returnS "fs8" else if (((b__0 = (0b11001w : 5 words$word)))) then sail2_state_monad$returnS "fs9" else if (((b__0 = (0b11010w : 5 words$word)))) then sail2_state_monad$returnS "fs10" else if (((b__0 = (0b11011w : 5 words$word)))) then sail2_state_monad$returnS "fs11" else if (((b__0 = (0b11100w : 5 words$word)))) then sail2_state_monad$returnS "ft8" else if (((b__0 = (0b11101w : 5 words$word)))) then sail2_state_monad$returnS "ft9" else if (((b__0 = (0b11110w : 5 words$word)))) then sail2_state_monad$returnS "ft10" else if (((b__0 = (0b11111w : 5 words$word)))) then sail2_state_monad$returnS "ft11" else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((freg_name_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((5)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "ft0"))) then sail2_state_monad$returnS (0b00000w : 5 words$word) else if (((p0_ = "ft1"))) then sail2_state_monad$returnS (0b00001w : 5 words$word) else if (((p0_ = "ft2"))) then sail2_state_monad$returnS (0b00010w : 5 words$word) else if (((p0_ = "ft3"))) then sail2_state_monad$returnS (0b00011w : 5 words$word) else if (((p0_ = "ft4"))) then sail2_state_monad$returnS (0b00100w : 5 words$word) else if (((p0_ = "ft5"))) then sail2_state_monad$returnS (0b00101w : 5 words$word) else if (((p0_ = "ft6"))) then sail2_state_monad$returnS (0b00110w : 5 words$word) else if (((p0_ = "ft7"))) then sail2_state_monad$returnS (0b00111w : 5 words$word) else if (((p0_ = "fs0"))) then sail2_state_monad$returnS (0b01000w : 5 words$word) else if (((p0_ = "fs1"))) then sail2_state_monad$returnS (0b01001w : 5 words$word) else if (((p0_ = "fa0"))) then sail2_state_monad$returnS (0b01010w : 5 words$word) else if (((p0_ = "fa1"))) then sail2_state_monad$returnS (0b01011w : 5 words$word) else if (((p0_ = "fa2"))) then sail2_state_monad$returnS (0b01100w : 5 words$word) else if (((p0_ = "fa3"))) then sail2_state_monad$returnS (0b01101w : 5 words$word) else if (((p0_ = "fa4"))) then sail2_state_monad$returnS (0b01110w : 5 words$word) else if (((p0_ = "fa5"))) then sail2_state_monad$returnS (0b01111w : 5 words$word) else if (((p0_ = "fa6"))) then sail2_state_monad$returnS (0b10000w : 5 words$word) else if (((p0_ = "fa7"))) then sail2_state_monad$returnS (0b10001w : 5 words$word) else if (((p0_ = "fs2"))) then sail2_state_monad$returnS (0b10010w : 5 words$word) else if (((p0_ = "fs3"))) then sail2_state_monad$returnS (0b10011w : 5 words$word) else if (((p0_ = "fs4"))) then sail2_state_monad$returnS (0b10100w : 5 words$word) else if (((p0_ = "fs5"))) then sail2_state_monad$returnS (0b10101w : 5 words$word) else if (((p0_ = "fs6"))) then sail2_state_monad$returnS (0b10110w : 5 words$word) else if (((p0_ = "fs7"))) then sail2_state_monad$returnS (0b10111w : 5 words$word) else if (((p0_ = "fs8"))) then sail2_state_monad$returnS (0b11000w : 5 words$word) else if (((p0_ = "fs9"))) then sail2_state_monad$returnS (0b11001w : 5 words$word) else if (((p0_ = "fs10"))) then sail2_state_monad$returnS (0b11010w : 5 words$word) else if (((p0_ = "fs11"))) then sail2_state_monad$returnS (0b11011w : 5 words$word) else if (((p0_ = "ft8"))) then sail2_state_monad$returnS (0b11100w : 5 words$word) else if (((p0_ = "ft9"))) then sail2_state_monad$returnS (0b11101w : 5 words$word) else if (((p0_ = "ft10"))) then sail2_state_monad$returnS (0b11110w : 5 words$word) else if (((p0_ = "ft11"))) then sail2_state_monad$returnS (0b11111w : 5 words$word) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((freg_name_forwards_matches:(5)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b00000w : 5 words$word)))) then T else if (((b__0 = (0b00001w : 5 words$word)))) then T else if (((b__0 = (0b00010w : 5 words$word)))) then T else if (((b__0 = (0b00011w : 5 words$word)))) then T else if (((b__0 = (0b00100w : 5 words$word)))) then T else if (((b__0 = (0b00101w : 5 words$word)))) then T else if (((b__0 = (0b00110w : 5 words$word)))) then T else if (((b__0 = (0b00111w : 5 words$word)))) then T else if (((b__0 = (0b01000w : 5 words$word)))) then T else if (((b__0 = (0b01001w : 5 words$word)))) then T else if (((b__0 = (0b01010w : 5 words$word)))) then T else if (((b__0 = (0b01011w : 5 words$word)))) then T else if (((b__0 = (0b01100w : 5 words$word)))) then T else if (((b__0 = (0b01101w : 5 words$word)))) then T else if (((b__0 = (0b01110w : 5 words$word)))) then T else if (((b__0 = (0b01111w : 5 words$word)))) then T else if (((b__0 = (0b10000w : 5 words$word)))) then T else if (((b__0 = (0b10001w : 5 words$word)))) then T else if (((b__0 = (0b10010w : 5 words$word)))) then T else if (((b__0 = (0b10011w : 5 words$word)))) then T else if (((b__0 = (0b10100w : 5 words$word)))) then T else if (((b__0 = (0b10101w : 5 words$word)))) then T else if (((b__0 = (0b10110w : 5 words$word)))) then T else if (((b__0 = (0b10111w : 5 words$word)))) then T else if (((b__0 = (0b11000w : 5 words$word)))) then T else if (((b__0 = (0b11001w : 5 words$word)))) then T else if (((b__0 = (0b11010w : 5 words$word)))) then T else if (((b__0 = (0b11011w : 5 words$word)))) then T else if (((b__0 = (0b11100w : 5 words$word)))) then T else if (((b__0 = (0b11101w : 5 words$word)))) then T else if (((b__0 = (0b11110w : 5 words$word)))) then T else if (((b__0 = (0b11111w : 5 words$word)))) then T else F))`; val _ = Define ` ((freg_name_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "ft0"))) then T else if (((p0_ = "ft1"))) then T else if (((p0_ = "ft2"))) then T else if (((p0_ = "ft3"))) then T else if (((p0_ = "ft4"))) then T else if (((p0_ = "ft5"))) then T else if (((p0_ = "ft6"))) then T else if (((p0_ = "ft7"))) then T else if (((p0_ = "fs0"))) then T else if (((p0_ = "fs1"))) then T else if (((p0_ = "fa0"))) then T else if (((p0_ = "fa1"))) then T else if (((p0_ = "fa2"))) then T else if (((p0_ = "fa3"))) then T else if (((p0_ = "fa4"))) then T else if (((p0_ = "fa5"))) then T else if (((p0_ = "fa6"))) then T else if (((p0_ = "fa7"))) then T else if (((p0_ = "fs2"))) then T else if (((p0_ = "fs3"))) then T else if (((p0_ = "fs4"))) then T else if (((p0_ = "fs5"))) then T else if (((p0_ = "fs6"))) then T else if (((p0_ = "fs7"))) then T else if (((p0_ = "fs8"))) then T else if (((p0_ = "fs9"))) then T else if (((p0_ = "fs10"))) then T else if (((p0_ = "fs11"))) then T else if (((p0_ = "ft8"))) then T else if (((p0_ = "ft9"))) then T else if (((p0_ = "ft10"))) then T else if (((p0_ = "ft11"))) then T else F))`; (*val _s452_ : string -> maybe string*) val _ = Define ` ((s452_:string ->(string)option) s453_0= (let s454_0 = s453_0 in if ((string_startswith s454_0 "ft11")) then (case ((string_drop s454_0 ((string_length "ft11")))) of s_ => SOME s_ ) else NONE))`; (*val _s448_ : string -> maybe string*) val _ = Define ` ((s448_:string ->(string)option) s449_0= (let s450_0 = s449_0 in if ((string_startswith s450_0 "ft10")) then (case ((string_drop s450_0 ((string_length "ft10")))) of s_ => SOME s_ ) else NONE))`; (*val _s444_ : string -> maybe string*) val _ = Define ` ((s444_:string ->(string)option) s445_0= (let s446_0 = s445_0 in if ((string_startswith s446_0 "ft9")) then (case ((string_drop s446_0 ((string_length "ft9")))) of s_ => SOME s_ ) else NONE))`; (*val _s440_ : string -> maybe string*) val _ = Define ` ((s440_:string ->(string)option) s441_0= (let s442_0 = s441_0 in if ((string_startswith s442_0 "ft8")) then (case ((string_drop s442_0 ((string_length "ft8")))) of s_ => SOME s_ ) else NONE))`; (*val _s436_ : string -> maybe string*) val _ = Define ` ((s436_:string ->(string)option) s437_0= (let s438_0 = s437_0 in if ((string_startswith s438_0 "fs11")) then (case ((string_drop s438_0 ((string_length "fs11")))) of s_ => SOME s_ ) else NONE))`; (*val _s432_ : string -> maybe string*) val _ = Define ` ((s432_:string ->(string)option) s433_0= (let s434_0 = s433_0 in if ((string_startswith s434_0 "fs10")) then (case ((string_drop s434_0 ((string_length "fs10")))) of s_ => SOME s_ ) else NONE))`; (*val _s428_ : string -> maybe string*) val _ = Define ` ((s428_:string ->(string)option) s429_0= (let s430_0 = s429_0 in if ((string_startswith s430_0 "fs9")) then (case ((string_drop s430_0 ((string_length "fs9")))) of s_ => SOME s_ ) else NONE))`; (*val _s424_ : string -> maybe string*) val _ = Define ` ((s424_:string ->(string)option) s425_0= (let s426_0 = s425_0 in if ((string_startswith s426_0 "fs8")) then (case ((string_drop s426_0 ((string_length "fs8")))) of s_ => SOME s_ ) else NONE))`; (*val _s420_ : string -> maybe string*) val _ = Define ` ((s420_:string ->(string)option) s421_0= (let s422_0 = s421_0 in if ((string_startswith s422_0 "fs7")) then (case ((string_drop s422_0 ((string_length "fs7")))) of s_ => SOME s_ ) else NONE))`; (*val _s416_ : string -> maybe string*) val _ = Define ` ((s416_:string ->(string)option) s417_0= (let s418_0 = s417_0 in if ((string_startswith s418_0 "fs6")) then (case ((string_drop s418_0 ((string_length "fs6")))) of s_ => SOME s_ ) else NONE))`; (*val _s412_ : string -> maybe string*) val _ = Define ` ((s412_:string ->(string)option) s413_0= (let s414_0 = s413_0 in if ((string_startswith s414_0 "fs5")) then (case ((string_drop s414_0 ((string_length "fs5")))) of s_ => SOME s_ ) else NONE))`; (*val _s408_ : string -> maybe string*) val _ = Define ` ((s408_:string ->(string)option) s409_0= (let s410_0 = s409_0 in if ((string_startswith s410_0 "fs4")) then (case ((string_drop s410_0 ((string_length "fs4")))) of s_ => SOME s_ ) else NONE))`; (*val _s404_ : string -> maybe string*) val _ = Define ` ((s404_:string ->(string)option) s405_0= (let s406_0 = s405_0 in if ((string_startswith s406_0 "fs3")) then (case ((string_drop s406_0 ((string_length "fs3")))) of s_ => SOME s_ ) else NONE))`; (*val _s400_ : string -> maybe string*) val _ = Define ` ((s400_:string ->(string)option) s401_0= (let s402_0 = s401_0 in if ((string_startswith s402_0 "fs2")) then (case ((string_drop s402_0 ((string_length "fs2")))) of s_ => SOME s_ ) else NONE))`; (*val _s396_ : string -> maybe string*) val _ = Define ` ((s396_:string ->(string)option) s397_0= (let s398_0 = s397_0 in if ((string_startswith s398_0 "fa7")) then (case ((string_drop s398_0 ((string_length "fa7")))) of s_ => SOME s_ ) else NONE))`; (*val _s392_ : string -> maybe string*) val _ = Define ` ((s392_:string ->(string)option) s393_0= (let s394_0 = s393_0 in if ((string_startswith s394_0 "fa6")) then (case ((string_drop s394_0 ((string_length "fa6")))) of s_ => SOME s_ ) else NONE))`; (*val _s388_ : string -> maybe string*) val _ = Define ` ((s388_:string ->(string)option) s389_0= (let s390_0 = s389_0 in if ((string_startswith s390_0 "fa5")) then (case ((string_drop s390_0 ((string_length "fa5")))) of s_ => SOME s_ ) else NONE))`; (*val _s384_ : string -> maybe string*) val _ = Define ` ((s384_:string ->(string)option) s385_0= (let s386_0 = s385_0 in if ((string_startswith s386_0 "fa4")) then (case ((string_drop s386_0 ((string_length "fa4")))) of s_ => SOME s_ ) else NONE))`; (*val _s380_ : string -> maybe string*) val _ = Define ` ((s380_:string ->(string)option) s381_0= (let s382_0 = s381_0 in if ((string_startswith s382_0 "fa3")) then (case ((string_drop s382_0 ((string_length "fa3")))) of s_ => SOME s_ ) else NONE))`; (*val _s376_ : string -> maybe string*) val _ = Define ` ((s376_:string ->(string)option) s377_0= (let s378_0 = s377_0 in if ((string_startswith s378_0 "fa2")) then (case ((string_drop s378_0 ((string_length "fa2")))) of s_ => SOME s_ ) else NONE))`; (*val _s372_ : string -> maybe string*) val _ = Define ` ((s372_:string ->(string)option) s373_0= (let s374_0 = s373_0 in if ((string_startswith s374_0 "fa1")) then (case ((string_drop s374_0 ((string_length "fa1")))) of s_ => SOME s_ ) else NONE))`; (*val _s368_ : string -> maybe string*) val _ = Define ` ((s368_:string ->(string)option) s369_0= (let s370_0 = s369_0 in if ((string_startswith s370_0 "fa0")) then (case ((string_drop s370_0 ((string_length "fa0")))) of s_ => SOME s_ ) else NONE))`; (*val _s364_ : string -> maybe string*) val _ = Define ` ((s364_:string ->(string)option) s365_0= (let s366_0 = s365_0 in if ((string_startswith s366_0 "fs1")) then (case ((string_drop s366_0 ((string_length "fs1")))) of s_ => SOME s_ ) else NONE))`; (*val _s360_ : string -> maybe string*) val _ = Define ` ((s360_:string ->(string)option) s361_0= (let s362_0 = s361_0 in if ((string_startswith s362_0 "fs0")) then (case ((string_drop s362_0 ((string_length "fs0")))) of s_ => SOME s_ ) else NONE))`; (*val _s356_ : string -> maybe string*) val _ = Define ` ((s356_:string ->(string)option) s357_0= (let s358_0 = s357_0 in if ((string_startswith s358_0 "ft7")) then (case ((string_drop s358_0 ((string_length "ft7")))) of s_ => SOME s_ ) else NONE))`; (*val _s352_ : string -> maybe string*) val _ = Define ` ((s352_:string ->(string)option) s353_0= (let s354_0 = s353_0 in if ((string_startswith s354_0 "ft6")) then (case ((string_drop s354_0 ((string_length "ft6")))) of s_ => SOME s_ ) else NONE))`; (*val _s348_ : string -> maybe string*) val _ = Define ` ((s348_:string ->(string)option) s349_0= (let s350_0 = s349_0 in if ((string_startswith s350_0 "ft5")) then (case ((string_drop s350_0 ((string_length "ft5")))) of s_ => SOME s_ ) else NONE))`; (*val _s344_ : string -> maybe string*) val _ = Define ` ((s344_:string ->(string)option) s345_0= (let s346_0 = s345_0 in if ((string_startswith s346_0 "ft4")) then (case ((string_drop s346_0 ((string_length "ft4")))) of s_ => SOME s_ ) else NONE))`; (*val _s340_ : string -> maybe string*) val _ = Define ` ((s340_:string ->(string)option) s341_0= (let s342_0 = s341_0 in if ((string_startswith s342_0 "ft3")) then (case ((string_drop s342_0 ((string_length "ft3")))) of s_ => SOME s_ ) else NONE))`; (*val _s336_ : string -> maybe string*) val _ = Define ` ((s336_:string ->(string)option) s337_0= (let s338_0 = s337_0 in if ((string_startswith s338_0 "ft2")) then (case ((string_drop s338_0 ((string_length "ft2")))) of s_ => SOME s_ ) else NONE))`; (*val _s332_ : string -> maybe string*) val _ = Define ` ((s332_:string ->(string)option) s333_0= (let s334_0 = s333_0 in if ((string_startswith s334_0 "ft1")) then (case ((string_drop s334_0 ((string_length "ft1")))) of s_ => SOME s_ ) else NONE))`; (*val _s328_ : string -> maybe string*) val _ = Define ` ((s328_:string ->(string)option) s329_0= (let s330_0 = s329_0 in if ((string_startswith s330_0 "ft0")) then (case ((string_drop s330_0 ((string_length "ft0")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((freg_name_matches_prefix:string ->((5)words$word#int)option) arg_= (let s331_0 = arg_ in if ((case ((s328_ s331_0)) of SOME (s_) => T | _ => F )) then (case s328_ s331_0 of (SOME (s_)) => SOME ((0b00000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s332_ s331_0)) of SOME (s_) => T | _ => F )) then (case s332_ s331_0 of (SOME (s_)) => SOME ((0b00001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s336_ s331_0)) of SOME (s_) => T | _ => F )) then (case s336_ s331_0 of (SOME (s_)) => SOME ((0b00010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s340_ s331_0)) of SOME (s_) => T | _ => F )) then (case s340_ s331_0 of (SOME (s_)) => SOME ((0b00011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s344_ s331_0)) of SOME (s_) => T | _ => F )) then (case s344_ s331_0 of (SOME (s_)) => SOME ((0b00100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s348_ s331_0)) of SOME (s_) => T | _ => F )) then (case s348_ s331_0 of (SOME (s_)) => SOME ((0b00101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s352_ s331_0)) of SOME (s_) => T | _ => F )) then (case s352_ s331_0 of (SOME (s_)) => SOME ((0b00110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s356_ s331_0)) of SOME (s_) => T | _ => F )) then (case s356_ s331_0 of (SOME (s_)) => SOME ((0b00111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s360_ s331_0)) of SOME (s_) => T | _ => F )) then (case s360_ s331_0 of (SOME (s_)) => SOME ((0b01000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s364_ s331_0)) of SOME (s_) => T | _ => F )) then (case s364_ s331_0 of (SOME (s_)) => SOME ((0b01001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s368_ s331_0)) of SOME (s_) => T | _ => F )) then (case s368_ s331_0 of (SOME (s_)) => SOME ((0b01010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s372_ s331_0)) of SOME (s_) => T | _ => F )) then (case s372_ s331_0 of (SOME (s_)) => SOME ((0b01011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s376_ s331_0)) of SOME (s_) => T | _ => F )) then (case s376_ s331_0 of (SOME (s_)) => SOME ((0b01100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s380_ s331_0)) of SOME (s_) => T | _ => F )) then (case s380_ s331_0 of (SOME (s_)) => SOME ((0b01101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s384_ s331_0)) of SOME (s_) => T | _ => F )) then (case s384_ s331_0 of (SOME (s_)) => SOME ((0b01110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s388_ s331_0)) of SOME (s_) => T | _ => F )) then (case s388_ s331_0 of (SOME (s_)) => SOME ((0b01111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s392_ s331_0)) of SOME (s_) => T | _ => F )) then (case s392_ s331_0 of (SOME (s_)) => SOME ((0b10000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s396_ s331_0)) of SOME (s_) => T | _ => F )) then (case s396_ s331_0 of (SOME (s_)) => SOME ((0b10001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s400_ s331_0)) of SOME (s_) => T | _ => F )) then (case s400_ s331_0 of (SOME (s_)) => SOME ((0b10010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s404_ s331_0)) of SOME (s_) => T | _ => F )) then (case s404_ s331_0 of (SOME (s_)) => SOME ((0b10011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s408_ s331_0)) of SOME (s_) => T | _ => F )) then (case s408_ s331_0 of (SOME (s_)) => SOME ((0b10100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s412_ s331_0)) of SOME (s_) => T | _ => F )) then (case s412_ s331_0 of (SOME (s_)) => SOME ((0b10101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s416_ s331_0)) of SOME (s_) => T | _ => F )) then (case s416_ s331_0 of (SOME (s_)) => SOME ((0b10110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s420_ s331_0)) of SOME (s_) => T | _ => F )) then (case s420_ s331_0 of (SOME (s_)) => SOME ((0b10111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s424_ s331_0)) of SOME (s_) => T | _ => F )) then (case s424_ s331_0 of (SOME (s_)) => SOME ((0b11000w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s428_ s331_0)) of SOME (s_) => T | _ => F )) then (case s428_ s331_0 of (SOME (s_)) => SOME ((0b11001w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s432_ s331_0)) of SOME (s_) => T | _ => F )) then (case s432_ s331_0 of (SOME (s_)) => SOME ((0b11010w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s436_ s331_0)) of SOME (s_) => T | _ => F )) then (case s436_ s331_0 of (SOME (s_)) => SOME ((0b11011w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s440_ s331_0)) of SOME (s_) => T | _ => F )) then (case s440_ s331_0 of (SOME (s_)) => SOME ((0b11100w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s444_ s331_0)) of SOME (s_) => T | _ => F )) then (case s444_ s331_0 of (SOME (s_)) => SOME ((0b11101w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s448_ s331_0)) of SOME (s_) => T | _ => F )) then (case s448_ s331_0 of (SOME (s_)) => SOME ((0b11110w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s452_ s331_0)) of SOME (s_) => T | _ => F )) then (case s452_ s331_0 of (SOME (s_)) => SOME ((0b11111w : 5 words$word), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val init_fdext_regs : unit -> M unit*) val _ = Define ` ((init_fdext_regs:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS f0_ref zero_freg) (sail2_state_monad$write_regS f1_ref zero_freg)) (sail2_state_monad$write_regS f2_ref zero_freg)) (sail2_state_monad$write_regS f3_ref zero_freg)) (sail2_state_monad$write_regS f4_ref zero_freg)) (sail2_state_monad$write_regS f5_ref zero_freg)) (sail2_state_monad$write_regS f6_ref zero_freg)) (sail2_state_monad$write_regS f7_ref zero_freg)) (sail2_state_monad$write_regS f8_ref zero_freg)) (sail2_state_monad$write_regS f9_ref zero_freg)) (sail2_state_monad$write_regS f10_ref zero_freg)) (sail2_state_monad$write_regS f11_ref zero_freg)) (sail2_state_monad$write_regS f12_ref zero_freg)) (sail2_state_monad$write_regS f13_ref zero_freg)) (sail2_state_monad$write_regS f14_ref zero_freg)) (sail2_state_monad$write_regS f15_ref zero_freg)) (sail2_state_monad$write_regS f16_ref zero_freg)) (sail2_state_monad$write_regS f17_ref zero_freg)) (sail2_state_monad$write_regS f18_ref zero_freg)) (sail2_state_monad$write_regS f19_ref zero_freg)) (sail2_state_monad$write_regS f20_ref zero_freg)) (sail2_state_monad$write_regS f21_ref zero_freg)) (sail2_state_monad$write_regS f22_ref zero_freg)) (sail2_state_monad$write_regS f23_ref zero_freg)) (sail2_state_monad$write_regS f24_ref zero_freg)) (sail2_state_monad$write_regS f25_ref zero_freg)) (sail2_state_monad$write_regS f26_ref zero_freg)) (sail2_state_monad$write_regS f27_ref zero_freg)) (sail2_state_monad$write_regS f28_ref zero_freg)) (sail2_state_monad$write_regS f29_ref zero_freg)) (sail2_state_monad$write_regS f30_ref zero_freg)) (sail2_state_monad$write_regS f31_ref zero_freg)))`; (*val Mk_Fcsr : mword ty32 -> Fcsr*) val _ = Define ` ((Mk_Fcsr:(32)words$word -> Fcsr) v= (<| Fcsr_Fcsr_chunk_0 := ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) |>))`; val _ = Define ` ((get_Fcsr_bits:Fcsr ->(32)words$word) v= ((subrange_vec_dec v.Fcsr_Fcsr_chunk_0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)))`; val _ = Define ` ((set_Fcsr_bits:((regstate),(register_value),(Fcsr))register_ref ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Fcsr_Fcsr_chunk_0 := ((update_subrange_vec_dec r.Fcsr_Fcsr_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_Fcsr_bits:Fcsr ->(32)words$word -> Fcsr) v x= (( v with<| Fcsr_Fcsr_chunk_0 := ((update_subrange_vec_dec v.Fcsr_Fcsr_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)))`; (*val _get_Fcsr_FRM : Fcsr -> mword ty3*) val _ = Define ` ((get_Fcsr_FRM:Fcsr ->(3)words$word) v= ((subrange_vec_dec v.Fcsr_Fcsr_chunk_0 (( 7 : int):ii) (( 5 : int):ii) : 3 words$word)))`; (*val _set_Fcsr_FRM : register_ref regstate register_value Fcsr -> mword ty3 -> M unit*) val _ = Define ` ((set_Fcsr_FRM:((regstate),(register_value),(Fcsr))register_ref ->(3)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Fcsr_Fcsr_chunk_0 := ((update_subrange_vec_dec r.Fcsr_Fcsr_chunk_0 (( 7 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Fcsr_FRM : Fcsr -> mword ty3 -> Fcsr*) val _ = Define ` ((update_Fcsr_FRM:Fcsr ->(3)words$word -> Fcsr) v x= (( v with<| Fcsr_Fcsr_chunk_0 := ((update_subrange_vec_dec v.Fcsr_Fcsr_chunk_0 (( 7 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) : 32 words$word)) |>)))`; (*val _get_Fcsr_FFLAGS : Fcsr -> mword ty5*) val _ = Define ` ((get_Fcsr_FFLAGS:Fcsr ->(5)words$word) v= ((subrange_vec_dec v.Fcsr_Fcsr_chunk_0 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)))`; (*val _set_Fcsr_FFLAGS : register_ref regstate register_value Fcsr -> mword ty5 -> M unit*) val _ = Define ` ((set_Fcsr_FFLAGS:((regstate),(register_value),(Fcsr))register_ref ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| Fcsr_Fcsr_chunk_0 := ((update_subrange_vec_dec r.Fcsr_Fcsr_chunk_0 (( 4 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_Fcsr_FFLAGS : Fcsr -> mword ty5 -> Fcsr*) val _ = Define ` ((update_Fcsr_FFLAGS:Fcsr ->(5)words$word -> Fcsr) v x= (( v with<| Fcsr_Fcsr_chunk_0 := ((update_subrange_vec_dec v.Fcsr_Fcsr_chunk_0 (( 4 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) : 32 words$word)) |>)))`; (*val ext_write_fcsr : mword ty3 -> mword ty5 -> M unit*) val _ = Define ` ((ext_write_fcsr:(3)words$word ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) frm fflags= (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Fcsr_FRM fcsr_ref frm) (set_Fcsr_FFLAGS fcsr_ref fflags)) (update_softfloat_fflags fflags)) (dirty_fd_context () )))`; (*val write_fflags : mword ty5 -> M unit*) val _ = Define ` ((write_fflags:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) fflags= (sail2_state_monad$bindS (sail2_state_monad$read_regS fcsr_ref) (\ (w__0 : Fcsr) . sail2_state_monad$seqS (if (((((get_Fcsr_FFLAGS w__0 : 5 words$word)) <> fflags))) then dirty_fd_context () else sail2_state_monad$returnS () ) (set_Fcsr_FFLAGS fcsr_ref fflags))))`; (*val accrue_fflags : mword ty5 -> M unit*) val _ = Define ` ((accrue_fflags:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) flags= (sail2_state_monad$bindS (sail2_state_monad$read_regS fcsr_ref) (\ (w__0 : Fcsr) . let f = ((or_vec ((get_Fcsr_FFLAGS w__0 : 5 words$word)) flags : 5 words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS fcsr_ref) (\ (w__1 : Fcsr) . if (((((get_Fcsr_FFLAGS w__1 : 5 words$word)) <> f))) then sail2_state_monad$seqS (sail2_state_monad$seqS (set_Fcsr_FFLAGS fcsr_ref f) (update_softfloat_fflags f)) (dirty_fd_context () ) else sail2_state_monad$returnS () ))))`; val _ = Define ` ((csr_name_map_forwards:(12)words$word -> string) arg_= (let b__0 = arg_ in if (((b__0 = (0x000w : 12 words$word)))) then "ustatus" else if (((b__0 = (0x004w : 12 words$word)))) then "uie" else if (((b__0 = (0x005w : 12 words$word)))) then "utvec" else if (((b__0 = (0x040w : 12 words$word)))) then "uscratch" else if (((b__0 = (0x041w : 12 words$word)))) then "uepc" else if (((b__0 = (0x042w : 12 words$word)))) then "ucause" else if (((b__0 = (0x043w : 12 words$word)))) then "utval" else if (((b__0 = (0x044w : 12 words$word)))) then "uip" else if (((b__0 = (0x001w : 12 words$word)))) then "fflags" else if (((b__0 = (0x002w : 12 words$word)))) then "frm" else if (((b__0 = (0x003w : 12 words$word)))) then "fcsr" else if (((b__0 = (0xC00w : 12 words$word)))) then "cycle" else if (((b__0 = (0xC01w : 12 words$word)))) then "time" else if (((b__0 = (0xC02w : 12 words$word)))) then "instret" else if (((b__0 = (0xC80w : 12 words$word)))) then "cycleh" else if (((b__0 = (0xC81w : 12 words$word)))) then "timeh" else if (((b__0 = (0xC82w : 12 words$word)))) then "instreth" else if (((b__0 = (0x100w : 12 words$word)))) then "sstatus" else if (((b__0 = (0x102w : 12 words$word)))) then "sedeleg" else if (((b__0 = (0x103w : 12 words$word)))) then "sideleg" else if (((b__0 = (0x104w : 12 words$word)))) then "sie" else if (((b__0 = (0x105w : 12 words$word)))) then "stvec" else if (((b__0 = (0x106w : 12 words$word)))) then "scounteren" else if (((b__0 = (0x140w : 12 words$word)))) then "sscratch" else if (((b__0 = (0x141w : 12 words$word)))) then "sepc" else if (((b__0 = (0x142w : 12 words$word)))) then "scause" else if (((b__0 = (0x143w : 12 words$word)))) then "stval" else if (((b__0 = (0x144w : 12 words$word)))) then "sip" else if (((b__0 = (0x180w : 12 words$word)))) then "satp" else if (((b__0 = (0xF11w : 12 words$word)))) then "mvendorid" else if (((b__0 = (0xF12w : 12 words$word)))) then "marchid" else if (((b__0 = (0xF13w : 12 words$word)))) then "mimpid" else if (((b__0 = (0xF14w : 12 words$word)))) then "mhartid" else if (((b__0 = (0x300w : 12 words$word)))) then "mstatus" else if (((b__0 = (0x301w : 12 words$word)))) then "misa" else if (((b__0 = (0x302w : 12 words$word)))) then "medeleg" else if (((b__0 = (0x303w : 12 words$word)))) then "mideleg" else if (((b__0 = (0x304w : 12 words$word)))) then "mie" else if (((b__0 = (0x305w : 12 words$word)))) then "mtvec" else if (((b__0 = (0x306w : 12 words$word)))) then "mcounteren" else if (((b__0 = (0x320w : 12 words$word)))) then "mcountinhibit" else if (((b__0 = (0x340w : 12 words$word)))) then "mscratch" else if (((b__0 = (0x341w : 12 words$word)))) then "mepc" else if (((b__0 = (0x342w : 12 words$word)))) then "mcause" else if (((b__0 = (0x343w : 12 words$word)))) then "mtval" else if (((b__0 = (0x344w : 12 words$word)))) then "mip" else if (((b__0 = (0x3A0w : 12 words$word)))) then "pmpcfg0" else if (((b__0 = (0x3A1w : 12 words$word)))) then "pmpcfg1" else if (((b__0 = (0x3A2w : 12 words$word)))) then "pmpcfg2" else if (((b__0 = (0x3A3w : 12 words$word)))) then "pmpcfg3" else if (((b__0 = (0x3B0w : 12 words$word)))) then "pmpaddr0" else if (((b__0 = (0x3B1w : 12 words$word)))) then "pmpaddr1" else if (((b__0 = (0x3B2w : 12 words$word)))) then "pmpaddr2" else if (((b__0 = (0x3B3w : 12 words$word)))) then "pmpaddr3" else if (((b__0 = (0x3B4w : 12 words$word)))) then "pmpaddr4" else if (((b__0 = (0x3B5w : 12 words$word)))) then "pmpaddr5" else if (((b__0 = (0x3B6w : 12 words$word)))) then "pmpaddr6" else if (((b__0 = (0x3B7w : 12 words$word)))) then "pmpaddr7" else if (((b__0 = (0x3B8w : 12 words$word)))) then "pmpaddr8" else if (((b__0 = (0x3B9w : 12 words$word)))) then "pmpaddr9" else if (((b__0 = (0x3BAw : 12 words$word)))) then "pmpaddr10" else if (((b__0 = (0x3BBw : 12 words$word)))) then "pmpaddr11" else if (((b__0 = (0x3BCw : 12 words$word)))) then "pmpaddr12" else if (((b__0 = (0x3BDw : 12 words$word)))) then "pmpaddr13" else if (((b__0 = (0x3BEw : 12 words$word)))) then "pmpaddr14" else if (((b__0 = (0x3BFw : 12 words$word)))) then "pmpaddr15" else if (((b__0 = (0xB00w : 12 words$word)))) then "mcycle" else if (((b__0 = (0xB02w : 12 words$word)))) then "minstret" else if (((b__0 = (0xB80w : 12 words$word)))) then "mcycleh" else if (((b__0 = (0xB82w : 12 words$word)))) then "minstreth" else if (((b__0 = (0x7A0w : 12 words$word)))) then "tselect" else if (((b__0 = (0x7A1w : 12 words$word)))) then "tdata1" else if (((b__0 = (0x7A2w : 12 words$word)))) then "tdata2" else if (((b__0 = (0x7A3w : 12 words$word)))) then "tdata3" else decimal_string_of_bits b__0))`; val _ = Define ` ((csr_name_map_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((12)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "ustatus"))) then sail2_state_monad$returnS (0x000w : 12 words$word) else if (((p0_ = "uie"))) then sail2_state_monad$returnS (0x004w : 12 words$word) else if (((p0_ = "utvec"))) then sail2_state_monad$returnS (0x005w : 12 words$word) else if (((p0_ = "uscratch"))) then sail2_state_monad$returnS (0x040w : 12 words$word) else if (((p0_ = "uepc"))) then sail2_state_monad$returnS (0x041w : 12 words$word) else if (((p0_ = "ucause"))) then sail2_state_monad$returnS (0x042w : 12 words$word) else if (((p0_ = "utval"))) then sail2_state_monad$returnS (0x043w : 12 words$word) else if (((p0_ = "uip"))) then sail2_state_monad$returnS (0x044w : 12 words$word) else if (((p0_ = "fflags"))) then sail2_state_monad$returnS (0x001w : 12 words$word) else if (((p0_ = "frm"))) then sail2_state_monad$returnS (0x002w : 12 words$word) else if (((p0_ = "fcsr"))) then sail2_state_monad$returnS (0x003w : 12 words$word) else if (((p0_ = "cycle"))) then sail2_state_monad$returnS (0xC00w : 12 words$word) else if (((p0_ = "time"))) then sail2_state_monad$returnS (0xC01w : 12 words$word) else if (((p0_ = "instret"))) then sail2_state_monad$returnS (0xC02w : 12 words$word) else if (((p0_ = "cycleh"))) then sail2_state_monad$returnS (0xC80w : 12 words$word) else if (((p0_ = "timeh"))) then sail2_state_monad$returnS (0xC81w : 12 words$word) else if (((p0_ = "instreth"))) then sail2_state_monad$returnS (0xC82w : 12 words$word) else if (((p0_ = "sstatus"))) then sail2_state_monad$returnS (0x100w : 12 words$word) else if (((p0_ = "sedeleg"))) then sail2_state_monad$returnS (0x102w : 12 words$word) else if (((p0_ = "sideleg"))) then sail2_state_monad$returnS (0x103w : 12 words$word) else if (((p0_ = "sie"))) then sail2_state_monad$returnS (0x104w : 12 words$word) else if (((p0_ = "stvec"))) then sail2_state_monad$returnS (0x105w : 12 words$word) else if (((p0_ = "scounteren"))) then sail2_state_monad$returnS (0x106w : 12 words$word) else if (((p0_ = "sscratch"))) then sail2_state_monad$returnS (0x140w : 12 words$word) else if (((p0_ = "sepc"))) then sail2_state_monad$returnS (0x141w : 12 words$word) else if (((p0_ = "scause"))) then sail2_state_monad$returnS (0x142w : 12 words$word) else if (((p0_ = "stval"))) then sail2_state_monad$returnS (0x143w : 12 words$word) else if (((p0_ = "sip"))) then sail2_state_monad$returnS (0x144w : 12 words$word) else if (((p0_ = "satp"))) then sail2_state_monad$returnS (0x180w : 12 words$word) else if (((p0_ = "mvendorid"))) then sail2_state_monad$returnS (0xF11w : 12 words$word) else if (((p0_ = "marchid"))) then sail2_state_monad$returnS (0xF12w : 12 words$word) else if (((p0_ = "mimpid"))) then sail2_state_monad$returnS (0xF13w : 12 words$word) else if (((p0_ = "mhartid"))) then sail2_state_monad$returnS (0xF14w : 12 words$word) else if (((p0_ = "mstatus"))) then sail2_state_monad$returnS (0x300w : 12 words$word) else if (((p0_ = "misa"))) then sail2_state_monad$returnS (0x301w : 12 words$word) else if (((p0_ = "medeleg"))) then sail2_state_monad$returnS (0x302w : 12 words$word) else if (((p0_ = "mideleg"))) then sail2_state_monad$returnS (0x303w : 12 words$word) else if (((p0_ = "mie"))) then sail2_state_monad$returnS (0x304w : 12 words$word) else if (((p0_ = "mtvec"))) then sail2_state_monad$returnS (0x305w : 12 words$word) else if (((p0_ = "mcounteren"))) then sail2_state_monad$returnS (0x306w : 12 words$word) else if (((p0_ = "mcountinhibit"))) then sail2_state_monad$returnS (0x320w : 12 words$word) else if (((p0_ = "mscratch"))) then sail2_state_monad$returnS (0x340w : 12 words$word) else if (((p0_ = "mepc"))) then sail2_state_monad$returnS (0x341w : 12 words$word) else if (((p0_ = "mcause"))) then sail2_state_monad$returnS (0x342w : 12 words$word) else if (((p0_ = "mtval"))) then sail2_state_monad$returnS (0x343w : 12 words$word) else if (((p0_ = "mip"))) then sail2_state_monad$returnS (0x344w : 12 words$word) else if (((p0_ = "pmpcfg0"))) then sail2_state_monad$returnS (0x3A0w : 12 words$word) else if (((p0_ = "pmpcfg1"))) then sail2_state_monad$returnS (0x3A1w : 12 words$word) else if (((p0_ = "pmpcfg2"))) then sail2_state_monad$returnS (0x3A2w : 12 words$word) else if (((p0_ = "pmpcfg3"))) then sail2_state_monad$returnS (0x3A3w : 12 words$word) else if (((p0_ = "pmpaddr0"))) then sail2_state_monad$returnS (0x3B0w : 12 words$word) else if (((p0_ = "pmpaddr1"))) then sail2_state_monad$returnS (0x3B1w : 12 words$word) else if (((p0_ = "pmpaddr2"))) then sail2_state_monad$returnS (0x3B2w : 12 words$word) else if (((p0_ = "pmpaddr3"))) then sail2_state_monad$returnS (0x3B3w : 12 words$word) else if (((p0_ = "pmpaddr4"))) then sail2_state_monad$returnS (0x3B4w : 12 words$word) else if (((p0_ = "pmpaddr5"))) then sail2_state_monad$returnS (0x3B5w : 12 words$word) else if (((p0_ = "pmpaddr6"))) then sail2_state_monad$returnS (0x3B6w : 12 words$word) else if (((p0_ = "pmpaddr7"))) then sail2_state_monad$returnS (0x3B7w : 12 words$word) else if (((p0_ = "pmpaddr8"))) then sail2_state_monad$returnS (0x3B8w : 12 words$word) else if (((p0_ = "pmpaddr9"))) then sail2_state_monad$returnS (0x3B9w : 12 words$word) else if (((p0_ = "pmpaddr10"))) then sail2_state_monad$returnS (0x3BAw : 12 words$word) else if (((p0_ = "pmpaddr11"))) then sail2_state_monad$returnS (0x3BBw : 12 words$word) else if (((p0_ = "pmpaddr12"))) then sail2_state_monad$returnS (0x3BCw : 12 words$word) else if (((p0_ = "pmpaddr13"))) then sail2_state_monad$returnS (0x3BDw : 12 words$word) else if (((p0_ = "pmpaddr14"))) then sail2_state_monad$returnS (0x3BEw : 12 words$word) else if (((p0_ = "pmpaddr15"))) then sail2_state_monad$returnS (0x3BFw : 12 words$word) else if (((p0_ = "mcycle"))) then sail2_state_monad$returnS (0xB00w : 12 words$word) else if (((p0_ = "minstret"))) then sail2_state_monad$returnS (0xB02w : 12 words$word) else if (((p0_ = "mcycleh"))) then sail2_state_monad$returnS (0xB80w : 12 words$word) else if (((p0_ = "minstreth"))) then sail2_state_monad$returnS (0xB82w : 12 words$word) else if (((p0_ = "tselect"))) then sail2_state_monad$returnS (0x7A0w : 12 words$word) else if (((p0_ = "tdata1"))) then sail2_state_monad$returnS (0x7A1w : 12 words$word) else if (((p0_ = "tdata2"))) then sail2_state_monad$returnS (0x7A2w : 12 words$word) else if (((p0_ = "tdata3"))) then sail2_state_monad$returnS (0x7A3w : 12 words$word) else if ((hex_bits_12_backwards_matches p0_)) then (hex_bits_12_backwards p0_ : ( 12 words$word) M) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((csr_name_map_forwards_matches:(12)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0x000w : 12 words$word)))) then T else if (((b__0 = (0x004w : 12 words$word)))) then T else if (((b__0 = (0x005w : 12 words$word)))) then T else if (((b__0 = (0x040w : 12 words$word)))) then T else if (((b__0 = (0x041w : 12 words$word)))) then T else if (((b__0 = (0x042w : 12 words$word)))) then T else if (((b__0 = (0x043w : 12 words$word)))) then T else if (((b__0 = (0x044w : 12 words$word)))) then T else if (((b__0 = (0x001w : 12 words$word)))) then T else if (((b__0 = (0x002w : 12 words$word)))) then T else if (((b__0 = (0x003w : 12 words$word)))) then T else if (((b__0 = (0xC00w : 12 words$word)))) then T else if (((b__0 = (0xC01w : 12 words$word)))) then T else if (((b__0 = (0xC02w : 12 words$word)))) then T else if (((b__0 = (0xC80w : 12 words$word)))) then T else if (((b__0 = (0xC81w : 12 words$word)))) then T else if (((b__0 = (0xC82w : 12 words$word)))) then T else if (((b__0 = (0x100w : 12 words$word)))) then T else if (((b__0 = (0x102w : 12 words$word)))) then T else if (((b__0 = (0x103w : 12 words$word)))) then T else if (((b__0 = (0x104w : 12 words$word)))) then T else if (((b__0 = (0x105w : 12 words$word)))) then T else if (((b__0 = (0x106w : 12 words$word)))) then T else if (((b__0 = (0x140w : 12 words$word)))) then T else if (((b__0 = (0x141w : 12 words$word)))) then T else if (((b__0 = (0x142w : 12 words$word)))) then T else if (((b__0 = (0x143w : 12 words$word)))) then T else if (((b__0 = (0x144w : 12 words$word)))) then T else if (((b__0 = (0x180w : 12 words$word)))) then T else if (((b__0 = (0xF11w : 12 words$word)))) then T else if (((b__0 = (0xF12w : 12 words$word)))) then T else if (((b__0 = (0xF13w : 12 words$word)))) then T else if (((b__0 = (0xF14w : 12 words$word)))) then T else if (((b__0 = (0x300w : 12 words$word)))) then T else if (((b__0 = (0x301w : 12 words$word)))) then T else if (((b__0 = (0x302w : 12 words$word)))) then T else if (((b__0 = (0x303w : 12 words$word)))) then T else if (((b__0 = (0x304w : 12 words$word)))) then T else if (((b__0 = (0x305w : 12 words$word)))) then T else if (((b__0 = (0x306w : 12 words$word)))) then T else if (((b__0 = (0x320w : 12 words$word)))) then T else if (((b__0 = (0x340w : 12 words$word)))) then T else if (((b__0 = (0x341w : 12 words$word)))) then T else if (((b__0 = (0x342w : 12 words$word)))) then T else if (((b__0 = (0x343w : 12 words$word)))) then T else if (((b__0 = (0x344w : 12 words$word)))) then T else if (((b__0 = (0x3A0w : 12 words$word)))) then T else if (((b__0 = (0x3A1w : 12 words$word)))) then T else if (((b__0 = (0x3A2w : 12 words$word)))) then T else if (((b__0 = (0x3A3w : 12 words$word)))) then T else if (((b__0 = (0x3B0w : 12 words$word)))) then T else if (((b__0 = (0x3B1w : 12 words$word)))) then T else if (((b__0 = (0x3B2w : 12 words$word)))) then T else if (((b__0 = (0x3B3w : 12 words$word)))) then T else if (((b__0 = (0x3B4w : 12 words$word)))) then T else if (((b__0 = (0x3B5w : 12 words$word)))) then T else if (((b__0 = (0x3B6w : 12 words$word)))) then T else if (((b__0 = (0x3B7w : 12 words$word)))) then T else if (((b__0 = (0x3B8w : 12 words$word)))) then T else if (((b__0 = (0x3B9w : 12 words$word)))) then T else if (((b__0 = (0x3BAw : 12 words$word)))) then T else if (((b__0 = (0x3BBw : 12 words$word)))) then T else if (((b__0 = (0x3BCw : 12 words$word)))) then T else if (((b__0 = (0x3BDw : 12 words$word)))) then T else if (((b__0 = (0x3BEw : 12 words$word)))) then T else if (((b__0 = (0x3BFw : 12 words$word)))) then T else if (((b__0 = (0xB00w : 12 words$word)))) then T else if (((b__0 = (0xB02w : 12 words$word)))) then T else if (((b__0 = (0xB80w : 12 words$word)))) then T else if (((b__0 = (0xB82w : 12 words$word)))) then T else if (((b__0 = (0x7A0w : 12 words$word)))) then T else if (((b__0 = (0x7A1w : 12 words$word)))) then T else if (((b__0 = (0x7A2w : 12 words$word)))) then T else if (((b__0 = (0x7A3w : 12 words$word)))) then T else T))`; val _ = Define ` ((csr_name_map_backwards_matches:string ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "ustatus"))) then sail2_state_monad$returnS T else if (((p0_ = "uie"))) then sail2_state_monad$returnS T else if (((p0_ = "utvec"))) then sail2_state_monad$returnS T else if (((p0_ = "uscratch"))) then sail2_state_monad$returnS T else if (((p0_ = "uepc"))) then sail2_state_monad$returnS T else if (((p0_ = "ucause"))) then sail2_state_monad$returnS T else if (((p0_ = "utval"))) then sail2_state_monad$returnS T else if (((p0_ = "uip"))) then sail2_state_monad$returnS T else if (((p0_ = "fflags"))) then sail2_state_monad$returnS T else if (((p0_ = "frm"))) then sail2_state_monad$returnS T else if (((p0_ = "fcsr"))) then sail2_state_monad$returnS T else if (((p0_ = "cycle"))) then sail2_state_monad$returnS T else if (((p0_ = "time"))) then sail2_state_monad$returnS T else if (((p0_ = "instret"))) then sail2_state_monad$returnS T else if (((p0_ = "cycleh"))) then sail2_state_monad$returnS T else if (((p0_ = "timeh"))) then sail2_state_monad$returnS T else if (((p0_ = "instreth"))) then sail2_state_monad$returnS T else if (((p0_ = "sstatus"))) then sail2_state_monad$returnS T else if (((p0_ = "sedeleg"))) then sail2_state_monad$returnS T else if (((p0_ = "sideleg"))) then sail2_state_monad$returnS T else if (((p0_ = "sie"))) then sail2_state_monad$returnS T else if (((p0_ = "stvec"))) then sail2_state_monad$returnS T else if (((p0_ = "scounteren"))) then sail2_state_monad$returnS T else if (((p0_ = "sscratch"))) then sail2_state_monad$returnS T else if (((p0_ = "sepc"))) then sail2_state_monad$returnS T else if (((p0_ = "scause"))) then sail2_state_monad$returnS T else if (((p0_ = "stval"))) then sail2_state_monad$returnS T else if (((p0_ = "sip"))) then sail2_state_monad$returnS T else if (((p0_ = "satp"))) then sail2_state_monad$returnS T else if (((p0_ = "mvendorid"))) then sail2_state_monad$returnS T else if (((p0_ = "marchid"))) then sail2_state_monad$returnS T else if (((p0_ = "mimpid"))) then sail2_state_monad$returnS T else if (((p0_ = "mhartid"))) then sail2_state_monad$returnS T else if (((p0_ = "mstatus"))) then sail2_state_monad$returnS T else if (((p0_ = "misa"))) then sail2_state_monad$returnS T else if (((p0_ = "medeleg"))) then sail2_state_monad$returnS T else if (((p0_ = "mideleg"))) then sail2_state_monad$returnS T else if (((p0_ = "mie"))) then sail2_state_monad$returnS T else if (((p0_ = "mtvec"))) then sail2_state_monad$returnS T else if (((p0_ = "mcounteren"))) then sail2_state_monad$returnS T else if (((p0_ = "mcountinhibit"))) then sail2_state_monad$returnS T else if (((p0_ = "mscratch"))) then sail2_state_monad$returnS T else if (((p0_ = "mepc"))) then sail2_state_monad$returnS T else if (((p0_ = "mcause"))) then sail2_state_monad$returnS T else if (((p0_ = "mtval"))) then sail2_state_monad$returnS T else if (((p0_ = "mip"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpcfg0"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpcfg1"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpcfg2"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpcfg3"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr0"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr1"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr2"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr3"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr4"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr5"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr6"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr7"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr8"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr9"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr10"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr11"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr12"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr13"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr14"))) then sail2_state_monad$returnS T else if (((p0_ = "pmpaddr15"))) then sail2_state_monad$returnS T else if (((p0_ = "mcycle"))) then sail2_state_monad$returnS T else if (((p0_ = "minstret"))) then sail2_state_monad$returnS T else if (((p0_ = "mcycleh"))) then sail2_state_monad$returnS T else if (((p0_ = "minstreth"))) then sail2_state_monad$returnS T else if (((p0_ = "tselect"))) then sail2_state_monad$returnS T else if (((p0_ = "tdata1"))) then sail2_state_monad$returnS T else if (((p0_ = "tdata2"))) then sail2_state_monad$returnS T else if (((p0_ = "tdata3"))) then sail2_state_monad$returnS T else if ((hex_bits_12_backwards_matches p0_)) then sail2_state_monad$bindS (hex_bits_12_backwards p0_ : ( 12 words$word) M) (\ reg . sail2_state_monad$returnS T) else sail2_state_monad$returnS F))`; (*val _s752_ : string -> maybe ((mword ty12 * string))*) val _ = Define ` ((s752_:string ->((12)words$word#string)option) s753_0= ((case s753_0 of s754_0 => (case ((hex_bits_12_matches_prefix0 s754_0 : (( 12 words$word # ii)) option)) of SOME ((reg, s755_0)) => (case ((string_drop s754_0 s755_0)) of s_ => SOME (reg, s_) ) | _ => NONE ) )))`; (*val _s748_ : string -> maybe string*) val _ = Define ` ((s748_:string ->(string)option) s749_0= (let s750_0 = s749_0 in if ((string_startswith s750_0 "tdata3")) then (case ((string_drop s750_0 ((string_length "tdata3")))) of s_ => SOME s_ ) else NONE))`; (*val _s744_ : string -> maybe string*) val _ = Define ` ((s744_:string ->(string)option) s745_0= (let s746_0 = s745_0 in if ((string_startswith s746_0 "tdata2")) then (case ((string_drop s746_0 ((string_length "tdata2")))) of s_ => SOME s_ ) else NONE))`; (*val _s740_ : string -> maybe string*) val _ = Define ` ((s740_:string ->(string)option) s741_0= (let s742_0 = s741_0 in if ((string_startswith s742_0 "tdata1")) then (case ((string_drop s742_0 ((string_length "tdata1")))) of s_ => SOME s_ ) else NONE))`; (*val _s736_ : string -> maybe string*) val _ = Define ` ((s736_:string ->(string)option) s737_0= (let s738_0 = s737_0 in if ((string_startswith s738_0 "tselect")) then (case ((string_drop s738_0 ((string_length "tselect")))) of s_ => SOME s_ ) else NONE))`; (*val _s732_ : string -> maybe string*) val _ = Define ` ((s732_:string ->(string)option) s733_0= (let s734_0 = s733_0 in if ((string_startswith s734_0 "minstreth")) then (case ((string_drop s734_0 ((string_length "minstreth")))) of s_ => SOME s_ ) else NONE))`; (*val _s728_ : string -> maybe string*) val _ = Define ` ((s728_:string ->(string)option) s729_0= (let s730_0 = s729_0 in if ((string_startswith s730_0 "mcycleh")) then (case ((string_drop s730_0 ((string_length "mcycleh")))) of s_ => SOME s_ ) else NONE))`; (*val _s724_ : string -> maybe string*) val _ = Define ` ((s724_:string ->(string)option) s725_0= (let s726_0 = s725_0 in if ((string_startswith s726_0 "minstret")) then (case ((string_drop s726_0 ((string_length "minstret")))) of s_ => SOME s_ ) else NONE))`; (*val _s720_ : string -> maybe string*) val _ = Define ` ((s720_:string ->(string)option) s721_0= (let s722_0 = s721_0 in if ((string_startswith s722_0 "mcycle")) then (case ((string_drop s722_0 ((string_length "mcycle")))) of s_ => SOME s_ ) else NONE))`; (*val _s716_ : string -> maybe string*) val _ = Define ` ((s716_:string ->(string)option) s717_0= (let s718_0 = s717_0 in if ((string_startswith s718_0 "pmpaddr15")) then (case ((string_drop s718_0 ((string_length "pmpaddr15")))) of s_ => SOME s_ ) else NONE))`; (*val _s712_ : string -> maybe string*) val _ = Define ` ((s712_:string ->(string)option) s713_0= (let s714_0 = s713_0 in if ((string_startswith s714_0 "pmpaddr14")) then (case ((string_drop s714_0 ((string_length "pmpaddr14")))) of s_ => SOME s_ ) else NONE))`; (*val _s708_ : string -> maybe string*) val _ = Define ` ((s708_:string ->(string)option) s709_0= (let s710_0 = s709_0 in if ((string_startswith s710_0 "pmpaddr13")) then (case ((string_drop s710_0 ((string_length "pmpaddr13")))) of s_ => SOME s_ ) else NONE))`; (*val _s704_ : string -> maybe string*) val _ = Define ` ((s704_:string ->(string)option) s705_0= (let s706_0 = s705_0 in if ((string_startswith s706_0 "pmpaddr12")) then (case ((string_drop s706_0 ((string_length "pmpaddr12")))) of s_ => SOME s_ ) else NONE))`; (*val _s700_ : string -> maybe string*) val _ = Define ` ((s700_:string ->(string)option) s701_0= (let s702_0 = s701_0 in if ((string_startswith s702_0 "pmpaddr11")) then (case ((string_drop s702_0 ((string_length "pmpaddr11")))) of s_ => SOME s_ ) else NONE))`; (*val _s696_ : string -> maybe string*) val _ = Define ` ((s696_:string ->(string)option) s697_0= (let s698_0 = s697_0 in if ((string_startswith s698_0 "pmpaddr10")) then (case ((string_drop s698_0 ((string_length "pmpaddr10")))) of s_ => SOME s_ ) else NONE))`; (*val _s692_ : string -> maybe string*) val _ = Define ` ((s692_:string ->(string)option) s693_0= (let s694_0 = s693_0 in if ((string_startswith s694_0 "pmpaddr9")) then (case ((string_drop s694_0 ((string_length "pmpaddr9")))) of s_ => SOME s_ ) else NONE))`; (*val _s688_ : string -> maybe string*) val _ = Define ` ((s688_:string ->(string)option) s689_0= (let s690_0 = s689_0 in if ((string_startswith s690_0 "pmpaddr8")) then (case ((string_drop s690_0 ((string_length "pmpaddr8")))) of s_ => SOME s_ ) else NONE))`; (*val _s684_ : string -> maybe string*) val _ = Define ` ((s684_:string ->(string)option) s685_0= (let s686_0 = s685_0 in if ((string_startswith s686_0 "pmpaddr7")) then (case ((string_drop s686_0 ((string_length "pmpaddr7")))) of s_ => SOME s_ ) else NONE))`; (*val _s680_ : string -> maybe string*) val _ = Define ` ((s680_:string ->(string)option) s681_0= (let s682_0 = s681_0 in if ((string_startswith s682_0 "pmpaddr6")) then (case ((string_drop s682_0 ((string_length "pmpaddr6")))) of s_ => SOME s_ ) else NONE))`; (*val _s676_ : string -> maybe string*) val _ = Define ` ((s676_:string ->(string)option) s677_0= (let s678_0 = s677_0 in if ((string_startswith s678_0 "pmpaddr5")) then (case ((string_drop s678_0 ((string_length "pmpaddr5")))) of s_ => SOME s_ ) else NONE))`; (*val _s672_ : string -> maybe string*) val _ = Define ` ((s672_:string ->(string)option) s673_0= (let s674_0 = s673_0 in if ((string_startswith s674_0 "pmpaddr4")) then (case ((string_drop s674_0 ((string_length "pmpaddr4")))) of s_ => SOME s_ ) else NONE))`; (*val _s668_ : string -> maybe string*) val _ = Define ` ((s668_:string ->(string)option) s669_0= (let s670_0 = s669_0 in if ((string_startswith s670_0 "pmpaddr3")) then (case ((string_drop s670_0 ((string_length "pmpaddr3")))) of s_ => SOME s_ ) else NONE))`; (*val _s664_ : string -> maybe string*) val _ = Define ` ((s664_:string ->(string)option) s665_0= (let s666_0 = s665_0 in if ((string_startswith s666_0 "pmpaddr2")) then (case ((string_drop s666_0 ((string_length "pmpaddr2")))) of s_ => SOME s_ ) else NONE))`; (*val _s660_ : string -> maybe string*) val _ = Define ` ((s660_:string ->(string)option) s661_0= (let s662_0 = s661_0 in if ((string_startswith s662_0 "pmpaddr1")) then (case ((string_drop s662_0 ((string_length "pmpaddr1")))) of s_ => SOME s_ ) else NONE))`; (*val _s656_ : string -> maybe string*) val _ = Define ` ((s656_:string ->(string)option) s657_0= (let s658_0 = s657_0 in if ((string_startswith s658_0 "pmpaddr0")) then (case ((string_drop s658_0 ((string_length "pmpaddr0")))) of s_ => SOME s_ ) else NONE))`; (*val _s652_ : string -> maybe string*) val _ = Define ` ((s652_:string ->(string)option) s653_0= (let s654_0 = s653_0 in if ((string_startswith s654_0 "pmpcfg3")) then (case ((string_drop s654_0 ((string_length "pmpcfg3")))) of s_ => SOME s_ ) else NONE))`; (*val _s648_ : string -> maybe string*) val _ = Define ` ((s648_:string ->(string)option) s649_0= (let s650_0 = s649_0 in if ((string_startswith s650_0 "pmpcfg2")) then (case ((string_drop s650_0 ((string_length "pmpcfg2")))) of s_ => SOME s_ ) else NONE))`; (*val _s644_ : string -> maybe string*) val _ = Define ` ((s644_:string ->(string)option) s645_0= (let s646_0 = s645_0 in if ((string_startswith s646_0 "pmpcfg1")) then (case ((string_drop s646_0 ((string_length "pmpcfg1")))) of s_ => SOME s_ ) else NONE))`; (*val _s640_ : string -> maybe string*) val _ = Define ` ((s640_:string ->(string)option) s641_0= (let s642_0 = s641_0 in if ((string_startswith s642_0 "pmpcfg0")) then (case ((string_drop s642_0 ((string_length "pmpcfg0")))) of s_ => SOME s_ ) else NONE))`; (*val _s636_ : string -> maybe string*) val _ = Define ` ((s636_:string ->(string)option) s637_0= (let s638_0 = s637_0 in if ((string_startswith s638_0 "mip")) then (case ((string_drop s638_0 ((string_length "mip")))) of s_ => SOME s_ ) else NONE))`; (*val _s632_ : string -> maybe string*) val _ = Define ` ((s632_:string ->(string)option) s633_0= (let s634_0 = s633_0 in if ((string_startswith s634_0 "mtval")) then (case ((string_drop s634_0 ((string_length "mtval")))) of s_ => SOME s_ ) else NONE))`; (*val _s628_ : string -> maybe string*) val _ = Define ` ((s628_:string ->(string)option) s629_0= (let s630_0 = s629_0 in if ((string_startswith s630_0 "mcause")) then (case ((string_drop s630_0 ((string_length "mcause")))) of s_ => SOME s_ ) else NONE))`; (*val _s624_ : string -> maybe string*) val _ = Define ` ((s624_:string ->(string)option) s625_0= (let s626_0 = s625_0 in if ((string_startswith s626_0 "mepc")) then (case ((string_drop s626_0 ((string_length "mepc")))) of s_ => SOME s_ ) else NONE))`; (*val _s620_ : string -> maybe string*) val _ = Define ` ((s620_:string ->(string)option) s621_0= (let s622_0 = s621_0 in if ((string_startswith s622_0 "mscratch")) then (case ((string_drop s622_0 ((string_length "mscratch")))) of s_ => SOME s_ ) else NONE))`; (*val _s616_ : string -> maybe string*) val _ = Define ` ((s616_:string ->(string)option) s617_0= (let s618_0 = s617_0 in if ((string_startswith s618_0 "mcountinhibit")) then (case ((string_drop s618_0 ((string_length "mcountinhibit")))) of s_ => SOME s_ ) else NONE))`; (*val _s612_ : string -> maybe string*) val _ = Define ` ((s612_:string ->(string)option) s613_0= (let s614_0 = s613_0 in if ((string_startswith s614_0 "mcounteren")) then (case ((string_drop s614_0 ((string_length "mcounteren")))) of s_ => SOME s_ ) else NONE))`; (*val _s608_ : string -> maybe string*) val _ = Define ` ((s608_:string ->(string)option) s609_0= (let s610_0 = s609_0 in if ((string_startswith s610_0 "mtvec")) then (case ((string_drop s610_0 ((string_length "mtvec")))) of s_ => SOME s_ ) else NONE))`; (*val _s604_ : string -> maybe string*) val _ = Define ` ((s604_:string ->(string)option) s605_0= (let s606_0 = s605_0 in if ((string_startswith s606_0 "mie")) then (case ((string_drop s606_0 ((string_length "mie")))) of s_ => SOME s_ ) else NONE))`; (*val _s600_ : string -> maybe string*) val _ = Define ` ((s600_:string ->(string)option) s601_0= (let s602_0 = s601_0 in if ((string_startswith s602_0 "mideleg")) then (case ((string_drop s602_0 ((string_length "mideleg")))) of s_ => SOME s_ ) else NONE))`; (*val _s596_ : string -> maybe string*) val _ = Define ` ((s596_:string ->(string)option) s597_0= (let s598_0 = s597_0 in if ((string_startswith s598_0 "medeleg")) then (case ((string_drop s598_0 ((string_length "medeleg")))) of s_ => SOME s_ ) else NONE))`; (*val _s592_ : string -> maybe string*) val _ = Define ` ((s592_:string ->(string)option) s593_0= (let s594_0 = s593_0 in if ((string_startswith s594_0 "misa")) then (case ((string_drop s594_0 ((string_length "misa")))) of s_ => SOME s_ ) else NONE))`; (*val _s588_ : string -> maybe string*) val _ = Define ` ((s588_:string ->(string)option) s589_0= (let s590_0 = s589_0 in if ((string_startswith s590_0 "mstatus")) then (case ((string_drop s590_0 ((string_length "mstatus")))) of s_ => SOME s_ ) else NONE))`; (*val _s584_ : string -> maybe string*) val _ = Define ` ((s584_:string ->(string)option) s585_0= (let s586_0 = s585_0 in if ((string_startswith s586_0 "mhartid")) then (case ((string_drop s586_0 ((string_length "mhartid")))) of s_ => SOME s_ ) else NONE))`; (*val _s580_ : string -> maybe string*) val _ = Define ` ((s580_:string ->(string)option) s581_0= (let s582_0 = s581_0 in if ((string_startswith s582_0 "mimpid")) then (case ((string_drop s582_0 ((string_length "mimpid")))) of s_ => SOME s_ ) else NONE))`; (*val _s576_ : string -> maybe string*) val _ = Define ` ((s576_:string ->(string)option) s577_0= (let s578_0 = s577_0 in if ((string_startswith s578_0 "marchid")) then (case ((string_drop s578_0 ((string_length "marchid")))) of s_ => SOME s_ ) else NONE))`; (*val _s572_ : string -> maybe string*) val _ = Define ` ((s572_:string ->(string)option) s573_0= (let s574_0 = s573_0 in if ((string_startswith s574_0 "mvendorid")) then (case ((string_drop s574_0 ((string_length "mvendorid")))) of s_ => SOME s_ ) else NONE))`; (*val _s568_ : string -> maybe string*) val _ = Define ` ((s568_:string ->(string)option) s569_0= (let s570_0 = s569_0 in if ((string_startswith s570_0 "satp")) then (case ((string_drop s570_0 ((string_length "satp")))) of s_ => SOME s_ ) else NONE))`; (*val _s564_ : string -> maybe string*) val _ = Define ` ((s564_:string ->(string)option) s565_0= (let s566_0 = s565_0 in if ((string_startswith s566_0 "sip")) then (case ((string_drop s566_0 ((string_length "sip")))) of s_ => SOME s_ ) else NONE))`; (*val _s560_ : string -> maybe string*) val _ = Define ` ((s560_:string ->(string)option) s561_0= (let s562_0 = s561_0 in if ((string_startswith s562_0 "stval")) then (case ((string_drop s562_0 ((string_length "stval")))) of s_ => SOME s_ ) else NONE))`; (*val _s556_ : string -> maybe string*) val _ = Define ` ((s556_:string ->(string)option) s557_0= (let s558_0 = s557_0 in if ((string_startswith s558_0 "scause")) then (case ((string_drop s558_0 ((string_length "scause")))) of s_ => SOME s_ ) else NONE))`; (*val _s552_ : string -> maybe string*) val _ = Define ` ((s552_:string ->(string)option) s553_0= (let s554_0 = s553_0 in if ((string_startswith s554_0 "sepc")) then (case ((string_drop s554_0 ((string_length "sepc")))) of s_ => SOME s_ ) else NONE))`; (*val _s548_ : string -> maybe string*) val _ = Define ` ((s548_:string ->(string)option) s549_0= (let s550_0 = s549_0 in if ((string_startswith s550_0 "sscratch")) then (case ((string_drop s550_0 ((string_length "sscratch")))) of s_ => SOME s_ ) else NONE))`; (*val _s544_ : string -> maybe string*) val _ = Define ` ((s544_:string ->(string)option) s545_0= (let s546_0 = s545_0 in if ((string_startswith s546_0 "scounteren")) then (case ((string_drop s546_0 ((string_length "scounteren")))) of s_ => SOME s_ ) else NONE))`; (*val _s540_ : string -> maybe string*) val _ = Define ` ((s540_:string ->(string)option) s541_0= (let s542_0 = s541_0 in if ((string_startswith s542_0 "stvec")) then (case ((string_drop s542_0 ((string_length "stvec")))) of s_ => SOME s_ ) else NONE))`; (*val _s536_ : string -> maybe string*) val _ = Define ` ((s536_:string ->(string)option) s537_0= (let s538_0 = s537_0 in if ((string_startswith s538_0 "sie")) then (case ((string_drop s538_0 ((string_length "sie")))) of s_ => SOME s_ ) else NONE))`; (*val _s532_ : string -> maybe string*) val _ = Define ` ((s532_:string ->(string)option) s533_0= (let s534_0 = s533_0 in if ((string_startswith s534_0 "sideleg")) then (case ((string_drop s534_0 ((string_length "sideleg")))) of s_ => SOME s_ ) else NONE))`; (*val _s528_ : string -> maybe string*) val _ = Define ` ((s528_:string ->(string)option) s529_0= (let s530_0 = s529_0 in if ((string_startswith s530_0 "sedeleg")) then (case ((string_drop s530_0 ((string_length "sedeleg")))) of s_ => SOME s_ ) else NONE))`; (*val _s524_ : string -> maybe string*) val _ = Define ` ((s524_:string ->(string)option) s525_0= (let s526_0 = s525_0 in if ((string_startswith s526_0 "sstatus")) then (case ((string_drop s526_0 ((string_length "sstatus")))) of s_ => SOME s_ ) else NONE))`; (*val _s520_ : string -> maybe string*) val _ = Define ` ((s520_:string ->(string)option) s521_0= (let s522_0 = s521_0 in if ((string_startswith s522_0 "instreth")) then (case ((string_drop s522_0 ((string_length "instreth")))) of s_ => SOME s_ ) else NONE))`; (*val _s516_ : string -> maybe string*) val _ = Define ` ((s516_:string ->(string)option) s517_0= (let s518_0 = s517_0 in if ((string_startswith s518_0 "timeh")) then (case ((string_drop s518_0 ((string_length "timeh")))) of s_ => SOME s_ ) else NONE))`; (*val _s512_ : string -> maybe string*) val _ = Define ` ((s512_:string ->(string)option) s513_0= (let s514_0 = s513_0 in if ((string_startswith s514_0 "cycleh")) then (case ((string_drop s514_0 ((string_length "cycleh")))) of s_ => SOME s_ ) else NONE))`; (*val _s508_ : string -> maybe string*) val _ = Define ` ((s508_:string ->(string)option) s509_0= (let s510_0 = s509_0 in if ((string_startswith s510_0 "instret")) then (case ((string_drop s510_0 ((string_length "instret")))) of s_ => SOME s_ ) else NONE))`; (*val _s504_ : string -> maybe string*) val _ = Define ` ((s504_:string ->(string)option) s505_0= (let s506_0 = s505_0 in if ((string_startswith s506_0 "time")) then (case ((string_drop s506_0 ((string_length "time")))) of s_ => SOME s_ ) else NONE))`; (*val _s500_ : string -> maybe string*) val _ = Define ` ((s500_:string ->(string)option) s501_0= (let s502_0 = s501_0 in if ((string_startswith s502_0 "cycle")) then (case ((string_drop s502_0 ((string_length "cycle")))) of s_ => SOME s_ ) else NONE))`; (*val _s496_ : string -> maybe string*) val _ = Define ` ((s496_:string ->(string)option) s497_0= (let s498_0 = s497_0 in if ((string_startswith s498_0 "fcsr")) then (case ((string_drop s498_0 ((string_length "fcsr")))) of s_ => SOME s_ ) else NONE))`; (*val _s492_ : string -> maybe string*) val _ = Define ` ((s492_:string ->(string)option) s493_0= (let s494_0 = s493_0 in if ((string_startswith s494_0 "frm")) then (case ((string_drop s494_0 ((string_length "frm")))) of s_ => SOME s_ ) else NONE))`; (*val _s488_ : string -> maybe string*) val _ = Define ` ((s488_:string ->(string)option) s489_0= (let s490_0 = s489_0 in if ((string_startswith s490_0 "fflags")) then (case ((string_drop s490_0 ((string_length "fflags")))) of s_ => SOME s_ ) else NONE))`; (*val _s484_ : string -> maybe string*) val _ = Define ` ((s484_:string ->(string)option) s485_0= (let s486_0 = s485_0 in if ((string_startswith s486_0 "uip")) then (case ((string_drop s486_0 ((string_length "uip")))) of s_ => SOME s_ ) else NONE))`; (*val _s480_ : string -> maybe string*) val _ = Define ` ((s480_:string ->(string)option) s481_0= (let s482_0 = s481_0 in if ((string_startswith s482_0 "utval")) then (case ((string_drop s482_0 ((string_length "utval")))) of s_ => SOME s_ ) else NONE))`; (*val _s476_ : string -> maybe string*) val _ = Define ` ((s476_:string ->(string)option) s477_0= (let s478_0 = s477_0 in if ((string_startswith s478_0 "ucause")) then (case ((string_drop s478_0 ((string_length "ucause")))) of s_ => SOME s_ ) else NONE))`; (*val _s472_ : string -> maybe string*) val _ = Define ` ((s472_:string ->(string)option) s473_0= (let s474_0 = s473_0 in if ((string_startswith s474_0 "uepc")) then (case ((string_drop s474_0 ((string_length "uepc")))) of s_ => SOME s_ ) else NONE))`; (*val _s468_ : string -> maybe string*) val _ = Define ` ((s468_:string ->(string)option) s469_0= (let s470_0 = s469_0 in if ((string_startswith s470_0 "uscratch")) then (case ((string_drop s470_0 ((string_length "uscratch")))) of s_ => SOME s_ ) else NONE))`; (*val _s464_ : string -> maybe string*) val _ = Define ` ((s464_:string ->(string)option) s465_0= (let s466_0 = s465_0 in if ((string_startswith s466_0 "utvec")) then (case ((string_drop s466_0 ((string_length "utvec")))) of s_ => SOME s_ ) else NONE))`; (*val _s460_ : string -> maybe string*) val _ = Define ` ((s460_:string ->(string)option) s461_0= (let s462_0 = s461_0 in if ((string_startswith s462_0 "uie")) then (case ((string_drop s462_0 ((string_length "uie")))) of s_ => SOME s_ ) else NONE))`; (*val _s456_ : string -> maybe string*) val _ = Define ` ((s456_:string ->(string)option) s457_0= (let s458_0 = s457_0 in if ((string_startswith s458_0 "ustatus")) then (case ((string_drop s458_0 ((string_length "ustatus")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((csr_name_map_matches_prefix:string ->((12)words$word#int)option) arg_= (let s459_0 = arg_ in if ((case ((s456_ s459_0)) of SOME (s_) => T | _ => F )) then (case s456_ s459_0 of (SOME (s_)) => SOME ((0x000w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s460_ s459_0)) of SOME (s_) => T | _ => F )) then (case s460_ s459_0 of (SOME (s_)) => SOME ((0x004w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s464_ s459_0)) of SOME (s_) => T | _ => F )) then (case s464_ s459_0 of (SOME (s_)) => SOME ((0x005w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s468_ s459_0)) of SOME (s_) => T | _ => F )) then (case s468_ s459_0 of (SOME (s_)) => SOME ((0x040w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s472_ s459_0)) of SOME (s_) => T | _ => F )) then (case s472_ s459_0 of (SOME (s_)) => SOME ((0x041w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s476_ s459_0)) of SOME (s_) => T | _ => F )) then (case s476_ s459_0 of (SOME (s_)) => SOME ((0x042w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s480_ s459_0)) of SOME (s_) => T | _ => F )) then (case s480_ s459_0 of (SOME (s_)) => SOME ((0x043w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s484_ s459_0)) of SOME (s_) => T | _ => F )) then (case s484_ s459_0 of (SOME (s_)) => SOME ((0x044w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s488_ s459_0)) of SOME (s_) => T | _ => F )) then (case s488_ s459_0 of (SOME (s_)) => SOME ((0x001w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s492_ s459_0)) of SOME (s_) => T | _ => F )) then (case s492_ s459_0 of (SOME (s_)) => SOME ((0x002w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s496_ s459_0)) of SOME (s_) => T | _ => F )) then (case s496_ s459_0 of (SOME (s_)) => SOME ((0x003w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s500_ s459_0)) of SOME (s_) => T | _ => F )) then (case s500_ s459_0 of (SOME (s_)) => SOME ((0xC00w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s504_ s459_0)) of SOME (s_) => T | _ => F )) then (case s504_ s459_0 of (SOME (s_)) => SOME ((0xC01w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s508_ s459_0)) of SOME (s_) => T | _ => F )) then (case s508_ s459_0 of (SOME (s_)) => SOME ((0xC02w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s512_ s459_0)) of SOME (s_) => T | _ => F )) then (case s512_ s459_0 of (SOME (s_)) => SOME ((0xC80w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s516_ s459_0)) of SOME (s_) => T | _ => F )) then (case s516_ s459_0 of (SOME (s_)) => SOME ((0xC81w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s520_ s459_0)) of SOME (s_) => T | _ => F )) then (case s520_ s459_0 of (SOME (s_)) => SOME ((0xC82w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s524_ s459_0)) of SOME (s_) => T | _ => F )) then (case s524_ s459_0 of (SOME (s_)) => SOME ((0x100w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s528_ s459_0)) of SOME (s_) => T | _ => F )) then (case s528_ s459_0 of (SOME (s_)) => SOME ((0x102w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s532_ s459_0)) of SOME (s_) => T | _ => F )) then (case s532_ s459_0 of (SOME (s_)) => SOME ((0x103w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s536_ s459_0)) of SOME (s_) => T | _ => F )) then (case s536_ s459_0 of (SOME (s_)) => SOME ((0x104w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s540_ s459_0)) of SOME (s_) => T | _ => F )) then (case s540_ s459_0 of (SOME (s_)) => SOME ((0x105w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s544_ s459_0)) of SOME (s_) => T | _ => F )) then (case s544_ s459_0 of (SOME (s_)) => SOME ((0x106w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s548_ s459_0)) of SOME (s_) => T | _ => F )) then (case s548_ s459_0 of (SOME (s_)) => SOME ((0x140w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s552_ s459_0)) of SOME (s_) => T | _ => F )) then (case s552_ s459_0 of (SOME (s_)) => SOME ((0x141w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s556_ s459_0)) of SOME (s_) => T | _ => F )) then (case s556_ s459_0 of (SOME (s_)) => SOME ((0x142w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s560_ s459_0)) of SOME (s_) => T | _ => F )) then (case s560_ s459_0 of (SOME (s_)) => SOME ((0x143w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s564_ s459_0)) of SOME (s_) => T | _ => F )) then (case s564_ s459_0 of (SOME (s_)) => SOME ((0x144w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s568_ s459_0)) of SOME (s_) => T | _ => F )) then (case s568_ s459_0 of (SOME (s_)) => SOME ((0x180w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s572_ s459_0)) of SOME (s_) => T | _ => F )) then (case s572_ s459_0 of (SOME (s_)) => SOME ((0xF11w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s576_ s459_0)) of SOME (s_) => T | _ => F )) then (case s576_ s459_0 of (SOME (s_)) => SOME ((0xF12w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s580_ s459_0)) of SOME (s_) => T | _ => F )) then (case s580_ s459_0 of (SOME (s_)) => SOME ((0xF13w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s584_ s459_0)) of SOME (s_) => T | _ => F )) then (case s584_ s459_0 of (SOME (s_)) => SOME ((0xF14w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s588_ s459_0)) of SOME (s_) => T | _ => F )) then (case s588_ s459_0 of (SOME (s_)) => SOME ((0x300w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s592_ s459_0)) of SOME (s_) => T | _ => F )) then (case s592_ s459_0 of (SOME (s_)) => SOME ((0x301w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s596_ s459_0)) of SOME (s_) => T | _ => F )) then (case s596_ s459_0 of (SOME (s_)) => SOME ((0x302w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s600_ s459_0)) of SOME (s_) => T | _ => F )) then (case s600_ s459_0 of (SOME (s_)) => SOME ((0x303w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s604_ s459_0)) of SOME (s_) => T | _ => F )) then (case s604_ s459_0 of (SOME (s_)) => SOME ((0x304w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s608_ s459_0)) of SOME (s_) => T | _ => F )) then (case s608_ s459_0 of (SOME (s_)) => SOME ((0x305w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s612_ s459_0)) of SOME (s_) => T | _ => F )) then (case s612_ s459_0 of (SOME (s_)) => SOME ((0x306w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s616_ s459_0)) of SOME (s_) => T | _ => F )) then (case s616_ s459_0 of (SOME (s_)) => SOME ((0x320w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s620_ s459_0)) of SOME (s_) => T | _ => F )) then (case s620_ s459_0 of (SOME (s_)) => SOME ((0x340w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s624_ s459_0)) of SOME (s_) => T | _ => F )) then (case s624_ s459_0 of (SOME (s_)) => SOME ((0x341w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s628_ s459_0)) of SOME (s_) => T | _ => F )) then (case s628_ s459_0 of (SOME (s_)) => SOME ((0x342w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s632_ s459_0)) of SOME (s_) => T | _ => F )) then (case s632_ s459_0 of (SOME (s_)) => SOME ((0x343w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s636_ s459_0)) of SOME (s_) => T | _ => F )) then (case s636_ s459_0 of (SOME (s_)) => SOME ((0x344w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s640_ s459_0)) of SOME (s_) => T | _ => F )) then (case s640_ s459_0 of (SOME (s_)) => SOME ((0x3A0w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s644_ s459_0)) of SOME (s_) => T | _ => F )) then (case s644_ s459_0 of (SOME (s_)) => SOME ((0x3A1w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s648_ s459_0)) of SOME (s_) => T | _ => F )) then (case s648_ s459_0 of (SOME (s_)) => SOME ((0x3A2w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s652_ s459_0)) of SOME (s_) => T | _ => F )) then (case s652_ s459_0 of (SOME (s_)) => SOME ((0x3A3w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s656_ s459_0)) of SOME (s_) => T | _ => F )) then (case s656_ s459_0 of (SOME (s_)) => SOME ((0x3B0w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s660_ s459_0)) of SOME (s_) => T | _ => F )) then (case s660_ s459_0 of (SOME (s_)) => SOME ((0x3B1w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s664_ s459_0)) of SOME (s_) => T | _ => F )) then (case s664_ s459_0 of (SOME (s_)) => SOME ((0x3B2w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s668_ s459_0)) of SOME (s_) => T | _ => F )) then (case s668_ s459_0 of (SOME (s_)) => SOME ((0x3B3w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s672_ s459_0)) of SOME (s_) => T | _ => F )) then (case s672_ s459_0 of (SOME (s_)) => SOME ((0x3B4w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s676_ s459_0)) of SOME (s_) => T | _ => F )) then (case s676_ s459_0 of (SOME (s_)) => SOME ((0x3B5w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s680_ s459_0)) of SOME (s_) => T | _ => F )) then (case s680_ s459_0 of (SOME (s_)) => SOME ((0x3B6w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s684_ s459_0)) of SOME (s_) => T | _ => F )) then (case s684_ s459_0 of (SOME (s_)) => SOME ((0x3B7w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s688_ s459_0)) of SOME (s_) => T | _ => F )) then (case s688_ s459_0 of (SOME (s_)) => SOME ((0x3B8w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s692_ s459_0)) of SOME (s_) => T | _ => F )) then (case s692_ s459_0 of (SOME (s_)) => SOME ((0x3B9w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s696_ s459_0)) of SOME (s_) => T | _ => F )) then (case s696_ s459_0 of (SOME (s_)) => SOME ((0x3BAw : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s700_ s459_0)) of SOME (s_) => T | _ => F )) then (case s700_ s459_0 of (SOME (s_)) => SOME ((0x3BBw : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s704_ s459_0)) of SOME (s_) => T | _ => F )) then (case s704_ s459_0 of (SOME (s_)) => SOME ((0x3BCw : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s708_ s459_0)) of SOME (s_) => T | _ => F )) then (case s708_ s459_0 of (SOME (s_)) => SOME ((0x3BDw : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s712_ s459_0)) of SOME (s_) => T | _ => F )) then (case s712_ s459_0 of (SOME (s_)) => SOME ((0x3BEw : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s716_ s459_0)) of SOME (s_) => T | _ => F )) then (case s716_ s459_0 of (SOME (s_)) => SOME ((0x3BFw : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s720_ s459_0)) of SOME (s_) => T | _ => F )) then (case s720_ s459_0 of (SOME (s_)) => SOME ((0xB00w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s724_ s459_0)) of SOME (s_) => T | _ => F )) then (case s724_ s459_0 of (SOME (s_)) => SOME ((0xB02w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s728_ s459_0)) of SOME (s_) => T | _ => F )) then (case s728_ s459_0 of (SOME (s_)) => SOME ((0xB80w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s732_ s459_0)) of SOME (s_) => T | _ => F )) then (case s732_ s459_0 of (SOME (s_)) => SOME ((0xB82w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s736_ s459_0)) of SOME (s_) => T | _ => F )) then (case s736_ s459_0 of (SOME (s_)) => SOME ((0x7A0w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s740_ s459_0)) of SOME (s_) => T | _ => F )) then (case s740_ s459_0 of (SOME (s_)) => SOME ((0x7A1w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s744_ s459_0)) of SOME (s_) => T | _ => F )) then (case s744_ s459_0 of (SOME (s_)) => SOME ((0x7A2w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s748_ s459_0)) of SOME (s_) => T | _ => F )) then (case s748_ s459_0 of (SOME (s_)) => SOME ((0x7A3w : 12 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s752_ s459_0 : (( 12 words$word # string))option)) of SOME ((reg, s_)) => T | _ => F )) then (case (s752_ s459_0 : (( 12 words$word # string)) option) of (SOME ((reg, s_))) => SOME (reg, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; val _ = Define ` ((csr_name:(12)words$word -> string) csr= (csr_name_map_forwards csr))`; val _ = Define ` ((ext_is_CSR_defined:(12)words$word -> Privilege ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) b__0 g__337= (if (((b__0 = (0x000w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () )) else if (((b__0 = (0x004w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () )) else if (((b__0 = (0x005w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () )) else if (((b__0 = (0x040w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () )) else if (((b__0 = (0x041w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () )) else if (((b__0 = (0x042w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () )) else if (((b__0 = (0x043w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () )) else if (((b__0 = (0x044w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) ((haveNExt () )) else if (((b__0 = (0x001w : 12 words$word)))) then sail2_state$or_boolS ((haveFExt () )) ((haveDExt () )) else if (((b__0 = (0x002w : 12 words$word)))) then sail2_state$or_boolS ((haveFExt () )) ((haveDExt () )) else if (((b__0 = (0x003w : 12 words$word)))) then sail2_state$or_boolS ((haveFExt () )) ((haveDExt () )) else sail2_state_monad$returnS F))`; val _ = Define ` ((ext_read_CSR:(12)words$word ->(regstate)sail2_state_monad$sequential_state ->(((((64)words$word)option),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) b__0= (if (((b__0 = (0x000w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . sail2_state_monad$returnS (SOME ((get_Ustatus_bits ((lower_sstatus ((lower_mstatus w__0)))) : 64 words$word)))) else if (((b__0 = (0x004w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__1 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__2 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS sideleg_ref) (\ (w__3 : Sinterrupts) . sail2_state_monad$returnS (SOME ((get_Uinterrupts_bits ((lower_sie ((lower_mie w__1 w__2)) w__3)) : 64 words$word)))))) else if (((b__0 = (0x005w : 12 words$word)))) then sail2_state_monad$bindS (get_utvec () : ( 64 words$word) M) (\ (w__4 : 64 words$word) . sail2_state_monad$returnS (SOME w__4)) else if (((b__0 = (0x040w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS uscratch_ref : ( 64 words$word) M) (\ (w__5 : 64 words$word) . sail2_state_monad$returnS (SOME w__5)) else if (((b__0 = (0x041w : 12 words$word)))) then sail2_state_monad$bindS (get_xret_target User : ( 64 words$word) M) (\ (w__6 : 64 words$word) . sail2_state_monad$bindS (pc_alignment_mask () : ( 64 words$word) M) (\ (w__7 : 64 words$word) . sail2_state_monad$returnS (SOME ((and_vec w__6 w__7 : 64 words$word))))) else if (((b__0 = (0x042w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS ucause_ref) (\ (w__8 : Mcause) . sail2_state_monad$returnS (SOME ((get_Mcause_bits w__8 : 64 words$word)))) else if (((b__0 = (0x043w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS utval_ref : ( 64 words$word) M) (\ (w__9 : 64 words$word) . sail2_state_monad$returnS (SOME w__9)) else if (((b__0 = (0x044w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mip_ref) (\ (w__10 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__11 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS sideleg_ref) (\ (w__12 : Sinterrupts) . sail2_state_monad$returnS (SOME ((get_Uinterrupts_bits ((lower_sip ((lower_mip w__10 w__11)) w__12)) : 64 words$word)))))) else if (((b__0 = (0x001w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS fcsr_ref) (\ (w__13 : Fcsr) . sail2_state_monad$returnS (SOME ((EXTZ (( 64 : int):ii) ((get_Fcsr_FFLAGS w__13 : 5 words$word)) : 64 words$word)))) else if (((b__0 = (0x002w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS fcsr_ref) (\ (w__14 : Fcsr) . sail2_state_monad$returnS (SOME ((EXTZ (( 64 : int):ii) ((get_Fcsr_FRM w__14 : 3 words$word)) : 64 words$word)))) else if (((b__0 = (0x003w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS fcsr_ref) (\ (w__15 : Fcsr) . sail2_state_monad$returnS (SOME ((EXTZ (( 64 : int):ii) ((get_Fcsr_bits w__15 : 32 words$word)) : 64 words$word)))) else sail2_state_monad$returnS NONE))`; val _ = Define ` ((ext_write_CSR:(12)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((((64)words$word)option),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) b__0 value= (if (((b__0 = (0x000w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . sail2_state_monad$bindS (legalize_ustatus w__0 value) (\ (w__1 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mstatus_ref w__1) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__2 : Mstatus) . sail2_state_monad$returnS (SOME ((get_Mstatus_bits w__2 : 64 words$word)))))) else if (((b__0 = (0x004w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__3 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__4 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS sideleg_ref) (\ (w__5 : Sinterrupts) . let sie = (legalize_uie ((lower_mie w__3 w__4)) w__5 value) in sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__6 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__7 : Minterrupts) . sail2_state_monad$bindS (lift_sie w__6 w__7 sie) (\ (w__8 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mie_ref w__8) (sail2_state_monad$read_regS mie_ref)) (\ (w__9 : Minterrupts) . sail2_state_monad$returnS (SOME ((get_Minterrupts_bits w__9 : 64 words$word)))))))))) else if (((b__0 = (0x005w : 12 words$word)))) then sail2_state_monad$bindS (set_utvec value : ( 64 words$word) M) (\ (w__10 : 64 words$word) . sail2_state_monad$returnS (SOME w__10)) else if (((b__0 = (0x040w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS uscratch_ref value) (sail2_state_monad$read_regS uscratch_ref : ( 64 words$word) M)) (\ (w__11 : 64 words$word) . sail2_state_monad$returnS (SOME w__11)) else if (((b__0 = (0x041w : 12 words$word)))) then sail2_state_monad$bindS (set_xret_target User value : ( 64 words$word) M) (\ (w__12 : 64 words$word) . sail2_state_monad$returnS (SOME w__12)) else if (((b__0 = (0x042w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (set_Mcause_bits ucause_ref value) (sail2_state_monad$read_regS ucause_ref)) (\ (w__13 : Mcause) . sail2_state_monad$returnS (SOME ((get_Mcause_bits w__13 : 64 words$word)))) else if (((b__0 = (0x043w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS utval_ref value) (sail2_state_monad$read_regS utval_ref : ( 64 words$word) M)) (\ (w__14 : 64 words$word) . sail2_state_monad$returnS (SOME w__14)) else if (((b__0 = (0x044w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mip_ref) (\ (w__15 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__16 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS sideleg_ref) (\ (w__17 : Sinterrupts) . let sip = (legalize_uip ((lower_mip w__15 w__16)) w__17 value) in sail2_state_monad$bindS (sail2_state_monad$read_regS mip_ref) (\ (w__18 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__19 : Minterrupts) . sail2_state_monad$bindS (lift_sip w__18 w__19 sip) (\ (w__20 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mip_ref w__20) (sail2_state_monad$read_regS mip_ref)) (\ (w__21 : Minterrupts) . sail2_state_monad$returnS (SOME ((get_Minterrupts_bits w__21 : 64 words$word)))))))))) else if (((b__0 = (0x001w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS fcsr_ref) (\ (w__22 : Fcsr) . sail2_state_monad$bindS (sail2_state_monad$seqS (ext_write_fcsr ((get_Fcsr_FRM w__22 : 3 words$word)) ((subrange_vec_dec value (( 4 : int):ii) (( 0 : int):ii) : 5 words$word))) (sail2_state_monad$read_regS fcsr_ref)) (\ (w__23 : Fcsr) . sail2_state_monad$returnS (SOME ((EXTZ (( 64 : int):ii) ((get_Fcsr_FFLAGS w__23 : 5 words$word)) : 64 words$word))))) else if (((b__0 = (0x002w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS fcsr_ref) (\ (w__24 : Fcsr) . sail2_state_monad$bindS (sail2_state_monad$seqS (ext_write_fcsr ((subrange_vec_dec value (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) ((get_Fcsr_FFLAGS w__24 : 5 words$word))) (sail2_state_monad$read_regS fcsr_ref)) (\ (w__25 : Fcsr) . sail2_state_monad$returnS (SOME ((EXTZ (( 64 : int):ii) ((get_Fcsr_FRM w__25 : 3 words$word)) : 64 words$word))))) else if (((b__0 = (0x003w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (ext_write_fcsr ((subrange_vec_dec value (( 7 : int):ii) (( 5 : int):ii) : 3 words$word)) ((subrange_vec_dec value (( 4 : int):ii) (( 0 : int):ii) : 5 words$word))) (sail2_state_monad$read_regS fcsr_ref)) (\ (w__26 : Fcsr) . sail2_state_monad$returnS (SOME ((EXTZ (( 64 : int):ii) ((get_Fcsr_bits w__26 : 32 words$word)) : 64 words$word)))) else sail2_state_monad$returnS NONE))`; (*val csrAccess : mword ty12 -> mword ty2*) val _ = Define ` ((csrAccess:(12)words$word ->(2)words$word) csr= ((subrange_vec_dec csr (( 11 : int):ii) (( 10 : int):ii) : 2 words$word)))`; (*val csrPriv : mword ty12 -> mword ty2*) val _ = Define ` ((csrPriv:(12)words$word ->(2)words$word) csr= ((subrange_vec_dec csr (( 9 : int):ii) (( 8 : int):ii) : 2 words$word)))`; (*val is_CSR_defined : mword ty12 -> Privilege -> M bool*) val _ = Define ` ((is_CSR_defined:(12)words$word -> Privilege ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (csr : csreg) (p : Privilege)= (let b__0 = csr in if (((b__0 = (0xF11w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0xF12w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0xF13w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0xF14w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x300w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x301w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x302w : 12 words$word)))) then sail2_state$and_boolS (sail2_state_monad$returnS (((p = Machine)))) (sail2_state$or_boolS ((haveSupMode () )) ((haveNExt () ))) else if (((b__0 = (0x303w : 12 words$word)))) then sail2_state$and_boolS (sail2_state_monad$returnS (((p = Machine)))) (sail2_state$or_boolS ((haveSupMode () )) ((haveNExt () ))) else if (((b__0 = (0x304w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x305w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x306w : 12 words$word)))) then sail2_state$and_boolS (sail2_state_monad$returnS (((p = Machine)))) ((haveUsrMode () )) else if (((b__0 = (0x310w : 12 words$word)))) then sail2_state_monad$returnS ((((((p = Machine))) /\ ((((( 64 : int):ii) = (( 32 : int):ii))))))) else if (((b__0 = (0x320w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x340w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x341w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x342w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x343w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x344w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3A0w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3A1w : 12 words$word)))) then sail2_state_monad$returnS ((((((p = Machine))) /\ ((((( 64 : int):ii) = (( 32 : int):ii))))))) else if (((b__0 = (0x3A2w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3A3w : 12 words$word)))) then sail2_state_monad$returnS ((((((p = Machine))) /\ ((((( 64 : int):ii) = (( 32 : int):ii))))))) else if (((b__0 = (0x3B0w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3B1w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3B2w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3B3w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3B4w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3B5w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3B6w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3B7w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3B8w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3B9w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3BAw : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3BBw : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3BCw : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3BDw : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3BEw : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x3BFw : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0xB00w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0xB02w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0xB80w : 12 words$word)))) then sail2_state_monad$returnS ((((((p = Machine))) /\ ((((( 64 : int):ii) = (( 32 : int):ii))))))) else if (((b__0 = (0xB82w : 12 words$word)))) then sail2_state_monad$returnS ((((((p = Machine))) /\ ((((( 64 : int):ii) = (( 32 : int):ii))))))) else if (((b__0 = (0x7A0w : 12 words$word)))) then sail2_state_monad$returnS (((p = Machine))) else if (((b__0 = (0x100w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0x102w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state$and_boolS ((haveNExt () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor)))))))) else if (((b__0 = (0x103w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state$and_boolS ((haveNExt () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor)))))))) else if (((b__0 = (0x104w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0x105w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0x106w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0x140w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0x141w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0x142w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0x143w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0x144w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0x180w : 12 words$word)))) then sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS ((((((p = Machine))) \/ (((p = Supervisor))))))) else if (((b__0 = (0xC00w : 12 words$word)))) then haveUsrMode () else if (((b__0 = (0xC01w : 12 words$word)))) then haveUsrMode () else if (((b__0 = (0xC02w : 12 words$word)))) then haveUsrMode () else if (((b__0 = (0xC80w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) else if (((b__0 = (0xC81w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) else if (((b__0 = (0xC82w : 12 words$word)))) then sail2_state$and_boolS ((haveUsrMode () )) (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) else ext_is_CSR_defined csr p))`; (*val check_CSR_access : mword ty2 -> mword ty2 -> Privilege -> bool -> bool*) val _ = Define ` ((check_CSR_access:(2)words$word ->(2)words$word -> Privilege -> bool -> bool) csrrw csrpr p isWrite= (((~ ((((((isWrite = T))) /\ (((csrrw = (0b11w : 2 words$word))))))))) /\ ((zopz0zKzJ_u ((privLevel_to_bits p : 2 words$word)) csrpr))))`; (*val check_TVM_SATP : mword ty12 -> Privilege -> M bool*) val _ = Define ` ((check_TVM_SATP:(12)words$word -> Privilege ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (csr : csreg) (p : Privilege)= (sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS (((csr = (0x180w : 12 words$word))))) (sail2_state$and_boolS (sail2_state_monad$returnS (((p = Supervisor)))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . sail2_state_monad$returnS (((((get_Mstatus_TVM w__0 : 1 words$word)) = (0b1w : 1 words$word)))))))) (\ (w__2 : bool) . sail2_state_monad$returnS ((~ w__2)))))`; (*val check_Counteren : mword ty12 -> Privilege -> M bool*) val _ = Define ` ((check_Counteren:(12)words$word -> Privilege ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (csr : csreg) (p : Privilege)= ((case (csr, p) of (b__0, Supervisor) => if (((b__0 = (0xC00w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcounteren_ref) (\ (w__0 : Counteren) . sail2_state_monad$returnS (((((get_Counteren_CY w__0 : 1 words$word)) = (0b1w : 1 words$word))))) else if (((b__0 = (0xC01w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcounteren_ref) (\ (w__1 : Counteren) . sail2_state_monad$returnS (((((get_Counteren_TM w__1 : 1 words$word)) = (0b1w : 1 words$word))))) else if (((b__0 = (0xC02w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcounteren_ref) (\ (w__2 : Counteren) . sail2_state_monad$returnS (((((get_Counteren_IR w__2 : 1 words$word)) = (0b1w : 1 words$word))))) else sail2_state_monad$returnS ((case (b__0, Supervisor) of (_, _) => if (((((zopz0zIzJ_u (0xC03w : 12 words$word) csr)) /\ ((zopz0zIzJ_u csr (0xC1Fw : 12 words$word)))))) then F else T )) | (b__3, User) => if (((b__3 = (0xC00w : 12 words$word)))) then sail2_state$and_boolS ( sail2_state_monad$bindS(sail2_state_monad$read_regS mcounteren_ref) (\ (w__6 : Counteren) . sail2_state_monad$returnS (((((get_Counteren_CY w__6 : 1 words$word)) = (0b1w : 1 words$word)))))) (sail2_state$or_boolS ( sail2_state_monad$bindS(haveSupMode () ) (\ (w__7 : bool) . sail2_state_monad$returnS ((~ w__7)))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS scounteren_ref) (\ (w__8 : Counteren) . sail2_state_monad$returnS (((((get_Counteren_CY w__8 : 1 words$word)) = (0b1w : 1 words$word))))))) else if (((b__3 = (0xC01w : 12 words$word)))) then sail2_state$and_boolS ( sail2_state_monad$bindS(sail2_state_monad$read_regS mcounteren_ref) (\ (w__11 : Counteren) . sail2_state_monad$returnS (((((get_Counteren_TM w__11 : 1 words$word)) = (0b1w : 1 words$word)))))) (sail2_state$or_boolS ( sail2_state_monad$bindS(haveSupMode () ) (\ (w__12 : bool) . sail2_state_monad$returnS ((~ w__12)))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS scounteren_ref) (\ (w__13 : Counteren) . sail2_state_monad$returnS (((((get_Counteren_TM w__13 : 1 words$word)) = (0b1w : 1 words$word))))))) else if (((b__3 = (0xC02w : 12 words$word)))) then sail2_state$and_boolS ( sail2_state_monad$bindS(sail2_state_monad$read_regS mcounteren_ref) (\ (w__16 : Counteren) . sail2_state_monad$returnS (((((get_Counteren_IR w__16 : 1 words$word)) = (0b1w : 1 words$word)))))) (sail2_state$or_boolS ( sail2_state_monad$bindS(haveSupMode () ) (\ (w__17 : bool) . sail2_state_monad$returnS ((~ w__17)))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS scounteren_ref) (\ (w__18 : Counteren) . sail2_state_monad$returnS (((((get_Counteren_IR w__18 : 1 words$word)) = (0b1w : 1 words$word))))))) else sail2_state_monad$returnS ((case (b__3, User) of (_, _) => if (((((zopz0zIzJ_u (0xC03w : 12 words$word) csr)) /\ ((zopz0zIzJ_u csr (0xC1Fw : 12 words$word)))))) then F else T )) | (_, _) => sail2_state_monad$returnS (if (((((zopz0zIzJ_u (0xC03w : 12 words$word) csr)) /\ ((zopz0zIzJ_u csr (0xC1Fw : 12 words$word)))))) then F else T) )))`; (*val check_CSR : mword ty12 -> Privilege -> bool -> M bool*) val _ = Define ` ((check_CSR:(12)words$word -> Privilege -> bool ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (csr : csreg) (p : Privilege) (isWrite : bool)= (sail2_state$and_boolS ((is_CSR_defined csr p)) (sail2_state$and_boolS (sail2_state_monad$returnS ((check_CSR_access ((csrAccess csr : 2 words$word)) ((csrPriv csr : 2 words$word)) p isWrite))) (sail2_state$and_boolS ((check_TVM_SATP csr p)) ((check_Counteren csr p))))))`; (*val exception_delegatee : ExceptionType -> Privilege -> M Privilege*) val _ = Define ` ((exception_delegatee:ExceptionType -> Privilege ->(regstate)sail2_state_monad$sequential_state ->(((Privilege),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (e : ExceptionType) (p : Privilege)= (let idx = (num_of_ExceptionType e) in sail2_state_monad$bindS (sail2_state_monad$read_regS medeleg_ref) (\ (w__0 : Medeleg) . let super = (bit_to_bool ((access_vec_dec ((get_Medeleg_bits w__0 : 64 words$word)) idx))) in sail2_state_monad$bindS (haveSupMode () ) (\ (w__1 : bool) . sail2_state_monad$bindS (if w__1 then sail2_state$and_boolS (sail2_state_monad$returnS super) (sail2_state$and_boolS ((haveNExt () )) ( sail2_state_monad$bindS(sail2_state_monad$read_regS sedeleg_ref) (\ (w__3 : Sedeleg) . sail2_state_monad$returnS ((bit_to_bool ((access_vec_dec ((get_Sedeleg_bits w__3 : 64 words$word)) idx))))))) else sail2_state$and_boolS (sail2_state_monad$returnS super) ((haveNExt () ))) (\ user . sail2_state_monad$bindS (sail2_state$and_boolS ((haveUsrMode () )) (sail2_state_monad$returnS user)) (\ w__9 . sail2_state_monad$bindS (if w__9 then sail2_state_monad$returnS User else sail2_state_monad$bindS (sail2_state$and_boolS ((haveSupMode () )) (sail2_state_monad$returnS super)) (\ w__11 . sail2_state_monad$returnS (if w__11 then Supervisor else Machine))) (\ deleg . sail2_state_monad$returnS (if ((zopz0zI_u ((privLevel_to_bits deleg : 2 words$word)) ((privLevel_to_bits p : 2 words$word)))) then p else deleg))))))))`; (*val findPendingInterrupt : mword ty64 -> maybe InterruptType*) val _ = Define ` ((findPendingInterrupt:(64)words$word ->(InterruptType)option) ip= (let ip = (Mk_Minterrupts ip) in if (((((get_Minterrupts_MEI ip : 1 words$word)) = (0b1w : 1 words$word)))) then SOME I_M_External else if (((((get_Minterrupts_MSI ip : 1 words$word)) = (0b1w : 1 words$word)))) then SOME I_M_Software else if (((((get_Minterrupts_MTI ip : 1 words$word)) = (0b1w : 1 words$word)))) then SOME I_M_Timer else if (((((get_Minterrupts_SEI ip : 1 words$word)) = (0b1w : 1 words$word)))) then SOME I_S_External else if (((((get_Minterrupts_SSI ip : 1 words$word)) = (0b1w : 1 words$word)))) then SOME I_S_Software else if (((((get_Minterrupts_STI ip : 1 words$word)) = (0b1w : 1 words$word)))) then SOME I_S_Timer else if (((((get_Minterrupts_UEI ip : 1 words$word)) = (0b1w : 1 words$word)))) then SOME I_U_External else if (((((get_Minterrupts_USI ip : 1 words$word)) = (0b1w : 1 words$word)))) then SOME I_U_Software else if (((((get_Minterrupts_UTI ip : 1 words$word)) = (0b1w : 1 words$word)))) then SOME I_U_Timer else NONE))`; (*val processPending : Minterrupts -> Minterrupts -> mword ty64 -> bool -> interrupt_set*) val _ = Define ` ((processPending:Minterrupts -> Minterrupts ->(64)words$word -> bool -> interrupt_set) (xip : Minterrupts) (xie : Minterrupts) (xideleg : xlenbits) (priv_enabled : bool)= (let effective_pend = ((and_vec ((get_Minterrupts_bits xip : 64 words$word)) ((and_vec ((get_Minterrupts_bits xie : 64 words$word)) ((not_vec xideleg : 64 words$word)) : 64 words$word)) : 64 words$word)) in let effective_delg = ((and_vec ((get_Minterrupts_bits xip : 64 words$word)) xideleg : 64 words$word)) in if (((priv_enabled /\ (((effective_pend <> ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))))))) then Ints_Pending effective_pend else if (((effective_delg <> ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))))) then Ints_Delegated effective_delg else Ints_Empty () ))`; (*val getPendingSet : Privilege -> M (maybe ((mword ty64 * Privilege)))*) val _ = Define ` ((getPendingSet:Privilege ->(regstate)sail2_state_monad$sequential_state ->(((((64)words$word#Privilege)option),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) priv= (sail2_state_monad$bindS (haveUsrMode () ) (\ (w__0 : bool) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$assert_expS w__0 "no user mode: M/U or M/S/U system required") (sail2_state_monad$read_regS mip_ref)) (\ (w__1 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__2 : Minterrupts) . let effective_pending = ((and_vec ((get_Minterrupts_bits w__1 : 64 words$word)) ((get_Minterrupts_bits w__2 : 64 words$word)) : 64 words$word)) in if (((effective_pending = ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))))) then sail2_state_monad$returnS NONE else sail2_state_monad$bindS (sail2_state$or_boolS (sail2_state_monad$returnS (((priv <> Machine)))) (sail2_state$and_boolS (sail2_state_monad$returnS (((priv = Machine)))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS mstatus_ref) (\ (w__3 : Mstatus) . sail2_state_monad$returnS (((((get_Mstatus_MIE w__3 : 1 words$word)) = (0b1w : 1 words$word)))))))) (\ mIE . sail2_state_monad$bindS (sail2_state$and_boolS ((haveSupMode () )) (sail2_state$or_boolS (sail2_state_monad$returnS (((priv = User)))) (sail2_state$and_boolS (sail2_state_monad$returnS (((priv = Supervisor)))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS mstatus_ref) (\ (w__6 : Mstatus) . sail2_state_monad$returnS (((((get_Mstatus_SIE w__6 : 1 words$word)) = (0b1w : 1 words$word))))))))) (\ sIE . sail2_state_monad$bindS (sail2_state$and_boolS ((haveNExt () )) (sail2_state$and_boolS (sail2_state_monad$returnS (((priv = User)))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS mstatus_ref) (\ (w__10 : Mstatus) . sail2_state_monad$returnS (((((get_Mstatus_UIE w__10 : 1 words$word)) = (0b1w : 1 words$word)))))))) (\ uIE . sail2_state_monad$bindS (sail2_state_monad$read_regS mip_ref) (\ (w__12 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__13 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__14 : Minterrupts) . (case ((processPending w__12 w__13 ((get_Minterrupts_bits w__14 : 64 words$word)) mIE)) of Ints_Empty (() ) => sail2_state_monad$returnS NONE | Ints_Pending (p) => let r = (p, Machine) in sail2_state_monad$returnS (SOME r) | Ints_Delegated (d) => sail2_state_monad$bindS (haveSupMode () ) (\ (w__15 : bool) . if ((~ w__15)) then sail2_state_monad$returnS (if uIE then let r = (d, User) in SOME r else NONE) else sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__16 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS sideleg_ref) (\ (w__17 : Sinterrupts) . sail2_state_monad$returnS ((case ((processPending ((Mk_Minterrupts d)) w__16 ((get_Sinterrupts_bits w__17 : 64 words$word)) sIE)) of Ints_Empty (() ) => NONE | Ints_Pending (p) => let r = (p, Supervisor) in SOME r | Ints_Delegated (d) => if uIE then let r = (d, User) in SOME r else NONE ))))) ))))))))))))`; (*val dispatchInterrupt : Privilege -> M (maybe ((InterruptType * Privilege)))*) val _ = Define ` ((dispatchInterrupt:Privilege ->(regstate)sail2_state_monad$sequential_state ->((((InterruptType#Privilege)option),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) priv= (sail2_state_monad$bindS (sail2_state$or_boolS ( sail2_state_monad$bindS(haveUsrMode () ) (\ (w__0 : bool) . sail2_state_monad$returnS ((~ w__0)))) (sail2_state$and_boolS ( sail2_state_monad$bindS(haveSupMode () ) (\ (w__1 : bool) . sail2_state_monad$returnS ((~ w__1)))) ( sail2_state_monad$bindS(haveNExt () ) (\ (w__2 : bool) . sail2_state_monad$returnS ((~ w__2)))))) (\ (w__4 : bool) . if w__4 then sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$assert_expS (((priv = Machine))) "invalid current privilege") (sail2_state_monad$read_regS mip_ref)) (\ (w__5 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__6 : Minterrupts) . let enabled_pending = ((and_vec ((get_Minterrupts_bits w__5 : 64 words$word)) ((get_Minterrupts_bits w__6 : 64 words$word)) : 64 words$word)) in sail2_state_monad$returnS ((case ((findPendingInterrupt enabled_pending)) of SOME (i) => let r = (i, Machine) in SOME r | NONE => NONE )))) else sail2_state_monad$bindS (getPendingSet priv : ( (( 64 words$word # Privilege))option) M) (\ (w__7 : (( 64 words$word # Privilege))option) . sail2_state_monad$returnS ((case w__7 of NONE => NONE | SOME ((ip, p)) => (case ((findPendingInterrupt ip)) of NONE => NONE | SOME (i) => let r = (i, p) in SOME r ) ))))))`; (*val tval : maybe (mword ty64) -> mword ty64*) val _ = Define ` ((tval:((64)words$word)option ->(64)words$word) excinfo= ((case excinfo of SOME (e) => e | NONE => (EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word) )))`; (*val rvfi_trap : unit -> unit*) val _ = Define ` ((rvfi_trap:unit -> unit) () = () )`; (*val trap_handler : Privilege -> bool -> mword ty8 -> mword ty64 -> maybe (mword ty64) -> maybe unit -> M (mword ty64)*) val _ = Define ` ((trap_handler:Privilege -> bool ->(8)words$word ->(64)words$word ->(xlenbits)option ->(ext_exception)option ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (del_priv : Privilege) (intr : bool) (c : exc_code) (pc : xlenbits) (info : xlenbits option) (ext : ext_exception option)= (let (_ : unit) = (rvfi_trap () ) in let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "handling " ((STRCAT (if intr then "int#" else "exc#") ((STRCAT ((string_of_bits c)) ((STRCAT " at priv " ((STRCAT ((privLevel_to_str del_priv)) ((STRCAT " with tval " ((string_of_bits ((tval info : 64 words$word)))))))))))))))) else () ) in let (_ : unit) = (cancel_reservation () ) in (case del_priv of Machine => sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Mcause_IsInterrupt mcause_ref ((bool_to_bits intr : 1 words$word))) (set_Mcause_Cause mcause_ref ((EXTZ (( 63 : int):ii) c : 63 words$word)))) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__0 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Mstatus_MPIE mstatus_ref ((get_Mstatus_MIE w__0 : 1 words$word))) (set_Mstatus_MIE mstatus_ref (0b0w : 1 words$word))) (sail2_state_monad$read_regS cur_privilege_ref)) (\ (w__1 : Privilege) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Mstatus_MPP mstatus_ref ((privLevel_to_bits w__1 : 2 words$word))) (sail2_state_monad$write_regS mtval_ref ((tval info : 64 words$word)))) (sail2_state_monad$write_regS mepc_ref pc)) (sail2_state_monad$write_regS cur_privilege_ref del_priv)) (let (_ : unit) = (handle_trap_extension del_priv pc ext) in sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_reg () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__2 : Mstatus) . sail2_state_monad$returnS ((print_dbg ((STRCAT "CSR mstatus <- " ((string_of_bits ((get_Mstatus_bits w__2 : 64 words$word))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS mcause_ref)) (\ (w__3 : Mcause) . (prepare_trap_vector del_priv w__3 : ( 64 words$word) M))))) | Supervisor => sail2_state_monad$bindS (haveSupMode () ) (\ (w__5 : bool) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$assert_expS w__5 "no supervisor mode present for delegation") (set_Mcause_IsInterrupt scause_ref ((bool_to_bits intr : 1 words$word)))) (set_Mcause_Cause scause_ref ((EXTZ (( 63 : int):ii) c : 63 words$word)))) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__6 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Mstatus_SPIE mstatus_ref ((get_Mstatus_SIE w__6 : 1 words$word))) (set_Mstatus_SIE mstatus_ref (0b0w : 1 words$word))) (sail2_state_monad$read_regS cur_privilege_ref)) (\ (w__7 : Privilege) . sail2_state_monad$bindS (case w__7 of User => sail2_state_monad$returnS (0b0w : 1 words$word) | Supervisor => sail2_state_monad$returnS (0b1w : 1 words$word) | Machine => (internal_error "invalid privilege for s-mode trap" : ( 1 words$word) M) ) (\ (w__9 : 1 words$word) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Mstatus_SPP mstatus_ref w__9) (sail2_state_monad$write_regS stval_ref ((tval info : 64 words$word)))) (sail2_state_monad$write_regS sepc_ref pc)) (sail2_state_monad$write_regS cur_privilege_ref del_priv)) (let (_ : unit) = (handle_trap_extension del_priv pc ext) in sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_reg () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__10 : Mstatus) . sail2_state_monad$returnS ((print_dbg ((STRCAT "CSR mstatus <- " ((string_of_bits ((get_Mstatus_bits w__10 : 64 words$word))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS scause_ref)) (\ (w__11 : Mcause) . (prepare_trap_vector del_priv w__11 : ( 64 words$word) M))))))) | User => sail2_state_monad$bindS (haveUsrMode () ) (\ (w__13 : bool) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$assert_expS w__13 "no user mode present for delegation") (set_Mcause_IsInterrupt ucause_ref ((bool_to_bits intr : 1 words$word)))) (set_Mcause_Cause ucause_ref ((EXTZ (( 63 : int):ii) c : 63 words$word)))) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__14 : Mstatus) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Mstatus_UPIE mstatus_ref ((get_Mstatus_UIE w__14 : 1 words$word))) (set_Mstatus_UIE mstatus_ref (0b0w : 1 words$word))) (sail2_state_monad$write_regS utval_ref ((tval info : 64 words$word)))) (sail2_state_monad$write_regS uepc_ref pc)) (sail2_state_monad$write_regS cur_privilege_ref del_priv)) (let (_ : unit) = (handle_trap_extension del_priv pc ext) in sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_reg () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__15 : Mstatus) . sail2_state_monad$returnS ((print_dbg ((STRCAT "CSR mstatus <- " ((string_of_bits ((get_Mstatus_bits w__15 : 64 words$word))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS ucause_ref)) (\ (w__16 : Mcause) . (prepare_trap_vector del_priv w__16 : ( 64 words$word) M))))) )))`; (*val exception_handler : Privilege -> ctl_result -> mword ty64 -> M (mword ty64)*) val _ = Define ` ((exception_handler:Privilege -> ctl_result ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (cur_priv : Privilege) (ctl : ctl_result) (pc : xlenbits)= ((case (cur_priv, ctl) of (_, CTL_TRAP (e)) => sail2_state_monad$bindS (exception_delegatee e.sync_exception_trap cur_priv) (\ del_priv . let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "trapping from " ((STRCAT ((privLevel_to_str cur_priv)) ((STRCAT " to " ((STRCAT ((privLevel_to_str del_priv)) ((STRCAT " to handle " ((exceptionType_to_str e.sync_exception_trap)))))))))))) else () ) in (trap_handler del_priv F ((exceptionType_to_bits e.sync_exception_trap : 8 words$word)) pc e.sync_exception_excinfo e.sync_exception_ext : ( 64 words$word) M)) | (_, CTL_MRET (() )) => sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ prev_priv . sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__1 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Mstatus_MIE mstatus_ref ((get_Mstatus_MPIE w__1 : 1 words$word))) (set_Mstatus_MPIE mstatus_ref (0b1w : 1 words$word))) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__2 : Mstatus) . sail2_state_monad$bindS (privLevel_of_bits ((get_Mstatus_MPP w__2 : 2 words$word))) (\ (w__3 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS cur_privilege_ref w__3) (haveUsrMode () )) (\ (w__4 : bool) . sail2_state_monad$bindS (sail2_state_monad$seqS (set_Mstatus_MPP mstatus_ref ((privLevel_to_bits (if w__4 then User else Machine) : 2 words$word))) (sail2_state_monad$read_regS cur_privilege_ref)) (\ (w__5 : Privilege) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (if (((w__5 <> Machine))) then set_Mstatus_MPRV mstatus_ref (0b0w : 1 words$word) else sail2_state_monad$returnS () ) (if ((get_config_print_reg () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__6 : Mstatus) . sail2_state_monad$returnS ((print_dbg ((STRCAT "CSR mstatus <- " ((string_of_bits ((get_Mstatus_bits w__6 : 64 words$word))))))))) else sail2_state_monad$returnS () )) (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__7 : Privilege) . sail2_state_monad$returnS ((print_dbg ((STRCAT "ret-ing from " ((STRCAT ((privLevel_to_str prev_priv)) ((STRCAT " to " ((privLevel_to_str w__7))))))))))) else sail2_state_monad$returnS () )) (let (_ : unit) = (cancel_reservation () ) in sail2_state_monad$bindS (prepare_xret_target Machine : ( 64 words$word) M) (\ (w__8 : 64 words$word) . sail2_state_monad$bindS (pc_alignment_mask () : ( 64 words$word) M) (\ (w__9 : 64 words$word) . sail2_state_monad$returnS ((and_vec w__8 w__9 : 64 words$word))))))))))) | (_, CTL_SRET (() )) => sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ prev_priv . sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__10 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Mstatus_SIE mstatus_ref ((get_Mstatus_SPIE w__10 : 1 words$word))) (set_Mstatus_SPIE mstatus_ref (0b1w : 1 words$word))) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__11 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS cur_privilege_ref (if (((((get_Mstatus_SPP w__11 : 1 words$word)) = (0b1w : 1 words$word)))) then Supervisor else User)) (set_Mstatus_SPP mstatus_ref (0b0w : 1 words$word))) (sail2_state_monad$read_regS cur_privilege_ref)) (\ (w__12 : Privilege) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (if (((w__12 <> Machine))) then set_Mstatus_MPRV mstatus_ref (0b0w : 1 words$word) else sail2_state_monad$returnS () ) (if ((get_config_print_reg () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__13 : Mstatus) . sail2_state_monad$returnS ((print_dbg ((STRCAT "CSR mstatus <- " ((string_of_bits ((get_Mstatus_bits w__13 : 64 words$word))))))))) else sail2_state_monad$returnS () )) (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__14 : Privilege) . sail2_state_monad$returnS ((print_dbg ((STRCAT "ret-ing from " ((STRCAT ((privLevel_to_str prev_priv)) ((STRCAT " to " ((privLevel_to_str w__14))))))))))) else sail2_state_monad$returnS () )) (let (_ : unit) = (cancel_reservation () ) in sail2_state_monad$bindS (prepare_xret_target Supervisor : ( 64 words$word) M) (\ (w__15 : 64 words$word) . sail2_state_monad$bindS (pc_alignment_mask () : ( 64 words$word) M) (\ (w__16 : 64 words$word) . sail2_state_monad$returnS ((and_vec w__15 w__16 : 64 words$word))))))))) | (_, CTL_URET (() )) => sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ prev_priv . sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__17 : Mstatus) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (set_Mstatus_UIE mstatus_ref ((get_Mstatus_UPIE w__17 : 1 words$word))) (set_Mstatus_UPIE mstatus_ref (0b1w : 1 words$word))) (sail2_state_monad$write_regS cur_privilege_ref User)) (if ((get_config_print_reg () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__18 : Mstatus) . sail2_state_monad$returnS ((print_dbg ((STRCAT "CSR mstatus <- " ((string_of_bits ((get_Mstatus_bits w__18 : 64 words$word))))))))) else sail2_state_monad$returnS () )) (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__19 : Privilege) . sail2_state_monad$returnS ((print_dbg ((STRCAT "ret-ing from " ((STRCAT ((privLevel_to_str prev_priv)) ((STRCAT " to " ((privLevel_to_str w__19))))))))))) else sail2_state_monad$returnS () )) (let (_ : unit) = (cancel_reservation () ) in sail2_state_monad$bindS (prepare_xret_target User : ( 64 words$word) M) (\ (w__20 : 64 words$word) . sail2_state_monad$bindS (pc_alignment_mask () : ( 64 words$word) M) (\ (w__21 : 64 words$word) . sail2_state_monad$returnS ((and_vec w__20 w__21 : 64 words$word))))))) )))`; (*val handle_mem_exception : mword ty64 -> ExceptionType -> M unit*) val _ = Define ` ((handle_mem_exception:(64)words$word -> ExceptionType ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (addr : xlenbits) (e : ExceptionType)= (let (t : sync_exception) = (<| sync_exception_trap := e; sync_exception_excinfo := (SOME addr); sync_exception_ext := NONE |>) in sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__0 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$bindS (exception_handler w__0 (CTL_TRAP t) w__1 : ( 64 words$word) M) (\ (w__2 : 64 words$word) . set_next_pc w__2)))))`; (*val handle_exception : ExceptionType -> M unit*) val _ = Define ` ((handle_exception:ExceptionType ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) e= (let (t : sync_exception) = (<| sync_exception_trap := e; sync_exception_excinfo := NONE; sync_exception_ext := NONE |>) in sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__0 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$bindS (exception_handler w__0 (CTL_TRAP t) w__1 : ( 64 words$word) M) (\ (w__2 : 64 words$word) . set_next_pc w__2)))))`; (*val handle_interrupt : InterruptType -> Privilege -> M unit*) val _ = Define ` ((handle_interrupt:InterruptType -> Privilege ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (i : InterruptType) (del_priv : Privilege)= (sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (trap_handler del_priv T ((interruptType_to_bits i : 8 words$word)) w__0 NONE NONE : ( 64 words$word) M) (\ (w__1 : 64 words$word) . set_next_pc w__1))))`; (*val init_sys : unit -> M unit*) val _ = Define ` ((init_sys:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS cur_privilege_ref Machine) (sail2_state_monad$write_regS mhartid_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (set_Misa_MXL misa_ref ((arch_to_bits RV64 : 2 words$word)))) (set_Misa_A misa_ref (0b1w : 1 words$word))) (set_Misa_C misa_ref ((bool_to_bits ((sys_enable_rvc () )) : 1 words$word)))) (set_Misa_I misa_ref (0b1w : 1 words$word))) (set_Misa_M misa_ref (0b1w : 1 words$word))) (set_Misa_U misa_ref (0b1w : 1 words$word))) (set_Misa_S misa_ref (0b1w : 1 words$word))) (set_Misa_F misa_ref ((bool_to_bits ((sys_enable_fdext () )) : 1 words$word)))) (set_Misa_D misa_ref ((bool_to_bits ((sys_enable_fdext () )) : 1 words$word)))) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__0 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__1 : Misa) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mstatus_ref ((set_mstatus_SXL w__0 ((get_Misa_MXL w__1 : 2 words$word))))) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__2 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__3 : Misa) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS mstatus_ref ((set_mstatus_UXL w__2 ((get_Misa_MXL w__3 : 2 words$word))))) (set_Mstatus_SD mstatus_ref (0b0w : 1 words$word))) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__4 : Mstatus) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS mstatus_ref ((Mk_Mstatus ((update_subrange_vec_dec ((get_Mstatus_bits w__4 : 64 words$word)) (( 37 : int):ii) (( 36 : int):ii) (0b00w : 2 words$word) : 64 words$word))))) (set_Mstatush_bits mstatush_ref ((EXTZ (( 32 : int):ii) (0b0w : 1 words$word) : 32 words$word)))) (set_Minterrupts_bits mip_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (set_Minterrupts_bits mie_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (set_Minterrupts_bits mideleg_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (set_Medeleg_bits medeleg_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (set_Mtvec_bits mtvec_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (set_Mcause_bits mcause_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (sail2_state_monad$write_regS mepc_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (sail2_state_monad$write_regS mtval_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (sail2_state_monad$write_regS mscratch_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (sail2_state_monad$write_regS mcycle_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (sail2_state_monad$write_regS mtime_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (set_Counteren_bits mcounteren_ref ((EXTZ (( 32 : int):ii) (0b0w : 1 words$word) : 32 words$word)))) (sail2_state_monad$write_regS minstret_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (sail2_state_monad$write_regS minstret_written_ref F)) (init_pmp () )) (if ((get_config_print_reg () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__5 : Mstatus) . sail2_state_monad$returnS ((print_dbg ((STRCAT "CSR mstatus <- " ((STRCAT ((string_of_bits ((get_Mstatus_bits w__5 : 64 words$word)))) ((STRCAT " (input: " ((STRCAT ((string_of_bits ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) ")"))))))))))) else sail2_state_monad$returnS () ))))))))`; (*val MemoryOpResult_add_meta : forall 't. MemoryOpResult 't -> unit -> MemoryOpResult (('t * unit))*) val _ = Define ` ((MemoryOpResult_add_meta:'t MemoryOpResult -> unit ->('t#unit)MemoryOpResult) r m= ((case r of MemValue (v) => MemValue (v, m) | MemException (e) => MemException e )))`; (*val MemoryOpResult_drop_meta : forall 't. MemoryOpResult (('t * unit)) -> MemoryOpResult 't*) val _ = Define ` ((MemoryOpResult_drop_meta:('t#unit)MemoryOpResult -> 't MemoryOpResult) r= ((case r of MemValue ((v, m)) => MemValue v | MemException (e) => MemException e )))`; (*val elf_tohost : unit -> ii*) (*val elf_entry : unit -> ii*) (*val phys_mem_segments : unit -> list ((mword ty64 * mword ty64))*) val _ = Define ` ((phys_mem_segments:unit ->((64)words$word#(64)words$word)list) () = (((plat_rom_base () : 64 words$word), (plat_rom_size () : 64 words$word)) :: (((plat_ram_base () : 64 words$word), (plat_ram_size () : 64 words$word)) :: [])))`; (*val within_phys_mem : mword ty64 -> integer -> bool*) val _ = Define ` ((within_phys_mem:(64)words$word -> int -> bool) (addr : xlenbits) (width : int)= (let addr_int = (lem$w2ui addr) in let ram_base_int = (lem$w2ui ((plat_ram_base () : 64 words$word))) in let rom_base_int = (lem$w2ui ((plat_rom_base () : 64 words$word))) in let ram_size_int = (lem$w2ui ((plat_ram_size () : 64 words$word))) in let rom_size_int = (lem$w2ui ((plat_rom_size () : 64 words$word))) in if (((((ram_base_int <= addr_int)) /\ ((((addr_int + ((id width)))) <= ((ram_base_int + ram_size_int))))))) then T else if (((((rom_base_int <= addr_int)) /\ ((((addr_int + ((id width)))) <= ((rom_base_int + rom_size_int))))))) then T else let (_ : unit) = (print_dbg ((STRCAT "within_phys_mem: " ((STRCAT ((string_of_bits addr)) " not within phys-mem:"))))) in let (_ : unit) = (print_dbg ((STRCAT " plat_rom_base: " ((string_of_bits ((plat_rom_base () : 64 words$word))))))) in let (_ : unit) = (print_dbg ((STRCAT " plat_rom_size: " ((string_of_bits ((plat_rom_size () : 64 words$word))))))) in let (_ : unit) = (print_dbg ((STRCAT " plat_ram_base: " ((string_of_bits ((plat_ram_base () : 64 words$word))))))) in let (_ : unit) = (print_dbg ((STRCAT " plat_ram_size: " ((string_of_bits ((plat_ram_size () : 64 words$word))))))) in F))`; (*val within_clint : mword ty64 -> integer -> bool*) val _ = Define ` ((within_clint:(64)words$word -> int -> bool) (addr : xlenbits) (width : int)= (let addr_int = (lem$w2ui addr) in let clint_base_int = (lem$w2ui ((plat_clint_base () : 64 words$word))) in let clint_size_int = (lem$w2ui ((plat_clint_size () : 64 words$word))) in (((clint_base_int <= addr_int)) /\ ((((addr_int + ((id width)))) <= ((clint_base_int + clint_size_int)))))))`; (*val within_htif_writable : mword ty64 -> integer -> bool*) val _ = Define ` ((within_htif_writable:(64)words$word -> int -> bool) (addr : xlenbits) (width : int)= ((((((plat_htif_tohost () : 64 words$word)) = addr))) \/ ((((((((add_vec_int ((plat_htif_tohost () : 64 words$word)) (( 4 : int):ii) : 64 words$word)) = addr))) /\ (((width = (( 4 : int):ii)))))))))`; (*val within_htif_readable : mword ty64 -> integer -> bool*) val _ = Define ` ((within_htif_readable:(64)words$word -> int -> bool) (addr : xlenbits) (width : int)= ((((((plat_htif_tohost () : 64 words$word)) = addr))) \/ ((((((((add_vec_int ((plat_htif_tohost () : 64 words$word)) (( 4 : int):ii) : 64 words$word)) = addr))) /\ (((width = (( 4 : int):ii)))))))))`; val _ = Define ` ((MSIP_BASE:(64)words$word)= ((0x0000000000000000w : 64 words$word)))`; val _ = Define ` ((MTIMECMP_BASE:(64)words$word)= ((0x0000000000004000w : 64 words$word)))`; val _ = Define ` ((MTIMECMP_BASE_HI:(64)words$word)= ((0x0000000000004004w : 64 words$word)))`; val _ = Define ` ((MTIME_BASE:(64)words$word)= ((0x000000000000BFF8w : 64 words$word)))`; val _ = Define ` ((MTIME_BASE_HI:(64)words$word)= ((0x000000000000BFFCw : 64 words$word)))`; (*val clint_load : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> mword ty64 -> integer -> M (MemoryOpResult (mword 'int8_times_n))*) val _ = Define ` ((clint_load:(unit)AccessType ->(64)words$word -> int ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) t addr width= (let addr = ((sub_vec addr ((plat_clint_base () : 64 words$word)) : 64 words$word)) in if ((((((addr = MSIP_BASE))) /\ ((((((((id width)) = (( 8 : int):ii)))) \/ (((((id width)) = (( 4 : int):ii)))))))))) then sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mip_ref) (\ (w__0 : Minterrupts) . sail2_state_monad$returnS ((print_dbg ((STRCAT "clint[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] -> " ((string_of_bits ((get_Minterrupts_MSI w__0 : 1 words$word))))))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS mip_ref)) (\ (w__1 : Minterrupts) . sail2_state_monad$returnS (MemValue ((zero_extend ((get_Minterrupts_MSI w__1 : 1 words$word)) (((( 8 : int):ii) * ((id width)))) : 'int8_times_n words$word)))) else if ((((((addr = MTIMECMP_BASE))) /\ (((((id width)) = (( 4 : int):ii))))))) then sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT "clint<4>[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] -> " ((string_of_bits ((subrange_vec_dec w__2 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M)) (\ (w__3 : 64 words$word) . sail2_state_monad$returnS (MemValue ((words$w2w ((zero_extend ((subrange_vec_dec w__3 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) (( 32 : int):ii) : 32 words$word)) : 'int8_times_n words$word)))) else if ((((((addr = MTIMECMP_BASE))) /\ (((((id width)) = (( 8 : int):ii))))))) then sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M) (\ (w__4 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT "clint<8>[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] -> " ((string_of_bits w__4))))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M)) (\ (w__5 : 64 words$word) . sail2_state_monad$returnS (MemValue ((words$w2w ((zero_extend w__5 (( 64 : int):ii) : 64 words$word)) : 'int8_times_n words$word)))) else if ((((((addr = MTIMECMP_BASE_HI))) /\ (((((id width)) = (( 4 : int):ii))))))) then sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M) (\ (w__6 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT "clint-hi<4>[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] -> " ((string_of_bits ((subrange_vec_dec w__6 (( 63 : int):ii) (( 32 : int):ii) : 32 words$word))))))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M)) (\ (w__7 : 64 words$word) . sail2_state_monad$returnS (MemValue ((words$w2w ((zero_extend ((subrange_vec_dec w__7 (( 63 : int):ii) (( 32 : int):ii) : 32 words$word)) (( 32 : int):ii) : 32 words$word)) : 'int8_times_n words$word)))) else if ((((((addr = MTIME_BASE))) /\ (((((id width)) = (( 4 : int):ii))))))) then sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M) (\ (w__8 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT "clint[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] -> " ((string_of_bits w__8))))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M)) (\ (w__9 : 64 words$word) . sail2_state_monad$returnS (MemValue ((words$w2w ((zero_extend ((subrange_vec_dec w__9 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) (( 32 : int):ii) : 32 words$word)) : 'int8_times_n words$word)))) else if ((((((addr = MTIME_BASE))) /\ (((((id width)) = (( 8 : int):ii))))))) then sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M) (\ (w__10 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT "clint[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] -> " ((string_of_bits w__10))))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M)) (\ (w__11 : 64 words$word) . sail2_state_monad$returnS (MemValue ((words$w2w ((zero_extend w__11 (( 64 : int):ii) : 64 words$word)) : 'int8_times_n words$word)))) else if ((((((addr = MTIME_BASE_HI))) /\ (((((id width)) = (( 4 : int):ii))))))) then sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M) (\ (w__12 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT "clint[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] -> " ((string_of_bits w__12))))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M)) (\ (w__13 : 64 words$word) . sail2_state_monad$returnS (MemValue ((words$w2w ((zero_extend ((subrange_vec_dec w__13 (( 63 : int):ii) (( 32 : int):ii) : 32 words$word)) (( 32 : int):ii) : 32 words$word)) : 'int8_times_n words$word)))) else let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "clint[" ((STRCAT ((string_of_bits addr)) "] -> ")))) else () ) in sail2_state_monad$returnS ((case t of Execute (() ) => MemException (E_Fetch_Access_Fault () ) | Read (Data1) => MemException (E_Load_Access_Fault () ) | _ => MemException (E_SAMO_Access_Fault () ) ))))`; (*val clint_dispatch : unit -> M unit*) val _ = Define ` ((clint_dispatch:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT "clint::tick mtime <- " ((string_of_bits w__0))))))) else sail2_state_monad$returnS () ) (set_Minterrupts_MTI mip_ref (0b0w : 1 words$word))) (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M)) (\ (w__1 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . if ((zopz0zIzJ_u w__1 w__2)) then sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M) (\ (w__3 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT " clint timer pending at mtime " ((string_of_bits w__3))))))) else sail2_state_monad$returnS () ) (set_Minterrupts_MTI mip_ref (0b1w : 1 words$word)) else sail2_state_monad$returnS () ))))`; (*val clint_store : forall 'int8_times_n. Size 'int8_times_n => mword ty64 -> integer -> mword 'int8_times_n -> M (MemoryOpResult bool)*) val _ = Define ` ((clint_store:(64)words$word -> int -> 'int8_times_n words$word ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) addr width data= (let addr = ((sub_vec addr ((plat_clint_base () : 64 words$word)) : 64 words$word)) in if ((((((addr = MSIP_BASE))) /\ ((((((((id width)) = (( 8 : int):ii)))) \/ (((((id width)) = (( 4 : int):ii)))))))))) then let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "clint[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] <- " ((STRCAT ((string_of_bits data)) ((STRCAT " (mip.MSI <- " ((STRCAT ((string_of_bit ((access_vec_dec data (( 0 : int):ii))))) ")")))))))))))) else () ) in sail2_state_monad$seqS (sail2_state_monad$seqS (set_Minterrupts_MSI mip_ref (vec_of_bits [access_vec_dec data (( 0 : int):ii)] : 1 words$word)) (clint_dispatch () )) (sail2_state_monad$returnS (MemValue T)) else if ((((((addr = MTIMECMP_BASE))) /\ (((((id width)) = (( 8 : int):ii))))))) then let (data : 64 words$word) = ((words$w2w data : 64 words$word)) in let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "clint<8>[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] <- " ((STRCAT ((string_of_bits data)) " (mtimecmp)")))))))) else () ) in sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS mtimecmp_ref ((zero_extend data (( 64 : int):ii) : 64 words$word))) (clint_dispatch () )) (sail2_state_monad$returnS (MemValue T)) else if ((((((addr = MTIMECMP_BASE))) /\ (((((id width)) = (( 4 : int):ii))))))) then let (data : 32 words$word) = ((words$w2w data : 32 words$word)) in let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "clint<4>[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] <- " ((STRCAT ((string_of_bits data)) " (mtimecmp)")))))))) else () ) in sail2_state_monad$bindS (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS mtimecmp_ref ((update_subrange_vec_dec w__0 (( 31 : int):ii) (( 0 : int):ii) ((zero_extend data (( 32 : int):ii) : 32 words$word)) : 64 words$word))) (clint_dispatch () )) (sail2_state_monad$returnS (MemValue T))) else if ((((((addr = MTIMECMP_BASE_HI))) /\ (((((id width)) = (( 4 : int):ii))))))) then let (data : 32 words$word) = ((words$w2w data : 32 words$word)) in let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "clint<4>[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] <- " ((STRCAT ((string_of_bits data)) " (mtimecmp)")))))))) else () ) in sail2_state_monad$bindS (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS mtimecmp_ref ((update_subrange_vec_dec w__1 (( 63 : int):ii) (( 32 : int):ii) ((zero_extend data (( 32 : int):ii) : 32 words$word)) : 64 words$word))) (clint_dispatch () )) (sail2_state_monad$returnS (MemValue T))) else let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "clint[" ((STRCAT ((string_of_bits addr)) ((STRCAT "] <- " ((STRCAT ((string_of_bits data)) " ()")))))))) else () ) in sail2_state_monad$returnS (MemException (E_SAMO_Access_Fault () ))))`; (*val tick_clock : unit -> M unit*) val _ = Define ` ((tick_clock:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS mcountinhibit_ref) (\ (w__0 : Counterin) . sail2_state_monad$bindS (sail2_state_monad$seqS (if (((((get_Counterin_CY w__0 : 1 words$word)) = (0b0w : 1 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcycle_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$write_regS mcycle_ref ((add_vec_int w__1 (( 1 : int):ii) : 64 words$word))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M)) (\ (w__2 : 64 words$word) . sail2_state_monad$seqS (sail2_state_monad$write_regS mtime_ref ((add_vec_int w__2 (( 1 : int):ii) : 64 words$word))) (clint_dispatch () )))))`; (*val Mk_htif_cmd : mword ty64 -> htif_cmd*) val _ = Define ` ((Mk_htif_cmd:(64)words$word -> htif_cmd) v= (<| htif_cmd_htif_cmd_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_htif_cmd_bits:htif_cmd ->(64)words$word) v= ((subrange_vec_dec v.htif_cmd_htif_cmd_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_htif_cmd_bits:((regstate),(register_value),(htif_cmd))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| htif_cmd_htif_cmd_chunk_0 := ((update_subrange_vec_dec r.htif_cmd_htif_cmd_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_htif_cmd_bits:htif_cmd ->(64)words$word -> htif_cmd) v x= (( v with<| htif_cmd_htif_cmd_chunk_0 := ((update_subrange_vec_dec v.htif_cmd_htif_cmd_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; (*val _get_htif_cmd_device : htif_cmd -> mword ty8*) val _ = Define ` ((get_htif_cmd_device:htif_cmd ->(8)words$word) v= ((subrange_vec_dec v.htif_cmd_htif_cmd_chunk_0 (( 63 : int):ii) (( 56 : int):ii) : 8 words$word)))`; (*val _set_htif_cmd_device : register_ref regstate register_value htif_cmd -> mword ty8 -> M unit*) val _ = Define ` ((set_htif_cmd_device:((regstate),(register_value),(htif_cmd))register_ref ->(8)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| htif_cmd_htif_cmd_chunk_0 := ((update_subrange_vec_dec r.htif_cmd_htif_cmd_chunk_0 (( 63 : int):ii) (( 56 : int):ii) ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_htif_cmd_device : htif_cmd -> mword ty8 -> htif_cmd*) val _ = Define ` ((update_htif_cmd_device:htif_cmd ->(8)words$word -> htif_cmd) v x= (( v with<| htif_cmd_htif_cmd_chunk_0 := ((update_subrange_vec_dec v.htif_cmd_htif_cmd_chunk_0 (( 63 : int):ii) (( 56 : int):ii) ((subrange_vec_dec x (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word)) |>)))`; (*val _get_htif_cmd_cmd : htif_cmd -> mword ty8*) val _ = Define ` ((get_htif_cmd_cmd:htif_cmd ->(8)words$word) v= ((subrange_vec_dec v.htif_cmd_htif_cmd_chunk_0 (( 55 : int):ii) (( 48 : int):ii) : 8 words$word)))`; (*val _set_htif_cmd_cmd : register_ref regstate register_value htif_cmd -> mword ty8 -> M unit*) val _ = Define ` ((set_htif_cmd_cmd:((regstate),(register_value),(htif_cmd))register_ref ->(8)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| htif_cmd_htif_cmd_chunk_0 := ((update_subrange_vec_dec r.htif_cmd_htif_cmd_chunk_0 (( 55 : int):ii) (( 48 : int):ii) ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_htif_cmd_cmd : htif_cmd -> mword ty8 -> htif_cmd*) val _ = Define ` ((update_htif_cmd_cmd:htif_cmd ->(8)words$word -> htif_cmd) v x= (( v with<| htif_cmd_htif_cmd_chunk_0 := ((update_subrange_vec_dec v.htif_cmd_htif_cmd_chunk_0 (( 55 : int):ii) (( 48 : int):ii) ((subrange_vec_dec x (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word)) |>)))`; (*val _get_htif_cmd_payload : htif_cmd -> mword ty48*) val _ = Define ` ((get_htif_cmd_payload:htif_cmd ->(48)words$word) v= ((subrange_vec_dec v.htif_cmd_htif_cmd_chunk_0 (( 47 : int):ii) (( 0 : int):ii) : 48 words$word)))`; (*val _set_htif_cmd_payload : register_ref regstate register_value htif_cmd -> mword ty48 -> M unit*) val _ = Define ` ((set_htif_cmd_payload:((regstate),(register_value),(htif_cmd))register_ref ->(48)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| htif_cmd_htif_cmd_chunk_0 := ((update_subrange_vec_dec r.htif_cmd_htif_cmd_chunk_0 (( 47 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 47 : int):ii) (( 0 : int):ii) : 48 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_htif_cmd_payload : htif_cmd -> mword ty48 -> htif_cmd*) val _ = Define ` ((update_htif_cmd_payload:htif_cmd ->(48)words$word -> htif_cmd) v x= (( v with<| htif_cmd_htif_cmd_chunk_0 := ((update_subrange_vec_dec v.htif_cmd_htif_cmd_chunk_0 (( 47 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 47 : int):ii) (( 0 : int):ii) : 48 words$word)) : 64 words$word)) |>)))`; (*val reset_htif : unit -> M unit*) val _ = Define ` ((reset_htif:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS htif_cmd_write_ref B0) (sail2_state_monad$write_regS htif_payload_writes_ref (0x0w : 4 words$word))) (sail2_state_monad$write_regS htif_tohost_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))))`; (*val htif_load : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> mword ty64 -> integer -> M (MemoryOpResult (mword 'int8_times_n))*) val _ = Define ` ((htif_load:(unit)AccessType ->(64)words$word -> int ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) t paddr width= (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT "htif[" ((STRCAT ((string_of_bits paddr)) ((STRCAT "] -> " ((string_of_bits w__0))))))))))) else sail2_state_monad$returnS () ) (if ((((((width = (( 8 : int):ii)))) /\ (((paddr = ((plat_htif_tohost () : 64 words$word)))))))) then sail2_state_monad$bindS (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS (MemValue ((words$w2w ((zero_extend w__1 (( 64 : int):ii) : 64 words$word)) : 'int8_times_n words$word)))) else if ((((((width = (( 4 : int):ii)))) /\ (((paddr = ((plat_htif_tohost () : 64 words$word)))))))) then sail2_state_monad$bindS (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . sail2_state_monad$returnS (MemValue ((words$w2w ((zero_extend ((subrange_vec_dec w__2 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) (( 32 : int):ii) : 32 words$word)) : 'int8_times_n words$word)))) else if ((((((width = (( 4 : int):ii)))) /\ (((paddr = ((add_vec_int ((plat_htif_tohost () : 64 words$word)) (( 4 : int):ii) : 64 words$word)))))))) then sail2_state_monad$bindS (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M) (\ (w__3 : 64 words$word) . sail2_state_monad$returnS (MemValue ((words$w2w ((zero_extend ((subrange_vec_dec w__3 (( 63 : int):ii) (( 32 : int):ii) : 32 words$word)) (( 32 : int):ii) : 32 words$word)) : 'int8_times_n words$word)))) else sail2_state_monad$returnS ((case t of Execute (() ) => MemException (E_Fetch_Access_Fault () ) | Read (Data1) => MemException (E_Load_Access_Fault () ) | _ => MemException (E_SAMO_Access_Fault () ) )))))`; (*val htif_store : forall 'int8_times_n. Size 'int8_times_n => mword ty64 -> integer -> mword 'int8_times_n -> M (MemoryOpResult bool)*) val _ = Define ` ((htif_store:(64)words$word -> int -> 'int8_times_n words$word ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) paddr width data= (let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "htif[" ((STRCAT ((string_of_bits paddr)) ((STRCAT "] <- " ((string_of_bits data)))))))) else () ) in sail2_state_monad$bindS (sail2_state_monad$seqS (if (((width = (( 8 : int):ii)))) then let (data : 64 words$word) = ((words$w2w data : 64 words$word)) in sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS htif_cmd_write_ref B1) (sail2_state_monad$read_regS htif_payload_writes_ref : ( 4 words$word) M)) (\ (w__0 : 4 words$word) . sail2_state_monad$seqS (sail2_state_monad$write_regS htif_payload_writes_ref ((add_vec_int w__0 (( 1 : int):ii) : 4 words$word))) (sail2_state_monad$write_regS htif_tohost_ref ((EXTZ (( 64 : int):ii) data : 64 words$word)))) else if ((((((width = (( 4 : int):ii)))) /\ (((paddr = ((plat_htif_tohost () : 64 words$word)))))))) then let (data : 32 words$word) = ((words$w2w data : 32 words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (if (((data = ((subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))))) then sail2_state_monad$bindS (sail2_state_monad$read_regS htif_payload_writes_ref : ( 4 words$word) M) (\ (w__2 : 4 words$word) . sail2_state_monad$write_regS htif_payload_writes_ref ((add_vec_int w__2 (( 1 : int):ii) : 4 words$word))) else sail2_state_monad$write_regS htif_payload_writes_ref (0x1w : 4 words$word)) (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M)) (\ (w__3 : 64 words$word) . sail2_state_monad$write_regS htif_tohost_ref ((update_subrange_vec_dec w__3 (( 31 : int):ii) (( 0 : int):ii) data : 64 words$word)))) else if ((((((width = (( 4 : int):ii)))) /\ (((paddr = ((add_vec_int ((plat_htif_tohost () : 64 words$word)) (( 4 : int):ii) : 64 words$word)))))))) then let (data : 32 words$word) = ((words$w2w data : 32 words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M) (\ (w__4 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$seqS (if (((((subrange_vec_dec data (( 15 : int):ii) (( 0 : int):ii) : 16 words$word)) = ((subrange_vec_dec w__4 (( 47 : int):ii) (( 32 : int):ii) : 16 words$word))))) then sail2_state_monad$bindS (sail2_state_monad$read_regS htif_payload_writes_ref : ( 4 words$word) M) (\ (w__5 : 4 words$word) . sail2_state_monad$write_regS htif_payload_writes_ref ((add_vec_int w__5 (( 1 : int):ii) : 4 words$word))) else sail2_state_monad$write_regS htif_payload_writes_ref (0x1w : 4 words$word)) (sail2_state_monad$write_regS htif_cmd_write_ref B1)) (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M)) (\ (w__6 : 64 words$word) . sail2_state_monad$write_regS htif_tohost_ref ((update_subrange_vec_dec w__6 (( 63 : int):ii) (( 32 : int):ii) data : 64 words$word)))) else sail2_state_monad$write_regS htif_tohost_ref ((EXTZ (( 64 : int):ii) data : 64 words$word))) (sail2_state$or_boolS (sail2_state$and_boolS ( sail2_state_monad$bindS(sail2_state_monad$read_regS htif_cmd_write_ref) (\ (w__7 : bitU) . sail2_state_monad$returnS (((w__7 = B1))))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS htif_payload_writes_ref : ( 4 words$word) M) (\ (w__8 : 4 words$word) . sail2_state_monad$returnS ((((lem$w2ui w__8)) > (( 0 : int):ii)))))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS htif_payload_writes_ref : ( 4 words$word) M) (\ (w__10 : 4 words$word) . sail2_state_monad$returnS ((((lem$w2ui w__10)) > (( 2 : int):ii))))))) (\ (w__11 : bool) . sail2_state_monad$seqS (if w__11 then sail2_state_monad$bindS (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M) (\ (w__12 : 64 words$word) . let cmd = (Mk_htif_cmd w__12) in let b__0 = ((get_htif_cmd_device cmd : 8 words$word)) in if (((b__0 = (0x00w : 8 words$word)))) then let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "htif-syscall-proxy cmd: " ((string_of_bits ((get_htif_cmd_payload cmd : 48 words$word)))))) else () ) in if (((((access_vec_dec ((get_htif_cmd_payload cmd : 48 words$word)) (( 0 : int):ii))) = B1))) then sail2_state_monad$seqS (sail2_state_monad$write_regS htif_done_ref T) (sail2_state_monad$write_regS htif_exit_code_ref ((shiftr ((zero_extend ((get_htif_cmd_payload cmd : 48 words$word)) (( 64 : int):ii) : 64 words$word)) (( 1 : int):ii) : 64 words$word))) else sail2_state_monad$returnS () else if (((b__0 = (0x01w : 8 words$word)))) then let (_ : unit) = (if ((get_config_print_platform () )) then print_dbg ((STRCAT "htif-term cmd: " ((string_of_bits ((get_htif_cmd_payload cmd : 48 words$word)))))) else () ) in let b__2 = ((get_htif_cmd_cmd cmd : 8 words$word)) in let (_ : unit) = (if (((b__2 = (0x00w : 8 words$word)))) then () else if (((b__2 = (0x01w : 8 words$word)))) then plat_term_write ((subrange_vec_dec ((get_htif_cmd_payload cmd : 48 words$word)) (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) else print_endline ((STRCAT "Unknown term cmd: " ((string_of_bits b__2))))) in reset_htif () else sail2_state_monad$returnS ((print_endline ((STRCAT "htif-???? cmd: " ((string_of_bits data))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$returnS (MemValue T)))))`; (*val htif_tick : unit -> M unit*) val _ = Define ` ((htif_tick:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_platform () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$returnS ((print_dbg ((STRCAT "htif::tick " ((string_of_bits w__0))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS htif_tohost_ref : ( 64 words$word) M)) (\ (w__1 : 64 words$word) . sail2_state_monad$write_regS htif_tohost_ref w__1)))`; (*val within_mmio_readable : mword ty64 -> integer -> bool*) val _ = Define ` ((within_mmio_readable:(64)words$word -> int -> bool) (addr : xlenbits) (width : int)= (((within_clint addr width)) \/ (((((within_htif_readable addr width)) /\ (((( 1 : int):ii) <= ((id width)))))))))`; (*val within_mmio_writable : mword ty64 -> integer -> bool*) val _ = Define ` ((within_mmio_writable:(64)words$word -> int -> bool) (addr : xlenbits) (width : int)= (((within_clint addr width)) \/ (((((within_htif_writable addr width)) /\ ((((id width)) <= (( 8 : int):ii))))))))`; (*val mmio_read : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> mword ty64 -> integer -> M (MemoryOpResult (mword 'int8_times_n))*) val _ = Define ` ((mmio_read:(ext_access_type)AccessType ->(64)words$word -> int ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (t : ext_access_type AccessType) (paddr : xlenbits) (width : int)= (if ((within_clint paddr width)) then (clint_load t paddr width : ( ( 'int8_times_n words$word)MemoryOpResult) M) else if (((((within_htif_readable paddr width)) /\ (((( 1 : int):ii) <= ((id width))))))) then (htif_load t paddr width : ( ( 'int8_times_n words$word)MemoryOpResult) M) else sail2_state_monad$returnS ((case t of Execute (() ) => MemException (E_Fetch_Access_Fault () ) | Read (Data1) => MemException (E_Load_Access_Fault () ) | _ => MemException (E_SAMO_Access_Fault () ) ))))`; (*val mmio_write : forall 'int8_times_n. Size 'int8_times_n => mword ty64 -> integer -> mword 'int8_times_n -> M (MemoryOpResult bool)*) val _ = Define ` ((mmio_write:(64)words$word -> int -> 'int8_times_n words$word ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (paddr : xlenbits) (width : int) (data : 'int8_times_n words$word)= (if ((within_clint paddr width)) then clint_store paddr width data else if (((((within_htif_writable paddr width)) /\ ((((id width)) <= (( 8 : int):ii)))))) then htif_store paddr width data else sail2_state_monad$returnS (MemException (E_SAMO_Access_Fault () ))))`; (*val init_platform : unit -> M unit*) val _ = Define ` ((init_platform:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS htif_tohost_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))) (sail2_state_monad$write_regS htif_done_ref F)) (sail2_state_monad$write_regS htif_exit_code_ref ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word)))) (sail2_state_monad$write_regS htif_cmd_write_ref B0)) (sail2_state_monad$write_regS htif_payload_writes_ref ((EXTZ (( 4 : int):ii) (0b0w : 1 words$word) : 4 words$word)))))`; (*val tick_platform : unit -> M unit*) val _ = Define ` ((tick_platform:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (htif_tick () ))`; (*val handle_illegal : unit -> M unit*) val _ = Define ` ((handle_illegal:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (if ((plat_mtval_has_illegal_inst_bits () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS instbits_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$returnS (SOME w__0)) else sail2_state_monad$returnS NONE) (\ info . let (t : sync_exception) = (<| sync_exception_trap := (E_Illegal_Instr () ); sync_exception_excinfo := info; sync_exception_ext := NONE |>) in sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__1 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . sail2_state_monad$bindS (exception_handler w__1 (CTL_TRAP t) w__2 : ( 64 words$word) M) (\ (w__3 : 64 words$word) . set_next_pc w__3))))))`; (*val platform_wfi : unit -> M unit*) val _ = Define ` ((platform_wfi:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (let (_ : unit) = (cancel_reservation () ) in sail2_state_monad$bindS (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . if ((zopz0zI_u w__0 w__1)) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mtime_ref w__2) (sail2_state_monad$read_regS mtimecmp_ref : ( 64 words$word) M)) (\ (w__3 : 64 words$word) . sail2_state_monad$write_regS mcycle_ref w__3)) else sail2_state_monad$returnS () ))))`; (*val is_aligned_addr : mword ty64 -> integer -> bool*) val _ = Define ` ((is_aligned_addr:(64)words$word -> int -> bool) (addr : xlenbits) (width : int)= (((((lem$w2ui addr)) % width)) = (( 0 : int):ii)))`; (*val read_kind_of_flags : bool -> bool -> bool -> maybe read_kind*) val _ = Define ` ((read_kind_of_flags:bool -> bool -> bool ->(read_kind)option) (aq : bool) (rl : bool) (res : bool)= ((case (aq, rl, res) of (F, F, F) => SOME Read_plain | (T, F, F) => SOME Read_RISCV_acquire | (T, T, F) => SOME Read_RISCV_strong_acquire | (F, F, T) => SOME Read_RISCV_reserved | (T, F, T) => SOME Read_RISCV_reserved_acquire | (T, T, T) => SOME Read_RISCV_reserved_strong_acquire | (F, T, F) => NONE | (F, T, T) => NONE )))`; (*val phys_mem_read : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> mword ty64 -> integer -> bool -> bool -> bool -> bool -> M (MemoryOpResult ((mword 'int8_times_n * unit)))*) val _ = Define ` ((phys_mem_read:(ext_access_type)AccessType ->(64)words$word -> int -> bool -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word#unit)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (t : ext_access_type AccessType) (paddr : xlenbits) (width : int) (aq : bool) (rl : bool) (res : bool) (meta : bool)= (sail2_state_monad$bindS (case ((read_kind_of_flags aq rl res)) of SOME (rk) => sail2_state_monad$bindS (read_ram rk paddr width meta : (( 'int8_times_n words$word # unit)) M) (\ (w__0 : ( 'int8_times_n words$word # unit)) . sail2_state_monad$returnS (SOME w__0)) | NONE => sail2_state_monad$returnS NONE ) (\ (w__1 : (( 'int8_times_n words$word # unit))option) . let result = w__1 in sail2_state_monad$returnS ((case (t, result) of (Execute (() ), NONE) => MemException (E_Fetch_Access_Fault () ) | (Read (Data1), NONE) => MemException (E_Load_Access_Fault () ) | (_, NONE) => MemException (E_SAMO_Access_Fault () ) | (_, SOME ((v, m))) => let (_ : unit) = (if ((get_config_print_mem () )) then print_dbg ((STRCAT "mem[" ((STRCAT ((accessType_to_str t)) ((STRCAT "," ((STRCAT ((string_of_bits paddr)) ((STRCAT "] -> " ((string_of_bits v)))))))))))) else () ) in MemValue (v, m) )))))`; (*val checked_mem_read : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> mword ty64 -> integer -> bool -> bool -> bool -> bool -> M (MemoryOpResult ((mword 'int8_times_n * unit)))*) val _ = Define ` ((checked_mem_read:(ext_access_type)AccessType ->(64)words$word -> int -> bool -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word#unit)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (t : ext_access_type AccessType) (paddr : xlenbits) (width : int) (aq : bool) (rl : bool) (res : bool) (meta : bool)= (if ((within_mmio_readable paddr width)) then sail2_state_monad$bindS (mmio_read t paddr width : ( ( 'int8_times_n words$word)MemoryOpResult) M) (\ (w__0 : ( 'int8_times_n words$word) MemoryOpResult) . sail2_state_monad$returnS ((MemoryOpResult_add_meta w__0 default_meta : (( 'int8_times_n words$word # unit)) MemoryOpResult))) else if ((within_phys_mem paddr width)) then (case ((ext_check_phys_mem_read t paddr width aq rl res meta)) of Ext_PhysAddr_OK (() ) => (phys_mem_read t paddr width aq rl res meta : ( (( 'int8_times_n words$word # unit))MemoryOpResult) M) | Ext_PhysAddr_Error (e) => sail2_state_monad$returnS (MemException e) ) else sail2_state_monad$returnS ((case t of Execute (() ) => MemException (E_Fetch_Access_Fault () ) | Read (Data1) => MemException (E_Load_Access_Fault () ) | _ => MemException (E_SAMO_Access_Fault () ) ))))`; (*val pmp_mem_read : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> Privilege -> mword ty64 -> integer -> bool -> bool -> bool -> bool -> M (MemoryOpResult ((mword 'int8_times_n * unit)))*) val _ = Define ` ((pmp_mem_read:(ext_access_type)AccessType -> Privilege ->(64)words$word -> int -> bool -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word#unit)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (t : ext_access_type AccessType) (p : Privilege) (paddr : xlenbits) (width : int) (aq : bool) (rl : bool) (res : bool) (meta : bool)= (if ((~ ((plat_enable_pmp () )))) then (checked_mem_read t paddr width aq rl res meta : ( (( 'int8_times_n words$word # unit))MemoryOpResult) M) else sail2_state_monad$bindS (pmpCheck paddr width t p) (\ (w__1 : ExceptionType option) . (case w__1 of NONE => (checked_mem_read t paddr width aq rl res meta : ( (( 'int8_times_n words$word # unit))MemoryOpResult) M) | SOME (e) => sail2_state_monad$returnS (MemException e) ))))`; (*val rvfi_read : forall 'int8_times_n. Size 'int8_times_n => mword ty64 -> integer -> MemoryOpResult ((mword 'int8_times_n * unit)) -> unit*) val _ = Define ` ((rvfi_read:(64)words$word -> int ->('int8_times_n words$word#unit)MemoryOpResult -> unit) addr width result= () )`; (*val mem_read : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> mword ty64 -> integer -> bool -> bool -> bool -> M (MemoryOpResult (mword 'int8_times_n))*) (*val mem_read_priv : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> Privilege -> mword ty64 -> integer -> bool -> bool -> bool -> M (MemoryOpResult (mword 'int8_times_n))*) (*val mem_read_meta : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> mword ty64 -> integer -> bool -> bool -> bool -> bool -> M (MemoryOpResult ((mword 'int8_times_n * unit)))*) (*val mem_read_priv_meta : forall 'int8_times_n. Size 'int8_times_n => AccessType unit -> Privilege -> mword ty64 -> integer -> bool -> bool -> bool -> bool -> M (MemoryOpResult ((mword 'int8_times_n * unit)))*) val _ = Define ` ((mem_read_priv_meta:(unit)AccessType -> Privilege ->(64)words$word -> int -> bool -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word#unit)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) typ priv paddr width aq rl res meta= (sail2_state_monad$bindS (if ((((((aq \/ res))) /\ ((~ ((is_aligned_addr paddr width))))))) then sail2_state_monad$returnS (MemException (E_Load_Addr_Align () )) else (case (aq, rl, res) of (F, T, F) => sail2_state_monad$throwS (Error_not_implemented "load.rl") | (F, T, T) => sail2_state_monad$throwS (Error_not_implemented "lr.rl") | (_, _, _) => (pmp_mem_read typ priv paddr width aq rl res meta : ( (( 'int8_times_n words$word # unit))MemoryOpResult) M) )) (\ (result : (( 'int8_times_n words$word # unit)) MemoryOpResult) . let (_ : unit) = (rvfi_read paddr width result) in sail2_state_monad$returnS result)))`; val _ = Define ` ((mem_read_meta:(unit)AccessType ->(64)words$word -> int -> bool -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word#unit)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) typ paddr width aq rl res meta= (sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__1 : Privilege) . sail2_state_monad$bindS (effectivePrivilege typ w__0 w__1) (\ (w__2 : Privilege) . (mem_read_priv_meta typ w__2 paddr width aq rl res meta : ( (( 'int8_times_n words$word # unit))MemoryOpResult) M))))))`; val _ = Define ` ((mem_read_priv:(unit)AccessType -> Privilege ->(64)words$word -> int -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) typ priv paddr width aq rl res= (sail2_state_monad$bindS (mem_read_priv_meta typ priv paddr width aq rl res F : ( (( 'int8_times_n words$word # unit))MemoryOpResult) M) (\ (w__0 : (( 'int8_times_n words$word # unit)) MemoryOpResult) . sail2_state_monad$returnS ((MemoryOpResult_drop_meta w__0 : ( 'int8_times_n words$word) MemoryOpResult)))))`; val _ = Define ` ((mem_read:(unit)AccessType ->(64)words$word -> int -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((('int8_times_n words$word)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) typ paddr width aq rel res= (sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__1 : Privilege) . sail2_state_monad$bindS (effectivePrivilege typ w__0 w__1) (\ (w__2 : Privilege) . (mem_read_priv typ w__2 paddr width aq rel res : ( ( 'int8_times_n words$word)MemoryOpResult) M))))))`; (*val mem_write_ea : mword ty64 -> integer -> bool -> bool -> bool -> M (MemoryOpResult unit)*) val _ = Define ` ((mem_write_ea:(64)words$word -> int -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->((((unit)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) addr width aq rl con= (if ((((((rl \/ con))) /\ ((~ ((is_aligned_addr addr width))))))) then sail2_state_monad$returnS (MemException (E_SAMO_Addr_Align () )) else (case (aq, rl, con) of (F, F, F) => sail2_state_monad$seqS (write_ram_ea Write_plain addr width) (sail2_state_monad$returnS (MemValue () )) | (F, T, F) => sail2_state_monad$seqS (write_ram_ea Write_RISCV_release addr width) (sail2_state_monad$returnS (MemValue () )) | (F, F, T) => sail2_state_monad$seqS (write_ram_ea Write_RISCV_conditional addr width) (sail2_state_monad$returnS (MemValue () )) | (F, T, T) => sail2_state_monad$seqS (write_ram_ea Write_RISCV_conditional_release addr width) (sail2_state_monad$returnS (MemValue () )) | (T, F, F) => sail2_state_monad$throwS (Error_not_implemented "store.aq") | (T, T, F) => sail2_state_monad$seqS (write_ram_ea Write_RISCV_strong_release addr width) (sail2_state_monad$returnS (MemValue () )) | (T, F, T) => sail2_state_monad$throwS (Error_not_implemented "sc.aq") | (T, T, T) => sail2_state_monad$seqS (write_ram_ea Write_RISCV_conditional_strong_release addr width) (sail2_state_monad$returnS (MemValue () )) )))`; (*val rvfi_write : forall 'int8_times_n. Size 'int8_times_n => mword ty64 -> integer -> mword 'int8_times_n -> unit -> unit*) val _ = Define ` ((rvfi_write:(64)words$word -> int -> 'int8_times_n words$word -> unit -> unit) addr width value meta= () )`; (*val phys_mem_write : forall 'int8_times_n. Size 'int8_times_n => write_kind -> mword ty64 -> integer -> mword 'int8_times_n -> unit -> M (MemoryOpResult bool)*) val _ = Define ` ((phys_mem_write:write_kind ->(64)words$word -> int -> 'int8_times_n words$word -> unit ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (wk : write_kind) (paddr : xlenbits) (width : int) (data : 'int8_times_n words$word) (meta : mem_meta)= (let (_ : unit) = (rvfi_write paddr width data meta) in sail2_state_monad$bindS (write_ram wk paddr width data meta) (\ (w__0 : bool) . let result = (MemValue w__0) in let (_ : unit) = (if ((get_config_print_mem () )) then print_dbg ((STRCAT "mem[" ((STRCAT ((string_of_bits paddr)) ((STRCAT "] <- " ((string_of_bits data)))))))) else () ) in sail2_state_monad$returnS result)))`; (*val checked_mem_write : forall 'int8_times_n. Size 'int8_times_n => write_kind -> mword ty64 -> integer -> mword 'int8_times_n -> unit -> M (MemoryOpResult bool)*) val _ = Define ` ((checked_mem_write:write_kind ->(64)words$word -> int -> 'int8_times_n words$word -> unit ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (wk : write_kind) (paddr : xlenbits) (width : int) (data : 'int8_times_n words$word) (meta : mem_meta)= (if ((within_mmio_writable paddr width)) then mmio_write paddr width data else if ((within_phys_mem paddr width)) then (case ((ext_check_phys_mem_write wk paddr width data meta)) of Ext_PhysAddr_OK (() ) => phys_mem_write wk paddr width data meta | Ext_PhysAddr_Error (e) => sail2_state_monad$returnS (MemException e) ) else sail2_state_monad$returnS (MemException (E_SAMO_Access_Fault () ))))`; (*val pmp_mem_write : forall 'int8_times_n. Size 'int8_times_n => write_kind -> mword ty64 -> integer -> mword 'int8_times_n -> AccessType unit -> Privilege -> unit -> M (MemoryOpResult bool)*) val _ = Define ` ((pmp_mem_write:write_kind ->(64)words$word -> int -> 'int8_times_n words$word ->(ext_access_type)AccessType -> Privilege -> unit ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (wk : write_kind) (paddr : xlenbits) (width : int) (data : 'int8_times_n words$word) (typ : ext_access_type AccessType) (priv : Privilege) (meta : mem_meta)= (if ((~ ((plat_enable_pmp () )))) then checked_mem_write wk paddr width data meta else sail2_state_monad$bindS (pmpCheck paddr width typ priv) (\ (w__1 : ExceptionType option) . (case w__1 of NONE => checked_mem_write wk paddr width data meta | SOME (e) => sail2_state_monad$returnS (MemException e) ))))`; (*val mem_write_value_priv_meta : forall 'int8_times_n. Size 'int8_times_n => mword ty64 -> integer -> mword 'int8_times_n -> AccessType unit -> Privilege -> unit -> bool -> bool -> bool -> M (MemoryOpResult bool)*) val _ = Define ` ((mem_write_value_priv_meta:(64)words$word -> int -> 'int8_times_n words$word ->(unit)AccessType -> Privilege -> unit -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) paddr width value typ priv meta aq rl con= (let (_ : unit) = (rvfi_write paddr width value meta) in if ((((((rl \/ con))) /\ ((~ ((is_aligned_addr paddr width))))))) then sail2_state_monad$returnS (MemException (E_SAMO_Addr_Align () )) else sail2_state_monad$bindS (case (aq, rl, con) of (F, F, F) => sail2_state_monad$returnS Write_plain | (F, T, F) => sail2_state_monad$returnS Write_RISCV_release | (F, F, T) => sail2_state_monad$returnS Write_RISCV_conditional | (F, T, T) => sail2_state_monad$returnS Write_RISCV_conditional_release | (T, T, F) => sail2_state_monad$returnS Write_RISCV_strong_release | (T, T, T) => sail2_state_monad$returnS Write_RISCV_conditional_strong_release | (T, F, F) => sail2_state_monad$throwS (Error_not_implemented "store.aq") | (T, F, T) => sail2_state_monad$throwS (Error_not_implemented "sc.aq") ) (\ (wk : write_kind) . pmp_mem_write wk paddr width value typ priv meta)))`; (*val mem_write_value_priv : forall 'int8_times_n. Size 'int8_times_n => mword ty64 -> integer -> mword 'int8_times_n -> Privilege -> bool -> bool -> bool -> M (MemoryOpResult bool)*) val _ = Define ` ((mem_write_value_priv:(64)words$word -> int -> 'int8_times_n words$word -> Privilege -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) paddr width value priv aq rl con= (mem_write_value_priv_meta paddr width value (Write default_write_acc) priv default_meta aq rl con))`; (*val mem_write_value_meta : forall 'int8_times_n. Size 'int8_times_n => mword ty64 -> integer -> mword 'int8_times_n -> unit -> unit -> bool -> bool -> bool -> M (MemoryOpResult bool)*) val _ = Define ` ((mem_write_value_meta:(64)words$word -> int -> 'int8_times_n words$word -> unit -> unit -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) paddr width value ext_acc meta aq rl con= (let typ = (Write ext_acc) in sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__1 : Privilege) . sail2_state_monad$bindS (effectivePrivilege typ w__0 w__1) (\ ep . mem_write_value_priv_meta paddr width value typ ep meta aq rl con)))))`; (*val mem_write_value : forall 'int8_times_n. Size 'int8_times_n => mword ty64 -> integer -> mword 'int8_times_n -> bool -> bool -> bool -> M (MemoryOpResult bool)*) val _ = Define ` ((mem_write_value:(64)words$word -> int -> 'int8_times_n words$word -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->((((bool)MemoryOpResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) paddr width value aq rl con= (mem_write_value_meta paddr width value default_write_acc default_meta aq rl con))`; val _ = Define ` ((default_sv32_ext_pte:(10)words$word)= ((0b0000000000w : 10 words$word)))`; (*val Mk_PTE_Bits : mword ty8 -> PTE_Bits*) val _ = Define ` ((Mk_PTE_Bits:(8)words$word -> PTE_Bits) v= (<| PTE_Bits_PTE_Bits_chunk_0 := ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) |>))`; val _ = Define ` ((get_PTE_Bits_bits:PTE_Bits ->(8)words$word) v= ((subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)))`; val _ = Define ` ((set_PTE_Bits_bits:((regstate),(register_value),(PTE_Bits))register_ref ->(8)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec r.PTE_Bits_PTE_Bits_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_PTE_Bits_bits:PTE_Bits ->(8)words$word -> PTE_Bits) v x= (( v with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_PTE_Bits_D:PTE_Bits ->(1)words$word) v= ((subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_PTE_Bits_D:((regstate),(register_value),(PTE_Bits))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec r.PTE_Bits_PTE_Bits_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_PTE_Bits_D:PTE_Bits ->(1)words$word -> PTE_Bits) v x= (( v with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 7 : int):ii) (( 7 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_PTE_Bits_A:PTE_Bits ->(1)words$word) v= ((subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_PTE_Bits_A:((regstate),(register_value),(PTE_Bits))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec r.PTE_Bits_PTE_Bits_chunk_0 (( 6 : int):ii) (( 6 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_PTE_Bits_A:PTE_Bits ->(1)words$word -> PTE_Bits) v x= (( v with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 6 : int):ii) (( 6 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_PTE_Bits_G:PTE_Bits ->(1)words$word) v= ((subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_PTE_Bits_G:((regstate),(register_value),(PTE_Bits))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec r.PTE_Bits_PTE_Bits_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_PTE_Bits_G:PTE_Bits ->(1)words$word -> PTE_Bits) v x= (( v with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 5 : int):ii) (( 5 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_PTE_Bits_U:PTE_Bits ->(1)words$word) v= ((subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_PTE_Bits_U:((regstate),(register_value),(PTE_Bits))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec r.PTE_Bits_PTE_Bits_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_PTE_Bits_U:PTE_Bits ->(1)words$word -> PTE_Bits) v x= (( v with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 4 : int):ii) (( 4 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_PTE_Bits_X:PTE_Bits ->(1)words$word) v= ((subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_PTE_Bits_X:((regstate),(register_value),(PTE_Bits))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec r.PTE_Bits_PTE_Bits_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_PTE_Bits_X:PTE_Bits ->(1)words$word -> PTE_Bits) v x= (( v with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 3 : int):ii) (( 3 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_PTE_Bits_W:PTE_Bits ->(1)words$word) v= ((subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_PTE_Bits_W:((regstate),(register_value),(PTE_Bits))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec r.PTE_Bits_PTE_Bits_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_PTE_Bits_W:PTE_Bits ->(1)words$word -> PTE_Bits) v x= (( v with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 2 : int):ii) (( 2 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_PTE_Bits_R:PTE_Bits ->(1)words$word) v= ((subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_PTE_Bits_R:((regstate),(register_value),(PTE_Bits))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec r.PTE_Bits_PTE_Bits_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_PTE_Bits_R:PTE_Bits ->(1)words$word -> PTE_Bits) v x= (( v with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 1 : int):ii) (( 1 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; val _ = Define ` ((get_PTE_Bits_V:PTE_Bits ->(1)words$word) v= ((subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)))`; val _ = Define ` ((set_PTE_Bits_V:((regstate),(register_value),(PTE_Bits))register_ref ->(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec r.PTE_Bits_PTE_Bits_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_PTE_Bits_V:PTE_Bits ->(1)words$word -> PTE_Bits) v x= (( v with<| PTE_Bits_PTE_Bits_chunk_0 := ((update_subrange_vec_dec v.PTE_Bits_PTE_Bits_chunk_0 (( 0 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) : 8 words$word)) |>)))`; (*val isPTEPtr : mword ty8 -> mword ty10 -> bool*) val _ = Define ` ((isPTEPtr:(8)words$word ->(10)words$word -> bool) (p : pteAttribs) (ext : extPte)= (let a = (Mk_PTE_Bits p) in ((((((get_PTE_Bits_R a : 1 words$word)) = (0b0w : 1 words$word)))) /\ ((((((((get_PTE_Bits_W a : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((get_PTE_Bits_X a : 1 words$word)) = (0b0w : 1 words$word))))))))))`; (*val isInvalidPTE : mword ty8 -> mword ty10 -> bool*) val _ = Define ` ((isInvalidPTE:(8)words$word ->(10)words$word -> bool) (p : pteAttribs) (ext : extPte)= (let a = (Mk_PTE_Bits p) in ((((((get_PTE_Bits_V a : 1 words$word)) = (0b0w : 1 words$word)))) \/ ((((((((get_PTE_Bits_W a : 1 words$word)) = (0b1w : 1 words$word)))) /\ (((((get_PTE_Bits_R a : 1 words$word)) = (0b0w : 1 words$word))))))))))`; (*val to_pte_check : bool -> PTE_Check*) val _ = Define ` ((to_pte_check:bool -> PTE_Check) b= (if b then PTE_Check_Success () else PTE_Check_Failure (() , () )))`; (*val checkPTEPermission : AccessType unit -> Privilege -> bool -> bool -> PTE_Bits -> mword ty10 -> unit -> M PTE_Check*) val _ = Define ` ((checkPTEPermission:(ext_access_type)AccessType -> Privilege -> bool -> bool -> PTE_Bits ->(10)words$word -> unit ->(regstate)sail2_state_monad$sequential_state ->(((PTE_Check),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (ac : ext_access_type AccessType) (priv : Privilege) (mxr : bool) (do_sum : bool) (p : PTE_Bits) (ext : extPte) (ext_ptw : ext_ptw)= ((case (ac, priv) of (Read (_), User) => sail2_state_monad$returnS ((to_pte_check ((((((((get_PTE_Bits_U p : 1 words$word)) = (0b1w : 1 words$word)))) /\ ((((((((get_PTE_Bits_R p : 1 words$word)) = (0b1w : 1 words$word)))) \/ ((((((((get_PTE_Bits_X p : 1 words$word)) = (0b1w : 1 words$word)))) /\ mxr))))))))))) | (Write (_), User) => sail2_state_monad$returnS ((to_pte_check ((((((((get_PTE_Bits_U p : 1 words$word)) = (0b1w : 1 words$word)))) /\ (((((get_PTE_Bits_W p : 1 words$word)) = (0b1w : 1 words$word))))))))) | (ReadWrite ((_, _)), User) => sail2_state_monad$returnS ((to_pte_check ((((((((get_PTE_Bits_U p : 1 words$word)) = (0b1w : 1 words$word)))) /\ ((((((((get_PTE_Bits_W p : 1 words$word)) = (0b1w : 1 words$word)))) /\ ((((((((get_PTE_Bits_R p : 1 words$word)) = (0b1w : 1 words$word)))) \/ ((((((((get_PTE_Bits_X p : 1 words$word)) = (0b1w : 1 words$word)))) /\ mxr)))))))))))))) | (Execute (() ), User) => sail2_state_monad$returnS ((to_pte_check ((((((((get_PTE_Bits_U p : 1 words$word)) = (0b1w : 1 words$word)))) /\ (((((get_PTE_Bits_X p : 1 words$word)) = (0b1w : 1 words$word))))))))) | (Read (_), Supervisor) => sail2_state_monad$returnS ((to_pte_check (((((((((((get_PTE_Bits_U p : 1 words$word)) = (0b0w : 1 words$word)))) \/ do_sum))) /\ ((((((((get_PTE_Bits_R p : 1 words$word)) = (0b1w : 1 words$word)))) \/ ((((((((get_PTE_Bits_X p : 1 words$word)) = (0b1w : 1 words$word)))) /\ mxr))))))))))) | (Write (_), Supervisor) => sail2_state_monad$returnS ((to_pte_check (((((((((((get_PTE_Bits_U p : 1 words$word)) = (0b0w : 1 words$word)))) \/ do_sum))) /\ (((((get_PTE_Bits_W p : 1 words$word)) = (0b1w : 1 words$word))))))))) | (ReadWrite ((_, _)), Supervisor) => sail2_state_monad$returnS ((to_pte_check (((((((((((get_PTE_Bits_U p : 1 words$word)) = (0b0w : 1 words$word)))) \/ do_sum))) /\ ((((((((get_PTE_Bits_W p : 1 words$word)) = (0b1w : 1 words$word)))) /\ ((((((((get_PTE_Bits_R p : 1 words$word)) = (0b1w : 1 words$word)))) \/ ((((((((get_PTE_Bits_X p : 1 words$word)) = (0b1w : 1 words$word)))) /\ mxr)))))))))))))) | (Execute (() ), Supervisor) => sail2_state_monad$returnS ((to_pte_check ((((((((get_PTE_Bits_U p : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((get_PTE_Bits_X p : 1 words$word)) = (0b1w : 1 words$word))))))))) | (_, Machine) => internal_error "m-mode mem perm check" )))`; (*val update_PTE_Bits : PTE_Bits -> AccessType unit -> mword ty10 -> maybe ((PTE_Bits * mword ty10))*) val _ = Define ` ((update_PTE_Bits:PTE_Bits ->(ext_access_type)AccessType ->(10)words$word ->(PTE_Bits#(10)words$word)option) (p : PTE_Bits) (a : ext_access_type AccessType) (ext : extPte)= (let update_d = ((((((get_PTE_Bits_D p : 1 words$word)) = (0b0w : 1 words$word)))) /\ ((case a of Execute (() ) => F | Read (() ) => F | Write (_) => T | ReadWrite ((_, _)) => T ))) in let update_a = (((get_PTE_Bits_A p : 1 words$word)) = (0b0w : 1 words$word)) in if (((update_d \/ update_a))) then let np = (update_PTE_Bits_A p (0b1w : 1 words$word)) in let np = (if update_d then update_PTE_Bits_D np (0b1w : 1 words$word) else np) in SOME (np, ext) else NONE))`; val _ = Define ` ((ptw_error_to_str:PTW_Error -> string) e= ((case e of PTW_Invalid_Addr (() ) => "invalid-source-addr" | PTW_Access (() ) => "mem-access-error" | PTW_Invalid_PTE (() ) => "invalid-pte" | PTW_No_Permission (() ) => "no-permission" | PTW_Misaligned (() ) => "misaligned-superpage" | PTW_PTE_Update (() ) => "pte-update-needed" | PTW_Ext_Error (e) => "extension-error" )))`; (*val ext_get_ptw_error : unit -> PTW_Error*) val _ = Define ` ((ext_get_ptw_error:unit -> PTW_Error) eptwf= (PTW_No_Permission () ))`; (*val translationException : AccessType unit -> PTW_Error -> ExceptionType*) val _ = Define ` ((translationException:(ext_access_type)AccessType -> PTW_Error -> ExceptionType) (a : ext_access_type AccessType) (f : PTW_Error)= ((case (a, f) of (_, PTW_Ext_Error (e)) => E_Extension ((ext_translate_exception e)) | (ReadWrite (_), PTW_Access (() )) => E_SAMO_Access_Fault () | (ReadWrite (_), _) => E_SAMO_Page_Fault () | (Read (_), PTW_Access (() )) => E_Load_Access_Fault () | (Read (_), _) => E_Load_Page_Fault () | (Write (_), PTW_Access (() )) => E_SAMO_Access_Fault () | (Write (_), _) => E_SAMO_Page_Fault () | (Execute (() ), PTW_Access (() )) => E_Fetch_Access_Fault () | (Execute (() ), _) => E_Fetch_Page_Fault () )))`; val _ = Define ` ((PAGESIZE_BITS:int)= ((( 12 : int):ii)))`; (*val curAsid32 : mword ty32 -> mword ty9*) val _ = Define ` ((curAsid32:(32)words$word ->(9)words$word) satp= (let s = (Mk_Satp32 satp) in (get_Satp32_Asid s : 9 words$word)))`; (*val curPTB32 : mword ty32 -> mword ty34*) val _ = Define ` ((curPTB32:(32)words$word ->(34)words$word) satp= (let (s : Satp32) = (Mk_Satp32 satp) in (shiftl ((EXTZ (( 34 : int):ii) ((get_Satp32_PPN s : 22 words$word)) : 34 words$word)) PAGESIZE_BITS : 34 words$word)))`; val _ = Define ` ((SV32_LEVEL_BITS:int)= ((( 10 : int):ii)))`; val _ = Define ` ((SV32_LEVELS:int)= ((( 2 : int):ii)))`; val _ = Define ` ((PTE32_LOG_SIZE:int)= ((( 2 : int):ii)))`; val _ = Define ` ((PTE32_SIZE:int)= ((( 4 : int):ii)))`; (*val Mk_SV32_Vaddr : mword ty32 -> SV32_Vaddr*) val _ = Define ` ((Mk_SV32_Vaddr:(32)words$word -> SV32_Vaddr) v= (<| SV32_Vaddr_SV32_Vaddr_chunk_0 := ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) |>))`; val _ = Define ` ((get_SV32_Vaddr_bits:SV32_Vaddr ->(32)words$word) v= ((subrange_vec_dec v.SV32_Vaddr_SV32_Vaddr_chunk_0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)))`; val _ = Define ` ((set_SV32_Vaddr_bits:((regstate),(register_value),(SV32_Vaddr))register_ref ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_Vaddr_SV32_Vaddr_chunk_0 := ((update_subrange_vec_dec r.SV32_Vaddr_SV32_Vaddr_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV32_Vaddr_bits:SV32_Vaddr ->(32)words$word -> SV32_Vaddr) v x= (( v with<| SV32_Vaddr_SV32_Vaddr_chunk_0 := ((update_subrange_vec_dec v.SV32_Vaddr_SV32_Vaddr_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)))`; (*val _get_SV32_Vaddr_VPNi : SV32_Vaddr -> mword ty20*) val _ = Define ` ((get_SV32_Vaddr_VPNi:SV32_Vaddr ->(20)words$word) v= ((subrange_vec_dec v.SV32_Vaddr_SV32_Vaddr_chunk_0 (( 31 : int):ii) (( 12 : int):ii) : 20 words$word)))`; (*val _set_SV32_Vaddr_VPNi : register_ref regstate register_value SV32_Vaddr -> mword ty20 -> M unit*) val _ = Define ` ((set_SV32_Vaddr_VPNi:((regstate),(register_value),(SV32_Vaddr))register_ref ->(20)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_Vaddr_SV32_Vaddr_chunk_0 := ((update_subrange_vec_dec r.SV32_Vaddr_SV32_Vaddr_chunk_0 (( 31 : int):ii) (( 12 : int):ii) ((subrange_vec_dec v (( 19 : int):ii) (( 0 : int):ii) : 20 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_SV32_Vaddr_VPNi : SV32_Vaddr -> mword ty20 -> SV32_Vaddr*) val _ = Define ` ((update_SV32_Vaddr_VPNi:SV32_Vaddr ->(20)words$word -> SV32_Vaddr) v x= (( v with<| SV32_Vaddr_SV32_Vaddr_chunk_0 := ((update_subrange_vec_dec v.SV32_Vaddr_SV32_Vaddr_chunk_0 (( 31 : int):ii) (( 12 : int):ii) ((subrange_vec_dec x (( 19 : int):ii) (( 0 : int):ii) : 20 words$word)) : 32 words$word)) |>)))`; (*val _update_SV39_Vaddr_VPNi : SV39_Vaddr -> mword ty27 -> SV39_Vaddr*) (*val _update_SV48_Vaddr_VPNi : SV48_Vaddr -> mword ty27 -> SV48_Vaddr*) (*val _get_SV39_Vaddr_VPNi : SV39_Vaddr -> mword ty27*) (*val _get_SV48_Vaddr_VPNi : SV48_Vaddr -> mword ty27*) (*val _set_SV39_Vaddr_VPNi : register_ref regstate register_value SV39_Vaddr -> mword ty27 -> M unit*) (*val _set_SV48_Vaddr_VPNi : register_ref regstate register_value SV48_Vaddr -> mword ty27 -> M unit*) (*val _get_SV32_Vaddr_PgOfs : SV32_Vaddr -> mword ty12*) val _ = Define ` ((get_SV32_Vaddr_PgOfs:SV32_Vaddr ->(12)words$word) v= ((subrange_vec_dec v.SV32_Vaddr_SV32_Vaddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)))`; (*val _set_SV32_Vaddr_PgOfs : register_ref regstate register_value SV32_Vaddr -> mword ty12 -> M unit*) val _ = Define ` ((set_SV32_Vaddr_PgOfs:((regstate),(register_value),(SV32_Vaddr))register_ref ->(12)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_Vaddr_SV32_Vaddr_chunk_0 := ((update_subrange_vec_dec r.SV32_Vaddr_SV32_Vaddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_SV32_Vaddr_PgOfs : SV32_Vaddr -> mword ty12 -> SV32_Vaddr*) val _ = Define ` ((update_SV32_Vaddr_PgOfs:SV32_Vaddr ->(12)words$word -> SV32_Vaddr) v x= (( v with<| SV32_Vaddr_SV32_Vaddr_chunk_0 := ((update_subrange_vec_dec v.SV32_Vaddr_SV32_Vaddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 32 words$word)) |>)))`; (*val _update_SV32_Paddr_PgOfs : SV32_Paddr -> mword ty12 -> SV32_Paddr*) (*val _update_SV39_Paddr_PgOfs : SV39_Paddr -> mword ty12 -> SV39_Paddr*) (*val _update_SV39_Vaddr_PgOfs : SV39_Vaddr -> mword ty12 -> SV39_Vaddr*) (*val _update_SV48_Paddr_PgOfs : SV48_Paddr -> mword ty12 -> SV48_Paddr*) (*val _update_SV48_Vaddr_PgOfs : SV48_Vaddr -> mword ty12 -> SV48_Vaddr*) (*val _get_SV32_Paddr_PgOfs : SV32_Paddr -> mword ty12*) (*val _get_SV39_Paddr_PgOfs : SV39_Paddr -> mword ty12*) (*val _get_SV39_Vaddr_PgOfs : SV39_Vaddr -> mword ty12*) (*val _get_SV48_Paddr_PgOfs : SV48_Paddr -> mword ty12*) (*val _get_SV48_Vaddr_PgOfs : SV48_Vaddr -> mword ty12*) (*val _set_SV32_Paddr_PgOfs : register_ref regstate register_value SV32_Paddr -> mword ty12 -> M unit*) (*val _set_SV39_Paddr_PgOfs : register_ref regstate register_value SV39_Paddr -> mword ty12 -> M unit*) (*val _set_SV39_Vaddr_PgOfs : register_ref regstate register_value SV39_Vaddr -> mword ty12 -> M unit*) (*val _set_SV48_Paddr_PgOfs : register_ref regstate register_value SV48_Paddr -> mword ty12 -> M unit*) (*val _set_SV48_Vaddr_PgOfs : register_ref regstate register_value SV48_Vaddr -> mword ty12 -> M unit*) (*val Mk_SV32_Paddr : mword ty34 -> SV32_Paddr*) val _ = Define ` ((Mk_SV32_Paddr:(34)words$word -> SV32_Paddr) v= (<| SV32_Paddr_SV32_Paddr_chunk_0 := ((subrange_vec_dec v (( 33 : int):ii) (( 0 : int):ii) : 34 words$word)) |>))`; val _ = Define ` ((get_SV32_Paddr_bits:SV32_Paddr ->(34)words$word) v= ((subrange_vec_dec v.SV32_Paddr_SV32_Paddr_chunk_0 (( 33 : int):ii) (( 0 : int):ii) : 34 words$word)))`; val _ = Define ` ((set_SV32_Paddr_bits:((regstate),(register_value),(SV32_Paddr))register_ref ->(34)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_Paddr_SV32_Paddr_chunk_0 := ((update_subrange_vec_dec r.SV32_Paddr_SV32_Paddr_chunk_0 (( 33 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 33 : int):ii) (( 0 : int):ii) : 34 words$word)) : 34 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV32_Paddr_bits:SV32_Paddr ->(34)words$word -> SV32_Paddr) v x= (( v with<| SV32_Paddr_SV32_Paddr_chunk_0 := ((update_subrange_vec_dec v.SV32_Paddr_SV32_Paddr_chunk_0 (( 33 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 33 : int):ii) (( 0 : int):ii) : 34 words$word)) : 34 words$word)) |>)))`; (*val _get_SV32_Paddr_PPNi : SV32_Paddr -> mword ty22*) val _ = Define ` ((get_SV32_Paddr_PPNi:SV32_Paddr ->(22)words$word) v= ((subrange_vec_dec v.SV32_Paddr_SV32_Paddr_chunk_0 (( 33 : int):ii) (( 12 : int):ii) : 22 words$word)))`; (*val _set_SV32_Paddr_PPNi : register_ref regstate register_value SV32_Paddr -> mword ty22 -> M unit*) val _ = Define ` ((set_SV32_Paddr_PPNi:((regstate),(register_value),(SV32_Paddr))register_ref ->(22)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_Paddr_SV32_Paddr_chunk_0 := ((update_subrange_vec_dec r.SV32_Paddr_SV32_Paddr_chunk_0 (( 33 : int):ii) (( 12 : int):ii) ((subrange_vec_dec v (( 21 : int):ii) (( 0 : int):ii) : 22 words$word)) : 34 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_SV32_Paddr_PPNi : SV32_Paddr -> mword ty22 -> SV32_Paddr*) val _ = Define ` ((update_SV32_Paddr_PPNi:SV32_Paddr ->(22)words$word -> SV32_Paddr) v x= (( v with<| SV32_Paddr_SV32_Paddr_chunk_0 := ((update_subrange_vec_dec v.SV32_Paddr_SV32_Paddr_chunk_0 (( 33 : int):ii) (( 12 : int):ii) ((subrange_vec_dec x (( 21 : int):ii) (( 0 : int):ii) : 22 words$word)) : 34 words$word)) |>)))`; (*val _update_SV32_PTE_PPNi : SV32_PTE -> mword ty22 -> SV32_PTE*) (*val _update_SV39_PTE_PPNi : SV39_PTE -> mword ty44 -> SV39_PTE*) (*val _update_SV39_Paddr_PPNi : SV39_Paddr -> mword ty44 -> SV39_Paddr*) (*val _update_SV48_PTE_PPNi : SV48_PTE -> mword ty44 -> SV48_PTE*) (*val _update_SV48_Paddr_PPNi : SV48_Paddr -> mword ty44 -> SV48_Paddr*) (*val _get_SV32_PTE_PPNi : SV32_PTE -> mword ty22*) (*val _get_SV39_PTE_PPNi : SV39_PTE -> mword ty44*) (*val _get_SV39_Paddr_PPNi : SV39_Paddr -> mword ty44*) (*val _get_SV48_PTE_PPNi : SV48_PTE -> mword ty44*) (*val _get_SV48_Paddr_PPNi : SV48_Paddr -> mword ty44*) (*val _set_SV32_PTE_PPNi : register_ref regstate register_value SV32_PTE -> mword ty22 -> M unit*) (*val _set_SV39_PTE_PPNi : register_ref regstate register_value SV39_PTE -> mword ty44 -> M unit*) (*val _set_SV39_Paddr_PPNi : register_ref regstate register_value SV39_Paddr -> mword ty44 -> M unit*) (*val _set_SV48_PTE_PPNi : register_ref regstate register_value SV48_PTE -> mword ty44 -> M unit*) (*val _set_SV48_Paddr_PPNi : register_ref regstate register_value SV48_Paddr -> mword ty44 -> M unit*) val _ = Define ` ((get_SV32_Paddr_PgOfs:SV32_Paddr ->(12)words$word) v= ((subrange_vec_dec v.SV32_Paddr_SV32_Paddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)))`; val _ = Define ` ((set_SV32_Paddr_PgOfs:((regstate),(register_value),(SV32_Paddr))register_ref ->(12)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_Paddr_SV32_Paddr_chunk_0 := ((update_subrange_vec_dec r.SV32_Paddr_SV32_Paddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 34 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV32_Paddr_PgOfs:SV32_Paddr ->(12)words$word -> SV32_Paddr) v x= (( v with<| SV32_Paddr_SV32_Paddr_chunk_0 := ((update_subrange_vec_dec v.SV32_Paddr_SV32_Paddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 34 words$word)) |>)))`; (*val Mk_SV32_PTE : mword ty32 -> SV32_PTE*) val _ = Define ` ((Mk_SV32_PTE:(32)words$word -> SV32_PTE) v= (<| SV32_PTE_SV32_PTE_chunk_0 := ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) |>))`; val _ = Define ` ((get_SV32_PTE_bits:SV32_PTE ->(32)words$word) v= ((subrange_vec_dec v.SV32_PTE_SV32_PTE_chunk_0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)))`; val _ = Define ` ((set_SV32_PTE_bits:((regstate),(register_value),(SV32_PTE))register_ref ->(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_PTE_SV32_PTE_chunk_0 := ((update_subrange_vec_dec r.SV32_PTE_SV32_PTE_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV32_PTE_bits:SV32_PTE ->(32)words$word -> SV32_PTE) v x= (( v with<| SV32_PTE_SV32_PTE_chunk_0 := ((update_subrange_vec_dec v.SV32_PTE_SV32_PTE_chunk_0 (( 31 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 32 words$word)) |>)))`; val _ = Define ` ((get_SV32_PTE_PPNi:SV32_PTE ->(22)words$word) v= ((subrange_vec_dec v.SV32_PTE_SV32_PTE_chunk_0 (( 31 : int):ii) (( 10 : int):ii) : 22 words$word)))`; val _ = Define ` ((set_SV32_PTE_PPNi:((regstate),(register_value),(SV32_PTE))register_ref ->(22)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_PTE_SV32_PTE_chunk_0 := ((update_subrange_vec_dec r.SV32_PTE_SV32_PTE_chunk_0 (( 31 : int):ii) (( 10 : int):ii) ((subrange_vec_dec v (( 21 : int):ii) (( 0 : int):ii) : 22 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV32_PTE_PPNi:SV32_PTE ->(22)words$word -> SV32_PTE) v x= (( v with<| SV32_PTE_SV32_PTE_chunk_0 := ((update_subrange_vec_dec v.SV32_PTE_SV32_PTE_chunk_0 (( 31 : int):ii) (( 10 : int):ii) ((subrange_vec_dec x (( 21 : int):ii) (( 0 : int):ii) : 22 words$word)) : 32 words$word)) |>)))`; (*val _get_SV32_PTE_RSW : SV32_PTE -> mword ty2*) val _ = Define ` ((get_SV32_PTE_RSW:SV32_PTE ->(2)words$word) v= ((subrange_vec_dec v.SV32_PTE_SV32_PTE_chunk_0 (( 9 : int):ii) (( 8 : int):ii) : 2 words$word)))`; (*val _set_SV32_PTE_RSW : register_ref regstate register_value SV32_PTE -> mword ty2 -> M unit*) val _ = Define ` ((set_SV32_PTE_RSW:((regstate),(register_value),(SV32_PTE))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_PTE_SV32_PTE_chunk_0 := ((update_subrange_vec_dec r.SV32_PTE_SV32_PTE_chunk_0 (( 9 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_SV32_PTE_RSW : SV32_PTE -> mword ty2 -> SV32_PTE*) val _ = Define ` ((update_SV32_PTE_RSW:SV32_PTE ->(2)words$word -> SV32_PTE) v x= (( v with<| SV32_PTE_SV32_PTE_chunk_0 := ((update_subrange_vec_dec v.SV32_PTE_SV32_PTE_chunk_0 (( 9 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 32 words$word)) |>)))`; (*val _update_SV39_PTE_RSW : SV39_PTE -> mword ty2 -> SV39_PTE*) (*val _update_SV48_PTE_RSW : SV48_PTE -> mword ty2 -> SV48_PTE*) (*val _get_SV39_PTE_RSW : SV39_PTE -> mword ty2*) (*val _get_SV48_PTE_RSW : SV48_PTE -> mword ty2*) (*val _set_SV39_PTE_RSW : register_ref regstate register_value SV39_PTE -> mword ty2 -> M unit*) (*val _set_SV48_PTE_RSW : register_ref regstate register_value SV48_PTE -> mword ty2 -> M unit*) (*val _get_SV32_PTE_BITS : SV32_PTE -> mword ty8*) val _ = Define ` ((get_SV32_PTE_BITS:SV32_PTE ->(8)words$word) v= ((subrange_vec_dec v.SV32_PTE_SV32_PTE_chunk_0 (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)))`; (*val _set_SV32_PTE_BITS : register_ref regstate register_value SV32_PTE -> mword ty8 -> M unit*) val _ = Define ` ((set_SV32_PTE_BITS:((regstate),(register_value),(SV32_PTE))register_ref ->(8)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV32_PTE_SV32_PTE_chunk_0 := ((update_subrange_vec_dec r.SV32_PTE_SV32_PTE_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 32 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_SV32_PTE_BITS : SV32_PTE -> mword ty8 -> SV32_PTE*) val _ = Define ` ((update_SV32_PTE_BITS:SV32_PTE ->(8)words$word -> SV32_PTE) v x= (( v with<| SV32_PTE_SV32_PTE_chunk_0 := ((update_subrange_vec_dec v.SV32_PTE_SV32_PTE_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 32 words$word)) |>)))`; (*val _update_SV39_PTE_BITS : SV39_PTE -> mword ty8 -> SV39_PTE*) (*val _update_SV48_PTE_BITS : SV48_PTE -> mword ty8 -> SV48_PTE*) (*val _get_SV39_PTE_BITS : SV39_PTE -> mword ty8*) (*val _get_SV48_PTE_BITS : SV48_PTE -> mword ty8*) (*val _set_SV39_PTE_BITS : register_ref regstate register_value SV39_PTE -> mword ty8 -> M unit*) (*val _set_SV48_PTE_BITS : register_ref regstate register_value SV48_PTE -> mword ty8 -> M unit*) (*val curAsid64 : mword ty64 -> mword ty16*) val _ = Define ` ((curAsid64:(64)words$word ->(16)words$word) satp= (let s = (Mk_Satp64 satp) in (get_Satp64_Asid s : 16 words$word)))`; (*val curPTB64 : mword ty64 -> mword ty56*) val _ = Define ` ((curPTB64:(64)words$word ->(56)words$word) satp= (let s = (Mk_Satp64 satp) in (shiftl ((EXTZ (( 56 : int):ii) ((get_Satp64_PPN s : 44 words$word)) : 56 words$word)) PAGESIZE_BITS : 56 words$word)))`; val _ = Define ` ((SV39_LEVEL_BITS:int)= ((( 9 : int):ii)))`; val _ = Define ` ((SV39_LEVELS:int)= ((( 3 : int):ii)))`; val _ = Define ` ((PTE39_LOG_SIZE:int)= ((( 3 : int):ii)))`; val _ = Define ` ((PTE39_SIZE:int)= ((( 8 : int):ii)))`; (*val Mk_SV39_Vaddr : mword ty39 -> SV39_Vaddr*) val _ = Define ` ((Mk_SV39_Vaddr:(39)words$word -> SV39_Vaddr) v= (<| SV39_Vaddr_SV39_Vaddr_chunk_0 := ((subrange_vec_dec v (( 38 : int):ii) (( 0 : int):ii) : 39 words$word)) |>))`; val _ = Define ` ((get_SV39_Vaddr_bits:SV39_Vaddr ->(39)words$word) v= ((subrange_vec_dec v.SV39_Vaddr_SV39_Vaddr_chunk_0 (( 38 : int):ii) (( 0 : int):ii) : 39 words$word)))`; val _ = Define ` ((set_SV39_Vaddr_bits:((regstate),(register_value),(SV39_Vaddr))register_ref ->(39)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_Vaddr_SV39_Vaddr_chunk_0 := ((update_subrange_vec_dec r.SV39_Vaddr_SV39_Vaddr_chunk_0 (( 38 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 38 : int):ii) (( 0 : int):ii) : 39 words$word)) : 39 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_Vaddr_bits:SV39_Vaddr ->(39)words$word -> SV39_Vaddr) v x= (( v with<| SV39_Vaddr_SV39_Vaddr_chunk_0 := ((update_subrange_vec_dec v.SV39_Vaddr_SV39_Vaddr_chunk_0 (( 38 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 38 : int):ii) (( 0 : int):ii) : 39 words$word)) : 39 words$word)) |>)))`; val _ = Define ` ((get_SV39_Vaddr_VPNi:SV39_Vaddr ->(27)words$word) v= ((subrange_vec_dec v.SV39_Vaddr_SV39_Vaddr_chunk_0 (( 38 : int):ii) (( 12 : int):ii) : 27 words$word)))`; val _ = Define ` ((set_SV39_Vaddr_VPNi:((regstate),(register_value),(SV39_Vaddr))register_ref ->(27)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_Vaddr_SV39_Vaddr_chunk_0 := ((update_subrange_vec_dec r.SV39_Vaddr_SV39_Vaddr_chunk_0 (( 38 : int):ii) (( 12 : int):ii) ((subrange_vec_dec v (( 26 : int):ii) (( 0 : int):ii) : 27 words$word)) : 39 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_Vaddr_VPNi:SV39_Vaddr ->(27)words$word -> SV39_Vaddr) v x= (( v with<| SV39_Vaddr_SV39_Vaddr_chunk_0 := ((update_subrange_vec_dec v.SV39_Vaddr_SV39_Vaddr_chunk_0 (( 38 : int):ii) (( 12 : int):ii) ((subrange_vec_dec x (( 26 : int):ii) (( 0 : int):ii) : 27 words$word)) : 39 words$word)) |>)))`; val _ = Define ` ((get_SV39_Vaddr_PgOfs:SV39_Vaddr ->(12)words$word) v= ((subrange_vec_dec v.SV39_Vaddr_SV39_Vaddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)))`; val _ = Define ` ((set_SV39_Vaddr_PgOfs:((regstate),(register_value),(SV39_Vaddr))register_ref ->(12)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_Vaddr_SV39_Vaddr_chunk_0 := ((update_subrange_vec_dec r.SV39_Vaddr_SV39_Vaddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 39 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_Vaddr_PgOfs:SV39_Vaddr ->(12)words$word -> SV39_Vaddr) v x= (( v with<| SV39_Vaddr_SV39_Vaddr_chunk_0 := ((update_subrange_vec_dec v.SV39_Vaddr_SV39_Vaddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 39 words$word)) |>)))`; (*val Mk_SV39_Paddr : mword ty56 -> SV39_Paddr*) val _ = Define ` ((Mk_SV39_Paddr:(56)words$word -> SV39_Paddr) v= (<| SV39_Paddr_SV39_Paddr_chunk_0 := ((subrange_vec_dec v (( 55 : int):ii) (( 0 : int):ii) : 56 words$word)) |>))`; val _ = Define ` ((get_SV39_Paddr_bits:SV39_Paddr ->(56)words$word) v= ((subrange_vec_dec v.SV39_Paddr_SV39_Paddr_chunk_0 (( 55 : int):ii) (( 0 : int):ii) : 56 words$word)))`; val _ = Define ` ((set_SV39_Paddr_bits:((regstate),(register_value),(SV39_Paddr))register_ref ->(56)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_Paddr_SV39_Paddr_chunk_0 := ((update_subrange_vec_dec r.SV39_Paddr_SV39_Paddr_chunk_0 (( 55 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 55 : int):ii) (( 0 : int):ii) : 56 words$word)) : 56 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_Paddr_bits:SV39_Paddr ->(56)words$word -> SV39_Paddr) v x= (( v with<| SV39_Paddr_SV39_Paddr_chunk_0 := ((update_subrange_vec_dec v.SV39_Paddr_SV39_Paddr_chunk_0 (( 55 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 55 : int):ii) (( 0 : int):ii) : 56 words$word)) : 56 words$word)) |>)))`; val _ = Define ` ((get_SV39_Paddr_PPNi:SV39_Paddr ->(44)words$word) v= ((subrange_vec_dec v.SV39_Paddr_SV39_Paddr_chunk_0 (( 55 : int):ii) (( 12 : int):ii) : 44 words$word)))`; val _ = Define ` ((set_SV39_Paddr_PPNi:((regstate),(register_value),(SV39_Paddr))register_ref ->(44)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_Paddr_SV39_Paddr_chunk_0 := ((update_subrange_vec_dec r.SV39_Paddr_SV39_Paddr_chunk_0 (( 55 : int):ii) (( 12 : int):ii) ((subrange_vec_dec v (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 56 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_Paddr_PPNi:SV39_Paddr ->(44)words$word -> SV39_Paddr) v x= (( v with<| SV39_Paddr_SV39_Paddr_chunk_0 := ((update_subrange_vec_dec v.SV39_Paddr_SV39_Paddr_chunk_0 (( 55 : int):ii) (( 12 : int):ii) ((subrange_vec_dec x (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 56 words$word)) |>)))`; val _ = Define ` ((get_SV39_Paddr_PgOfs:SV39_Paddr ->(12)words$word) v= ((subrange_vec_dec v.SV39_Paddr_SV39_Paddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)))`; val _ = Define ` ((set_SV39_Paddr_PgOfs:((regstate),(register_value),(SV39_Paddr))register_ref ->(12)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_Paddr_SV39_Paddr_chunk_0 := ((update_subrange_vec_dec r.SV39_Paddr_SV39_Paddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 56 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_Paddr_PgOfs:SV39_Paddr ->(12)words$word -> SV39_Paddr) v x= (( v with<| SV39_Paddr_SV39_Paddr_chunk_0 := ((update_subrange_vec_dec v.SV39_Paddr_SV39_Paddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 56 words$word)) |>)))`; (*val Mk_SV39_PTE : mword ty64 -> SV39_PTE*) val _ = Define ` ((Mk_SV39_PTE:(64)words$word -> SV39_PTE) v= (<| SV39_PTE_SV39_PTE_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_SV39_PTE_bits:SV39_PTE ->(64)words$word) v= ((subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_SV39_PTE_bits:((regstate),(register_value),(SV39_PTE))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec r.SV39_PTE_SV39_PTE_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_PTE_bits:SV39_PTE ->(64)words$word -> SV39_PTE) v x= (( v with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; (*val _get_SV39_PTE_Ext : SV39_PTE -> mword ty10*) val _ = Define ` ((get_SV39_PTE_Ext:SV39_PTE ->(10)words$word) v= ((subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 63 : int):ii) (( 54 : int):ii) : 10 words$word)))`; (*val _set_SV39_PTE_Ext : register_ref regstate register_value SV39_PTE -> mword ty10 -> M unit*) val _ = Define ` ((set_SV39_PTE_Ext:((regstate),(register_value),(SV39_PTE))register_ref ->(10)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec r.SV39_PTE_SV39_PTE_chunk_0 (( 63 : int):ii) (( 54 : int):ii) ((subrange_vec_dec v (( 9 : int):ii) (( 0 : int):ii) : 10 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; (*val _update_SV39_PTE_Ext : SV39_PTE -> mword ty10 -> SV39_PTE*) val _ = Define ` ((update_SV39_PTE_Ext:SV39_PTE ->(10)words$word -> SV39_PTE) v x= (( v with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 63 : int):ii) (( 54 : int):ii) ((subrange_vec_dec x (( 9 : int):ii) (( 0 : int):ii) : 10 words$word)) : 64 words$word)) |>)))`; (*val _update_SV48_PTE_Ext : SV48_PTE -> mword ty10 -> SV48_PTE*) (*val _get_SV48_PTE_Ext : SV48_PTE -> mword ty10*) (*val _set_SV48_PTE_Ext : register_ref regstate register_value SV48_PTE -> mword ty10 -> M unit*) val _ = Define ` ((get_SV39_PTE_PPNi:SV39_PTE ->(44)words$word) v= ((subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 53 : int):ii) (( 10 : int):ii) : 44 words$word)))`; val _ = Define ` ((set_SV39_PTE_PPNi:((regstate),(register_value),(SV39_PTE))register_ref ->(44)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec r.SV39_PTE_SV39_PTE_chunk_0 (( 53 : int):ii) (( 10 : int):ii) ((subrange_vec_dec v (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_PTE_PPNi:SV39_PTE ->(44)words$word -> SV39_PTE) v x= (( v with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 53 : int):ii) (( 10 : int):ii) ((subrange_vec_dec x (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_SV39_PTE_RSW:SV39_PTE ->(2)words$word) v= ((subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 9 : int):ii) (( 8 : int):ii) : 2 words$word)))`; val _ = Define ` ((set_SV39_PTE_RSW:((regstate),(register_value),(SV39_PTE))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec r.SV39_PTE_SV39_PTE_chunk_0 (( 9 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_PTE_RSW:SV39_PTE ->(2)words$word -> SV39_PTE) v x= (( v with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 9 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_SV39_PTE_BITS:SV39_PTE ->(8)words$word) v= ((subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)))`; val _ = Define ` ((set_SV39_PTE_BITS:((regstate),(register_value),(SV39_PTE))register_ref ->(8)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec r.SV39_PTE_SV39_PTE_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV39_PTE_BITS:SV39_PTE ->(8)words$word -> SV39_PTE) v x= (( v with<| SV39_PTE_SV39_PTE_chunk_0 := ((update_subrange_vec_dec v.SV39_PTE_SV39_PTE_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((SV48_LEVEL_BITS:int)= ((( 9 : int):ii)))`; val _ = Define ` ((SV48_LEVELS:int)= ((( 4 : int):ii)))`; val _ = Define ` ((PTE48_LOG_SIZE:int)= ((( 3 : int):ii)))`; val _ = Define ` ((PTE48_SIZE:int)= ((( 8 : int):ii)))`; (*val Mk_SV48_Vaddr : mword ty48 -> SV48_Vaddr*) val _ = Define ` ((Mk_SV48_Vaddr:(48)words$word -> SV48_Vaddr) v= (<| SV48_Vaddr_SV48_Vaddr_chunk_0 := ((subrange_vec_dec v (( 47 : int):ii) (( 0 : int):ii) : 48 words$word)) |>))`; val _ = Define ` ((get_SV48_Vaddr_bits:SV48_Vaddr ->(48)words$word) v= ((subrange_vec_dec v.SV48_Vaddr_SV48_Vaddr_chunk_0 (( 47 : int):ii) (( 0 : int):ii) : 48 words$word)))`; val _ = Define ` ((set_SV48_Vaddr_bits:((regstate),(register_value),(SV48_Vaddr))register_ref ->(48)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_Vaddr_SV48_Vaddr_chunk_0 := ((update_subrange_vec_dec r.SV48_Vaddr_SV48_Vaddr_chunk_0 (( 47 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 47 : int):ii) (( 0 : int):ii) : 48 words$word)) : 48 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_Vaddr_bits:SV48_Vaddr ->(48)words$word -> SV48_Vaddr) v x= (( v with<| SV48_Vaddr_SV48_Vaddr_chunk_0 := ((update_subrange_vec_dec v.SV48_Vaddr_SV48_Vaddr_chunk_0 (( 47 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 47 : int):ii) (( 0 : int):ii) : 48 words$word)) : 48 words$word)) |>)))`; val _ = Define ` ((get_SV48_Vaddr_VPNi:SV48_Vaddr ->(27)words$word) v= ((subrange_vec_dec v.SV48_Vaddr_SV48_Vaddr_chunk_0 (( 38 : int):ii) (( 12 : int):ii) : 27 words$word)))`; val _ = Define ` ((set_SV48_Vaddr_VPNi:((regstate),(register_value),(SV48_Vaddr))register_ref ->(27)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_Vaddr_SV48_Vaddr_chunk_0 := ((update_subrange_vec_dec r.SV48_Vaddr_SV48_Vaddr_chunk_0 (( 38 : int):ii) (( 12 : int):ii) ((subrange_vec_dec v (( 26 : int):ii) (( 0 : int):ii) : 27 words$word)) : 48 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_Vaddr_VPNi:SV48_Vaddr ->(27)words$word -> SV48_Vaddr) v x= (( v with<| SV48_Vaddr_SV48_Vaddr_chunk_0 := ((update_subrange_vec_dec v.SV48_Vaddr_SV48_Vaddr_chunk_0 (( 38 : int):ii) (( 12 : int):ii) ((subrange_vec_dec x (( 26 : int):ii) (( 0 : int):ii) : 27 words$word)) : 48 words$word)) |>)))`; val _ = Define ` ((get_SV48_Vaddr_PgOfs:SV48_Vaddr ->(12)words$word) v= ((subrange_vec_dec v.SV48_Vaddr_SV48_Vaddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)))`; val _ = Define ` ((set_SV48_Vaddr_PgOfs:((regstate),(register_value),(SV48_Vaddr))register_ref ->(12)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_Vaddr_SV48_Vaddr_chunk_0 := ((update_subrange_vec_dec r.SV48_Vaddr_SV48_Vaddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 48 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_Vaddr_PgOfs:SV48_Vaddr ->(12)words$word -> SV48_Vaddr) v x= (( v with<| SV48_Vaddr_SV48_Vaddr_chunk_0 := ((update_subrange_vec_dec v.SV48_Vaddr_SV48_Vaddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 48 words$word)) |>)))`; (*val Mk_SV48_Paddr : mword ty56 -> SV48_Paddr*) val _ = Define ` ((Mk_SV48_Paddr:(56)words$word -> SV48_Paddr) v= (<| SV48_Paddr_SV48_Paddr_chunk_0 := ((subrange_vec_dec v (( 55 : int):ii) (( 0 : int):ii) : 56 words$word)) |>))`; val _ = Define ` ((get_SV48_Paddr_bits:SV48_Paddr ->(56)words$word) v= ((subrange_vec_dec v.SV48_Paddr_SV48_Paddr_chunk_0 (( 55 : int):ii) (( 0 : int):ii) : 56 words$word)))`; val _ = Define ` ((set_SV48_Paddr_bits:((regstate),(register_value),(SV48_Paddr))register_ref ->(56)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_Paddr_SV48_Paddr_chunk_0 := ((update_subrange_vec_dec r.SV48_Paddr_SV48_Paddr_chunk_0 (( 55 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 55 : int):ii) (( 0 : int):ii) : 56 words$word)) : 56 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_Paddr_bits:SV48_Paddr ->(56)words$word -> SV48_Paddr) v x= (( v with<| SV48_Paddr_SV48_Paddr_chunk_0 := ((update_subrange_vec_dec v.SV48_Paddr_SV48_Paddr_chunk_0 (( 55 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 55 : int):ii) (( 0 : int):ii) : 56 words$word)) : 56 words$word)) |>)))`; val _ = Define ` ((get_SV48_Paddr_PPNi:SV48_Paddr ->(44)words$word) v= ((subrange_vec_dec v.SV48_Paddr_SV48_Paddr_chunk_0 (( 55 : int):ii) (( 12 : int):ii) : 44 words$word)))`; val _ = Define ` ((set_SV48_Paddr_PPNi:((regstate),(register_value),(SV48_Paddr))register_ref ->(44)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_Paddr_SV48_Paddr_chunk_0 := ((update_subrange_vec_dec r.SV48_Paddr_SV48_Paddr_chunk_0 (( 55 : int):ii) (( 12 : int):ii) ((subrange_vec_dec v (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 56 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_Paddr_PPNi:SV48_Paddr ->(44)words$word -> SV48_Paddr) v x= (( v with<| SV48_Paddr_SV48_Paddr_chunk_0 := ((update_subrange_vec_dec v.SV48_Paddr_SV48_Paddr_chunk_0 (( 55 : int):ii) (( 12 : int):ii) ((subrange_vec_dec x (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 56 words$word)) |>)))`; val _ = Define ` ((get_SV48_Paddr_PgOfs:SV48_Paddr ->(12)words$word) v= ((subrange_vec_dec v.SV48_Paddr_SV48_Paddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)))`; val _ = Define ` ((set_SV48_Paddr_PgOfs:((regstate),(register_value),(SV48_Paddr))register_ref ->(12)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_Paddr_SV48_Paddr_chunk_0 := ((update_subrange_vec_dec r.SV48_Paddr_SV48_Paddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 56 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_Paddr_PgOfs:SV48_Paddr ->(12)words$word -> SV48_Paddr) v x= (( v with<| SV48_Paddr_SV48_Paddr_chunk_0 := ((update_subrange_vec_dec v.SV48_Paddr_SV48_Paddr_chunk_0 (( 11 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 11 : int):ii) (( 0 : int):ii) : 12 words$word)) : 56 words$word)) |>)))`; (*val Mk_SV48_PTE : mword ty64 -> SV48_PTE*) val _ = Define ` ((Mk_SV48_PTE:(64)words$word -> SV48_PTE) v= (<| SV48_PTE_SV48_PTE_chunk_0 := ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) |>))`; val _ = Define ` ((get_SV48_PTE_bits:SV48_PTE ->(64)words$word) v= ((subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)))`; val _ = Define ` ((set_SV48_PTE_bits:((regstate),(register_value),(SV48_PTE))register_ref ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec r.SV48_PTE_SV48_PTE_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_PTE_bits:SV48_PTE ->(64)words$word -> SV48_PTE) v x= (( v with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 63 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 63 : int):ii) (( 0 : int):ii) : 64 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_SV48_PTE_Ext:SV48_PTE ->(10)words$word) v= ((subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 63 : int):ii) (( 54 : int):ii) : 10 words$word)))`; val _ = Define ` ((set_SV48_PTE_Ext:((regstate),(register_value),(SV48_PTE))register_ref ->(10)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec r.SV48_PTE_SV48_PTE_chunk_0 (( 63 : int):ii) (( 54 : int):ii) ((subrange_vec_dec v (( 9 : int):ii) (( 0 : int):ii) : 10 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_PTE_Ext:SV48_PTE ->(10)words$word -> SV48_PTE) v x= (( v with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 63 : int):ii) (( 54 : int):ii) ((subrange_vec_dec x (( 9 : int):ii) (( 0 : int):ii) : 10 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_SV48_PTE_PPNi:SV48_PTE ->(44)words$word) v= ((subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 53 : int):ii) (( 10 : int):ii) : 44 words$word)))`; val _ = Define ` ((set_SV48_PTE_PPNi:((regstate),(register_value),(SV48_PTE))register_ref ->(44)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec r.SV48_PTE_SV48_PTE_chunk_0 (( 53 : int):ii) (( 10 : int):ii) ((subrange_vec_dec v (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_PTE_PPNi:SV48_PTE ->(44)words$word -> SV48_PTE) v x= (( v with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 53 : int):ii) (( 10 : int):ii) ((subrange_vec_dec x (( 43 : int):ii) (( 0 : int):ii) : 44 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_SV48_PTE_RSW:SV48_PTE ->(2)words$word) v= ((subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 9 : int):ii) (( 8 : int):ii) : 2 words$word)))`; val _ = Define ` ((set_SV48_PTE_RSW:((regstate),(register_value),(SV48_PTE))register_ref ->(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec r.SV48_PTE_SV48_PTE_chunk_0 (( 9 : int):ii) (( 8 : int):ii) ((subrange_vec_dec v (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_PTE_RSW:SV48_PTE ->(2)words$word -> SV48_PTE) v x= (( v with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 9 : int):ii) (( 8 : int):ii) ((subrange_vec_dec x (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) : 64 words$word)) |>)))`; val _ = Define ` ((get_SV48_PTE_BITS:SV48_PTE ->(8)words$word) v= ((subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)))`; val _ = Define ` ((set_SV48_PTE_BITS:((regstate),(register_value),(SV48_PTE))register_ref ->(8)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) r_ref v= (sail2_state_monad$bindS (sail2_state_monad$read_regS r_ref) (\ r . let r = (( r with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec r.SV48_PTE_SV48_PTE_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec v (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word)) |>)) in sail2_state_monad$write_regS r_ref r)))`; val _ = Define ` ((update_SV48_PTE_BITS:SV48_PTE ->(8)words$word -> SV48_PTE) v x= (( v with<| SV48_PTE_SV48_PTE_chunk_0 := ((update_subrange_vec_dec v.SV48_PTE_SV48_PTE_chunk_0 (( 7 : int):ii) (( 0 : int):ii) ((subrange_vec_dec x (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word)) |>)))`; (*val make_TLB_Entry : forall 'asidlen 'palen 'ptelen 'valen. Size 'asidlen, Size 'palen, Size 'ptelen, Size 'valen => mword 'asidlen -> bool -> mword 'valen -> mword 'palen -> mword 'ptelen -> ii -> mword 'palen -> ii -> M (TLB_Entry 'asidlen 'valen 'palen 'ptelen)*) val _ = Define ` ((make_TLB_Entry:'asidlen words$word -> bool -> 'valen words$word -> 'palen words$word -> 'ptelen words$word -> int -> 'palen words$word -> int ->(regstate)sail2_state_monad$sequential_state ->(((('asidlen,'valen,'palen,'ptelen)TLB_Entry),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid global vAddr pAddr pte level pteAddr levelBitSize= (let (shift : ii) = (PAGESIZE_BITS + ((level * levelBitSize))) in let (vAddrMask : 'valen words$word) = ((sub_vec_int ((shiftl ((xor_vec vAddr ((xor_vec vAddr ((EXTZ ((int_of_num (words$word_len vAddr))) (0b1w : 1 words$word) : 'valen words$word)) : 'valen words$word)) : 'valen words$word)) shift : 'valen words$word)) (( 1 : int):ii) : 'valen words$word)) in let (vMatchMask : 'valen words$word) = ((not_vec vAddrMask : 'valen words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS mcycle_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$returnS (<| TLB_Entry_asid := asid; TLB_Entry_global := global; TLB_Entry_pte := pte; TLB_Entry_pteAddr := pteAddr; TLB_Entry_vAddrMask := vAddrMask; TLB_Entry_vMatchMask := vMatchMask; TLB_Entry_vAddr := ((and_vec vAddr vMatchMask : 'valen words$word)); TLB_Entry_pAddr := ((shiftl ((shiftr pAddr shift : 'palen words$word)) shift : 'palen words$word)); TLB_Entry_age := w__0 |>))))`; (*val match_TLB_Entry : forall 'asidlen 'palen 'ptelen 'valen. Size 'asidlen, Size 'valen => TLB_Entry 'asidlen 'valen 'palen 'ptelen -> mword 'asidlen -> mword 'valen -> bool*) val _ = Define ` ((match_TLB_Entry:('asidlen,'valen,'palen,'ptelen)TLB_Entry -> 'asidlen words$word -> 'valen words$word -> bool) ent asid vaddr= ((((ent.TLB_Entry_global \/ (((ent.TLB_Entry_asid = asid)))))) /\ (((ent.TLB_Entry_vAddr = ((and_vec ent.TLB_Entry_vMatchMask vaddr : 'valen words$word)))))))`; (*val flush_TLB_Entry : forall 'asidlen 'palen 'ptelen 'valen. Size 'asidlen, Size 'valen => TLB_Entry 'asidlen 'valen 'palen 'ptelen -> maybe (mword 'asidlen) -> maybe (mword 'valen) -> bool*) val _ = Define ` ((flush_TLB_Entry:('asidlen,'valen,'palen,'ptelen)TLB_Entry ->('asidlen words$word)option ->('valen words$word)option -> bool) e asid addr= ((case (asid, addr) of (NONE, NONE) => T | (NONE, SOME (a)) => (e.TLB_Entry_vAddr = ((and_vec e.TLB_Entry_vMatchMask a : 'valen words$word))) | (SOME (i), NONE) => ((((e.TLB_Entry_asid = i))) /\ ((~ e.TLB_Entry_global))) | (SOME (i), SOME (a)) => ((((e.TLB_Entry_asid = i))) /\ ((((((e.TLB_Entry_vAddr = ((and_vec a e.TLB_Entry_vMatchMask : 'valen words$word))))) /\ ((~ e.TLB_Entry_global)))))) )))`; (*val walk39 : mword ty39 -> AccessType unit -> Privilege -> bool -> bool -> mword ty56 -> ii -> bool -> unit -> M (PTW_Result (mword ty56) SV39_PTE)*) val walk39_defn = Hol_defn "walk39" ` ((walk39:(39)words$word ->(unit)AccessType -> Privilege -> bool -> bool ->(56)words$word -> int -> bool -> unit ->(regstate)sail2_state_monad$sequential_state ->((((((56)words$word),(SV39_PTE))PTW_Result),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) vaddr ac priv mxr do_sum ptb level global ext_ptw= (let va = (Mk_SV39_Vaddr vaddr) in let (pt_ofs : paddr64) = ((shiftl ((EXTZ (( 56 : int):ii) ((subrange_vec_dec ((shiftr ((get_SV39_Vaddr_VPNi va : 27 words$word)) ((level * SV39_LEVEL_BITS)) : 27 words$word)) ((SV39_LEVEL_BITS - (( 1 : int):ii))) (( 0 : int):ii) : 9 words$word)) : 56 words$word)) PTE39_LOG_SIZE : 56 words$word)) in let pte_addr = ((add_vec ptb pt_ofs : 56 words$word)) in sail2_state_monad$bindS (mem_read_priv (Read Data) Supervisor ((EXTZ (( 64 : int):ii) pte_addr : 64 words$word)) (( 8 : int):ii) F F F : ( ( 64 words$word)MemoryOpResult) M) (\ (w__0 : ( 64 words$word) MemoryOpResult) . (case w__0 of MemException (_) => sail2_state_monad$returnS (PTW_Failure (PTW_Access () , ext_ptw)) | MemValue (v) => let pte = (Mk_SV39_PTE v) in let pbits = ((get_SV39_PTE_BITS pte : 8 words$word)) in let ext_pte = ((get_SV39_PTE_Ext pte : 10 words$word)) in let pattr = (Mk_PTE_Bits pbits) in let is_global = (global \/ (((((get_PTE_Bits_G pattr : 1 words$word)) = (0b1w : 1 words$word))))) in if ((isInvalidPTE pbits ext_pte)) then sail2_state_monad$returnS (PTW_Failure (PTW_Invalid_PTE () , ext_ptw)) else if ((isPTEPtr pbits ext_pte)) then if ((level > (( 0 : int):ii))) then (walk39 vaddr ac priv mxr do_sum ((shiftl ((EXTZ (( 56 : int):ii) ((get_SV39_PTE_PPNi pte : 44 words$word)) : 56 words$word)) PAGESIZE_BITS : 56 words$word)) ((level - (( 1 : int):ii))) is_global ext_ptw : ( (( 56 words$word), SV39_PTE)PTW_Result) M) else sail2_state_monad$returnS (PTW_Failure (PTW_Invalid_PTE () , ext_ptw)) else sail2_state_monad$bindS (checkPTEPermission ac priv mxr do_sum pattr ext_pte ext_ptw) (\ (w__3 : PTE_Check) . sail2_state_monad$returnS ((case w__3 of PTE_Check_Failure ((ext_ptw, ext_ptw_fail)) => PTW_Failure (ext_get_ptw_error ext_ptw_fail, ext_ptw) | PTE_Check_Success (ext_ptw) => if ((level > (( 0 : int):ii))) then let mask = ((sub_vec_int ((shiftl ((xor_vec ((get_SV39_PTE_PPNi pte : 44 words$word)) ((xor_vec ((get_SV39_PTE_PPNi pte : 44 words$word)) ((EXTZ (( 44 : int):ii) (0b1w : 1 words$word) : 44 words$word)) : 44 words$word)) : 44 words$word)) ((level * SV39_LEVEL_BITS)) : 44 words$word)) (( 1 : int):ii) : 44 words$word)) in if (((((and_vec ((get_SV39_PTE_PPNi pte : 44 words$word)) mask : 44 words$word)) <> ((EXTZ (( 44 : int):ii) (0b0w : 1 words$word) : 44 words$word))))) then PTW_Failure (PTW_Misaligned () , ext_ptw) else let ppn = ((or_vec ((get_SV39_PTE_PPNi pte : 44 words$word)) ((and_vec ((EXTZ (( 44 : int):ii) ((get_SV39_Vaddr_VPNi va : 27 words$word)) : 44 words$word)) mask : 44 words$word)) : 44 words$word)) in PTW_Success ((concat_vec ppn ((get_SV39_Vaddr_PgOfs va : 12 words$word)) : 56 words$word), pte, pte_addr, level, is_global, ext_ptw) else PTW_Success ((concat_vec ((get_SV39_PTE_PPNi pte : 44 words$word)) ((get_SV39_Vaddr_PgOfs va : 12 words$word)) : 56 words$word), pte, pte_addr, level, is_global, ext_ptw) ))) ))))`; val _ = Lib.with_flag (computeLib.auto_import_definitions, false) Defn.save_defn walk39_defn; (*val lookup_TLB39 : mword ty16 -> mword ty39 -> M (maybe ((ii * TLB_Entry ty16 ty39 ty56 ty64)))*) val _ = Define ` ((lookup_TLB39:(16)words$word ->(39)words$word ->(regstate)sail2_state_monad$sequential_state ->((((int#((16),(39),(56),(64))TLB_Entry)option),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid vaddr= (sail2_state_monad$bindS (sail2_state_monad$read_regS tlb39_ref) (\ (w__0 : ( (16, 39, 56, 64)TLB_Entry)option) . sail2_state_monad$returnS ((case w__0 of NONE => NONE | SOME (e) => if ((match_TLB_Entry e asid vaddr)) then SOME ((( 0 : int):ii), e) else NONE )))))`; (*val add_to_TLB39 : mword ty16 -> mword ty39 -> mword ty56 -> SV39_PTE -> mword ty56 -> ii -> bool -> M unit*) val _ = Define ` ((add_to_TLB39:(16)words$word ->(39)words$word ->(56)words$word -> SV39_PTE ->(56)words$word -> int -> bool ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid vAddr pAddr pte pteAddr level global= (sail2_state_monad$bindS (make_TLB_Entry asid global vAddr pAddr ((get_SV39_PTE_bits pte : 64 words$word)) level pteAddr SV39_LEVEL_BITS) (\ (ent : TLB39_Entry) . sail2_state_monad$write_regS tlb39_ref (SOME ent))))`; (*val write_TLB39 : ii -> TLB_Entry ty16 ty39 ty56 ty64 -> M unit*) val _ = Define ` ((write_TLB39:int ->((16),(39),(56),(64))TLB_Entry ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (idx : ii) (ent : TLB39_Entry)= (sail2_state_monad$write_regS tlb39_ref (SOME ent)))`; (*val flush_TLB39 : maybe (mword ty16) -> maybe (mword ty39) -> M unit*) val _ = Define ` ((flush_TLB39:((16)words$word)option ->((39)words$word)option ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid addr= (sail2_state_monad$bindS (sail2_state_monad$read_regS tlb39_ref) (\ (w__0 : ( (16, 39, 56, 64)TLB_Entry)option) . (case w__0 of NONE => sail2_state_monad$returnS () | SOME (e) => if ((flush_TLB_Entry e asid addr)) then sail2_state_monad$write_regS tlb39_ref NONE else sail2_state_monad$returnS () ))))`; (*val translate39 : mword ty16 -> mword ty56 -> mword ty39 -> AccessType unit -> Privilege -> bool -> bool -> ii -> unit -> M (TR_Result (mword ty56) PTW_Error)*) val _ = Define ` ((translate39:(16)words$word ->(56)words$word ->(39)words$word ->(unit)AccessType -> Privilege -> bool -> bool -> int -> unit ->(regstate)sail2_state_monad$sequential_state ->((((((56)words$word),(PTW_Error))TR_Result),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid ptb vAddr ac priv mxr do_sum level ext_ptw= (sail2_state_monad$bindS (lookup_TLB39 asid vAddr) (\ (w__0 : ((ii # (16, 39, 56, 64) TLB_Entry))option) . (case w__0 of SOME ((idx, ent)) => let pte = (Mk_SV39_PTE ent.TLB_Entry_pte) in let ext_pte = ((get_SV39_PTE_Ext pte : 10 words$word)) in let pteBits = (Mk_PTE_Bits ((get_SV39_PTE_BITS pte : 8 words$word))) in sail2_state_monad$bindS (checkPTEPermission ac priv mxr do_sum pteBits ext_pte ext_ptw) (\ (w__1 : PTE_Check) . (case w__1 of PTE_Check_Failure ((ext_ptw, ext_ptw_fail)) => sail2_state_monad$returnS (TR_Failure (ext_get_ptw_error ext_ptw_fail, ext_ptw)) | PTE_Check_Success (ext_ptw) => (case ((update_PTE_Bits pteBits ac ext_pte : ((PTE_Bits # 10 words$word))option)) of NONE => sail2_state_monad$returnS (TR_Address ((or_vec ent.TLB_Entry_pAddr ((EXTZ (( 56 : int):ii) ((and_vec vAddr ent.TLB_Entry_vAddrMask : 39 words$word)) : 56 words$word)) : 56 words$word), ext_ptw)) | SOME ((pbits, ext)) => if ((~ ((plat_enable_dirty_update () )))) then sail2_state_monad$returnS (TR_Failure (PTW_PTE_Update () , ext_ptw)) else let n_pte = (update_SV39_PTE_BITS pte ((get_PTE_Bits_bits pbits : 8 words$word))) in let n_pte = (update_SV39_PTE_Ext n_pte ext) in let (n_ent : TLB39_Entry) = ent in let n_ent = (( n_ent with<| TLB_Entry_pte := ((get_SV39_PTE_bits n_pte : 64 words$word)) |>)) in sail2_state_monad$bindS (sail2_state_monad$seqS (write_TLB39 idx n_ent) (mem_write_value_priv ((EXTZ (( 64 : int):ii) ent.TLB_Entry_pteAddr : 64 words$word)) (( 8 : int):ii) ((get_SV39_PTE_bits n_pte : 64 words$word)) Supervisor F F F)) (\ (w__2 : bool MemoryOpResult) . sail2_state_monad$seqS (case w__2 of MemValue (_) => sail2_state_monad$returnS () | MemException (e) => internal_error "invalid physical address in TLB" ) (sail2_state_monad$returnS (TR_Address ((or_vec ent.TLB_Entry_pAddr ((EXTZ (( 56 : int):ii) ((and_vec vAddr ent.TLB_Entry_vAddrMask : 39 words$word)) : 56 words$word)) : 56 words$word), ext_ptw)))) ) )) | NONE => sail2_state_monad$bindS (walk39 vAddr ac priv mxr do_sum ptb level F ext_ptw : ( (( 56 words$word), SV39_PTE)PTW_Result) M) (\ (w__6 : (( 56 words$word), SV39_PTE) PTW_Result) . (case w__6 of PTW_Failure ((f, ext_ptw)) => sail2_state_monad$returnS (TR_Failure (f, ext_ptw)) | PTW_Success ((pAddr, pte, pteAddr, level, global, ext_ptw)) => (case ((update_PTE_Bits ((Mk_PTE_Bits ((get_SV39_PTE_BITS pte : 8 words$word)))) ac ((get_SV39_PTE_Ext pte : 10 words$word)) : ((PTE_Bits # 10 words$word))option)) of NONE => sail2_state_monad$seqS (add_to_TLB39 asid vAddr pAddr pte pteAddr level global) (sail2_state_monad$returnS (TR_Address (pAddr, ext_ptw))) | SOME ((pbits, ext)) => if ((~ ((plat_enable_dirty_update () )))) then sail2_state_monad$returnS (TR_Failure (PTW_PTE_Update () , ext_ptw)) else let (w_pte : SV39_PTE) = (update_SV39_PTE_BITS pte ((get_PTE_Bits_bits pbits : 8 words$word))) in let (w_pte : SV39_PTE) = (update_SV39_PTE_Ext w_pte ext) in sail2_state_monad$bindS (mem_write_value_priv ((EXTZ (( 64 : int):ii) pteAddr : 64 words$word)) (( 8 : int):ii) ((get_SV39_PTE_bits w_pte : 64 words$word)) Supervisor F F F) (\ (w__7 : bool MemoryOpResult) . (case w__7 of MemValue (_) => sail2_state_monad$seqS (add_to_TLB39 asid vAddr pAddr w_pte pteAddr level global) (sail2_state_monad$returnS (TR_Address (pAddr, ext_ptw))) | MemException (e) => sail2_state_monad$returnS (TR_Failure (PTW_Access () , ext_ptw)) )) ) )) ))))`; (*val init_vmem_sv39 : unit -> M unit*) val _ = Define ` ((init_vmem_sv39:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$write_regS tlb39_ref NONE))`; (*val walk48 : mword ty48 -> AccessType unit -> Privilege -> bool -> bool -> mword ty56 -> ii -> bool -> unit -> M (PTW_Result (mword ty56) SV48_PTE)*) val walk48_defn = Hol_defn "walk48" ` ((walk48:(48)words$word ->(unit)AccessType -> Privilege -> bool -> bool ->(56)words$word -> int -> bool -> unit ->(regstate)sail2_state_monad$sequential_state ->((((((56)words$word),(SV48_PTE))PTW_Result),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) vaddr ac priv mxr do_sum ptb level global ext_ptw= (let va = (Mk_SV48_Vaddr vaddr) in let (pt_ofs : paddr64) = ((shiftl ((EXTZ (( 56 : int):ii) ((subrange_vec_dec ((shiftr ((get_SV48_Vaddr_VPNi va : 27 words$word)) ((level * SV48_LEVEL_BITS)) : 27 words$word)) ((SV48_LEVEL_BITS - (( 1 : int):ii))) (( 0 : int):ii) : 9 words$word)) : 56 words$word)) PTE48_LOG_SIZE : 56 words$word)) in let pte_addr = ((add_vec ptb pt_ofs : 56 words$word)) in sail2_state_monad$bindS (mem_read_priv (Read Data) Supervisor ((EXTZ (( 64 : int):ii) pte_addr : 64 words$word)) (( 8 : int):ii) F F F : ( ( 64 words$word)MemoryOpResult) M) (\ (w__0 : ( 64 words$word) MemoryOpResult) . (case w__0 of MemException (_) => sail2_state_monad$returnS (PTW_Failure (PTW_Access () , ext_ptw)) | MemValue (v) => let pte = (Mk_SV48_PTE v) in let pbits = ((get_SV48_PTE_BITS pte : 8 words$word)) in let ext_pte = ((get_SV48_PTE_Ext pte : 10 words$word)) in let pattr = (Mk_PTE_Bits pbits) in let is_global = (global \/ (((((get_PTE_Bits_G pattr : 1 words$word)) = (0b1w : 1 words$word))))) in if ((isInvalidPTE pbits ext_pte)) then sail2_state_monad$returnS (PTW_Failure (PTW_Invalid_PTE () , ext_ptw)) else if ((isPTEPtr pbits ext_pte)) then if ((level > (( 0 : int):ii))) then (walk48 vaddr ac priv mxr do_sum ((shiftl ((EXTZ (( 56 : int):ii) ((get_SV48_PTE_PPNi pte : 44 words$word)) : 56 words$word)) PAGESIZE_BITS : 56 words$word)) ((level - (( 1 : int):ii))) is_global ext_ptw : ( (( 56 words$word), SV48_PTE)PTW_Result) M) else sail2_state_monad$returnS (PTW_Failure (PTW_Invalid_PTE () , ext_ptw)) else sail2_state_monad$bindS (checkPTEPermission ac priv mxr do_sum pattr ext_pte ext_ptw) (\ (w__3 : PTE_Check) . sail2_state_monad$returnS ((case w__3 of PTE_Check_Failure ((ext_ptw, ext_ptw_fail)) => PTW_Failure (ext_get_ptw_error ext_ptw_fail, ext_ptw) | PTE_Check_Success (ext_ptw) => if ((level > (( 0 : int):ii))) then let mask = ((sub_vec_int ((shiftl ((xor_vec ((get_SV48_PTE_PPNi pte : 44 words$word)) ((xor_vec ((get_SV48_PTE_PPNi pte : 44 words$word)) ((EXTZ (( 44 : int):ii) (0b1w : 1 words$word) : 44 words$word)) : 44 words$word)) : 44 words$word)) ((level * SV48_LEVEL_BITS)) : 44 words$word)) (( 1 : int):ii) : 44 words$word)) in if (((((and_vec ((get_SV48_PTE_PPNi pte : 44 words$word)) mask : 44 words$word)) <> ((EXTZ (( 44 : int):ii) (0b0w : 1 words$word) : 44 words$word))))) then PTW_Failure (PTW_Misaligned () , ext_ptw) else let ppn = ((or_vec ((get_SV48_PTE_PPNi pte : 44 words$word)) ((and_vec ((EXTZ (( 44 : int):ii) ((get_SV48_Vaddr_VPNi va : 27 words$word)) : 44 words$word)) mask : 44 words$word)) : 44 words$word)) in PTW_Success ((concat_vec ppn ((get_SV48_Vaddr_PgOfs va : 12 words$word)) : 56 words$word), pte, pte_addr, level, is_global, ext_ptw) else PTW_Success ((concat_vec ((get_SV48_PTE_PPNi pte : 44 words$word)) ((get_SV48_Vaddr_PgOfs va : 12 words$word)) : 56 words$word), pte, pte_addr, level, is_global, ext_ptw) ))) ))))`; val _ = Lib.with_flag (computeLib.auto_import_definitions, false) Defn.save_defn walk48_defn; (*val lookup_TLB48 : mword ty16 -> mword ty48 -> M (maybe ((ii * TLB_Entry ty16 ty48 ty56 ty64)))*) val _ = Define ` ((lookup_TLB48:(16)words$word ->(48)words$word ->(regstate)sail2_state_monad$sequential_state ->((((int#((16),(48),(56),(64))TLB_Entry)option),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid vaddr= (sail2_state_monad$bindS (sail2_state_monad$read_regS tlb48_ref) (\ (w__0 : ( (16, 48, 56, 64)TLB_Entry)option) . sail2_state_monad$returnS ((case w__0 of NONE => NONE | SOME (e) => if ((match_TLB_Entry e asid vaddr)) then SOME ((( 0 : int):ii), e) else NONE )))))`; (*val add_to_TLB48 : mword ty16 -> mword ty48 -> mword ty56 -> SV48_PTE -> mword ty56 -> ii -> bool -> M unit*) val _ = Define ` ((add_to_TLB48:(16)words$word ->(48)words$word ->(56)words$word -> SV48_PTE ->(56)words$word -> int -> bool ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid vAddr pAddr pte pteAddr level global= (sail2_state_monad$bindS (make_TLB_Entry asid global vAddr pAddr ((get_SV48_PTE_bits pte : 64 words$word)) level pteAddr SV48_LEVEL_BITS) (\ (ent : TLB48_Entry) . sail2_state_monad$write_regS tlb48_ref (SOME ent))))`; (*val write_TLB48 : ii -> TLB_Entry ty16 ty48 ty56 ty64 -> M unit*) val _ = Define ` ((write_TLB48:int ->((16),(48),(56),(64))TLB_Entry ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (idx : ii) (ent : TLB48_Entry)= (sail2_state_monad$write_regS tlb48_ref (SOME ent)))`; (*val flush_TLB48 : maybe (mword ty16) -> maybe (mword ty48) -> M unit*) val _ = Define ` ((flush_TLB48:((16)words$word)option ->((48)words$word)option ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid addr= (sail2_state_monad$bindS (sail2_state_monad$read_regS tlb48_ref) (\ (w__0 : ( (16, 48, 56, 64)TLB_Entry)option) . (case w__0 of NONE => sail2_state_monad$returnS () | SOME (e) => if ((flush_TLB_Entry e asid addr)) then sail2_state_monad$write_regS tlb48_ref NONE else sail2_state_monad$returnS () ))))`; (*val translate48 : mword ty16 -> mword ty56 -> mword ty48 -> AccessType unit -> Privilege -> bool -> bool -> ii -> unit -> M (TR_Result (mword ty56) PTW_Error)*) val _ = Define ` ((translate48:(16)words$word ->(56)words$word ->(48)words$word ->(unit)AccessType -> Privilege -> bool -> bool -> int -> unit ->(regstate)sail2_state_monad$sequential_state ->((((((56)words$word),(PTW_Error))TR_Result),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid ptb vAddr ac priv mxr do_sum level ext_ptw= (sail2_state_monad$bindS (walk48 vAddr ac priv mxr do_sum ptb level F ext_ptw : ( (( 56 words$word), SV48_PTE)PTW_Result) M) (\ (w__0 : (( 56 words$word), SV48_PTE) PTW_Result) . (case w__0 of PTW_Failure ((f, ext_ptw)) => sail2_state_monad$returnS (TR_Failure (f, ext_ptw)) | PTW_Success ((pAddr, pte, pteAddr, level, global, ext_ptw)) => (case ((update_PTE_Bits ((Mk_PTE_Bits ((get_SV48_PTE_BITS pte : 8 words$word)))) ac ((get_SV48_PTE_Ext pte : 10 words$word)) : ((PTE_Bits # 10 words$word))option)) of NONE => sail2_state_monad$seqS (add_to_TLB48 asid vAddr pAddr pte pteAddr level global) (sail2_state_monad$returnS (TR_Address (pAddr, ext_ptw))) | SOME ((pbits, ext)) => if ((~ ((plat_enable_dirty_update () )))) then sail2_state_monad$returnS (TR_Failure (PTW_PTE_Update () , ext_ptw)) else let (w_pte : SV48_PTE) = (update_SV48_PTE_BITS pte ((get_PTE_Bits_bits pbits : 8 words$word))) in let (w_pte : SV48_PTE) = (update_SV48_PTE_Ext w_pte ext) in sail2_state_monad$bindS (mem_write_value_priv ((EXTZ (( 64 : int):ii) pteAddr : 64 words$word)) (( 8 : int):ii) ((get_SV48_PTE_bits w_pte : 64 words$word)) Supervisor F F F) (\ (w__1 : bool MemoryOpResult) . (case w__1 of MemValue (_) => sail2_state_monad$seqS (add_to_TLB48 asid vAddr pAddr w_pte pteAddr level global) (sail2_state_monad$returnS (TR_Address (pAddr, ext_ptw))) | MemException (e) => sail2_state_monad$returnS (TR_Failure (PTW_Access () , ext_ptw)) )) ) ))))`; (*val init_vmem_sv48 : unit -> M unit*) val _ = Define ` ((init_vmem_sv48:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$write_regS tlb48_ref NONE))`; (*val legalize_satp : Architecture -> mword ty64 -> mword ty64 -> mword ty64*) val _ = Define ` ((legalize_satp:Architecture ->(64)words$word ->(64)words$word ->(64)words$word) (a : Architecture) (o1 : xlenbits) (v : xlenbits)= ((legalize_satp64 a o1 v : 64 words$word)))`; (*val isValidSv39Addr : mword ty64 -> bool*) val _ = Define ` ((isValidSv39Addr:(64)words$word -> bool) vAddr= (((subrange_vec_dec vAddr (( 63 : int):ii) (( 39 : int):ii) : 25 words$word)) = (if (((((access_vec_dec vAddr (( 38 : int):ii))) = B1))) then (ones (((((( 63 : int):ii) - (( 39 : int):ii))) + (( 1 : int):ii))) : 25 words$word) else (zeros_implicit (((((( 63 : int):ii) - (( 39 : int):ii))) + (( 1 : int):ii))) : 25 words$word))))`; (*val isValidSv48Addr : mword ty64 -> bool*) val _ = Define ` ((isValidSv48Addr:(64)words$word -> bool) vAddr= (((subrange_vec_dec vAddr (( 63 : int):ii) (( 48 : int):ii) : 16 words$word)) = (if (((((access_vec_dec vAddr (( 47 : int):ii))) = B1))) then (ones (((((( 63 : int):ii) - (( 48 : int):ii))) + (( 1 : int):ii))) : 16 words$word) else (zeros_implicit (((((( 63 : int):ii) - (( 48 : int):ii))) + (( 1 : int):ii))) : 16 words$word))))`; (*val translationMode : Privilege -> M SATPMode*) val _ = Define ` ((translationMode:Privilege ->(regstate)sail2_state_monad$sequential_state ->(((SATPMode),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) priv= (if (((priv = Machine))) then sail2_state_monad$returnS Sbare else sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . let arch = (architecture ((get_mstatus_SXL w__0 : 2 words$word))) in (case arch of SOME (RV64) => sail2_state_monad$bindS (sail2_state_monad$read_regS satp_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let (mbits : satp_mode) = ((get_Satp64_Mode ((Mk_Satp64 w__1)) : 4 words$word)) in (case ((satp64Mode_of_bits RV64 mbits)) of SOME (m) => sail2_state_monad$returnS m | NONE => internal_error "invalid RV64 translation mode in satp" )) | SOME (RV32) => sail2_state_monad$bindS (sail2_state_monad$read_regS satp_ref : ( 64 words$word) M) (\ (w__4 : 64 words$word) . let s = (Mk_Satp32 ((subrange_vec_dec w__4 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word))) in sail2_state_monad$returnS (if (((((get_Satp32_Mode s : 1 words$word)) = (0b0w : 1 words$word)))) then Sbare else Sv32)) | _ => internal_error "unsupported address translation arch" ))))`; (*val translateAddr_priv : mword ty64 -> AccessType unit -> Privilege -> M (TR_Result (mword ty64) ExceptionType)*) val _ = Define ` ((translateAddr_priv:(64)words$word ->(unit)AccessType -> Privilege ->(regstate)sail2_state_monad$sequential_state ->((((((64)words$word),(ExceptionType))TR_Result),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) vAddr ac effPriv= (sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . let (mxr : bool) = (((get_Mstatus_MXR w__0 : 1 words$word)) = (0b1w : 1 words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__1 : Mstatus) . let (do_sum : bool) = (((get_Mstatus_SUM w__1 : 1 words$word)) = (0b1w : 1 words$word)) in sail2_state_monad$bindS (translationMode effPriv) (\ (mode : SATPMode) . sail2_state_monad$bindS (sail2_state_monad$read_regS satp_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . let asid = ((curAsid64 w__2 : 16 words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS satp_ref : ( 64 words$word) M) (\ (w__3 : 64 words$word) . let ptb = ((curPTB64 w__3 : 56 words$word)) in let (ext_ptw : ext_ptw) = init_ext_ptw in (case mode of Sbare => sail2_state_monad$returnS (TR_Address (vAddr, ext_ptw)) | Sv39 => if ((isValidSv39Addr vAddr)) then sail2_state_monad$bindS (translate39 asid ptb ((subrange_vec_dec vAddr (( 38 : int):ii) (( 0 : int):ii) : 39 words$word)) ac effPriv mxr do_sum ((SV39_LEVELS - (( 1 : int):ii))) ext_ptw : ( (( 56 words$word), PTW_Error)TR_Result) M) (\ (w__4 : (( 56 words$word), PTW_Error) TR_Result) . sail2_state_monad$returnS ((case w__4 of TR_Address ((pa, ext_ptw)) => TR_Address ((EXTZ (( 64 : int):ii) pa : 64 words$word), ext_ptw) | TR_Failure ((f, ext_ptw)) => TR_Failure (translationException ac f, ext_ptw) ))) else sail2_state_monad$returnS (TR_Failure (translationException ac (PTW_Invalid_Addr () ), ext_ptw)) | Sv48 => if ((isValidSv48Addr vAddr)) then sail2_state_monad$bindS (translate48 asid ptb ((subrange_vec_dec vAddr (( 47 : int):ii) (( 0 : int):ii) : 48 words$word)) ac effPriv mxr do_sum ((SV48_LEVELS - (( 1 : int):ii))) ext_ptw : ( (( 56 words$word), PTW_Error)TR_Result) M) (\ (w__6 : (( 56 words$word), PTW_Error) TR_Result) . sail2_state_monad$returnS ((case w__6 of TR_Address ((pa, ext_ptw)) => TR_Address ((EXTZ (( 64 : int):ii) pa : 64 words$word), ext_ptw) | TR_Failure ((f, ext_ptw)) => TR_Failure (translationException ac f, ext_ptw) ))) else sail2_state_monad$returnS (TR_Failure (translationException ac (PTW_Invalid_Addr () ), ext_ptw)) | _ => (internal_error "unsupported address translation scheme" : ( (( 64 words$word), ExceptionType)TR_Result) M) ))))))))`; (*val translateAddr : mword ty64 -> AccessType unit -> M (TR_Result (mword ty64) ExceptionType)*) val _ = Define ` ((translateAddr:(64)words$word ->(unit)AccessType ->(regstate)sail2_state_monad$sequential_state ->((((((64)words$word),(ExceptionType))TR_Result),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) vAddr ac= (sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__1 : Privilege) . sail2_state_monad$bindS (effectivePrivilege ac w__0 w__1) (\ (w__2 : Privilege) . (translateAddr_priv vAddr ac w__2 : ( (( 64 words$word), ExceptionType)TR_Result) M))))))`; (*val flush_TLB : maybe (mword ty64) -> maybe (mword ty64) -> M unit*) val _ = Define ` ((flush_TLB:((64)words$word)option ->((64)words$word)option ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) asid_xlen addr_xlen= (let ((addr39 : vaddr39 option), (addr48 : vaddr48 option)) = ((case addr_xlen of NONE => (NONE, NONE) | SOME (a) => (SOME ((subrange_vec_dec a (( 38 : int):ii) (( 0 : int):ii) : 39 words$word)), SOME ((subrange_vec_dec a (( 47 : int):ii) (( 0 : int):ii) : 48 words$word))) )) in let (asid : asid64 option) = ((case asid_xlen of NONE => NONE | SOME (a) => SOME ((subrange_vec_dec a (( 15 : int):ii) (( 0 : int):ii) : 16 words$word)) )) in sail2_state_monad$seqS (flush_TLB39 asid addr39) (flush_TLB48 asid addr48)))`; (*val init_vmem : unit -> M unit*) val _ = Define ` ((init_vmem:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$seqS (init_vmem_sv39 () ) (init_vmem_sv48 () )))`; (*val execute : ast -> M Retired*) (*val assembly_forwards : ast -> M string*) (*val assembly_backwards : string -> M ast*) (*val assembly_forwards_matches : ast -> bool*) (*val assembly_backwards_matches : string -> bool*) (*val assembly_matches_prefix : string -> maybe ((ast * ii))*) (*val encdec_forwards : ast -> M (mword ty32)*) (*val encdec_backwards : mword ty32 -> M ast*) (*val encdec_forwards_matches : ast -> M bool*) (*val encdec_backwards_matches : mword ty32 -> M bool*) (*val encdec_compressed_forwards : ast -> M (mword ty16)*) (*val encdec_compressed_backwards : mword ty16 -> M ast*) (*val encdec_compressed_forwards_matches : ast -> M bool*) (*val encdec_compressed_backwards_matches : mword ty16 -> M bool*) (*val encdec_uop_forwards : uop -> mword ty7*) (*val encdec_uop_backwards : mword ty7 -> M uop*) (*val encdec_uop_forwards_matches : uop -> bool*) (*val encdec_uop_backwards_matches : mword ty7 -> bool*) val _ = Define ` ((encdec_uop_forwards:uop ->(7)words$word) arg_= ((case arg_ of RISCV_LUI => (0b0110111w : 7 words$word) | RISCV_AUIPC => (0b0010111w : 7 words$word) )))`; val _ = Define ` ((encdec_uop_backwards:(7)words$word ->(regstate)sail2_state_monad$sequential_state ->(((uop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b0110111w : 7 words$word)))) then sail2_state_monad$returnS RISCV_LUI else if (((b__0 = (0b0010111w : 7 words$word)))) then sail2_state_monad$returnS RISCV_AUIPC else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((encdec_uop_forwards_matches:uop -> bool) arg_= ((case arg_ of RISCV_LUI => T | RISCV_AUIPC => T )))`; val _ = Define ` ((encdec_uop_backwards_matches:(7)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b0110111w : 7 words$word)))) then T else if (((b__0 = (0b0010111w : 7 words$word)))) then T else F))`; (*val utype_mnemonic_forwards : uop -> string*) (*val utype_mnemonic_backwards : string -> M uop*) (*val utype_mnemonic_forwards_matches : uop -> bool*) (*val utype_mnemonic_backwards_matches : string -> bool*) (*val utype_mnemonic_matches_prefix : string -> maybe ((uop * ii))*) val _ = Define ` ((utype_mnemonic_forwards:uop -> string) arg_= ((case arg_ of RISCV_LUI => "lui" | RISCV_AUIPC => "auipc" )))`; val _ = Define ` ((utype_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((uop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "lui"))) then sail2_state_monad$returnS RISCV_LUI else if (((p0_ = "auipc"))) then sail2_state_monad$returnS RISCV_AUIPC else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((utype_mnemonic_forwards_matches:uop -> bool) arg_= ((case arg_ of RISCV_LUI => T | RISCV_AUIPC => T )))`; val _ = Define ` ((utype_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "lui"))) then T else if (((p0_ = "auipc"))) then T else F))`; (*val _s761_ : string -> maybe string*) val _ = Define ` ((s761_:string ->(string)option) s762_0= (let s763_0 = s762_0 in if ((string_startswith s763_0 "auipc")) then (case ((string_drop s763_0 ((string_length "auipc")))) of s_ => SOME s_ ) else NONE))`; (*val _s757_ : string -> maybe string*) val _ = Define ` ((s757_:string ->(string)option) s758_0= (let s759_0 = s758_0 in if ((string_startswith s759_0 "lui")) then (case ((string_drop s759_0 ((string_length "lui")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((utype_mnemonic_matches_prefix:string ->(uop#int)option) arg_= (let s760_0 = arg_ in if ((case ((s757_ s760_0)) of SOME (s_) => T | _ => F )) then (case s757_ s760_0 of (SOME (s_)) => SOME (RISCV_LUI, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s761_ s760_0)) of SOME (s_) => T | _ => F )) then (case s761_ s760_0 of (SOME (s_)) => SOME (RISCV_AUIPC, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val encdec_bop_forwards : bop -> mword ty3*) (*val encdec_bop_backwards : mword ty3 -> M bop*) (*val encdec_bop_forwards_matches : bop -> bool*) (*val encdec_bop_backwards_matches : mword ty3 -> bool*) val _ = Define ` ((encdec_bop_forwards:bop ->(3)words$word) arg_= ((case arg_ of RISCV_BEQ => (0b000w : 3 words$word) | RISCV_BNE => (0b001w : 3 words$word) | RISCV_BLT => (0b100w : 3 words$word) | RISCV_BGE => (0b101w : 3 words$word) | RISCV_BLTU => (0b110w : 3 words$word) | RISCV_BGEU => (0b111w : 3 words$word) )))`; val _ = Define ` ((encdec_bop_backwards:(3)words$word ->(regstate)sail2_state_monad$sequential_state ->(((bop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then sail2_state_monad$returnS RISCV_BEQ else if (((b__0 = (0b001w : 3 words$word)))) then sail2_state_monad$returnS RISCV_BNE else if (((b__0 = (0b100w : 3 words$word)))) then sail2_state_monad$returnS RISCV_BLT else if (((b__0 = (0b101w : 3 words$word)))) then sail2_state_monad$returnS RISCV_BGE else if (((b__0 = (0b110w : 3 words$word)))) then sail2_state_monad$returnS RISCV_BLTU else if (((b__0 = (0b111w : 3 words$word)))) then sail2_state_monad$returnS RISCV_BGEU else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((encdec_bop_forwards_matches:bop -> bool) arg_= ((case arg_ of RISCV_BEQ => T | RISCV_BNE => T | RISCV_BLT => T | RISCV_BGE => T | RISCV_BLTU => T | RISCV_BGEU => T )))`; val _ = Define ` ((encdec_bop_backwards_matches:(3)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then T else if (((b__0 = (0b001w : 3 words$word)))) then T else if (((b__0 = (0b100w : 3 words$word)))) then T else if (((b__0 = (0b101w : 3 words$word)))) then T else if (((b__0 = (0b110w : 3 words$word)))) then T else if (((b__0 = (0b111w : 3 words$word)))) then T else F))`; (*val btype_mnemonic_forwards : bop -> string*) (*val btype_mnemonic_backwards : string -> M bop*) (*val btype_mnemonic_forwards_matches : bop -> bool*) (*val btype_mnemonic_backwards_matches : string -> bool*) (*val btype_mnemonic_matches_prefix : string -> maybe ((bop * ii))*) val _ = Define ` ((btype_mnemonic_forwards:bop -> string) arg_= ((case arg_ of RISCV_BEQ => "beq" | RISCV_BNE => "bne" | RISCV_BLT => "blt" | RISCV_BGE => "bge" | RISCV_BLTU => "bltu" | RISCV_BGEU => "bgeu" )))`; val _ = Define ` ((btype_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((bop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "beq"))) then sail2_state_monad$returnS RISCV_BEQ else if (((p0_ = "bne"))) then sail2_state_monad$returnS RISCV_BNE else if (((p0_ = "blt"))) then sail2_state_monad$returnS RISCV_BLT else if (((p0_ = "bge"))) then sail2_state_monad$returnS RISCV_BGE else if (((p0_ = "bltu"))) then sail2_state_monad$returnS RISCV_BLTU else if (((p0_ = "bgeu"))) then sail2_state_monad$returnS RISCV_BGEU else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((btype_mnemonic_forwards_matches:bop -> bool) arg_= ((case arg_ of RISCV_BEQ => T | RISCV_BNE => T | RISCV_BLT => T | RISCV_BGE => T | RISCV_BLTU => T | RISCV_BGEU => T )))`; val _ = Define ` ((btype_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "beq"))) then T else if (((p0_ = "bne"))) then T else if (((p0_ = "blt"))) then T else if (((p0_ = "bge"))) then T else if (((p0_ = "bltu"))) then T else if (((p0_ = "bgeu"))) then T else F))`; (*val _s785_ : string -> maybe string*) val _ = Define ` ((s785_:string ->(string)option) s786_0= (let s787_0 = s786_0 in if ((string_startswith s787_0 "bgeu")) then (case ((string_drop s787_0 ((string_length "bgeu")))) of s_ => SOME s_ ) else NONE))`; (*val _s781_ : string -> maybe string*) val _ = Define ` ((s781_:string ->(string)option) s782_0= (let s783_0 = s782_0 in if ((string_startswith s783_0 "bltu")) then (case ((string_drop s783_0 ((string_length "bltu")))) of s_ => SOME s_ ) else NONE))`; (*val _s777_ : string -> maybe string*) val _ = Define ` ((s777_:string ->(string)option) s778_0= (let s779_0 = s778_0 in if ((string_startswith s779_0 "bge")) then (case ((string_drop s779_0 ((string_length "bge")))) of s_ => SOME s_ ) else NONE))`; (*val _s773_ : string -> maybe string*) val _ = Define ` ((s773_:string ->(string)option) s774_0= (let s775_0 = s774_0 in if ((string_startswith s775_0 "blt")) then (case ((string_drop s775_0 ((string_length "blt")))) of s_ => SOME s_ ) else NONE))`; (*val _s769_ : string -> maybe string*) val _ = Define ` ((s769_:string ->(string)option) s770_0= (let s771_0 = s770_0 in if ((string_startswith s771_0 "bne")) then (case ((string_drop s771_0 ((string_length "bne")))) of s_ => SOME s_ ) else NONE))`; (*val _s765_ : string -> maybe string*) val _ = Define ` ((s765_:string ->(string)option) s766_0= (let s767_0 = s766_0 in if ((string_startswith s767_0 "beq")) then (case ((string_drop s767_0 ((string_length "beq")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((btype_mnemonic_matches_prefix:string ->(bop#int)option) arg_= (let s768_0 = arg_ in if ((case ((s765_ s768_0)) of SOME (s_) => T | _ => F )) then (case s765_ s768_0 of (SOME (s_)) => SOME (RISCV_BEQ, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s769_ s768_0)) of SOME (s_) => T | _ => F )) then (case s769_ s768_0 of (SOME (s_)) => SOME (RISCV_BNE, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s773_ s768_0)) of SOME (s_) => T | _ => F )) then (case s773_ s768_0 of (SOME (s_)) => SOME (RISCV_BLT, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s777_ s768_0)) of SOME (s_) => T | _ => F )) then (case s777_ s768_0 of (SOME (s_)) => SOME (RISCV_BGE, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s781_ s768_0)) of SOME (s_) => T | _ => F )) then (case s781_ s768_0 of (SOME (s_)) => SOME (RISCV_BLTU, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s785_ s768_0)) of SOME (s_) => T | _ => F )) then (case s785_ s768_0 of (SOME (s_)) => SOME (RISCV_BGEU, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val encdec_iop_forwards : iop -> mword ty3*) (*val encdec_iop_backwards : mword ty3 -> M iop*) (*val encdec_iop_forwards_matches : iop -> bool*) (*val encdec_iop_backwards_matches : mword ty3 -> bool*) val _ = Define ` ((encdec_iop_forwards:iop ->(3)words$word) arg_= ((case arg_ of RISCV_ADDI => (0b000w : 3 words$word) | RISCV_SLTI => (0b010w : 3 words$word) | RISCV_SLTIU => (0b011w : 3 words$word) | RISCV_ANDI => (0b111w : 3 words$word) | RISCV_ORI => (0b110w : 3 words$word) | RISCV_XORI => (0b100w : 3 words$word) )))`; val _ = Define ` ((encdec_iop_backwards:(3)words$word ->(regstate)sail2_state_monad$sequential_state ->(((iop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then sail2_state_monad$returnS RISCV_ADDI else if (((b__0 = (0b010w : 3 words$word)))) then sail2_state_monad$returnS RISCV_SLTI else if (((b__0 = (0b011w : 3 words$word)))) then sail2_state_monad$returnS RISCV_SLTIU else if (((b__0 = (0b111w : 3 words$word)))) then sail2_state_monad$returnS RISCV_ANDI else if (((b__0 = (0b110w : 3 words$word)))) then sail2_state_monad$returnS RISCV_ORI else if (((b__0 = (0b100w : 3 words$word)))) then sail2_state_monad$returnS RISCV_XORI else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((encdec_iop_forwards_matches:iop -> bool) arg_= ((case arg_ of RISCV_ADDI => T | RISCV_SLTI => T | RISCV_SLTIU => T | RISCV_ANDI => T | RISCV_ORI => T | RISCV_XORI => T )))`; val _ = Define ` ((encdec_iop_backwards_matches:(3)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then T else if (((b__0 = (0b010w : 3 words$word)))) then T else if (((b__0 = (0b011w : 3 words$word)))) then T else if (((b__0 = (0b111w : 3 words$word)))) then T else if (((b__0 = (0b110w : 3 words$word)))) then T else if (((b__0 = (0b100w : 3 words$word)))) then T else F))`; (*val itype_mnemonic_forwards : iop -> string*) (*val itype_mnemonic_backwards : string -> M iop*) (*val itype_mnemonic_forwards_matches : iop -> bool*) (*val itype_mnemonic_backwards_matches : string -> bool*) (*val itype_mnemonic_matches_prefix : string -> maybe ((iop * ii))*) val _ = Define ` ((itype_mnemonic_forwards:iop -> string) arg_= ((case arg_ of RISCV_ADDI => "addi" | RISCV_SLTI => "slti" | RISCV_SLTIU => "sltiu" | RISCV_XORI => "xori" | RISCV_ORI => "ori" | RISCV_ANDI => "andi" )))`; val _ = Define ` ((itype_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((iop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "addi"))) then sail2_state_monad$returnS RISCV_ADDI else if (((p0_ = "slti"))) then sail2_state_monad$returnS RISCV_SLTI else if (((p0_ = "sltiu"))) then sail2_state_monad$returnS RISCV_SLTIU else if (((p0_ = "xori"))) then sail2_state_monad$returnS RISCV_XORI else if (((p0_ = "ori"))) then sail2_state_monad$returnS RISCV_ORI else if (((p0_ = "andi"))) then sail2_state_monad$returnS RISCV_ANDI else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((itype_mnemonic_forwards_matches:iop -> bool) arg_= ((case arg_ of RISCV_ADDI => T | RISCV_SLTI => T | RISCV_SLTIU => T | RISCV_XORI => T | RISCV_ORI => T | RISCV_ANDI => T )))`; val _ = Define ` ((itype_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "addi"))) then T else if (((p0_ = "slti"))) then T else if (((p0_ = "sltiu"))) then T else if (((p0_ = "xori"))) then T else if (((p0_ = "ori"))) then T else if (((p0_ = "andi"))) then T else F))`; (*val _s809_ : string -> maybe string*) val _ = Define ` ((s809_:string ->(string)option) s810_0= (let s811_0 = s810_0 in if ((string_startswith s811_0 "andi")) then (case ((string_drop s811_0 ((string_length "andi")))) of s_ => SOME s_ ) else NONE))`; (*val _s805_ : string -> maybe string*) val _ = Define ` ((s805_:string ->(string)option) s806_0= (let s807_0 = s806_0 in if ((string_startswith s807_0 "ori")) then (case ((string_drop s807_0 ((string_length "ori")))) of s_ => SOME s_ ) else NONE))`; (*val _s801_ : string -> maybe string*) val _ = Define ` ((s801_:string ->(string)option) s802_0= (let s803_0 = s802_0 in if ((string_startswith s803_0 "xori")) then (case ((string_drop s803_0 ((string_length "xori")))) of s_ => SOME s_ ) else NONE))`; (*val _s797_ : string -> maybe string*) val _ = Define ` ((s797_:string ->(string)option) s798_0= (let s799_0 = s798_0 in if ((string_startswith s799_0 "sltiu")) then (case ((string_drop s799_0 ((string_length "sltiu")))) of s_ => SOME s_ ) else NONE))`; (*val _s793_ : string -> maybe string*) val _ = Define ` ((s793_:string ->(string)option) s794_0= (let s795_0 = s794_0 in if ((string_startswith s795_0 "slti")) then (case ((string_drop s795_0 ((string_length "slti")))) of s_ => SOME s_ ) else NONE))`; (*val _s789_ : string -> maybe string*) val _ = Define ` ((s789_:string ->(string)option) s790_0= (let s791_0 = s790_0 in if ((string_startswith s791_0 "addi")) then (case ((string_drop s791_0 ((string_length "addi")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((itype_mnemonic_matches_prefix:string ->(iop#int)option) arg_= (let s792_0 = arg_ in if ((case ((s789_ s792_0)) of SOME (s_) => T | _ => F )) then (case s789_ s792_0 of (SOME (s_)) => SOME (RISCV_ADDI, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s793_ s792_0)) of SOME (s_) => T | _ => F )) then (case s793_ s792_0 of (SOME (s_)) => SOME (RISCV_SLTI, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s797_ s792_0)) of SOME (s_) => T | _ => F )) then (case s797_ s792_0 of (SOME (s_)) => SOME (RISCV_SLTIU, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s801_ s792_0)) of SOME (s_) => T | _ => F )) then (case s801_ s792_0 of (SOME (s_)) => SOME (RISCV_XORI, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s805_ s792_0)) of SOME (s_) => T | _ => F )) then (case s805_ s792_0 of (SOME (s_)) => SOME (RISCV_ORI, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s809_ s792_0)) of SOME (s_) => T | _ => F )) then (case s809_ s792_0 of (SOME (s_)) => SOME (RISCV_ANDI, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val encdec_sop_forwards : sop -> mword ty3*) (*val encdec_sop_backwards : mword ty3 -> M sop*) (*val encdec_sop_forwards_matches : sop -> bool*) (*val encdec_sop_backwards_matches : mword ty3 -> bool*) val _ = Define ` ((encdec_sop_forwards:sop ->(3)words$word) arg_= ((case arg_ of RISCV_SLLI => (0b001w : 3 words$word) | RISCV_SRLI => (0b101w : 3 words$word) | RISCV_SRAI => (0b101w : 3 words$word) )))`; val _ = Define ` ((encdec_sop_backwards:(3)words$word ->(regstate)sail2_state_monad$sequential_state ->(((sop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b001w : 3 words$word)))) then sail2_state_monad$returnS RISCV_SLLI else if (((b__0 = (0b101w : 3 words$word)))) then sail2_state_monad$returnS RISCV_SRLI else if (((b__0 = (0b101w : 3 words$word)))) then sail2_state_monad$returnS RISCV_SRAI else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((encdec_sop_forwards_matches:sop -> bool) arg_= ((case arg_ of RISCV_SLLI => T | RISCV_SRLI => T | RISCV_SRAI => T )))`; val _ = Define ` ((encdec_sop_backwards_matches:(3)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b001w : 3 words$word)))) then T else if (((b__0 = (0b101w : 3 words$word)))) then T else if (((b__0 = (0b101w : 3 words$word)))) then T else F))`; (*val shiftiop_mnemonic_forwards : sop -> string*) (*val shiftiop_mnemonic_backwards : string -> M sop*) (*val shiftiop_mnemonic_forwards_matches : sop -> bool*) (*val shiftiop_mnemonic_backwards_matches : string -> bool*) (*val shiftiop_mnemonic_matches_prefix : string -> maybe ((sop * ii))*) val _ = Define ` ((shiftiop_mnemonic_forwards:sop -> string) arg_= ((case arg_ of RISCV_SLLI => "slli" | RISCV_SRLI => "srli" | RISCV_SRAI => "srai" )))`; val _ = Define ` ((shiftiop_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((sop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "slli"))) then sail2_state_monad$returnS RISCV_SLLI else if (((p0_ = "srli"))) then sail2_state_monad$returnS RISCV_SRLI else if (((p0_ = "srai"))) then sail2_state_monad$returnS RISCV_SRAI else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((shiftiop_mnemonic_forwards_matches:sop -> bool) arg_= ((case arg_ of RISCV_SLLI => T | RISCV_SRLI => T | RISCV_SRAI => T )))`; val _ = Define ` ((shiftiop_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "slli"))) then T else if (((p0_ = "srli"))) then T else if (((p0_ = "srai"))) then T else F))`; (*val _s821_ : string -> maybe string*) val _ = Define ` ((s821_:string ->(string)option) s822_0= (let s823_0 = s822_0 in if ((string_startswith s823_0 "srai")) then (case ((string_drop s823_0 ((string_length "srai")))) of s_ => SOME s_ ) else NONE))`; (*val _s817_ : string -> maybe string*) val _ = Define ` ((s817_:string ->(string)option) s818_0= (let s819_0 = s818_0 in if ((string_startswith s819_0 "srli")) then (case ((string_drop s819_0 ((string_length "srli")))) of s_ => SOME s_ ) else NONE))`; (*val _s813_ : string -> maybe string*) val _ = Define ` ((s813_:string ->(string)option) s814_0= (let s815_0 = s814_0 in if ((string_startswith s815_0 "slli")) then (case ((string_drop s815_0 ((string_length "slli")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((shiftiop_mnemonic_matches_prefix:string ->(sop#int)option) arg_= (let s816_0 = arg_ in if ((case ((s813_ s816_0)) of SOME (s_) => T | _ => F )) then (case s813_ s816_0 of (SOME (s_)) => SOME (RISCV_SLLI, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s817_ s816_0)) of SOME (s_) => T | _ => F )) then (case s817_ s816_0 of (SOME (s_)) => SOME (RISCV_SRLI, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s821_ s816_0)) of SOME (s_) => T | _ => F )) then (case s821_ s816_0 of (SOME (s_)) => SOME (RISCV_SRAI, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val rtype_mnemonic_forwards : rop -> string*) (*val rtype_mnemonic_backwards : string -> M rop*) (*val rtype_mnemonic_forwards_matches : rop -> bool*) (*val rtype_mnemonic_backwards_matches : string -> bool*) (*val rtype_mnemonic_matches_prefix : string -> maybe ((rop * ii))*) val _ = Define ` ((rtype_mnemonic_forwards:rop -> string) arg_= ((case arg_ of RISCV_ADD => "add" | RISCV_SLT => "slt" | RISCV_SLTU => "sltu" | RISCV_AND => "and" | RISCV_OR => "or" | RISCV_XOR => "xor" | RISCV_SLL => "sll" | RISCV_SRL => "srl" | RISCV_SUB => "sub" | RISCV_SRA => "sra" )))`; val _ = Define ` ((rtype_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((rop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "add"))) then sail2_state_monad$returnS RISCV_ADD else if (((p0_ = "slt"))) then sail2_state_monad$returnS RISCV_SLT else if (((p0_ = "sltu"))) then sail2_state_monad$returnS RISCV_SLTU else if (((p0_ = "and"))) then sail2_state_monad$returnS RISCV_AND else if (((p0_ = "or"))) then sail2_state_monad$returnS RISCV_OR else if (((p0_ = "xor"))) then sail2_state_monad$returnS RISCV_XOR else if (((p0_ = "sll"))) then sail2_state_monad$returnS RISCV_SLL else if (((p0_ = "srl"))) then sail2_state_monad$returnS RISCV_SRL else if (((p0_ = "sub"))) then sail2_state_monad$returnS RISCV_SUB else if (((p0_ = "sra"))) then sail2_state_monad$returnS RISCV_SRA else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((rtype_mnemonic_forwards_matches:rop -> bool) arg_= ((case arg_ of RISCV_ADD => T | RISCV_SLT => T | RISCV_SLTU => T | RISCV_AND => T | RISCV_OR => T | RISCV_XOR => T | RISCV_SLL => T | RISCV_SRL => T | RISCV_SUB => T | RISCV_SRA => T )))`; val _ = Define ` ((rtype_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "add"))) then T else if (((p0_ = "slt"))) then T else if (((p0_ = "sltu"))) then T else if (((p0_ = "and"))) then T else if (((p0_ = "or"))) then T else if (((p0_ = "xor"))) then T else if (((p0_ = "sll"))) then T else if (((p0_ = "srl"))) then T else if (((p0_ = "sub"))) then T else if (((p0_ = "sra"))) then T else F))`; (*val _s861_ : string -> maybe string*) val _ = Define ` ((s861_:string ->(string)option) s862_0= (let s863_0 = s862_0 in if ((string_startswith s863_0 "sra")) then (case ((string_drop s863_0 ((string_length "sra")))) of s_ => SOME s_ ) else NONE))`; (*val _s857_ : string -> maybe string*) val _ = Define ` ((s857_:string ->(string)option) s858_0= (let s859_0 = s858_0 in if ((string_startswith s859_0 "sub")) then (case ((string_drop s859_0 ((string_length "sub")))) of s_ => SOME s_ ) else NONE))`; (*val _s853_ : string -> maybe string*) val _ = Define ` ((s853_:string ->(string)option) s854_0= (let s855_0 = s854_0 in if ((string_startswith s855_0 "srl")) then (case ((string_drop s855_0 ((string_length "srl")))) of s_ => SOME s_ ) else NONE))`; (*val _s849_ : string -> maybe string*) val _ = Define ` ((s849_:string ->(string)option) s850_0= (let s851_0 = s850_0 in if ((string_startswith s851_0 "sll")) then (case ((string_drop s851_0 ((string_length "sll")))) of s_ => SOME s_ ) else NONE))`; (*val _s845_ : string -> maybe string*) val _ = Define ` ((s845_:string ->(string)option) s846_0= (let s847_0 = s846_0 in if ((string_startswith s847_0 "xor")) then (case ((string_drop s847_0 ((string_length "xor")))) of s_ => SOME s_ ) else NONE))`; (*val _s841_ : string -> maybe string*) val _ = Define ` ((s841_:string ->(string)option) s842_0= (let s843_0 = s842_0 in if ((string_startswith s843_0 "or")) then (case ((string_drop s843_0 ((string_length "or")))) of s_ => SOME s_ ) else NONE))`; (*val _s837_ : string -> maybe string*) val _ = Define ` ((s837_:string ->(string)option) s838_0= (let s839_0 = s838_0 in if ((string_startswith s839_0 "and")) then (case ((string_drop s839_0 ((string_length "and")))) of s_ => SOME s_ ) else NONE))`; (*val _s833_ : string -> maybe string*) val _ = Define ` ((s833_:string ->(string)option) s834_0= (let s835_0 = s834_0 in if ((string_startswith s835_0 "sltu")) then (case ((string_drop s835_0 ((string_length "sltu")))) of s_ => SOME s_ ) else NONE))`; (*val _s829_ : string -> maybe string*) val _ = Define ` ((s829_:string ->(string)option) s830_0= (let s831_0 = s830_0 in if ((string_startswith s831_0 "slt")) then (case ((string_drop s831_0 ((string_length "slt")))) of s_ => SOME s_ ) else NONE))`; (*val _s825_ : string -> maybe string*) val _ = Define ` ((s825_:string ->(string)option) s826_0= (let s827_0 = s826_0 in if ((string_startswith s827_0 "add")) then (case ((string_drop s827_0 ((string_length "add")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((rtype_mnemonic_matches_prefix:string ->(rop#int)option) arg_= (let s828_0 = arg_ in if ((case ((s825_ s828_0)) of SOME (s_) => T | _ => F )) then (case s825_ s828_0 of (SOME (s_)) => SOME (RISCV_ADD, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s829_ s828_0)) of SOME (s_) => T | _ => F )) then (case s829_ s828_0 of (SOME (s_)) => SOME (RISCV_SLT, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s833_ s828_0)) of SOME (s_) => T | _ => F )) then (case s833_ s828_0 of (SOME (s_)) => SOME (RISCV_SLTU, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s837_ s828_0)) of SOME (s_) => T | _ => F )) then (case s837_ s828_0 of (SOME (s_)) => SOME (RISCV_AND, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s841_ s828_0)) of SOME (s_) => T | _ => F )) then (case s841_ s828_0 of (SOME (s_)) => SOME (RISCV_OR, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s845_ s828_0)) of SOME (s_) => T | _ => F )) then (case s845_ s828_0 of (SOME (s_)) => SOME (RISCV_XOR, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s849_ s828_0)) of SOME (s_) => T | _ => F )) then (case s849_ s828_0 of (SOME (s_)) => SOME (RISCV_SLL, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s853_ s828_0)) of SOME (s_) => T | _ => F )) then (case s853_ s828_0 of (SOME (s_)) => SOME (RISCV_SRL, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s857_ s828_0)) of SOME (s_) => T | _ => F )) then (case s857_ s828_0 of (SOME (s_)) => SOME (RISCV_SUB, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s861_ s828_0)) of SOME (s_) => T | _ => F )) then (case s861_ s828_0 of (SOME (s_)) => SOME (RISCV_SRA, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val extend_value : forall 'int8_times_n. Size 'int8_times_n => bool -> MemoryOpResult (mword 'int8_times_n) -> MemoryOpResult (mword ty64)*) val _ = Define ` ((extend_value:bool ->('int8_times_n words$word)MemoryOpResult ->((64)words$word)MemoryOpResult) is_unsigned value= ((case value of MemValue (v) => MemValue (if is_unsigned then (EXTZ (( 64 : int):ii) v : 64 words$word) else (EXTS (( 64 : int):ii) v : 64 words$word)) | MemException (e) => MemException e )))`; (*val process_load : forall 'int8_times_n. Size 'int8_times_n => mword ty5 -> mword ty64 -> MemoryOpResult (mword 'int8_times_n) -> bool -> M Retired*) val _ = Define ` ((process_load:(5)words$word ->(64)words$word ->('int8_times_n words$word)MemoryOpResult -> bool ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rd vaddr value is_unsigned= ((case ((extend_value is_unsigned value : ( 64 words$word) MemoryOpResult)) of MemValue (result) => sail2_state_monad$seqS (wX_bits rd result) (sail2_state_monad$returnS RETIRE_SUCCESS) | MemException (e) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) )))`; (*val check_misaligned : mword ty64 -> word_width -> bool*) val _ = Define ` ((check_misaligned:(64)words$word -> word_width -> bool) (vaddr : xlenbits) (width : word_width)= (if ((plat_enable_misaligned_access () )) then F else (case width of BYTE => F | HALF => (((access_vec_dec vaddr (( 0 : int):ii))) = B1) | WORD => ((((((access_vec_dec vaddr (( 0 : int):ii))) = B1))) \/ (((((access_vec_dec vaddr (( 1 : int):ii))) = B1)))) | DOUBLE => ((((((access_vec_dec vaddr (( 0 : int):ii))) = B1))) \/ ((((((((access_vec_dec vaddr (( 1 : int):ii))) = B1))) \/ (((((access_vec_dec vaddr (( 2 : int):ii))) = B1))))))) )))`; (*val maybe_aq_forwards : bool -> string*) (*val maybe_aq_backwards : string -> M bool*) (*val maybe_aq_forwards_matches : bool -> bool*) (*val maybe_aq_backwards_matches : string -> bool*) (*val maybe_aq_matches_prefix : string -> maybe ((bool * ii))*) val _ = Define ` ((maybe_aq_forwards:bool -> string) arg_= ((case arg_ of T => ".aq" | F => "" )))`; val _ = Define ` ((maybe_aq_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = ".aq"))) then sail2_state_monad$returnS T else if (((p0_ = ""))) then sail2_state_monad$returnS F else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((maybe_aq_forwards_matches:bool -> bool) arg_= ((case arg_ of T => T | F => T )))`; val _ = Define ` ((maybe_aq_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = ".aq"))) then T else if (((p0_ = ""))) then T else F))`; (*val _s869_ : string -> maybe string*) val _ = Define ` ((s869_:string ->(string)option) s870_0= (let s871_0 = s870_0 in if ((string_startswith s871_0 "")) then (case ((string_drop s871_0 ((string_length "")))) of s_ => SOME s_ ) else NONE))`; (*val _s865_ : string -> maybe string*) val _ = Define ` ((s865_:string ->(string)option) s866_0= (let s867_0 = s866_0 in if ((string_startswith s867_0 ".aq")) then (case ((string_drop s867_0 ((string_length ".aq")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((maybe_aq_matches_prefix:string ->(bool#int)option) arg_= (let s868_0 = arg_ in if ((case ((s865_ s868_0)) of SOME (s_) => T | _ => F )) then (case s865_ s868_0 of (SOME (s_)) => SOME (T, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s869_ s868_0)) of SOME (s_) => T | _ => F )) then (case s869_ s868_0 of (SOME (s_)) => SOME (F, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val maybe_rl_forwards : bool -> string*) (*val maybe_rl_backwards : string -> M bool*) (*val maybe_rl_forwards_matches : bool -> bool*) (*val maybe_rl_backwards_matches : string -> bool*) (*val maybe_rl_matches_prefix : string -> maybe ((bool * ii))*) val _ = Define ` ((maybe_rl_forwards:bool -> string) arg_= ((case arg_ of T => ".rl" | F => "" )))`; val _ = Define ` ((maybe_rl_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = ".rl"))) then sail2_state_monad$returnS T else if (((p0_ = ""))) then sail2_state_monad$returnS F else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((maybe_rl_forwards_matches:bool -> bool) arg_= ((case arg_ of T => T | F => T )))`; val _ = Define ` ((maybe_rl_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = ".rl"))) then T else if (((p0_ = ""))) then T else F))`; (*val _s877_ : string -> maybe string*) val _ = Define ` ((s877_:string ->(string)option) s878_0= (let s879_0 = s878_0 in if ((string_startswith s879_0 "")) then (case ((string_drop s879_0 ((string_length "")))) of s_ => SOME s_ ) else NONE))`; (*val _s873_ : string -> maybe string*) val _ = Define ` ((s873_:string ->(string)option) s874_0= (let s875_0 = s874_0 in if ((string_startswith s875_0 ".rl")) then (case ((string_drop s875_0 ((string_length ".rl")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((maybe_rl_matches_prefix:string ->(bool#int)option) arg_= (let s876_0 = arg_ in if ((case ((s873_ s876_0)) of SOME (s_) => T | _ => F )) then (case s873_ s876_0 of (SOME (s_)) => SOME (T, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s877_ s876_0)) of SOME (s_) => T | _ => F )) then (case s877_ s876_0 of (SOME (s_)) => SOME (F, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val maybe_u_forwards : bool -> string*) (*val maybe_u_backwards : string -> M bool*) (*val maybe_u_forwards_matches : bool -> bool*) (*val maybe_u_backwards_matches : string -> bool*) (*val maybe_u_matches_prefix : string -> maybe ((bool * ii))*) val _ = Define ` ((maybe_u_forwards:bool -> string) arg_= ((case arg_ of T => "u" | F => "" )))`; val _ = Define ` ((maybe_u_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "u"))) then sail2_state_monad$returnS T else if (((p0_ = ""))) then sail2_state_monad$returnS F else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((maybe_u_forwards_matches:bool -> bool) arg_= ((case arg_ of T => T | F => T )))`; val _ = Define ` ((maybe_u_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "u"))) then T else if (((p0_ = ""))) then T else F))`; (*val _s885_ : string -> maybe string*) val _ = Define ` ((s885_:string ->(string)option) s886_0= (let s887_0 = s886_0 in if ((string_startswith s887_0 "")) then (case ((string_drop s887_0 ((string_length "")))) of s_ => SOME s_ ) else NONE))`; (*val _s881_ : string -> maybe string*) val _ = Define ` ((s881_:string ->(string)option) s882_0= (let s883_0 = s882_0 in if ((string_startswith s883_0 "u")) then (case ((string_drop s883_0 ((string_length "u")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((maybe_u_matches_prefix:string ->(bool#int)option) arg_= (let s884_0 = arg_ in if ((case ((s881_ s884_0)) of SOME (s_) => T | _ => F )) then (case s881_ s884_0 of (SOME (s_)) => SOME (T, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s885_ s884_0)) of SOME (s_) => T | _ => F )) then (case s885_ s884_0 of (SOME (s_)) => SOME (F, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val shiftw_mnemonic_forwards : sop -> string*) (*val shiftw_mnemonic_backwards : string -> M sop*) (*val shiftw_mnemonic_forwards_matches : sop -> bool*) (*val shiftw_mnemonic_backwards_matches : string -> bool*) (*val shiftw_mnemonic_matches_prefix : string -> maybe ((sop * ii))*) val _ = Define ` ((shiftw_mnemonic_forwards:sop -> string) arg_= ((case arg_ of RISCV_SLLI => "slli" | RISCV_SRLI => "srli" | RISCV_SRAI => "srai" )))`; val _ = Define ` ((shiftw_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((sop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "slli"))) then sail2_state_monad$returnS RISCV_SLLI else if (((p0_ = "srli"))) then sail2_state_monad$returnS RISCV_SRLI else if (((p0_ = "srai"))) then sail2_state_monad$returnS RISCV_SRAI else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((shiftw_mnemonic_forwards_matches:sop -> bool) arg_= ((case arg_ of RISCV_SLLI => T | RISCV_SRLI => T | RISCV_SRAI => T )))`; val _ = Define ` ((shiftw_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "slli"))) then T else if (((p0_ = "srli"))) then T else if (((p0_ = "srai"))) then T else F))`; (*val _s897_ : string -> maybe string*) val _ = Define ` ((s897_:string ->(string)option) s898_0= (let s899_0 = s898_0 in if ((string_startswith s899_0 "srai")) then (case ((string_drop s899_0 ((string_length "srai")))) of s_ => SOME s_ ) else NONE))`; (*val _s893_ : string -> maybe string*) val _ = Define ` ((s893_:string ->(string)option) s894_0= (let s895_0 = s894_0 in if ((string_startswith s895_0 "srli")) then (case ((string_drop s895_0 ((string_length "srli")))) of s_ => SOME s_ ) else NONE))`; (*val _s889_ : string -> maybe string*) val _ = Define ` ((s889_:string ->(string)option) s890_0= (let s891_0 = s890_0 in if ((string_startswith s891_0 "slli")) then (case ((string_drop s891_0 ((string_length "slli")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((shiftw_mnemonic_matches_prefix:string ->(sop#int)option) arg_= (let s892_0 = arg_ in if ((case ((s889_ s892_0)) of SOME (s_) => T | _ => F )) then (case s889_ s892_0 of (SOME (s_)) => SOME (RISCV_SLLI, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s893_ s892_0)) of SOME (s_) => T | _ => F )) then (case s893_ s892_0 of (SOME (s_)) => SOME (RISCV_SRLI, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s897_ s892_0)) of SOME (s_) => T | _ => F )) then (case s897_ s892_0 of (SOME (s_)) => SOME (RISCV_SRAI, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val rtypew_mnemonic_forwards : ropw -> string*) (*val rtypew_mnemonic_backwards : string -> M ropw*) (*val rtypew_mnemonic_forwards_matches : ropw -> bool*) (*val rtypew_mnemonic_backwards_matches : string -> bool*) (*val rtypew_mnemonic_matches_prefix : string -> maybe ((ropw * ii))*) val _ = Define ` ((rtypew_mnemonic_forwards:ropw -> string) arg_= ((case arg_ of RISCV_ADDW => "addw" | RISCV_SUBW => "subw" | RISCV_SLLW => "sllw" | RISCV_SRLW => "srlw" | RISCV_SRAW => "sraw" )))`; val _ = Define ` ((rtypew_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((ropw),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "addw"))) then sail2_state_monad$returnS RISCV_ADDW else if (((p0_ = "subw"))) then sail2_state_monad$returnS RISCV_SUBW else if (((p0_ = "sllw"))) then sail2_state_monad$returnS RISCV_SLLW else if (((p0_ = "srlw"))) then sail2_state_monad$returnS RISCV_SRLW else if (((p0_ = "sraw"))) then sail2_state_monad$returnS RISCV_SRAW else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((rtypew_mnemonic_forwards_matches:ropw -> bool) arg_= ((case arg_ of RISCV_ADDW => T | RISCV_SUBW => T | RISCV_SLLW => T | RISCV_SRLW => T | RISCV_SRAW => T )))`; val _ = Define ` ((rtypew_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "addw"))) then T else if (((p0_ = "subw"))) then T else if (((p0_ = "sllw"))) then T else if (((p0_ = "srlw"))) then T else if (((p0_ = "sraw"))) then T else F))`; (*val _s917_ : string -> maybe string*) val _ = Define ` ((s917_:string ->(string)option) s918_0= (let s919_0 = s918_0 in if ((string_startswith s919_0 "sraw")) then (case ((string_drop s919_0 ((string_length "sraw")))) of s_ => SOME s_ ) else NONE))`; (*val _s913_ : string -> maybe string*) val _ = Define ` ((s913_:string ->(string)option) s914_0= (let s915_0 = s914_0 in if ((string_startswith s915_0 "srlw")) then (case ((string_drop s915_0 ((string_length "srlw")))) of s_ => SOME s_ ) else NONE))`; (*val _s909_ : string -> maybe string*) val _ = Define ` ((s909_:string ->(string)option) s910_0= (let s911_0 = s910_0 in if ((string_startswith s911_0 "sllw")) then (case ((string_drop s911_0 ((string_length "sllw")))) of s_ => SOME s_ ) else NONE))`; (*val _s905_ : string -> maybe string*) val _ = Define ` ((s905_:string ->(string)option) s906_0= (let s907_0 = s906_0 in if ((string_startswith s907_0 "subw")) then (case ((string_drop s907_0 ((string_length "subw")))) of s_ => SOME s_ ) else NONE))`; (*val _s901_ : string -> maybe string*) val _ = Define ` ((s901_:string ->(string)option) s902_0= (let s903_0 = s902_0 in if ((string_startswith s903_0 "addw")) then (case ((string_drop s903_0 ((string_length "addw")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((rtypew_mnemonic_matches_prefix:string ->(ropw#int)option) arg_= (let s904_0 = arg_ in if ((case ((s901_ s904_0)) of SOME (s_) => T | _ => F )) then (case s901_ s904_0 of (SOME (s_)) => SOME (RISCV_ADDW, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s905_ s904_0)) of SOME (s_) => T | _ => F )) then (case s905_ s904_0 of (SOME (s_)) => SOME (RISCV_SUBW, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s909_ s904_0)) of SOME (s_) => T | _ => F )) then (case s909_ s904_0 of (SOME (s_)) => SOME (RISCV_SLLW, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s913_ s904_0)) of SOME (s_) => T | _ => F )) then (case s913_ s904_0 of (SOME (s_)) => SOME (RISCV_SRLW, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s917_ s904_0)) of SOME (s_) => T | _ => F )) then (case s917_ s904_0 of (SOME (s_)) => SOME (RISCV_SRAW, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val shiftiwop_mnemonic_forwards : sopw -> string*) (*val shiftiwop_mnemonic_backwards : string -> M sopw*) (*val shiftiwop_mnemonic_forwards_matches : sopw -> bool*) (*val shiftiwop_mnemonic_backwards_matches : string -> bool*) (*val shiftiwop_mnemonic_matches_prefix : string -> maybe ((sopw * ii))*) val _ = Define ` ((shiftiwop_mnemonic_forwards:sopw -> string) arg_= ((case arg_ of RISCV_SLLIW => "slliw" | RISCV_SRLIW => "srliw" | RISCV_SRAIW => "sraiw" )))`; val _ = Define ` ((shiftiwop_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((sopw),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "slliw"))) then sail2_state_monad$returnS RISCV_SLLIW else if (((p0_ = "srliw"))) then sail2_state_monad$returnS RISCV_SRLIW else if (((p0_ = "sraiw"))) then sail2_state_monad$returnS RISCV_SRAIW else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((shiftiwop_mnemonic_forwards_matches:sopw -> bool) arg_= ((case arg_ of RISCV_SLLIW => T | RISCV_SRLIW => T | RISCV_SRAIW => T )))`; val _ = Define ` ((shiftiwop_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "slliw"))) then T else if (((p0_ = "srliw"))) then T else if (((p0_ = "sraiw"))) then T else F))`; (*val _s929_ : string -> maybe string*) val _ = Define ` ((s929_:string ->(string)option) s930_0= (let s931_0 = s930_0 in if ((string_startswith s931_0 "sraiw")) then (case ((string_drop s931_0 ((string_length "sraiw")))) of s_ => SOME s_ ) else NONE))`; (*val _s925_ : string -> maybe string*) val _ = Define ` ((s925_:string ->(string)option) s926_0= (let s927_0 = s926_0 in if ((string_startswith s927_0 "srliw")) then (case ((string_drop s927_0 ((string_length "srliw")))) of s_ => SOME s_ ) else NONE))`; (*val _s921_ : string -> maybe string*) val _ = Define ` ((s921_:string ->(string)option) s922_0= (let s923_0 = s922_0 in if ((string_startswith s923_0 "slliw")) then (case ((string_drop s923_0 ((string_length "slliw")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((shiftiwop_mnemonic_matches_prefix:string ->(sopw#int)option) arg_= (let s924_0 = arg_ in if ((case ((s921_ s924_0)) of SOME (s_) => T | _ => F )) then (case s921_ s924_0 of (SOME (s_)) => SOME (RISCV_SLLIW, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s925_ s924_0)) of SOME (s_) => T | _ => F )) then (case s925_ s924_0 of (SOME (s_)) => SOME (RISCV_SRLIW, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s929_ s924_0)) of SOME (s_) => T | _ => F )) then (case s929_ s924_0 of (SOME (s_)) => SOME (RISCV_SRAIW, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val bit_maybe_r_forwards : mword ty1 -> M string*) (*val bit_maybe_r_backwards : string -> M (mword ty1)*) (*val bit_maybe_r_forwards_matches : mword ty1 -> bool*) (*val bit_maybe_r_backwards_matches : string -> bool*) (*val bit_maybe_r_matches_prefix : string -> maybe ((mword ty1 * ii))*) val _ = Define ` ((bit_maybe_r_forwards:(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then sail2_state_monad$returnS "r" else if (((b__0 = (0b0w : 1 words$word)))) then sail2_state_monad$returnS "" else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bit_maybe_r_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((1)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "r"))) then sail2_state_monad$returnS (0b1w : 1 words$word) else if (((p0_ = ""))) then sail2_state_monad$returnS (0b0w : 1 words$word) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bit_maybe_r_forwards_matches:(1)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then T else if (((b__0 = (0b0w : 1 words$word)))) then T else F))`; val _ = Define ` ((bit_maybe_r_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "r"))) then T else if (((p0_ = ""))) then T else F))`; (*val _s937_ : string -> maybe string*) val _ = Define ` ((s937_:string ->(string)option) s938_0= (let s939_0 = s938_0 in if ((string_startswith s939_0 "")) then (case ((string_drop s939_0 ((string_length "")))) of s_ => SOME s_ ) else NONE))`; (*val _s933_ : string -> maybe string*) val _ = Define ` ((s933_:string ->(string)option) s934_0= (let s935_0 = s934_0 in if ((string_startswith s935_0 "r")) then (case ((string_drop s935_0 ((string_length "r")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((bit_maybe_r_matches_prefix:string ->((1)words$word#int)option) arg_= (let s936_0 = arg_ in if ((case ((s933_ s936_0)) of SOME (s_) => T | _ => F )) then (case s933_ s936_0 of (SOME (s_)) => SOME ((0b1w : 1 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s937_ s936_0)) of SOME (s_) => T | _ => F )) then (case s937_ s936_0 of (SOME (s_)) => SOME ((0b0w : 1 words$word), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val bit_maybe_w_forwards : mword ty1 -> M string*) (*val bit_maybe_w_backwards : string -> M (mword ty1)*) (*val bit_maybe_w_forwards_matches : mword ty1 -> bool*) (*val bit_maybe_w_backwards_matches : string -> bool*) (*val bit_maybe_w_matches_prefix : string -> maybe ((mword ty1 * ii))*) val _ = Define ` ((bit_maybe_w_forwards:(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then sail2_state_monad$returnS "w" else if (((b__0 = (0b0w : 1 words$word)))) then sail2_state_monad$returnS "" else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bit_maybe_w_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((1)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "w"))) then sail2_state_monad$returnS (0b1w : 1 words$word) else if (((p0_ = ""))) then sail2_state_monad$returnS (0b0w : 1 words$word) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bit_maybe_w_forwards_matches:(1)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then T else if (((b__0 = (0b0w : 1 words$word)))) then T else F))`; val _ = Define ` ((bit_maybe_w_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "w"))) then T else if (((p0_ = ""))) then T else F))`; (*val _s945_ : string -> maybe string*) val _ = Define ` ((s945_:string ->(string)option) s946_0= (let s947_0 = s946_0 in if ((string_startswith s947_0 "")) then (case ((string_drop s947_0 ((string_length "")))) of s_ => SOME s_ ) else NONE))`; (*val _s941_ : string -> maybe string*) val _ = Define ` ((s941_:string ->(string)option) s942_0= (let s943_0 = s942_0 in if ((string_startswith s943_0 "w")) then (case ((string_drop s943_0 ((string_length "w")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((bit_maybe_w_matches_prefix:string ->((1)words$word#int)option) arg_= (let s944_0 = arg_ in if ((case ((s941_ s944_0)) of SOME (s_) => T | _ => F )) then (case s941_ s944_0 of (SOME (s_)) => SOME ((0b1w : 1 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s945_ s944_0)) of SOME (s_) => T | _ => F )) then (case s945_ s944_0 of (SOME (s_)) => SOME ((0b0w : 1 words$word), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val bit_maybe_i_forwards : mword ty1 -> M string*) (*val bit_maybe_i_backwards : string -> M (mword ty1)*) (*val bit_maybe_i_forwards_matches : mword ty1 -> bool*) (*val bit_maybe_i_backwards_matches : string -> bool*) (*val bit_maybe_i_matches_prefix : string -> maybe ((mword ty1 * ii))*) val _ = Define ` ((bit_maybe_i_forwards:(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then sail2_state_monad$returnS "i" else if (((b__0 = (0b0w : 1 words$word)))) then sail2_state_monad$returnS "" else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bit_maybe_i_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((1)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "i"))) then sail2_state_monad$returnS (0b1w : 1 words$word) else if (((p0_ = ""))) then sail2_state_monad$returnS (0b0w : 1 words$word) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bit_maybe_i_forwards_matches:(1)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then T else if (((b__0 = (0b0w : 1 words$word)))) then T else F))`; val _ = Define ` ((bit_maybe_i_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "i"))) then T else if (((p0_ = ""))) then T else F))`; (*val _s953_ : string -> maybe string*) val _ = Define ` ((s953_:string ->(string)option) s954_0= (let s955_0 = s954_0 in if ((string_startswith s955_0 "")) then (case ((string_drop s955_0 ((string_length "")))) of s_ => SOME s_ ) else NONE))`; (*val _s949_ : string -> maybe string*) val _ = Define ` ((s949_:string ->(string)option) s950_0= (let s951_0 = s950_0 in if ((string_startswith s951_0 "i")) then (case ((string_drop s951_0 ((string_length "i")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((bit_maybe_i_matches_prefix:string ->((1)words$word#int)option) arg_= (let s952_0 = arg_ in if ((case ((s949_ s952_0)) of SOME (s_) => T | _ => F )) then (case s949_ s952_0 of (SOME (s_)) => SOME ((0b1w : 1 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s953_ s952_0)) of SOME (s_) => T | _ => F )) then (case s953_ s952_0 of (SOME (s_)) => SOME ((0b0w : 1 words$word), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val bit_maybe_o_forwards : mword ty1 -> M string*) (*val bit_maybe_o_backwards : string -> M (mword ty1)*) (*val bit_maybe_o_forwards_matches : mword ty1 -> bool*) (*val bit_maybe_o_backwards_matches : string -> bool*) (*val bit_maybe_o_matches_prefix : string -> maybe ((mword ty1 * ii))*) val _ = Define ` ((bit_maybe_o_forwards:(1)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then sail2_state_monad$returnS "o" else if (((b__0 = (0b0w : 1 words$word)))) then sail2_state_monad$returnS "" else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bit_maybe_o_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((1)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "o"))) then sail2_state_monad$returnS (0b1w : 1 words$word) else if (((p0_ = ""))) then sail2_state_monad$returnS (0b0w : 1 words$word) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((bit_maybe_o_forwards_matches:(1)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b1w : 1 words$word)))) then T else if (((b__0 = (0b0w : 1 words$word)))) then T else F))`; val _ = Define ` ((bit_maybe_o_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "o"))) then T else if (((p0_ = ""))) then T else F))`; (*val _s961_ : string -> maybe string*) val _ = Define ` ((s961_:string ->(string)option) s962_0= (let s963_0 = s962_0 in if ((string_startswith s963_0 "")) then (case ((string_drop s963_0 ((string_length "")))) of s_ => SOME s_ ) else NONE))`; (*val _s957_ : string -> maybe string*) val _ = Define ` ((s957_:string ->(string)option) s958_0= (let s959_0 = s958_0 in if ((string_startswith s959_0 "o")) then (case ((string_drop s959_0 ((string_length "o")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((bit_maybe_o_matches_prefix:string ->((1)words$word#int)option) arg_= (let s960_0 = arg_ in if ((case ((s957_ s960_0)) of SOME (s_) => T | _ => F )) then (case s957_ s960_0 of (SOME (s_)) => SOME ((0b1w : 1 words$word), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s961_ s960_0)) of SOME (s_) => T | _ => F )) then (case s961_ s960_0 of (SOME (s_)) => SOME ((0b0w : 1 words$word), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val fence_bits_forwards : mword ty4 -> M string*) (*val fence_bits_backwards : string -> M (mword ty4)*) (*val fence_bits_forwards_matches : mword ty4 -> bool*) (*val fence_bits_backwards_matches : string -> bool*) (*val fence_bits_matches_prefix : string -> maybe ((mword ty4 * ii))*) val _ = Define ` ((fence_bits_forwards:(4)words$word ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= ((case arg_ of v__0 => let (i : 1 bits) = ((subrange_vec_dec v__0 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)) in let (w : 1 bits) = ((subrange_vec_dec v__0 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in let (r : 1 bits) = ((subrange_vec_dec v__0 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)) in let (o1 : 1 bits) = ((subrange_vec_dec v__0 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (i : 1 bits) = ((subrange_vec_dec v__0 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (bit_maybe_i_forwards i) (\ (w__0 : string) . sail2_state_monad$bindS (bit_maybe_o_forwards o1) (\ (w__1 : string) . sail2_state_monad$bindS (bit_maybe_r_forwards r) (\ (w__2 : string) . sail2_state_monad$bindS (bit_maybe_w_forwards w) (\ (w__3 : string) . sail2_state_monad$returnS ((string_append w__0 ((string_append w__1 ((string_append w__2 ((string_append w__3 "")))))))))))) )))`; (*val _s965_ : string -> maybe ((mword ty1 * mword ty1 * mword ty1 * mword ty1))*) val _ = Define ` ((s965_:string ->((1)words$word#(1)words$word#(1)words$word#(1)words$word)option) s966_0= ((case s966_0 of s967_0 => (case ((bit_maybe_i_matches_prefix s967_0 : (( 1 words$word # ii)) option)) of SOME ((i, s968_0)) => (case ((string_drop s967_0 s968_0)) of s969_0 => (case ((bit_maybe_o_matches_prefix s969_0 : (( 1 words$word # ii)) option)) of SOME ((o1, s970_0)) => (case ((string_drop s969_0 s970_0)) of s971_0 => (case ((bit_maybe_r_matches_prefix s971_0 : (( 1 words$word # ii)) option)) of SOME ((r, s972_0)) => (case ((string_drop s971_0 s972_0)) of s973_0 => (case ((bit_maybe_w_matches_prefix s973_0 : (( 1 words$word # ii)) option)) of SOME ((w, s974_0)) => let p0_ = (string_drop s973_0 s974_0) in if (((p0_ = ""))) then SOME (i, o1, r, w) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; val _ = Define ` ((fence_bits_backwards:string ->(regstate)sail2_state_monad$sequential_state ->((((4)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let s975_0 = arg_ in if ((case ((s965_ s975_0 : (( 1 words$word # 1 words$word # 1 words$word # 1 words$word))option)) of SOME ((i, o1, r, w)) => T | _ => F )) then (case (s965_ s975_0 : (( 1 words$word # 1 words$word # 1 words$word # 1 words$word)) option) of (SOME ((i, o1, r, w))) => sail2_state_monad$returnS ((concat_vec i ((concat_vec o1 ((concat_vec r w : 2 words$word)) : 3 words$word)) : 4 words$word)) ) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((fence_bits_forwards_matches:(4)words$word -> bool) arg_= ((case arg_ of v__1 => T )))`; (*val _s976_ : string -> maybe ((mword ty1 * mword ty1 * mword ty1 * mword ty1))*) val _ = Define ` ((s976_:string ->((1)words$word#(1)words$word#(1)words$word#(1)words$word)option) s977_0= ((case s977_0 of s978_0 => (case ((bit_maybe_i_matches_prefix s978_0 : (( 1 words$word # ii)) option)) of SOME ((i, s979_0)) => (case ((string_drop s978_0 s979_0)) of s980_0 => (case ((bit_maybe_o_matches_prefix s980_0 : (( 1 words$word # ii)) option)) of SOME ((o1, s981_0)) => (case ((string_drop s980_0 s981_0)) of s982_0 => (case ((bit_maybe_r_matches_prefix s982_0 : (( 1 words$word # ii)) option)) of SOME ((r, s983_0)) => (case ((string_drop s982_0 s983_0)) of s984_0 => (case ((bit_maybe_w_matches_prefix s984_0 : (( 1 words$word # ii)) option)) of SOME ((w, s985_0)) => let p0_ = (string_drop s984_0 s985_0) in if (((p0_ = ""))) then SOME (i, o1, r, w) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; val _ = Define ` ((fence_bits_backwards_matches:string -> bool) arg_= (let s986_0 = arg_ in if ((case ((s976_ s986_0 : (( 1 words$word # 1 words$word # 1 words$word # 1 words$word))option)) of SOME ((i, o1, r, w)) => T | _ => F )) then (case (s976_ s986_0 : (( 1 words$word # 1 words$word # 1 words$word # 1 words$word)) option) of (SOME ((i, o1, r, w))) => T ) else F))`; (*val _s987_ : string -> maybe ((mword ty1 * mword ty1 * mword ty1 * mword ty1 * string))*) val _ = Define ` ((s987_:string ->((1)words$word#(1)words$word#(1)words$word#(1)words$word#string)option) s988_0= ((case s988_0 of s989_0 => (case ((bit_maybe_i_matches_prefix s989_0 : (( 1 words$word # ii)) option)) of SOME ((i, s990_0)) => (case ((string_drop s989_0 s990_0)) of s991_0 => (case ((bit_maybe_o_matches_prefix s991_0 : (( 1 words$word # ii)) option)) of SOME ((o1, s992_0)) => (case ((string_drop s991_0 s992_0)) of s993_0 => (case ((bit_maybe_r_matches_prefix s993_0 : (( 1 words$word # ii)) option)) of SOME ((r, s994_0)) => (case ((string_drop s993_0 s994_0)) of s995_0 => (case ((bit_maybe_w_matches_prefix s995_0 : (( 1 words$word # ii)) option)) of SOME ((w, s996_0)) => (case ((string_drop s995_0 s996_0)) of s_ => SOME (i, o1, r, w, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; val _ = Define ` ((fence_bits_matches_prefix:string ->((4)words$word#int)option) arg_= (let s997_0 = arg_ in if ((case ((s987_ s997_0 : (( 1 words$word # 1 words$word # 1 words$word # 1 words$word # string))option)) of SOME ((i, o1, r, w, s_)) => T | _ => F )) then (case (s987_ s997_0 : (( 1 words$word # 1 words$word # 1 words$word # 1 words$word # string)) option) of (SOME ((i, o1, r, w, s_))) => SOME ((concat_vec i ((concat_vec o1 ((concat_vec r w : 2 words$word)) : 3 words$word)) : 4 words$word), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val aqrl_str : bool -> bool -> string*) val _ = Define ` ((aqrl_str:bool -> bool -> string) (aq : bool) (rl : bool)= ((case (aq, rl) of (F, F) => "" | (F, T) => ".rl" | (T, F) => ".aq" | (T, T) => ".aqrl" )))`; (*val lrsc_width_str : word_width -> string*) val _ = Define ` ((lrsc_width_str:word_width -> string) width= ((case width of BYTE => ".b" | HALF => ".h" | WORD => ".w" | DOUBLE => ".d" )))`; (*val amo_width_valid : word_width -> bool*) val _ = Define ` ((amo_width_valid:word_width -> bool) size1= ((case size1 of WORD => T | DOUBLE => (( 64 : int):ii) >= (( 64 : int):ii) | _ => F )))`; (*val process_loadres : forall 'int8_times_n. Size 'int8_times_n => mword ty5 -> mword ty64 -> MemoryOpResult (mword 'int8_times_n) -> bool -> M Retired*) val _ = Define ` ((process_loadres:(5)words$word ->(64)words$word ->('int8_times_n words$word)MemoryOpResult -> bool ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rd addr value is_unsigned= ((case ((extend_value is_unsigned value : ( 64 words$word) MemoryOpResult)) of MemValue (result) => let (_ : unit) = (load_reservation addr) in sail2_state_monad$seqS (wX_bits rd result) (sail2_state_monad$returnS RETIRE_SUCCESS) | MemException (e) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS RETIRE_FAIL) )))`; (*val encdec_amoop_forwards : amoop -> mword ty5*) (*val encdec_amoop_backwards : mword ty5 -> M amoop*) (*val encdec_amoop_forwards_matches : amoop -> bool*) (*val encdec_amoop_backwards_matches : mword ty5 -> bool*) val _ = Define ` ((encdec_amoop_forwards:amoop ->(5)words$word) arg_= ((case arg_ of AMOSWAP => (0b00001w : 5 words$word) | AMOADD => (0b00000w : 5 words$word) | AMOXOR => (0b00100w : 5 words$word) | AMOAND => (0b01100w : 5 words$word) | AMOOR => (0b01000w : 5 words$word) | AMOMIN => (0b10000w : 5 words$word) | AMOMAX => (0b10100w : 5 words$word) | AMOMINU => (0b11000w : 5 words$word) | AMOMAXU => (0b11100w : 5 words$word) )))`; val _ = Define ` ((encdec_amoop_backwards:(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((amoop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b00001w : 5 words$word)))) then sail2_state_monad$returnS AMOSWAP else if (((b__0 = (0b00000w : 5 words$word)))) then sail2_state_monad$returnS AMOADD else if (((b__0 = (0b00100w : 5 words$word)))) then sail2_state_monad$returnS AMOXOR else if (((b__0 = (0b01100w : 5 words$word)))) then sail2_state_monad$returnS AMOAND else if (((b__0 = (0b01000w : 5 words$word)))) then sail2_state_monad$returnS AMOOR else if (((b__0 = (0b10000w : 5 words$word)))) then sail2_state_monad$returnS AMOMIN else if (((b__0 = (0b10100w : 5 words$word)))) then sail2_state_monad$returnS AMOMAX else if (((b__0 = (0b11000w : 5 words$word)))) then sail2_state_monad$returnS AMOMINU else if (((b__0 = (0b11100w : 5 words$word)))) then sail2_state_monad$returnS AMOMAXU else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((encdec_amoop_forwards_matches:amoop -> bool) arg_= ((case arg_ of AMOSWAP => T | AMOADD => T | AMOXOR => T | AMOAND => T | AMOOR => T | AMOMIN => T | AMOMAX => T | AMOMINU => T | AMOMAXU => T )))`; val _ = Define ` ((encdec_amoop_backwards_matches:(5)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b00001w : 5 words$word)))) then T else if (((b__0 = (0b00000w : 5 words$word)))) then T else if (((b__0 = (0b00100w : 5 words$word)))) then T else if (((b__0 = (0b01100w : 5 words$word)))) then T else if (((b__0 = (0b01000w : 5 words$word)))) then T else if (((b__0 = (0b10000w : 5 words$word)))) then T else if (((b__0 = (0b10100w : 5 words$word)))) then T else if (((b__0 = (0b11000w : 5 words$word)))) then T else if (((b__0 = (0b11100w : 5 words$word)))) then T else F))`; (*val amo_mnemonic_forwards : amoop -> string*) (*val amo_mnemonic_backwards : string -> M amoop*) (*val amo_mnemonic_forwards_matches : amoop -> bool*) (*val amo_mnemonic_backwards_matches : string -> bool*) (*val amo_mnemonic_matches_prefix : string -> maybe ((amoop * ii))*) val _ = Define ` ((amo_mnemonic_forwards:amoop -> string) arg_= ((case arg_ of AMOSWAP => "amoswap" | AMOADD => "amoadd" | AMOXOR => "amoxor" | AMOAND => "amoand" | AMOOR => "amoor" | AMOMIN => "amomin" | AMOMAX => "amomax" | AMOMINU => "amominu" | AMOMAXU => "amomaxu" )))`; val _ = Define ` ((amo_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((amoop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "amoswap"))) then sail2_state_monad$returnS AMOSWAP else if (((p0_ = "amoadd"))) then sail2_state_monad$returnS AMOADD else if (((p0_ = "amoxor"))) then sail2_state_monad$returnS AMOXOR else if (((p0_ = "amoand"))) then sail2_state_monad$returnS AMOAND else if (((p0_ = "amoor"))) then sail2_state_monad$returnS AMOOR else if (((p0_ = "amomin"))) then sail2_state_monad$returnS AMOMIN else if (((p0_ = "amomax"))) then sail2_state_monad$returnS AMOMAX else if (((p0_ = "amominu"))) then sail2_state_monad$returnS AMOMINU else if (((p0_ = "amomaxu"))) then sail2_state_monad$returnS AMOMAXU else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((amo_mnemonic_forwards_matches:amoop -> bool) arg_= ((case arg_ of AMOSWAP => T | AMOADD => T | AMOXOR => T | AMOAND => T | AMOOR => T | AMOMIN => T | AMOMAX => T | AMOMINU => T | AMOMAXU => T )))`; val _ = Define ` ((amo_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "amoswap"))) then T else if (((p0_ = "amoadd"))) then T else if (((p0_ = "amoxor"))) then T else if (((p0_ = "amoand"))) then T else if (((p0_ = "amoor"))) then T else if (((p0_ = "amomin"))) then T else if (((p0_ = "amomax"))) then T else if (((p0_ = "amominu"))) then T else if (((p0_ = "amomaxu"))) then T else F))`; (*val _s1030_ : string -> maybe string*) val _ = Define ` ((s1030_:string ->(string)option) s1031_0= (let s1032_0 = s1031_0 in if ((string_startswith s1032_0 "amomaxu")) then (case ((string_drop s1032_0 ((string_length "amomaxu")))) of s_ => SOME s_ ) else NONE))`; (*val _s1026_ : string -> maybe string*) val _ = Define ` ((s1026_:string ->(string)option) s1027_0= (let s1028_0 = s1027_0 in if ((string_startswith s1028_0 "amominu")) then (case ((string_drop s1028_0 ((string_length "amominu")))) of s_ => SOME s_ ) else NONE))`; (*val _s1022_ : string -> maybe string*) val _ = Define ` ((s1022_:string ->(string)option) s1023_0= (let s1024_0 = s1023_0 in if ((string_startswith s1024_0 "amomax")) then (case ((string_drop s1024_0 ((string_length "amomax")))) of s_ => SOME s_ ) else NONE))`; (*val _s1018_ : string -> maybe string*) val _ = Define ` ((s1018_:string ->(string)option) s1019_0= (let s1020_0 = s1019_0 in if ((string_startswith s1020_0 "amomin")) then (case ((string_drop s1020_0 ((string_length "amomin")))) of s_ => SOME s_ ) else NONE))`; (*val _s1014_ : string -> maybe string*) val _ = Define ` ((s1014_:string ->(string)option) s1015_0= (let s1016_0 = s1015_0 in if ((string_startswith s1016_0 "amoor")) then (case ((string_drop s1016_0 ((string_length "amoor")))) of s_ => SOME s_ ) else NONE))`; (*val _s1010_ : string -> maybe string*) val _ = Define ` ((s1010_:string ->(string)option) s1011_0= (let s1012_0 = s1011_0 in if ((string_startswith s1012_0 "amoand")) then (case ((string_drop s1012_0 ((string_length "amoand")))) of s_ => SOME s_ ) else NONE))`; (*val _s1006_ : string -> maybe string*) val _ = Define ` ((s1006_:string ->(string)option) s1007_0= (let s1008_0 = s1007_0 in if ((string_startswith s1008_0 "amoxor")) then (case ((string_drop s1008_0 ((string_length "amoxor")))) of s_ => SOME s_ ) else NONE))`; (*val _s1002_ : string -> maybe string*) val _ = Define ` ((s1002_:string ->(string)option) s1003_0= (let s1004_0 = s1003_0 in if ((string_startswith s1004_0 "amoadd")) then (case ((string_drop s1004_0 ((string_length "amoadd")))) of s_ => SOME s_ ) else NONE))`; (*val _s998_ : string -> maybe string*) val _ = Define ` ((s998_:string ->(string)option) s999_0= (let s1000_0 = s999_0 in if ((string_startswith s1000_0 "amoswap")) then (case ((string_drop s1000_0 ((string_length "amoswap")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((amo_mnemonic_matches_prefix:string ->(amoop#int)option) arg_= (let s1001_0 = arg_ in if ((case ((s998_ s1001_0)) of SOME (s_) => T | _ => F )) then (case s998_ s1001_0 of (SOME (s_)) => SOME (AMOSWAP, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1002_ s1001_0)) of SOME (s_) => T | _ => F )) then (case s1002_ s1001_0 of (SOME (s_)) => SOME (AMOADD, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1006_ s1001_0)) of SOME (s_) => T | _ => F )) then (case s1006_ s1001_0 of (SOME (s_)) => SOME (AMOXOR, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1010_ s1001_0)) of SOME (s_) => T | _ => F )) then (case s1010_ s1001_0 of (SOME (s_)) => SOME (AMOAND, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1014_ s1001_0)) of SOME (s_) => T | _ => F )) then (case s1014_ s1001_0 of (SOME (s_)) => SOME (AMOOR, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1018_ s1001_0)) of SOME (s_) => T | _ => F )) then (case s1018_ s1001_0 of (SOME (s_)) => SOME (AMOMIN, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1022_ s1001_0)) of SOME (s_) => T | _ => F )) then (case s1022_ s1001_0 of (SOME (s_)) => SOME (AMOMAX, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1026_ s1001_0)) of SOME (s_) => T | _ => F )) then (case s1026_ s1001_0 of (SOME (s_)) => SOME (AMOMINU, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1030_ s1001_0)) of SOME (s_) => T | _ => F )) then (case s1030_ s1001_0 of (SOME (s_)) => SOME (AMOMAXU, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val encdec_mul_op_forwards : (bool * bool * bool) -> mword ty3*) (*val encdec_mul_op_backwards : mword ty3 -> M (bool * bool * bool)*) (*val encdec_mul_op_forwards_matches : (bool * bool * bool) -> bool*) (*val encdec_mul_op_backwards_matches : mword ty3 -> bool*) val _ = Define ` ((encdec_mul_op_forwards:bool#bool#bool ->(3)words$word) arg_= ((case arg_ of (F, T, T) => (0b000w : 3 words$word) | (T, T, T) => (0b001w : 3 words$word) | (T, T, F) => (0b010w : 3 words$word) | (T, F, F) => (0b011w : 3 words$word) )))`; val _ = Define ` ((encdec_mul_op_backwards:(3)words$word ->(regstate)sail2_state_monad$sequential_state ->(((bool#bool#bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then sail2_state_monad$returnS (F, T, T) else if (((b__0 = (0b001w : 3 words$word)))) then sail2_state_monad$returnS (T, T, T) else if (((b__0 = (0b010w : 3 words$word)))) then sail2_state_monad$returnS (T, T, F) else if (((b__0 = (0b011w : 3 words$word)))) then sail2_state_monad$returnS (T, F, F) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((encdec_mul_op_forwards_matches:bool#bool#bool -> bool) arg_= ((case arg_ of (F, T, T) => T | (T, T, T) => T | (T, T, F) => T | (T, F, F) => T | _ => F )))`; val _ = Define ` ((encdec_mul_op_backwards_matches:(3)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then T else if (((b__0 = (0b001w : 3 words$word)))) then T else if (((b__0 = (0b010w : 3 words$word)))) then T else if (((b__0 = (0b011w : 3 words$word)))) then T else F))`; (*val mul_mnemonic_forwards : (bool * bool * bool) -> string*) (*val mul_mnemonic_backwards : string -> M (bool * bool * bool)*) (*val mul_mnemonic_forwards_matches : (bool * bool * bool) -> bool*) (*val mul_mnemonic_backwards_matches : string -> bool*) (*val mul_mnemonic_matches_prefix : string -> maybe (((bool * bool * bool) * ii))*) val _ = Define ` ((mul_mnemonic_forwards:bool#bool#bool -> string) arg_= ((case arg_ of (F, T, T) => "mul" | (T, T, T) => "mulh" | (T, T, F) => "mulhsu" | (T, F, F) => "mulhu" )))`; val _ = Define ` ((mul_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((bool#bool#bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "mul"))) then sail2_state_monad$returnS (F, T, T) else if (((p0_ = "mulh"))) then sail2_state_monad$returnS (T, T, T) else if (((p0_ = "mulhsu"))) then sail2_state_monad$returnS (T, T, F) else if (((p0_ = "mulhu"))) then sail2_state_monad$returnS (T, F, F) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((mul_mnemonic_forwards_matches:bool#bool#bool -> bool) arg_= ((case arg_ of (F, T, T) => T | (T, T, T) => T | (T, T, F) => T | (T, F, F) => T | _ => F )))`; val _ = Define ` ((mul_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "mul"))) then T else if (((p0_ = "mulh"))) then T else if (((p0_ = "mulhsu"))) then T else if (((p0_ = "mulhu"))) then T else F))`; (*val _s1046_ : string -> maybe string*) val _ = Define ` ((s1046_:string ->(string)option) s1047_0= (let s1048_0 = s1047_0 in if ((string_startswith s1048_0 "mulhu")) then (case ((string_drop s1048_0 ((string_length "mulhu")))) of s_ => SOME s_ ) else NONE))`; (*val _s1042_ : string -> maybe string*) val _ = Define ` ((s1042_:string ->(string)option) s1043_0= (let s1044_0 = s1043_0 in if ((string_startswith s1044_0 "mulhsu")) then (case ((string_drop s1044_0 ((string_length "mulhsu")))) of s_ => SOME s_ ) else NONE))`; (*val _s1038_ : string -> maybe string*) val _ = Define ` ((s1038_:string ->(string)option) s1039_0= (let s1040_0 = s1039_0 in if ((string_startswith s1040_0 "mulh")) then (case ((string_drop s1040_0 ((string_length "mulh")))) of s_ => SOME s_ ) else NONE))`; (*val _s1034_ : string -> maybe string*) val _ = Define ` ((s1034_:string ->(string)option) s1035_0= (let s1036_0 = s1035_0 in if ((string_startswith s1036_0 "mul")) then (case ((string_drop s1036_0 ((string_length "mul")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((mul_mnemonic_matches_prefix:string ->((bool#bool#bool)#int)option) arg_= (let s1037_0 = arg_ in if ((case ((s1034_ s1037_0)) of SOME (s_) => T | _ => F )) then (case s1034_ s1037_0 of (SOME (s_)) => SOME ((F, T, T), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1038_ s1037_0)) of SOME (s_) => T | _ => F )) then (case s1038_ s1037_0 of (SOME (s_)) => SOME ((T, T, T), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1042_ s1037_0)) of SOME (s_) => T | _ => F )) then (case s1042_ s1037_0 of (SOME (s_)) => SOME ((T, T, F), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1046_ s1037_0)) of SOME (s_) => T | _ => F )) then (case s1046_ s1037_0 of (SOME (s_)) => SOME ((T, F, F), ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val maybe_not_u_forwards : bool -> string*) (*val maybe_not_u_backwards : string -> M bool*) (*val maybe_not_u_forwards_matches : bool -> bool*) (*val maybe_not_u_backwards_matches : string -> bool*) (*val maybe_not_u_matches_prefix : string -> maybe ((bool * ii))*) val _ = Define ` ((maybe_not_u_forwards:bool -> string) arg_= ((case arg_ of F => "u" | T => "" )))`; val _ = Define ` ((maybe_not_u_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "u"))) then sail2_state_monad$returnS F else if (((p0_ = ""))) then sail2_state_monad$returnS T else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((maybe_not_u_forwards_matches:bool -> bool) arg_= ((case arg_ of F => T | T => T )))`; val _ = Define ` ((maybe_not_u_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "u"))) then T else if (((p0_ = ""))) then T else F))`; (*val _s1054_ : string -> maybe string*) val _ = Define ` ((s1054_:string ->(string)option) s1055_0= (let s1056_0 = s1055_0 in if ((string_startswith s1056_0 "")) then (case ((string_drop s1056_0 ((string_length "")))) of s_ => SOME s_ ) else NONE))`; (*val _s1050_ : string -> maybe string*) val _ = Define ` ((s1050_:string ->(string)option) s1051_0= (let s1052_0 = s1051_0 in if ((string_startswith s1052_0 "u")) then (case ((string_drop s1052_0 ((string_length "u")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((maybe_not_u_matches_prefix:string ->(bool#int)option) arg_= (let s1053_0 = arg_ in if ((case ((s1050_ s1053_0)) of SOME (s_) => T | _ => F )) then (case s1050_ s1053_0 of (SOME (s_)) => SOME (F, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1054_ s1053_0)) of SOME (s_) => T | _ => F )) then (case s1054_ s1053_0 of (SOME (s_)) => SOME (T, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val encdec_csrop_forwards : csrop -> mword ty2*) (*val encdec_csrop_backwards : mword ty2 -> M csrop*) (*val encdec_csrop_forwards_matches : csrop -> bool*) (*val encdec_csrop_backwards_matches : mword ty2 -> bool*) val _ = Define ` ((encdec_csrop_forwards:csrop ->(2)words$word) arg_= ((case arg_ of CSRRW => (0b01w : 2 words$word) | CSRRS => (0b10w : 2 words$word) | CSRRC => (0b11w : 2 words$word) )))`; val _ = Define ` ((encdec_csrop_backwards:(2)words$word ->(regstate)sail2_state_monad$sequential_state ->(((csrop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b01w : 2 words$word)))) then sail2_state_monad$returnS CSRRW else if (((b__0 = (0b10w : 2 words$word)))) then sail2_state_monad$returnS CSRRS else if (((b__0 = (0b11w : 2 words$word)))) then sail2_state_monad$returnS CSRRC else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((encdec_csrop_forwards_matches:csrop -> bool) arg_= ((case arg_ of CSRRW => T | CSRRS => T | CSRRC => T )))`; val _ = Define ` ((encdec_csrop_backwards_matches:(2)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b01w : 2 words$word)))) then T else if (((b__0 = (0b10w : 2 words$word)))) then T else if (((b__0 = (0b11w : 2 words$word)))) then T else F))`; (*val readCSR : mword ty12 -> M (mword ty64)*) val _ = Define ` ((readCSR:(12)words$word ->(regstate)sail2_state_monad$sequential_state ->((((64)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) csr= (sail2_state_monad$bindS (case (csr, (( 64 : int):ii)) of (b__0, g__336) => if (((b__0 = (0xF11w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mvendorid_ref : ( 32 words$word) M) (\ (w__0 : 32 words$word) . sail2_state_monad$returnS ((EXTZ (( 64 : int):ii) w__0 : 64 words$word))) else if (((b__0 = (0xF12w : 12 words$word)))) then (sail2_state_monad$read_regS marchid_ref : ( 64 words$word) M) else if (((b__0 = (0xF13w : 12 words$word)))) then (sail2_state_monad$read_regS mimpid_ref : ( 64 words$word) M) else if (((b__0 = (0xF14w : 12 words$word)))) then (sail2_state_monad$read_regS mhartid_ref : ( 64 words$word) M) else if (((b__0 = (0x300w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__4 : Mstatus) . sail2_state_monad$returnS ((get_Mstatus_bits w__4 : 64 words$word))) else if (((b__0 = (0x301w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__5 : Misa) . sail2_state_monad$returnS ((get_Misa_bits w__5 : 64 words$word))) else if (((b__0 = (0x302w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS medeleg_ref) (\ (w__6 : Medeleg) . sail2_state_monad$returnS ((get_Medeleg_bits w__6 : 64 words$word))) else if (((b__0 = (0x303w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__7 : Minterrupts) . sail2_state_monad$returnS ((get_Minterrupts_bits w__7 : 64 words$word))) else if (((b__0 = (0x304w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__8 : Minterrupts) . sail2_state_monad$returnS ((get_Minterrupts_bits w__8 : 64 words$word))) else if (((b__0 = (0x305w : 12 words$word)))) then (get_mtvec () : ( 64 words$word) M) else if (((b__0 = (0x306w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcounteren_ref) (\ (w__10 : Counteren) . sail2_state_monad$returnS ((EXTZ (( 64 : int):ii) ((get_Counteren_bits w__10 : 32 words$word)) : 64 words$word))) else if (((b__0 = (0x320w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcountinhibit_ref) (\ (w__11 : Counterin) . sail2_state_monad$returnS ((EXTZ (( 64 : int):ii) ((get_Counterin_bits w__11 : 32 words$word)) : 64 words$word))) else if (((b__0 = (0x340w : 12 words$word)))) then (sail2_state_monad$read_regS mscratch_ref : ( 64 words$word) M) else if (((b__0 = (0x341w : 12 words$word)))) then sail2_state_monad$bindS (get_xret_target Machine : ( 64 words$word) M) (\ (w__13 : 64 words$word) . sail2_state_monad$bindS (pc_alignment_mask () : ( 64 words$word) M) (\ (w__14 : 64 words$word) . sail2_state_monad$returnS ((and_vec w__13 w__14 : 64 words$word)))) else if (((b__0 = (0x342w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcause_ref) (\ (w__15 : Mcause) . sail2_state_monad$returnS ((get_Mcause_bits w__15 : 64 words$word))) else if (((b__0 = (0x343w : 12 words$word)))) then (sail2_state_monad$read_regS mtval_ref : ( 64 words$word) M) else if (((b__0 = (0x344w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mip_ref) (\ (w__17 : Minterrupts) . sail2_state_monad$returnS ((get_Minterrupts_bits w__17 : 64 words$word))) else if (((b__0 = (0x3A0w : 12 words$word)))) then (pmpReadCfgReg (( 0 : int):ii) : ( 64 words$word) M) else if (((b__0 = (0x3A2w : 12 words$word)))) then (pmpReadCfgReg (( 2 : int):ii) : ( 64 words$word) M) else if (((b__0 = (0x3B0w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr0_ref : ( 64 words$word) M) else if (((b__0 = (0x3B1w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr1_ref : ( 64 words$word) M) else if (((b__0 = (0x3B2w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr2_ref : ( 64 words$word) M) else if (((b__0 = (0x3B3w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr3_ref : ( 64 words$word) M) else if (((b__0 = (0x3B4w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr4_ref : ( 64 words$word) M) else if (((b__0 = (0x3B5w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr5_ref : ( 64 words$word) M) else if (((b__0 = (0x3B6w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr6_ref : ( 64 words$word) M) else if (((b__0 = (0x3B7w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr7_ref : ( 64 words$word) M) else if (((b__0 = (0x3B8w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr8_ref : ( 64 words$word) M) else if (((b__0 = (0x3B9w : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr9_ref : ( 64 words$word) M) else if (((b__0 = (0x3BAw : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr10_ref : ( 64 words$word) M) else if (((b__0 = (0x3BBw : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr11_ref : ( 64 words$word) M) else if (((b__0 = (0x3BCw : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr12_ref : ( 64 words$word) M) else if (((b__0 = (0x3BDw : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr13_ref : ( 64 words$word) M) else if (((b__0 = (0x3BEw : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr14_ref : ( 64 words$word) M) else if (((b__0 = (0x3BFw : 12 words$word)))) then (sail2_state_monad$read_regS pmpaddr15_ref : ( 64 words$word) M) else if (((b__0 = (0xB00w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcycle_ref : ( 64 words$word) M) (\ (w__36 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__36 (((( 64 : int):ii) - (( 1 : int):ii))) (( 0 : int):ii) : 64 words$word))) else if (((b__0 = (0xB02w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS minstret_ref : ( 64 words$word) M) (\ (w__37 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__37 (((( 64 : int):ii) - (( 1 : int):ii))) (( 0 : int):ii) : 64 words$word))) else if (((b__0 = (0x7A0w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS tselect_ref : ( 64 words$word) M) (\ (w__38 : 64 words$word) . sail2_state_monad$returnS ((not_vec w__38 : 64 words$word))) else if (((b__0 = (0x100w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__39 : Mstatus) . sail2_state_monad$returnS ((get_Sstatus_bits ((lower_mstatus w__39)) : 64 words$word))) else if (((b__0 = (0x102w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS sedeleg_ref) (\ (w__40 : Sedeleg) . sail2_state_monad$returnS ((get_Sedeleg_bits w__40 : 64 words$word))) else if (((b__0 = (0x103w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS sideleg_ref) (\ (w__41 : Sinterrupts) . sail2_state_monad$returnS ((get_Sinterrupts_bits w__41 : 64 words$word))) else if (((b__0 = (0x104w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__42 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__43 : Minterrupts) . sail2_state_monad$returnS ((get_Sinterrupts_bits ((lower_mie w__42 w__43)) : 64 words$word)))) else if (((b__0 = (0x105w : 12 words$word)))) then (get_stvec () : ( 64 words$word) M) else if (((b__0 = (0x106w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS scounteren_ref) (\ (w__45 : Counteren) . sail2_state_monad$returnS ((EXTZ (( 64 : int):ii) ((get_Counteren_bits w__45 : 32 words$word)) : 64 words$word))) else if (((b__0 = (0x140w : 12 words$word)))) then (sail2_state_monad$read_regS sscratch_ref : ( 64 words$word) M) else if (((b__0 = (0x141w : 12 words$word)))) then sail2_state_monad$bindS (get_xret_target Supervisor : ( 64 words$word) M) (\ (w__47 : 64 words$word) . sail2_state_monad$bindS (pc_alignment_mask () : ( 64 words$word) M) (\ (w__48 : 64 words$word) . sail2_state_monad$returnS ((and_vec w__47 w__48 : 64 words$word)))) else if (((b__0 = (0x142w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS scause_ref) (\ (w__49 : Mcause) . sail2_state_monad$returnS ((get_Mcause_bits w__49 : 64 words$word))) else if (((b__0 = (0x143w : 12 words$word)))) then (sail2_state_monad$read_regS stval_ref : ( 64 words$word) M) else if (((b__0 = (0x144w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mip_ref) (\ (w__51 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__52 : Minterrupts) . sail2_state_monad$returnS ((get_Sinterrupts_bits ((lower_mip w__51 w__52)) : 64 words$word)))) else if (((b__0 = (0x180w : 12 words$word)))) then (sail2_state_monad$read_regS satp_ref : ( 64 words$word) M) else if (((b__0 = (0xC00w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcycle_ref : ( 64 words$word) M) (\ (w__54 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__54 (((( 64 : int):ii) - (( 1 : int):ii))) (( 0 : int):ii) : 64 words$word))) else if (((b__0 = (0xC01w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mtime_ref : ( 64 words$word) M) (\ (w__55 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__55 (((( 64 : int):ii) - (( 1 : int):ii))) (( 0 : int):ii) : 64 words$word))) else if (((b__0 = (0xC02w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS minstret_ref : ( 64 words$word) M) (\ (w__56 : 64 words$word) . sail2_state_monad$returnS ((subrange_vec_dec w__56 (((( 64 : int):ii) - (( 1 : int):ii))) (( 0 : int):ii) : 64 words$word))) else sail2_state_monad$bindS (ext_read_CSR csr : ( ( 64 words$word)option) M) (\ (w__57 : ( 64 words$word)option) . sail2_state_monad$returnS ((case w__57 of SOME (res) => res | NONE => let (_ : unit) = (print_bits0 "unhandled read to CSR " csr) in (EXTZ (( 64 : int):ii) (0x0w : 4 words$word) : 64 words$word) ))) ) (\ (res : xlenbits) . let (_ : unit) = (if ((get_config_print_reg () )) then print_dbg ((STRCAT "CSR " ((STRCAT ((csr_name csr)) ((STRCAT " -> " ((string_of_bits res)))))))) else () ) in sail2_state_monad$returnS res)))`; (*val writeCSR : mword ty12 -> mword ty64 -> M unit*) val _ = Define ` ((writeCSR:(12)words$word ->(64)words$word ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) (csr : csreg) (value : xlenbits)= (sail2_state_monad$bindS (case (csr, (( 64 : int):ii)) of (b__0, g__335) => if (((b__0 = (0x300w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__0 : Mstatus) . sail2_state_monad$bindS (legalize_mstatus w__0 value) (\ (w__1 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mstatus_ref w__1) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__2 : Mstatus) . sail2_state_monad$returnS (SOME ((get_Mstatus_bits w__2 : 64 words$word)))))) else if (((b__0 = (0x301w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS misa_ref) (\ (w__3 : Misa) . sail2_state_monad$bindS (legalize_misa w__3 value) (\ (w__4 : Misa) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS misa_ref w__4) (sail2_state_monad$read_regS misa_ref)) (\ (w__5 : Misa) . sail2_state_monad$returnS (SOME ((get_Misa_bits w__5 : 64 words$word)))))) else if (((b__0 = (0x302w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS medeleg_ref) (\ (w__6 : Medeleg) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS medeleg_ref ((legalize_medeleg w__6 value))) (sail2_state_monad$read_regS medeleg_ref)) (\ (w__7 : Medeleg) . sail2_state_monad$returnS (SOME ((get_Medeleg_bits w__7 : 64 words$word))))) else if (((b__0 = (0x303w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__8 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mideleg_ref ((legalize_mideleg w__8 value))) (sail2_state_monad$read_regS mideleg_ref)) (\ (w__9 : Minterrupts) . sail2_state_monad$returnS (SOME ((get_Minterrupts_bits w__9 : 64 words$word))))) else if (((b__0 = (0x304w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__10 : Minterrupts) . sail2_state_monad$bindS (legalize_mie w__10 value) (\ (w__11 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mie_ref w__11) (sail2_state_monad$read_regS mie_ref)) (\ (w__12 : Minterrupts) . sail2_state_monad$returnS (SOME ((get_Minterrupts_bits w__12 : 64 words$word)))))) else if (((b__0 = (0x305w : 12 words$word)))) then sail2_state_monad$bindS (set_mtvec value : ( 64 words$word) M) (\ (w__13 : 64 words$word) . sail2_state_monad$returnS (SOME w__13)) else if (((b__0 = (0x306w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcounteren_ref) (\ (w__14 : Counteren) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mcounteren_ref ((legalize_mcounteren w__14 value))) (sail2_state_monad$read_regS mcounteren_ref)) (\ (w__15 : Counteren) . sail2_state_monad$returnS (SOME ((EXTZ (( 64 : int):ii) ((get_Counteren_bits w__15 : 32 words$word)) : 64 words$word))))) else if (((b__0 = (0x320w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcountinhibit_ref) (\ (w__16 : Counterin) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mcountinhibit_ref ((legalize_mcountinhibit w__16 value))) (sail2_state_monad$read_regS mcountinhibit_ref)) (\ (w__17 : Counterin) . sail2_state_monad$returnS (SOME ((EXTZ (( 64 : int):ii) ((get_Counterin_bits w__17 : 32 words$word)) : 64 words$word))))) else if (((b__0 = (0x340w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mscratch_ref value) (sail2_state_monad$read_regS mscratch_ref : ( 64 words$word) M)) (\ (w__18 : 64 words$word) . sail2_state_monad$returnS (SOME w__18)) else if (((b__0 = (0x341w : 12 words$word)))) then sail2_state_monad$bindS (set_xret_target Machine value : ( 64 words$word) M) (\ (w__19 : 64 words$word) . sail2_state_monad$returnS (SOME w__19)) else if (((b__0 = (0x342w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (set_Mcause_bits mcause_ref value) (sail2_state_monad$read_regS mcause_ref)) (\ (w__20 : Mcause) . sail2_state_monad$returnS (SOME ((get_Mcause_bits w__20 : 64 words$word)))) else if (((b__0 = (0x343w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mtval_ref value) (sail2_state_monad$read_regS mtval_ref : ( 64 words$word) M)) (\ (w__21 : 64 words$word) . sail2_state_monad$returnS (SOME w__21)) else if (((b__0 = (0x344w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mip_ref) (\ (w__22 : Minterrupts) . sail2_state_monad$bindS (legalize_mip w__22 value) (\ (w__23 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mip_ref w__23) (sail2_state_monad$read_regS mip_ref)) (\ (w__24 : Minterrupts) . sail2_state_monad$returnS (SOME ((get_Minterrupts_bits w__24 : 64 words$word)))))) else if (((b__0 = (0x3A0w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (pmpWriteCfgReg (( 0 : int):ii) value) (pmpReadCfgReg (( 0 : int):ii) : ( 64 words$word) M)) (\ (w__25 : 64 words$word) . sail2_state_monad$returnS (SOME w__25)) else if (((b__0 = (0x3A2w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (pmpWriteCfgReg (( 2 : int):ii) value) (pmpReadCfgReg (( 2 : int):ii) : ( 64 words$word) M)) (\ (w__26 : 64 words$word) . sail2_state_monad$returnS (SOME w__26)) else if (((b__0 = (0x3B0w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp0cfg_ref) (\ (w__27 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp1cfg_ref) (\ (w__28 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__28) (\ (w__29 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr0_ref : ( 64 words$word) M) (\ (w__30 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr0_ref ((pmpWriteAddr ((pmpLocked w__27)) w__29 w__30 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr0_ref : ( 64 words$word) M)) (\ (w__31 : 64 words$word) . sail2_state_monad$returnS (SOME w__31)))))) else if (((b__0 = (0x3B1w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp1cfg_ref) (\ (w__32 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp2cfg_ref) (\ (w__33 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__33) (\ (w__34 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr1_ref : ( 64 words$word) M) (\ (w__35 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr1_ref ((pmpWriteAddr ((pmpLocked w__32)) w__34 w__35 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr1_ref : ( 64 words$word) M)) (\ (w__36 : 64 words$word) . sail2_state_monad$returnS (SOME w__36)))))) else if (((b__0 = (0x3B2w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp2cfg_ref) (\ (w__37 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp3cfg_ref) (\ (w__38 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__38) (\ (w__39 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr2_ref : ( 64 words$word) M) (\ (w__40 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr2_ref ((pmpWriteAddr ((pmpLocked w__37)) w__39 w__40 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr2_ref : ( 64 words$word) M)) (\ (w__41 : 64 words$word) . sail2_state_monad$returnS (SOME w__41)))))) else if (((b__0 = (0x3B3w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp3cfg_ref) (\ (w__42 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp4cfg_ref) (\ (w__43 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__43) (\ (w__44 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr3_ref : ( 64 words$word) M) (\ (w__45 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr3_ref ((pmpWriteAddr ((pmpLocked w__42)) w__44 w__45 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr3_ref : ( 64 words$word) M)) (\ (w__46 : 64 words$word) . sail2_state_monad$returnS (SOME w__46)))))) else if (((b__0 = (0x3B4w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp4cfg_ref) (\ (w__47 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp5cfg_ref) (\ (w__48 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__48) (\ (w__49 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr4_ref : ( 64 words$word) M) (\ (w__50 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr4_ref ((pmpWriteAddr ((pmpLocked w__47)) w__49 w__50 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr4_ref : ( 64 words$word) M)) (\ (w__51 : 64 words$word) . sail2_state_monad$returnS (SOME w__51)))))) else if (((b__0 = (0x3B5w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp5cfg_ref) (\ (w__52 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp6cfg_ref) (\ (w__53 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__53) (\ (w__54 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr5_ref : ( 64 words$word) M) (\ (w__55 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr5_ref ((pmpWriteAddr ((pmpLocked w__52)) w__54 w__55 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr5_ref : ( 64 words$word) M)) (\ (w__56 : 64 words$word) . sail2_state_monad$returnS (SOME w__56)))))) else if (((b__0 = (0x3B6w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp6cfg_ref) (\ (w__57 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp7cfg_ref) (\ (w__58 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__58) (\ (w__59 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr6_ref : ( 64 words$word) M) (\ (w__60 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr6_ref ((pmpWriteAddr ((pmpLocked w__57)) w__59 w__60 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr6_ref : ( 64 words$word) M)) (\ (w__61 : 64 words$word) . sail2_state_monad$returnS (SOME w__61)))))) else if (((b__0 = (0x3B7w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp7cfg_ref) (\ (w__62 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp8cfg_ref) (\ (w__63 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__63) (\ (w__64 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr7_ref : ( 64 words$word) M) (\ (w__65 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr7_ref ((pmpWriteAddr ((pmpLocked w__62)) w__64 w__65 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr7_ref : ( 64 words$word) M)) (\ (w__66 : 64 words$word) . sail2_state_monad$returnS (SOME w__66)))))) else if (((b__0 = (0x3B8w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp8cfg_ref) (\ (w__67 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp9cfg_ref) (\ (w__68 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__68) (\ (w__69 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr8_ref : ( 64 words$word) M) (\ (w__70 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr8_ref ((pmpWriteAddr ((pmpLocked w__67)) w__69 w__70 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr8_ref : ( 64 words$word) M)) (\ (w__71 : 64 words$word) . sail2_state_monad$returnS (SOME w__71)))))) else if (((b__0 = (0x3B9w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp9cfg_ref) (\ (w__72 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp10cfg_ref) (\ (w__73 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__73) (\ (w__74 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr9_ref : ( 64 words$word) M) (\ (w__75 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr9_ref ((pmpWriteAddr ((pmpLocked w__72)) w__74 w__75 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr9_ref : ( 64 words$word) M)) (\ (w__76 : 64 words$word) . sail2_state_monad$returnS (SOME w__76)))))) else if (((b__0 = (0x3BAw : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp10cfg_ref) (\ (w__77 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp11cfg_ref) (\ (w__78 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__78) (\ (w__79 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr10_ref : ( 64 words$word) M) (\ (w__80 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr10_ref ((pmpWriteAddr ((pmpLocked w__77)) w__79 w__80 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr10_ref : ( 64 words$word) M)) (\ (w__81 : 64 words$word) . sail2_state_monad$returnS (SOME w__81)))))) else if (((b__0 = (0x3BBw : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp11cfg_ref) (\ (w__82 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp12cfg_ref) (\ (w__83 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__83) (\ (w__84 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr11_ref : ( 64 words$word) M) (\ (w__85 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr11_ref ((pmpWriteAddr ((pmpLocked w__82)) w__84 w__85 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr11_ref : ( 64 words$word) M)) (\ (w__86 : 64 words$word) . sail2_state_monad$returnS (SOME w__86)))))) else if (((b__0 = (0x3BCw : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp12cfg_ref) (\ (w__87 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp13cfg_ref) (\ (w__88 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__88) (\ (w__89 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr12_ref : ( 64 words$word) M) (\ (w__90 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr12_ref ((pmpWriteAddr ((pmpLocked w__87)) w__89 w__90 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr12_ref : ( 64 words$word) M)) (\ (w__91 : 64 words$word) . sail2_state_monad$returnS (SOME w__91)))))) else if (((b__0 = (0x3BDw : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp13cfg_ref) (\ (w__92 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp14cfg_ref) (\ (w__93 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__93) (\ (w__94 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr13_ref : ( 64 words$word) M) (\ (w__95 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr13_ref ((pmpWriteAddr ((pmpLocked w__92)) w__94 w__95 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr13_ref : ( 64 words$word) M)) (\ (w__96 : 64 words$word) . sail2_state_monad$returnS (SOME w__96)))))) else if (((b__0 = (0x3BEw : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp14cfg_ref) (\ (w__97 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmp15cfg_ref) (\ (w__98 : Pmpcfg_ent) . sail2_state_monad$bindS (pmpTORLocked w__98) (\ (w__99 : bool) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr14_ref : ( 64 words$word) M) (\ (w__100 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr14_ref ((pmpWriteAddr ((pmpLocked w__97)) w__99 w__100 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr14_ref : ( 64 words$word) M)) (\ (w__101 : 64 words$word) . sail2_state_monad$returnS (SOME w__101)))))) else if (((b__0 = (0x3BFw : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS pmp15cfg_ref) (\ (w__102 : Pmpcfg_ent) . sail2_state_monad$bindS (sail2_state_monad$read_regS pmpaddr15_ref : ( 64 words$word) M) (\ (w__103 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS pmpaddr15_ref ((pmpWriteAddr ((pmpLocked w__102)) F w__103 value : 64 words$word))) (sail2_state_monad$read_regS pmpaddr15_ref : ( 64 words$word) M)) (\ (w__104 : 64 words$word) . sail2_state_monad$returnS (SOME w__104)))) else if (((b__0 = (0xB00w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mcycle_ref : ( 64 words$word) M) (\ (w__105 : 64 words$word) . sail2_state_monad$seqS (sail2_state_monad$write_regS mcycle_ref ((update_subrange_vec_dec w__105 (((( 64 : int):ii) - (( 1 : int):ii))) (( 0 : int):ii) value : 64 words$word))) (sail2_state_monad$returnS (SOME value))) else if (((b__0 = (0xB02w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS minstret_ref : ( 64 words$word) M) (\ (w__106 : 64 words$word) . sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$write_regS minstret_ref ((update_subrange_vec_dec w__106 (((( 64 : int):ii) - (( 1 : int):ii))) (( 0 : int):ii) value : 64 words$word))) (sail2_state_monad$write_regS minstret_written_ref T)) (sail2_state_monad$returnS (SOME value))) else if (((b__0 = (0x7A0w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS tselect_ref value) (sail2_state_monad$read_regS tselect_ref : ( 64 words$word) M)) (\ (w__107 : 64 words$word) . sail2_state_monad$returnS (SOME w__107)) else if (((b__0 = (0x100w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__108 : Mstatus) . sail2_state_monad$bindS (legalize_sstatus w__108 value) (\ (w__109 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mstatus_ref w__109) (sail2_state_monad$read_regS mstatus_ref)) (\ (w__110 : Mstatus) . sail2_state_monad$returnS (SOME ((get_Mstatus_bits w__110 : 64 words$word)))))) else if (((b__0 = (0x102w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS sedeleg_ref) (\ (w__111 : Sedeleg) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS sedeleg_ref ((legalize_sedeleg w__111 value))) (sail2_state_monad$read_regS sedeleg_ref)) (\ (w__112 : Sedeleg) . sail2_state_monad$returnS (SOME ((get_Sedeleg_bits w__112 : 64 words$word))))) else if (((b__0 = (0x103w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (set_Sinterrupts_bits sideleg_ref value) (sail2_state_monad$read_regS sideleg_ref)) (\ (w__113 : Sinterrupts) . sail2_state_monad$returnS (SOME ((get_Sinterrupts_bits w__113 : 64 words$word)))) else if (((b__0 = (0x104w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mie_ref) (\ (w__114 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__115 : Minterrupts) . sail2_state_monad$bindS (legalize_sie w__114 w__115 value) (\ (w__116 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mie_ref w__116) (sail2_state_monad$read_regS mie_ref)) (\ (w__117 : Minterrupts) . sail2_state_monad$returnS (SOME ((get_Minterrupts_bits w__117 : 64 words$word))))))) else if (((b__0 = (0x105w : 12 words$word)))) then sail2_state_monad$bindS (set_stvec value : ( 64 words$word) M) (\ (w__118 : 64 words$word) . sail2_state_monad$returnS (SOME w__118)) else if (((b__0 = (0x106w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS scounteren_ref) (\ (w__119 : Counteren) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS scounteren_ref ((legalize_scounteren w__119 value))) (sail2_state_monad$read_regS scounteren_ref)) (\ (w__120 : Counteren) . sail2_state_monad$returnS (SOME ((EXTZ (( 64 : int):ii) ((get_Counteren_bits w__120 : 32 words$word)) : 64 words$word))))) else if (((b__0 = (0x140w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS sscratch_ref value) (sail2_state_monad$read_regS sscratch_ref : ( 64 words$word) M)) (\ (w__121 : 64 words$word) . sail2_state_monad$returnS (SOME w__121)) else if (((b__0 = (0x141w : 12 words$word)))) then sail2_state_monad$bindS (set_xret_target Supervisor value : ( 64 words$word) M) (\ (w__122 : 64 words$word) . sail2_state_monad$returnS (SOME w__122)) else if (((b__0 = (0x142w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (set_Mcause_bits scause_ref value) (sail2_state_monad$read_regS scause_ref)) (\ (w__123 : Mcause) . sail2_state_monad$returnS (SOME ((get_Mcause_bits w__123 : 64 words$word)))) else if (((b__0 = (0x143w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS stval_ref value) (sail2_state_monad$read_regS stval_ref : ( 64 words$word) M)) (\ (w__124 : 64 words$word) . sail2_state_monad$returnS (SOME w__124)) else if (((b__0 = (0x144w : 12 words$word)))) then sail2_state_monad$bindS (sail2_state_monad$read_regS mip_ref) (\ (w__125 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$read_regS mideleg_ref) (\ (w__126 : Minterrupts) . sail2_state_monad$bindS (legalize_sip w__125 w__126 value) (\ (w__127 : Minterrupts) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS mip_ref w__127) (sail2_state_monad$read_regS mip_ref)) (\ (w__128 : Minterrupts) . sail2_state_monad$returnS (SOME ((get_Minterrupts_bits w__128 : 64 words$word))))))) else if (((b__0 = (0x180w : 12 words$word)))) then sail2_state_monad$bindS (cur_Architecture () ) (\ (w__129 : Architecture) . sail2_state_monad$bindS (sail2_state_monad$read_regS satp_ref : ( 64 words$word) M) (\ (w__130 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS satp_ref ((legalize_satp w__129 w__130 value : 64 words$word))) (sail2_state_monad$read_regS satp_ref : ( 64 words$word) M)) (\ (w__131 : 64 words$word) . sail2_state_monad$returnS (SOME w__131)))) else (ext_write_CSR csr value : ( ( 64 words$word)option) M) ) (\ (res : xlenbits option) . sail2_state_monad$returnS ((case res of SOME (v) => if ((get_config_print_reg () )) then print_dbg ((STRCAT "CSR " ((STRCAT ((csr_name csr)) ((STRCAT " <- " ((STRCAT ((string_of_bits v)) ((STRCAT " (input: " ((STRCAT ((string_of_bits value)) ")")))))))))))) else () | NONE => print_bits0 "unhandled write to CSR " csr )))))`; (*val maybe_i_forwards : bool -> string*) (*val maybe_i_backwards : string -> M bool*) (*val maybe_i_forwards_matches : bool -> bool*) (*val maybe_i_backwards_matches : string -> bool*) (*val maybe_i_matches_prefix : string -> maybe ((bool * ii))*) val _ = Define ` ((maybe_i_forwards:bool -> string) arg_= ((case arg_ of T => "i" | F => "" )))`; val _ = Define ` ((maybe_i_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "i"))) then sail2_state_monad$returnS T else if (((p0_ = ""))) then sail2_state_monad$returnS F else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((maybe_i_forwards_matches:bool -> bool) arg_= ((case arg_ of T => T | F => T )))`; val _ = Define ` ((maybe_i_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "i"))) then T else if (((p0_ = ""))) then T else F))`; (*val _s1062_ : string -> maybe string*) val _ = Define ` ((s1062_:string ->(string)option) s1063_0= (let s1064_0 = s1063_0 in if ((string_startswith s1064_0 "")) then (case ((string_drop s1064_0 ((string_length "")))) of s_ => SOME s_ ) else NONE))`; (*val _s1058_ : string -> maybe string*) val _ = Define ` ((s1058_:string ->(string)option) s1059_0= (let s1060_0 = s1059_0 in if ((string_startswith s1060_0 "i")) then (case ((string_drop s1060_0 ((string_length "i")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((maybe_i_matches_prefix:string ->(bool#int)option) arg_= (let s1061_0 = arg_ in if ((case ((s1058_ s1061_0)) of SOME (s_) => T | _ => F )) then (case s1058_ s1061_0 of (SOME (s_)) => SOME (T, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1062_ s1061_0)) of SOME (s_) => T | _ => F )) then (case s1062_ s1061_0 of (SOME (s_)) => SOME (F, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val csr_mnemonic_forwards : csrop -> string*) (*val csr_mnemonic_backwards : string -> M csrop*) (*val csr_mnemonic_forwards_matches : csrop -> bool*) (*val csr_mnemonic_backwards_matches : string -> bool*) (*val csr_mnemonic_matches_prefix : string -> maybe ((csrop * ii))*) val _ = Define ` ((csr_mnemonic_forwards:csrop -> string) arg_= ((case arg_ of CSRRW => "csrrw" | CSRRS => "csrrs" | CSRRC => "csrrc" )))`; val _ = Define ` ((csr_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((csrop),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "csrrw"))) then sail2_state_monad$returnS CSRRW else if (((p0_ = "csrrs"))) then sail2_state_monad$returnS CSRRS else if (((p0_ = "csrrc"))) then sail2_state_monad$returnS CSRRC else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((csr_mnemonic_forwards_matches:csrop -> bool) arg_= ((case arg_ of CSRRW => T | CSRRS => T | CSRRC => T )))`; val _ = Define ` ((csr_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "csrrw"))) then T else if (((p0_ = "csrrs"))) then T else if (((p0_ = "csrrc"))) then T else F))`; (*val _s1074_ : string -> maybe string*) val _ = Define ` ((s1074_:string ->(string)option) s1075_0= (let s1076_0 = s1075_0 in if ((string_startswith s1076_0 "csrrc")) then (case ((string_drop s1076_0 ((string_length "csrrc")))) of s_ => SOME s_ ) else NONE))`; (*val _s1070_ : string -> maybe string*) val _ = Define ` ((s1070_:string ->(string)option) s1071_0= (let s1072_0 = s1071_0 in if ((string_startswith s1072_0 "csrrs")) then (case ((string_drop s1072_0 ((string_length "csrrs")))) of s_ => SOME s_ ) else NONE))`; (*val _s1066_ : string -> maybe string*) val _ = Define ` ((s1066_:string ->(string)option) s1067_0= (let s1068_0 = s1067_0 in if ((string_startswith s1068_0 "csrrw")) then (case ((string_drop s1068_0 ((string_length "csrrw")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((csr_mnemonic_matches_prefix:string ->(csrop#int)option) arg_= (let s1069_0 = arg_ in if ((case ((s1066_ s1069_0)) of SOME (s_) => T | _ => F )) then (case s1066_ s1069_0 of (SOME (s_)) => SOME (CSRRW, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1070_ s1069_0)) of SOME (s_) => T | _ => F )) then (case s1070_ s1069_0 of (SOME (s_)) => SOME (CSRRS, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1074_ s1069_0)) of SOME (s_) => T | _ => F )) then (case s1074_ s1069_0 of (SOME (s_)) => SOME (CSRRC, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val encdec_rounding_mode_forwards : rounding_mode -> mword ty3*) (*val encdec_rounding_mode_backwards : mword ty3 -> M rounding_mode*) (*val encdec_rounding_mode_forwards_matches : rounding_mode -> bool*) (*val encdec_rounding_mode_backwards_matches : mword ty3 -> bool*) val _ = Define ` ((encdec_rounding_mode_forwards:rounding_mode ->(3)words$word) arg_= ((case arg_ of RM_RNE => (0b000w : 3 words$word) | RM_RTZ => (0b001w : 3 words$word) | RM_RDN => (0b010w : 3 words$word) | RM_RUP => (0b011w : 3 words$word) | RM_RMM => (0b100w : 3 words$word) | RM_DYN => (0b111w : 3 words$word) )))`; val _ = Define ` ((encdec_rounding_mode_backwards:(3)words$word ->(regstate)sail2_state_monad$sequential_state ->(((rounding_mode),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then sail2_state_monad$returnS RM_RNE else if (((b__0 = (0b001w : 3 words$word)))) then sail2_state_monad$returnS RM_RTZ else if (((b__0 = (0b010w : 3 words$word)))) then sail2_state_monad$returnS RM_RDN else if (((b__0 = (0b011w : 3 words$word)))) then sail2_state_monad$returnS RM_RUP else if (((b__0 = (0b100w : 3 words$word)))) then sail2_state_monad$returnS RM_RMM else if (((b__0 = (0b111w : 3 words$word)))) then sail2_state_monad$returnS RM_DYN else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((encdec_rounding_mode_forwards_matches:rounding_mode -> bool) arg_= ((case arg_ of RM_RNE => T | RM_RTZ => T | RM_RDN => T | RM_RUP => T | RM_RMM => T | RM_DYN => T )))`; val _ = Define ` ((encdec_rounding_mode_backwards_matches:(3)words$word -> bool) arg_= (let b__0 = arg_ in if (((b__0 = (0b000w : 3 words$word)))) then T else if (((b__0 = (0b001w : 3 words$word)))) then T else if (((b__0 = (0b010w : 3 words$word)))) then T else if (((b__0 = (0b011w : 3 words$word)))) then T else if (((b__0 = (0b100w : 3 words$word)))) then T else if (((b__0 = (0b111w : 3 words$word)))) then T else F))`; (*val frm_mnemonic_forwards : rounding_mode -> string*) (*val frm_mnemonic_backwards : string -> M rounding_mode*) (*val frm_mnemonic_forwards_matches : rounding_mode -> bool*) (*val frm_mnemonic_backwards_matches : string -> bool*) (*val frm_mnemonic_matches_prefix : string -> maybe ((rounding_mode * ii))*) val _ = Define ` ((frm_mnemonic_forwards:rounding_mode -> string) arg_= ((case arg_ of RM_RNE => "rne" | RM_RTZ => "rtz" | RM_RDN => "rdn" | RM_RUP => "rup" | RM_RMM => "rmm" | RM_DYN => "dyn" )))`; val _ = Define ` ((frm_mnemonic_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((rounding_mode),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "rne"))) then sail2_state_monad$returnS RM_RNE else if (((p0_ = "rtz"))) then sail2_state_monad$returnS RM_RTZ else if (((p0_ = "rdn"))) then sail2_state_monad$returnS RM_RDN else if (((p0_ = "rup"))) then sail2_state_monad$returnS RM_RUP else if (((p0_ = "rmm"))) then sail2_state_monad$returnS RM_RMM else if (((p0_ = "dyn"))) then sail2_state_monad$returnS RM_DYN else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((frm_mnemonic_forwards_matches:rounding_mode -> bool) arg_= ((case arg_ of RM_RNE => T | RM_RTZ => T | RM_RDN => T | RM_RUP => T | RM_RMM => T | RM_DYN => T )))`; val _ = Define ` ((frm_mnemonic_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "rne"))) then T else if (((p0_ = "rtz"))) then T else if (((p0_ = "rdn"))) then T else if (((p0_ = "rup"))) then T else if (((p0_ = "rmm"))) then T else if (((p0_ = "dyn"))) then T else F))`; (*val _s1098_ : string -> maybe string*) val _ = Define ` ((s1098_:string ->(string)option) s1099_0= (let s1100_0 = s1099_0 in if ((string_startswith s1100_0 "dyn")) then (case ((string_drop s1100_0 ((string_length "dyn")))) of s_ => SOME s_ ) else NONE))`; (*val _s1094_ : string -> maybe string*) val _ = Define ` ((s1094_:string ->(string)option) s1095_0= (let s1096_0 = s1095_0 in if ((string_startswith s1096_0 "rmm")) then (case ((string_drop s1096_0 ((string_length "rmm")))) of s_ => SOME s_ ) else NONE))`; (*val _s1090_ : string -> maybe string*) val _ = Define ` ((s1090_:string ->(string)option) s1091_0= (let s1092_0 = s1091_0 in if ((string_startswith s1092_0 "rup")) then (case ((string_drop s1092_0 ((string_length "rup")))) of s_ => SOME s_ ) else NONE))`; (*val _s1086_ : string -> maybe string*) val _ = Define ` ((s1086_:string ->(string)option) s1087_0= (let s1088_0 = s1087_0 in if ((string_startswith s1088_0 "rdn")) then (case ((string_drop s1088_0 ((string_length "rdn")))) of s_ => SOME s_ ) else NONE))`; (*val _s1082_ : string -> maybe string*) val _ = Define ` ((s1082_:string ->(string)option) s1083_0= (let s1084_0 = s1083_0 in if ((string_startswith s1084_0 "rtz")) then (case ((string_drop s1084_0 ((string_length "rtz")))) of s_ => SOME s_ ) else NONE))`; (*val _s1078_ : string -> maybe string*) val _ = Define ` ((s1078_:string ->(string)option) s1079_0= (let s1080_0 = s1079_0 in if ((string_startswith s1080_0 "rne")) then (case ((string_drop s1080_0 ((string_length "rne")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((frm_mnemonic_matches_prefix:string ->(rounding_mode#int)option) arg_= (let s1081_0 = arg_ in if ((case ((s1078_ s1081_0)) of SOME (s_) => T | _ => F )) then (case s1078_ s1081_0 of (SOME (s_)) => SOME (RM_RNE, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1082_ s1081_0)) of SOME (s_) => T | _ => F )) then (case s1082_ s1081_0 of (SOME (s_)) => SOME (RM_RTZ, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1086_ s1081_0)) of SOME (s_) => T | _ => F )) then (case s1086_ s1081_0 of (SOME (s_)) => SOME (RM_RDN, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1090_ s1081_0)) of SOME (s_) => T | _ => F )) then (case s1090_ s1081_0 of (SOME (s_)) => SOME (RM_RUP, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1094_ s1081_0)) of SOME (s_) => T | _ => F )) then (case s1094_ s1081_0 of (SOME (s_)) => SOME (RM_RMM, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1098_ s1081_0)) of SOME (s_) => T | _ => F )) then (case s1098_ s1081_0 of (SOME (s_)) => SOME (RM_DYN, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val select_instr_or_fcsr_rm : rounding_mode -> M rounding_mode*) val _ = Define ` ((select_instr_or_fcsr_rm:rounding_mode ->(regstate)sail2_state_monad$sequential_state ->(((rounding_mode),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) instr_rm= (if (((instr_rm = RM_DYN))) then sail2_state_monad$bindS (sail2_state_monad$read_regS fcsr_ref) (\ (w__0 : Fcsr) . encdec_rounding_mode_backwards ((get_Fcsr_FRM w__0 : 3 words$word))) else sail2_state_monad$returnS instr_rm))`; (*val nxFlag : unit -> mword ty5*) val _ = Define ` ((nxFlag:unit ->(5)words$word) () = ((0b00001w : 5 words$word)))`; (*val ufFlag : unit -> mword ty5*) val _ = Define ` ((ufFlag:unit ->(5)words$word) () = ((0b00010w : 5 words$word)))`; (*val ofFlag : unit -> mword ty5*) val _ = Define ` ((ofFlag:unit ->(5)words$word) () = ((0b00100w : 5 words$word)))`; (*val dzFlag : unit -> mword ty5*) val _ = Define ` ((dzFlag:unit ->(5)words$word) () = ((0b01000w : 5 words$word)))`; (*val nvFlag : unit -> mword ty5*) val _ = Define ` ((nvFlag:unit ->(5)words$word) () = ((0b10000w : 5 words$word)))`; (*val fsplit_S : mword ty32 -> (mword ty1 * mword ty8 * mword ty23)*) val _ = Define ` ((fsplit_S:(32)words$word ->(1)words$word#(8)words$word#(23)words$word) x32= ((subrange_vec_dec x32 (( 31 : int):ii) (( 31 : int):ii) : 1 words$word), (subrange_vec_dec x32 (( 30 : int):ii) (( 23 : int):ii) : 8 words$word), (subrange_vec_dec x32 (( 22 : int):ii) (( 0 : int):ii) : 23 words$word)))`; (*val fmake_S : mword ty1 -> mword ty8 -> mword ty23 -> mword ty32*) val _ = Define ` ((fmake_S:(1)words$word ->(8)words$word ->(23)words$word ->(32)words$word) sign exp mant= ((concat_vec sign ((concat_vec exp mant : 31 words$word)) : 32 words$word)))`; (*val canonical_NaN_S : unit -> mword ty32*) val _ = Define ` ((canonical_NaN_S:unit ->(32)words$word) () = ((0x7FC00000w : 32 words$word)))`; (*val f_is_neg_inf_S : mword ty32 -> bool*) val _ = Define ` ((f_is_neg_inf_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((sign = (0b1w : 1 words$word)))) /\ ((((((exp = ((ones (( 8 : int):ii) : 8 words$word))))) /\ (((mant = ((zeros_implicit (( 23 : int):ii) : 23 words$word)))))))))))`; (*val f_is_neg_norm_S : mword ty32 -> bool*) val _ = Define ` ((f_is_neg_norm_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((sign = (0b1w : 1 words$word)))) /\ ((((((exp <> ((zeros_implicit (( 8 : int):ii) : 8 words$word))))) /\ (((exp <> ((ones (( 8 : int):ii) : 8 words$word)))))))))))`; (*val f_is_neg_subnorm_S : mword ty32 -> bool*) val _ = Define ` ((f_is_neg_subnorm_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((sign = (0b1w : 1 words$word)))) /\ ((((((exp = ((zeros_implicit (( 8 : int):ii) : 8 words$word))))) /\ (((mant <> ((zeros_implicit (( 23 : int):ii) : 23 words$word)))))))))))`; (*val f_is_neg_zero_S : mword ty32 -> bool*) val _ = Define ` ((f_is_neg_zero_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((sign = ((ones (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp = ((zeros_implicit (( 8 : int):ii) : 8 words$word))))) /\ (((mant = ((zeros_implicit (( 23 : int):ii) : 23 words$word)))))))))))`; (*val f_is_pos_zero_S : mword ty32 -> bool*) val _ = Define ` ((f_is_pos_zero_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((sign = ((zeros_implicit (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp = ((zeros_implicit (( 8 : int):ii) : 8 words$word))))) /\ (((mant = ((zeros_implicit (( 23 : int):ii) : 23 words$word)))))))))))`; (*val f_is_pos_subnorm_S : mword ty32 -> bool*) val _ = Define ` ((f_is_pos_subnorm_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((sign = ((zeros_implicit (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp = ((zeros_implicit (( 8 : int):ii) : 8 words$word))))) /\ (((mant <> ((zeros_implicit (( 23 : int):ii) : 23 words$word)))))))))))`; (*val f_is_pos_norm_S : mword ty32 -> bool*) val _ = Define ` ((f_is_pos_norm_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((sign = ((zeros_implicit (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp <> ((zeros_implicit (( 8 : int):ii) : 8 words$word))))) /\ (((exp <> ((ones (( 8 : int):ii) : 8 words$word)))))))))))`; (*val f_is_pos_inf_S : mword ty32 -> bool*) val _ = Define ` ((f_is_pos_inf_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((sign = ((zeros_implicit (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp = ((ones (( 8 : int):ii) : 8 words$word))))) /\ (((mant = ((zeros_implicit (( 23 : int):ii) : 23 words$word)))))))))))`; (*val f_is_SNaN_S : mword ty32 -> bool*) val _ = Define ` ((f_is_SNaN_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((exp = ((ones (( 8 : int):ii) : 8 words$word))))) /\ ((((((((access_vec_dec mant (( 22 : int):ii))) = B0))) /\ (((mant <> ((zeros_implicit (( 23 : int):ii) : 23 words$word)))))))))))`; (*val f_is_QNaN_S : mword ty32 -> bool*) val _ = Define ` ((f_is_QNaN_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((exp = ((ones (( 8 : int):ii) : 8 words$word))))) /\ (((((access_vec_dec mant (( 22 : int):ii))) = B1))))))`; (*val f_is_NaN_S : mword ty32 -> bool*) val _ = Define ` ((f_is_NaN_S:(32)words$word -> bool) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in ((((exp = ((ones (( 8 : int):ii) : 8 words$word))))) /\ (((mant <> ((zeros_implicit (( 23 : int):ii) : 23 words$word))))))))`; (*val negate_S : mword ty32 -> mword ty32*) val _ = Define ` ((negate_S:(32)words$word ->(32)words$word) x32= (let (sign, exp, mant) = ((fsplit_S x32 : ( 1 words$word # 8 words$word # 23 words$word))) in let new_sign = (if (((sign = (0b0w : 1 words$word)))) then (0b1w : 1 words$word) else (0b0w : 1 words$word)) in (fmake_S new_sign exp mant : 32 words$word)))`; (*val feq_quiet_S : mword ty32 -> mword ty32 -> (bool * mword ty5)*) val _ = Define ` ((feq_quiet_S:(32)words$word ->(32)words$word -> bool#(5)words$word) v1 v2= (let (s1, e1, m1) = ((fsplit_S v1 : ( 1 words$word # 8 words$word # 23 words$word))) in let (s2, e2, m2) = ((fsplit_S v2 : ( 1 words$word # 8 words$word # 23 words$word))) in let v1Is0 = (((f_is_neg_zero_S v1)) \/ ((f_is_pos_zero_S v1))) in let v2Is0 = (((f_is_neg_zero_S v2)) \/ ((f_is_pos_zero_S v2))) in let result = ((((v1 = v2))) \/ (((v1Is0 /\ v2Is0)))) in let fflags = (if (((((f_is_SNaN_S v1)) \/ ((f_is_SNaN_S v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word)) in (result, fflags)))`; (*val flt_S : mword ty32 -> mword ty32 -> bool -> (bool * mword ty5)*) val _ = Define ` ((flt_S:(32)words$word ->(32)words$word -> bool -> bool#(5)words$word) v1 v2 is_quiet= (let (s1, e1, m1) = ((fsplit_S v1 : ( 1 words$word # 8 words$word # 23 words$word))) in let (s2, e2, m2) = ((fsplit_S v2 : ( 1 words$word # 8 words$word # 23 words$word))) in let (result : bool) = (if ((((((s1 = (0b0w : 1 words$word)))) /\ (((s2 = (0b0w : 1 words$word))))))) then if (((e1 = e2))) then ((lem$w2ui m1)) < ((lem$w2ui m2)) else ((lem$w2ui e1)) < ((lem$w2ui e2)) else if ((((((s1 = (0b0w : 1 words$word)))) /\ (((s2 = (0b1w : 1 words$word))))))) then F else if ((((((s1 = (0b1w : 1 words$word)))) /\ (((s2 = (0b0w : 1 words$word))))))) then T else if (((e1 = e2))) then ((lem$w2ui m1)) > ((lem$w2ui m2)) else ((lem$w2ui e1)) > ((lem$w2ui e2))) in let fflags = (if is_quiet then if (((((f_is_SNaN_S v1)) \/ ((f_is_SNaN_S v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word) else if (((((f_is_NaN_S v1)) \/ ((f_is_NaN_S v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word)) in (result, fflags)))`; (*val fle_S : mword ty32 -> mword ty32 -> bool -> (bool * mword ty5)*) val _ = Define ` ((fle_S:(32)words$word ->(32)words$word -> bool -> bool#(5)words$word) v1 v2 is_quiet= (let (s1, e1, m1) = ((fsplit_S v1 : ( 1 words$word # 8 words$word # 23 words$word))) in let (s2, e2, m2) = ((fsplit_S v2 : ( 1 words$word # 8 words$word # 23 words$word))) in let v1Is0 = (((f_is_neg_zero_S v1)) \/ ((f_is_pos_zero_S v1))) in let v2Is0 = (((f_is_neg_zero_S v2)) \/ ((f_is_pos_zero_S v2))) in let (result : bool) = (if ((((((s1 = (0b0w : 1 words$word)))) /\ (((s2 = (0b0w : 1 words$word))))))) then if (((e1 = e2))) then ((lem$w2ui m1)) <= ((lem$w2ui m2)) else ((lem$w2ui e1)) < ((lem$w2ui e2)) else if ((((((s1 = (0b0w : 1 words$word)))) /\ (((s2 = (0b1w : 1 words$word))))))) then (v1Is0 /\ v2Is0) else if ((((((s1 = (0b1w : 1 words$word)))) /\ (((s2 = (0b0w : 1 words$word))))))) then T else if (((e1 = e2))) then ((lem$w2ui m1)) >= ((lem$w2ui m2)) else ((lem$w2ui e1)) > ((lem$w2ui e2))) in let fflags = (if is_quiet then if (((((f_is_SNaN_S v1)) \/ ((f_is_SNaN_S v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word) else if (((((f_is_NaN_S v1)) \/ ((f_is_NaN_S v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word)) in (result, fflags)))`; (*val nan_box : mword ty32 -> mword ty64*) val _ = Define ` ((nan_box:(32)words$word ->(64)words$word) val_32b= ((concat_vec (0xFFFFFFFFw : 32 words$word) val_32b : 64 words$word)))`; (*val nan_unbox : mword ty64 -> mword ty32*) val _ = Define ` ((nan_unbox:(64)words$word ->(32)words$word) regval= (if (((((subrange_vec_dec regval (( 63 : int):ii) (( 32 : int):ii) : 32 words$word)) = (0xFFFFFFFFw : 32 words$word)))) then (subrange_vec_dec regval (( 31 : int):ii) (( 0 : int):ii) : 32 words$word) else (canonical_NaN_S () : 32 words$word)))`; (*val is_RV32F_or_RV64F : unit -> M bool*) val _ = Define ` ((is_RV32F_or_RV64F:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state$and_boolS ((haveFExt () )) (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))))))))`; (*val is_RV64F : unit -> M bool*) val _ = Define ` ((is_RV64F:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state$and_boolS ((haveFExt () )) (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 64 : int):ii)))))))`; (*val is_RV32D_or_RV64D : unit -> M bool*) val _ = Define ` ((is_RV32D_or_RV64D:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state$and_boolS ((haveDExt () )) (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))))))))`; (*val is_RV64D : unit -> M bool*) val _ = Define ` ((is_RV64D:unit ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state$and_boolS ((haveDExt () )) (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 64 : int):ii)))))))`; (*val process_fload64 : mword ty5 -> mword ty64 -> MemoryOpResult (mword ty64) -> M Retired*) val _ = Define ` ((process_fload64:(5)words$word ->(64)words$word ->((64)words$word)MemoryOpResult ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rd addr value= ((case value of MemValue (result) => sail2_state_monad$seqS (wF_bits rd result) (sail2_state_monad$returnS RETIRE_SUCCESS) | MemException (e) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS RETIRE_FAIL) )))`; (*val process_fload32 : mword ty5 -> mword ty64 -> MemoryOpResult (mword ty32) -> M Retired*) val _ = Define ` ((process_fload32:(5)words$word ->(64)words$word ->((32)words$word)MemoryOpResult ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rd addr value= ((case value of MemValue (result) => sail2_state_monad$seqS (wF_bits rd ((nan_box result : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS) | MemException (e) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS RETIRE_FAIL) )))`; (*val process_fstore : mword ty64 -> MemoryOpResult bool -> M Retired*) val _ = Define ` ((process_fstore:(64)words$word ->(bool)MemoryOpResult ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) vaddr value= ((case value of MemValue (T) => sail2_state_monad$returnS RETIRE_SUCCESS | MemValue (F) => internal_error "store got false from mem_write_value" | MemException (e) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) )))`; (*val f_madd_type_mnemonic_S_forwards : f_madd_op_S -> string*) (*val f_madd_type_mnemonic_S_backwards : string -> M f_madd_op_S*) (*val f_madd_type_mnemonic_S_forwards_matches : f_madd_op_S -> bool*) (*val f_madd_type_mnemonic_S_backwards_matches : string -> bool*) (*val f_madd_type_mnemonic_S_matches_prefix : string -> maybe ((f_madd_op_S * ii))*) val _ = Define ` ((f_madd_type_mnemonic_S_forwards:f_madd_op_S -> string) arg_= ((case arg_ of FMADD_S => "fmadd.s" | FMSUB_S => "fmsub.s" | FNMSUB_S => "fnmsub.s" | FNMADD_S => "fnmadd.s" )))`; val _ = Define ` ((f_madd_type_mnemonic_S_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_madd_op_S),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fmadd.s"))) then sail2_state_monad$returnS FMADD_S else if (((p0_ = "fmsub.s"))) then sail2_state_monad$returnS FMSUB_S else if (((p0_ = "fnmsub.s"))) then sail2_state_monad$returnS FNMSUB_S else if (((p0_ = "fnmadd.s"))) then sail2_state_monad$returnS FNMADD_S else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_madd_type_mnemonic_S_forwards_matches:f_madd_op_S -> bool) arg_= ((case arg_ of FMADD_S => T | FMSUB_S => T | FNMSUB_S => T | FNMADD_S => T )))`; val _ = Define ` ((f_madd_type_mnemonic_S_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fmadd.s"))) then T else if (((p0_ = "fmsub.s"))) then T else if (((p0_ = "fnmsub.s"))) then T else if (((p0_ = "fnmadd.s"))) then T else F))`; (*val _s1114_ : string -> maybe string*) val _ = Define ` ((s1114_:string ->(string)option) s1115_0= (let s1116_0 = s1115_0 in if ((string_startswith s1116_0 "fnmadd.s")) then (case ((string_drop s1116_0 ((string_length "fnmadd.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1110_ : string -> maybe string*) val _ = Define ` ((s1110_:string ->(string)option) s1111_0= (let s1112_0 = s1111_0 in if ((string_startswith s1112_0 "fnmsub.s")) then (case ((string_drop s1112_0 ((string_length "fnmsub.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1106_ : string -> maybe string*) val _ = Define ` ((s1106_:string ->(string)option) s1107_0= (let s1108_0 = s1107_0 in if ((string_startswith s1108_0 "fmsub.s")) then (case ((string_drop s1108_0 ((string_length "fmsub.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1102_ : string -> maybe string*) val _ = Define ` ((s1102_:string ->(string)option) s1103_0= (let s1104_0 = s1103_0 in if ((string_startswith s1104_0 "fmadd.s")) then (case ((string_drop s1104_0 ((string_length "fmadd.s")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_madd_type_mnemonic_S_matches_prefix:string ->(f_madd_op_S#int)option) arg_= (let s1105_0 = arg_ in if ((case ((s1102_ s1105_0)) of SOME (s_) => T | _ => F )) then (case s1102_ s1105_0 of (SOME (s_)) => SOME (FMADD_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1106_ s1105_0)) of SOME (s_) => T | _ => F )) then (case s1106_ s1105_0 of (SOME (s_)) => SOME (FMSUB_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1110_ s1105_0)) of SOME (s_) => T | _ => F )) then (case s1110_ s1105_0 of (SOME (s_)) => SOME (FNMSUB_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1114_ s1105_0)) of SOME (s_) => T | _ => F )) then (case s1114_ s1105_0 of (SOME (s_)) => SOME (FNMADD_S, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val f_bin_rm_type_mnemonic_S_forwards : f_bin_rm_op_S -> string*) (*val f_bin_rm_type_mnemonic_S_backwards : string -> M f_bin_rm_op_S*) (*val f_bin_rm_type_mnemonic_S_forwards_matches : f_bin_rm_op_S -> bool*) (*val f_bin_rm_type_mnemonic_S_backwards_matches : string -> bool*) (*val f_bin_rm_type_mnemonic_S_matches_prefix : string -> maybe ((f_bin_rm_op_S * ii))*) val _ = Define ` ((f_bin_rm_type_mnemonic_S_forwards:f_bin_rm_op_S -> string) arg_= ((case arg_ of FADD_S => "fadd.s" | FSUB_S => "fsub.s" | FMUL_S => "fmul.s" | FDIV_S => "fdiv.s" )))`; val _ = Define ` ((f_bin_rm_type_mnemonic_S_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_bin_rm_op_S),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fadd.s"))) then sail2_state_monad$returnS FADD_S else if (((p0_ = "fsub.s"))) then sail2_state_monad$returnS FSUB_S else if (((p0_ = "fmul.s"))) then sail2_state_monad$returnS FMUL_S else if (((p0_ = "fdiv.s"))) then sail2_state_monad$returnS FDIV_S else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_bin_rm_type_mnemonic_S_forwards_matches:f_bin_rm_op_S -> bool) arg_= ((case arg_ of FADD_S => T | FSUB_S => T | FMUL_S => T | FDIV_S => T )))`; val _ = Define ` ((f_bin_rm_type_mnemonic_S_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fadd.s"))) then T else if (((p0_ = "fsub.s"))) then T else if (((p0_ = "fmul.s"))) then T else if (((p0_ = "fdiv.s"))) then T else F))`; (*val _s1130_ : string -> maybe string*) val _ = Define ` ((s1130_:string ->(string)option) s1131_0= (let s1132_0 = s1131_0 in if ((string_startswith s1132_0 "fdiv.s")) then (case ((string_drop s1132_0 ((string_length "fdiv.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1126_ : string -> maybe string*) val _ = Define ` ((s1126_:string ->(string)option) s1127_0= (let s1128_0 = s1127_0 in if ((string_startswith s1128_0 "fmul.s")) then (case ((string_drop s1128_0 ((string_length "fmul.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1122_ : string -> maybe string*) val _ = Define ` ((s1122_:string ->(string)option) s1123_0= (let s1124_0 = s1123_0 in if ((string_startswith s1124_0 "fsub.s")) then (case ((string_drop s1124_0 ((string_length "fsub.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1118_ : string -> maybe string*) val _ = Define ` ((s1118_:string ->(string)option) s1119_0= (let s1120_0 = s1119_0 in if ((string_startswith s1120_0 "fadd.s")) then (case ((string_drop s1120_0 ((string_length "fadd.s")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_bin_rm_type_mnemonic_S_matches_prefix:string ->(f_bin_rm_op_S#int)option) arg_= (let s1121_0 = arg_ in if ((case ((s1118_ s1121_0)) of SOME (s_) => T | _ => F )) then (case s1118_ s1121_0 of (SOME (s_)) => SOME (FADD_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1122_ s1121_0)) of SOME (s_) => T | _ => F )) then (case s1122_ s1121_0 of (SOME (s_)) => SOME (FSUB_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1126_ s1121_0)) of SOME (s_) => T | _ => F )) then (case s1126_ s1121_0 of (SOME (s_)) => SOME (FMUL_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1130_ s1121_0)) of SOME (s_) => T | _ => F )) then (case s1130_ s1121_0 of (SOME (s_)) => SOME (FDIV_S, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val f_un_rm_type_mnemonic_S_forwards : f_un_rm_op_S -> string*) (*val f_un_rm_type_mnemonic_S_backwards : string -> M f_un_rm_op_S*) (*val f_un_rm_type_mnemonic_S_forwards_matches : f_un_rm_op_S -> bool*) (*val f_un_rm_type_mnemonic_S_backwards_matches : string -> bool*) (*val f_un_rm_type_mnemonic_S_matches_prefix : string -> maybe ((f_un_rm_op_S * ii))*) val _ = Define ` ((f_un_rm_type_mnemonic_S_forwards:f_un_rm_op_S -> string) arg_= ((case arg_ of FSQRT_S => "fsqrt.s" | FCVT_W_S => "fcvt.w.s" | FCVT_WU_S => "fcvt.wu.s" | FCVT_S_W => "fcvt.s.w" | FCVT_S_WU => "fcvt.s.wu" | FCVT_L_S => "fcvt.l.s" | FCVT_LU_S => "fcvt.lu.s" | FCVT_S_L => "fcvt.s.l" | FCVT_S_LU => "fcvt.s.lu" )))`; val _ = Define ` ((f_un_rm_type_mnemonic_S_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_un_rm_op_S),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fsqrt.s"))) then sail2_state_monad$returnS FSQRT_S else if (((p0_ = "fcvt.w.s"))) then sail2_state_monad$returnS FCVT_W_S else if (((p0_ = "fcvt.wu.s"))) then sail2_state_monad$returnS FCVT_WU_S else if (((p0_ = "fcvt.s.w"))) then sail2_state_monad$returnS FCVT_S_W else if (((p0_ = "fcvt.s.wu"))) then sail2_state_monad$returnS FCVT_S_WU else if (((p0_ = "fcvt.l.s"))) then sail2_state_monad$returnS FCVT_L_S else if (((p0_ = "fcvt.lu.s"))) then sail2_state_monad$returnS FCVT_LU_S else if (((p0_ = "fcvt.s.l"))) then sail2_state_monad$returnS FCVT_S_L else if (((p0_ = "fcvt.s.lu"))) then sail2_state_monad$returnS FCVT_S_LU else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_un_rm_type_mnemonic_S_forwards_matches:f_un_rm_op_S -> bool) arg_= ((case arg_ of FSQRT_S => T | FCVT_W_S => T | FCVT_WU_S => T | FCVT_S_W => T | FCVT_S_WU => T | FCVT_L_S => T | FCVT_LU_S => T | FCVT_S_L => T | FCVT_S_LU => T )))`; val _ = Define ` ((f_un_rm_type_mnemonic_S_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fsqrt.s"))) then T else if (((p0_ = "fcvt.w.s"))) then T else if (((p0_ = "fcvt.wu.s"))) then T else if (((p0_ = "fcvt.s.w"))) then T else if (((p0_ = "fcvt.s.wu"))) then T else if (((p0_ = "fcvt.l.s"))) then T else if (((p0_ = "fcvt.lu.s"))) then T else if (((p0_ = "fcvt.s.l"))) then T else if (((p0_ = "fcvt.s.lu"))) then T else F))`; (*val _s1166_ : string -> maybe string*) val _ = Define ` ((s1166_:string ->(string)option) s1167_0= (let s1168_0 = s1167_0 in if ((string_startswith s1168_0 "fcvt.s.lu")) then (case ((string_drop s1168_0 ((string_length "fcvt.s.lu")))) of s_ => SOME s_ ) else NONE))`; (*val _s1162_ : string -> maybe string*) val _ = Define ` ((s1162_:string ->(string)option) s1163_0= (let s1164_0 = s1163_0 in if ((string_startswith s1164_0 "fcvt.s.l")) then (case ((string_drop s1164_0 ((string_length "fcvt.s.l")))) of s_ => SOME s_ ) else NONE))`; (*val _s1158_ : string -> maybe string*) val _ = Define ` ((s1158_:string ->(string)option) s1159_0= (let s1160_0 = s1159_0 in if ((string_startswith s1160_0 "fcvt.lu.s")) then (case ((string_drop s1160_0 ((string_length "fcvt.lu.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1154_ : string -> maybe string*) val _ = Define ` ((s1154_:string ->(string)option) s1155_0= (let s1156_0 = s1155_0 in if ((string_startswith s1156_0 "fcvt.l.s")) then (case ((string_drop s1156_0 ((string_length "fcvt.l.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1150_ : string -> maybe string*) val _ = Define ` ((s1150_:string ->(string)option) s1151_0= (let s1152_0 = s1151_0 in if ((string_startswith s1152_0 "fcvt.s.wu")) then (case ((string_drop s1152_0 ((string_length "fcvt.s.wu")))) of s_ => SOME s_ ) else NONE))`; (*val _s1146_ : string -> maybe string*) val _ = Define ` ((s1146_:string ->(string)option) s1147_0= (let s1148_0 = s1147_0 in if ((string_startswith s1148_0 "fcvt.s.w")) then (case ((string_drop s1148_0 ((string_length "fcvt.s.w")))) of s_ => SOME s_ ) else NONE))`; (*val _s1142_ : string -> maybe string*) val _ = Define ` ((s1142_:string ->(string)option) s1143_0= (let s1144_0 = s1143_0 in if ((string_startswith s1144_0 "fcvt.wu.s")) then (case ((string_drop s1144_0 ((string_length "fcvt.wu.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1138_ : string -> maybe string*) val _ = Define ` ((s1138_:string ->(string)option) s1139_0= (let s1140_0 = s1139_0 in if ((string_startswith s1140_0 "fcvt.w.s")) then (case ((string_drop s1140_0 ((string_length "fcvt.w.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1134_ : string -> maybe string*) val _ = Define ` ((s1134_:string ->(string)option) s1135_0= (let s1136_0 = s1135_0 in if ((string_startswith s1136_0 "fsqrt.s")) then (case ((string_drop s1136_0 ((string_length "fsqrt.s")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_un_rm_type_mnemonic_S_matches_prefix:string ->(f_un_rm_op_S#int)option) arg_= (let s1137_0 = arg_ in if ((case ((s1134_ s1137_0)) of SOME (s_) => T | _ => F )) then (case s1134_ s1137_0 of (SOME (s_)) => SOME (FSQRT_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1138_ s1137_0)) of SOME (s_) => T | _ => F )) then (case s1138_ s1137_0 of (SOME (s_)) => SOME (FCVT_W_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1142_ s1137_0)) of SOME (s_) => T | _ => F )) then (case s1142_ s1137_0 of (SOME (s_)) => SOME (FCVT_WU_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1146_ s1137_0)) of SOME (s_) => T | _ => F )) then (case s1146_ s1137_0 of (SOME (s_)) => SOME (FCVT_S_W, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1150_ s1137_0)) of SOME (s_) => T | _ => F )) then (case s1150_ s1137_0 of (SOME (s_)) => SOME (FCVT_S_WU, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1154_ s1137_0)) of SOME (s_) => T | _ => F )) then (case s1154_ s1137_0 of (SOME (s_)) => SOME (FCVT_L_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1158_ s1137_0)) of SOME (s_) => T | _ => F )) then (case s1158_ s1137_0 of (SOME (s_)) => SOME (FCVT_LU_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1162_ s1137_0)) of SOME (s_) => T | _ => F )) then (case s1162_ s1137_0 of (SOME (s_)) => SOME (FCVT_S_L, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1166_ s1137_0)) of SOME (s_) => T | _ => F )) then (case s1166_ s1137_0 of (SOME (s_)) => SOME (FCVT_S_LU, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val f_bin_type_mnemonic_S_forwards : f_bin_op_S -> string*) (*val f_bin_type_mnemonic_S_backwards : string -> M f_bin_op_S*) (*val f_bin_type_mnemonic_S_forwards_matches : f_bin_op_S -> bool*) (*val f_bin_type_mnemonic_S_backwards_matches : string -> bool*) (*val f_bin_type_mnemonic_S_matches_prefix : string -> maybe ((f_bin_op_S * ii))*) val _ = Define ` ((f_bin_type_mnemonic_S_forwards:f_bin_op_S -> string) arg_= ((case arg_ of FSGNJ_S => "fsgnj.s" | FSGNJN_S => "fsgnjn.s" | FSGNJX_S => "fsgnjx.s" | FMIN_S => "fmin.s" | FMAX_S => "fmax.s" | FEQ_S => "feq.s" | FLT_S => "flt.s" | FLE_S => "fle.s" )))`; val _ = Define ` ((f_bin_type_mnemonic_S_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_bin_op_S),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fsgnj.s"))) then sail2_state_monad$returnS FSGNJ_S else if (((p0_ = "fsgnjn.s"))) then sail2_state_monad$returnS FSGNJN_S else if (((p0_ = "fsgnjx.s"))) then sail2_state_monad$returnS FSGNJX_S else if (((p0_ = "fmin.s"))) then sail2_state_monad$returnS FMIN_S else if (((p0_ = "fmax.s"))) then sail2_state_monad$returnS FMAX_S else if (((p0_ = "feq.s"))) then sail2_state_monad$returnS FEQ_S else if (((p0_ = "flt.s"))) then sail2_state_monad$returnS FLT_S else if (((p0_ = "fle.s"))) then sail2_state_monad$returnS FLE_S else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_bin_type_mnemonic_S_forwards_matches:f_bin_op_S -> bool) arg_= ((case arg_ of FSGNJ_S => T | FSGNJN_S => T | FSGNJX_S => T | FMIN_S => T | FMAX_S => T | FEQ_S => T | FLT_S => T | FLE_S => T )))`; val _ = Define ` ((f_bin_type_mnemonic_S_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fsgnj.s"))) then T else if (((p0_ = "fsgnjn.s"))) then T else if (((p0_ = "fsgnjx.s"))) then T else if (((p0_ = "fmin.s"))) then T else if (((p0_ = "fmax.s"))) then T else if (((p0_ = "feq.s"))) then T else if (((p0_ = "flt.s"))) then T else if (((p0_ = "fle.s"))) then T else F))`; (*val _s1198_ : string -> maybe string*) val _ = Define ` ((s1198_:string ->(string)option) s1199_0= (let s1200_0 = s1199_0 in if ((string_startswith s1200_0 "fle.s")) then (case ((string_drop s1200_0 ((string_length "fle.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1194_ : string -> maybe string*) val _ = Define ` ((s1194_:string ->(string)option) s1195_0= (let s1196_0 = s1195_0 in if ((string_startswith s1196_0 "flt.s")) then (case ((string_drop s1196_0 ((string_length "flt.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1190_ : string -> maybe string*) val _ = Define ` ((s1190_:string ->(string)option) s1191_0= (let s1192_0 = s1191_0 in if ((string_startswith s1192_0 "feq.s")) then (case ((string_drop s1192_0 ((string_length "feq.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1186_ : string -> maybe string*) val _ = Define ` ((s1186_:string ->(string)option) s1187_0= (let s1188_0 = s1187_0 in if ((string_startswith s1188_0 "fmax.s")) then (case ((string_drop s1188_0 ((string_length "fmax.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1182_ : string -> maybe string*) val _ = Define ` ((s1182_:string ->(string)option) s1183_0= (let s1184_0 = s1183_0 in if ((string_startswith s1184_0 "fmin.s")) then (case ((string_drop s1184_0 ((string_length "fmin.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1178_ : string -> maybe string*) val _ = Define ` ((s1178_:string ->(string)option) s1179_0= (let s1180_0 = s1179_0 in if ((string_startswith s1180_0 "fsgnjx.s")) then (case ((string_drop s1180_0 ((string_length "fsgnjx.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1174_ : string -> maybe string*) val _ = Define ` ((s1174_:string ->(string)option) s1175_0= (let s1176_0 = s1175_0 in if ((string_startswith s1176_0 "fsgnjn.s")) then (case ((string_drop s1176_0 ((string_length "fsgnjn.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1170_ : string -> maybe string*) val _ = Define ` ((s1170_:string ->(string)option) s1171_0= (let s1172_0 = s1171_0 in if ((string_startswith s1172_0 "fsgnj.s")) then (case ((string_drop s1172_0 ((string_length "fsgnj.s")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_bin_type_mnemonic_S_matches_prefix:string ->(f_bin_op_S#int)option) arg_= (let s1173_0 = arg_ in if ((case ((s1170_ s1173_0)) of SOME (s_) => T | _ => F )) then (case s1170_ s1173_0 of (SOME (s_)) => SOME (FSGNJ_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1174_ s1173_0)) of SOME (s_) => T | _ => F )) then (case s1174_ s1173_0 of (SOME (s_)) => SOME (FSGNJN_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1178_ s1173_0)) of SOME (s_) => T | _ => F )) then (case s1178_ s1173_0 of (SOME (s_)) => SOME (FSGNJX_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1182_ s1173_0)) of SOME (s_) => T | _ => F )) then (case s1182_ s1173_0 of (SOME (s_)) => SOME (FMIN_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1186_ s1173_0)) of SOME (s_) => T | _ => F )) then (case s1186_ s1173_0 of (SOME (s_)) => SOME (FMAX_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1190_ s1173_0)) of SOME (s_) => T | _ => F )) then (case s1190_ s1173_0 of (SOME (s_)) => SOME (FEQ_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1194_ s1173_0)) of SOME (s_) => T | _ => F )) then (case s1194_ s1173_0 of (SOME (s_)) => SOME (FLT_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1198_ s1173_0)) of SOME (s_) => T | _ => F )) then (case s1198_ s1173_0 of (SOME (s_)) => SOME (FLE_S, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val f_un_type_mnemonic_S_forwards : f_un_op_S -> string*) (*val f_un_type_mnemonic_S_backwards : string -> M f_un_op_S*) (*val f_un_type_mnemonic_S_forwards_matches : f_un_op_S -> bool*) (*val f_un_type_mnemonic_S_backwards_matches : string -> bool*) (*val f_un_type_mnemonic_S_matches_prefix : string -> maybe ((f_un_op_S * ii))*) val _ = Define ` ((f_un_type_mnemonic_S_forwards:f_un_op_S -> string) arg_= ((case arg_ of FMV_X_W => "fmv.x.w" | FCLASS_S => "fclass.s" | FMV_W_X => "fmv.w.x" )))`; val _ = Define ` ((f_un_type_mnemonic_S_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_un_op_S),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fmv.x.w"))) then sail2_state_monad$returnS FMV_X_W else if (((p0_ = "fclass.s"))) then sail2_state_monad$returnS FCLASS_S else if (((p0_ = "fmv.w.x"))) then sail2_state_monad$returnS FMV_W_X else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_un_type_mnemonic_S_forwards_matches:f_un_op_S -> bool) arg_= ((case arg_ of FMV_X_W => T | FCLASS_S => T | FMV_W_X => T )))`; val _ = Define ` ((f_un_type_mnemonic_S_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fmv.x.w"))) then T else if (((p0_ = "fclass.s"))) then T else if (((p0_ = "fmv.w.x"))) then T else F))`; (*val _s1210_ : string -> maybe string*) val _ = Define ` ((s1210_:string ->(string)option) s1211_0= (let s1212_0 = s1211_0 in if ((string_startswith s1212_0 "fmv.w.x")) then (case ((string_drop s1212_0 ((string_length "fmv.w.x")))) of s_ => SOME s_ ) else NONE))`; (*val _s1206_ : string -> maybe string*) val _ = Define ` ((s1206_:string ->(string)option) s1207_0= (let s1208_0 = s1207_0 in if ((string_startswith s1208_0 "fclass.s")) then (case ((string_drop s1208_0 ((string_length "fclass.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1202_ : string -> maybe string*) val _ = Define ` ((s1202_:string ->(string)option) s1203_0= (let s1204_0 = s1203_0 in if ((string_startswith s1204_0 "fmv.x.w")) then (case ((string_drop s1204_0 ((string_length "fmv.x.w")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_un_type_mnemonic_S_matches_prefix:string ->(f_un_op_S#int)option) arg_= (let s1205_0 = arg_ in if ((case ((s1202_ s1205_0)) of SOME (s_) => T | _ => F )) then (case s1202_ s1205_0 of (SOME (s_)) => SOME (FMV_X_W, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1206_ s1205_0)) of SOME (s_) => T | _ => F )) then (case s1206_ s1205_0 of (SOME (s_)) => SOME (FCLASS_S, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1210_ s1205_0)) of SOME (s_) => T | _ => F )) then (case s1210_ s1205_0 of (SOME (s_)) => SOME (FMV_W_X, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val fsplit_D : mword ty64 -> (mword ty1 * mword ty11 * mword ty52)*) val _ = Define ` ((fsplit_D:(64)words$word ->(1)words$word#(11)words$word#(52)words$word) x64= ((subrange_vec_dec x64 (( 63 : int):ii) (( 63 : int):ii) : 1 words$word), (subrange_vec_dec x64 (( 62 : int):ii) (( 52 : int):ii) : 11 words$word), (subrange_vec_dec x64 (( 51 : int):ii) (( 0 : int):ii) : 52 words$word)))`; (*val fmake_D : mword ty1 -> mword ty11 -> mword ty52 -> mword ty64*) val _ = Define ` ((fmake_D:(1)words$word ->(11)words$word ->(52)words$word ->(64)words$word) sign exp mant= ((concat_vec sign ((concat_vec exp mant : 63 words$word)) : 64 words$word)))`; (*val canonical_NaN_D : unit -> mword ty64*) val _ = Define ` ((canonical_NaN_D:unit ->(64)words$word) () = ((0x7FF8000000000000w : 64 words$word)))`; (*val f_is_neg_inf_D : mword ty64 -> bool*) val _ = Define ` ((f_is_neg_inf_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((sign = (0b1w : 1 words$word)))) /\ ((((((exp = ((ones (( 11 : int):ii) : 11 words$word))))) /\ (((mant = ((zeros_implicit (( 52 : int):ii) : 52 words$word)))))))))))`; (*val f_is_neg_norm_D : mword ty64 -> bool*) val _ = Define ` ((f_is_neg_norm_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((sign = (0b1w : 1 words$word)))) /\ ((((((exp <> ((zeros_implicit (( 11 : int):ii) : 11 words$word))))) /\ (((exp <> ((ones (( 11 : int):ii) : 11 words$word)))))))))))`; (*val f_is_neg_subnorm_D : mword ty64 -> bool*) val _ = Define ` ((f_is_neg_subnorm_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((sign = (0b1w : 1 words$word)))) /\ ((((((exp = ((zeros_implicit (( 11 : int):ii) : 11 words$word))))) /\ (((mant <> ((zeros_implicit (( 52 : int):ii) : 52 words$word)))))))))))`; (*val f_is_neg_zero_D : mword ty64 -> bool*) val _ = Define ` ((f_is_neg_zero_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((sign = ((ones (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp = ((zeros_implicit (( 11 : int):ii) : 11 words$word))))) /\ (((mant = ((zeros_implicit (( 52 : int):ii) : 52 words$word)))))))))))`; (*val f_is_pos_zero_D : mword ty64 -> bool*) val _ = Define ` ((f_is_pos_zero_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((sign = ((zeros_implicit (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp = ((zeros_implicit (( 11 : int):ii) : 11 words$word))))) /\ (((mant = ((zeros_implicit (( 52 : int):ii) : 52 words$word)))))))))))`; (*val f_is_pos_subnorm_D : mword ty64 -> bool*) val _ = Define ` ((f_is_pos_subnorm_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((sign = ((zeros_implicit (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp = ((zeros_implicit (( 11 : int):ii) : 11 words$word))))) /\ (((mant <> ((zeros_implicit (( 52 : int):ii) : 52 words$word)))))))))))`; (*val f_is_pos_norm_D : mword ty64 -> bool*) val _ = Define ` ((f_is_pos_norm_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((sign = ((zeros_implicit (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp <> ((zeros_implicit (( 11 : int):ii) : 11 words$word))))) /\ (((exp <> ((ones (( 11 : int):ii) : 11 words$word)))))))))))`; (*val f_is_pos_inf_D : mword ty64 -> bool*) val _ = Define ` ((f_is_pos_inf_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((sign = ((zeros_implicit (( 1 : int):ii) : 1 words$word))))) /\ ((((((exp = ((ones (( 11 : int):ii) : 11 words$word))))) /\ (((mant = ((zeros_implicit (( 52 : int):ii) : 52 words$word)))))))))))`; (*val f_is_SNaN_D : mword ty64 -> bool*) val _ = Define ` ((f_is_SNaN_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((exp = ((ones (( 11 : int):ii) : 11 words$word))))) /\ ((((((((access_vec_dec mant (( 51 : int):ii))) = B0))) /\ (((mant <> ((zeros_implicit (( 52 : int):ii) : 52 words$word)))))))))))`; (*val f_is_QNaN_D : mword ty64 -> bool*) val _ = Define ` ((f_is_QNaN_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((exp = ((ones (( 11 : int):ii) : 11 words$word))))) /\ (((((access_vec_dec mant (( 51 : int):ii))) = B1))))))`; (*val f_is_NaN_D : mword ty64 -> bool*) val _ = Define ` ((f_is_NaN_D:(64)words$word -> bool) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in ((((exp = ((ones (( 11 : int):ii) : 11 words$word))))) /\ (((mant <> ((zeros_implicit (( 52 : int):ii) : 52 words$word))))))))`; (*val negate_D : mword ty64 -> mword ty64*) val _ = Define ` ((negate_D:(64)words$word ->(64)words$word) x64= (let (sign, exp, mant) = ((fsplit_D x64 : ( 1 words$word # 11 words$word # 52 words$word))) in let new_sign = (if (((sign = (0b0w : 1 words$word)))) then (0b1w : 1 words$word) else (0b0w : 1 words$word)) in (fmake_D new_sign exp mant : 64 words$word)))`; (*val feq_quiet_D : mword ty64 -> mword ty64 -> (bool * mword ty5)*) val _ = Define ` ((feq_quiet_D:(64)words$word ->(64)words$word -> bool#(5)words$word) v1 v2= (let (s1, e1, m1) = ((fsplit_D v1 : ( 1 words$word # 11 words$word # 52 words$word))) in let (s2, e2, m2) = ((fsplit_D v2 : ( 1 words$word # 11 words$word # 52 words$word))) in let v1Is0 = (((f_is_neg_zero_D v1)) \/ ((f_is_pos_zero_D v1))) in let v2Is0 = (((f_is_neg_zero_D v2)) \/ ((f_is_pos_zero_D v2))) in let result = ((((v1 = v2))) \/ (((v1Is0 /\ v2Is0)))) in let fflags = (if (((((f_is_SNaN_D v1)) \/ ((f_is_SNaN_D v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word)) in (result, fflags)))`; (*val flt_D : mword ty64 -> mword ty64 -> bool -> (bool * mword ty5)*) val _ = Define ` ((flt_D:(64)words$word ->(64)words$word -> bool -> bool#(5)words$word) v1 v2 is_quiet= (let (s1, e1, m1) = ((fsplit_D v1 : ( 1 words$word # 11 words$word # 52 words$word))) in let (s2, e2, m2) = ((fsplit_D v2 : ( 1 words$word # 11 words$word # 52 words$word))) in let (result : bool) = (if ((((((s1 = (0b0w : 1 words$word)))) /\ (((s2 = (0b0w : 1 words$word))))))) then if (((e1 = e2))) then ((lem$w2ui m1)) < ((lem$w2ui m2)) else ((lem$w2ui e1)) < ((lem$w2ui e2)) else if ((((((s1 = (0b0w : 1 words$word)))) /\ (((s2 = (0b1w : 1 words$word))))))) then F else if ((((((s1 = (0b1w : 1 words$word)))) /\ (((s2 = (0b0w : 1 words$word))))))) then T else if (((e1 = e2))) then ((lem$w2ui m1)) > ((lem$w2ui m2)) else ((lem$w2ui e1)) > ((lem$w2ui e2))) in let fflags = (if is_quiet then if (((((f_is_SNaN_D v1)) \/ ((f_is_SNaN_D v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word) else if (((((f_is_NaN_D v1)) \/ ((f_is_NaN_D v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word)) in (result, fflags)))`; (*val fle_D : mword ty64 -> mword ty64 -> bool -> (bool * mword ty5)*) val _ = Define ` ((fle_D:(64)words$word ->(64)words$word -> bool -> bool#(5)words$word) v1 v2 is_quiet= (let (s1, e1, m1) = ((fsplit_D v1 : ( 1 words$word # 11 words$word # 52 words$word))) in let (s2, e2, m2) = ((fsplit_D v2 : ( 1 words$word # 11 words$word # 52 words$word))) in let v1Is0 = (((f_is_neg_zero_D v1)) \/ ((f_is_pos_zero_D v1))) in let v2Is0 = (((f_is_neg_zero_D v2)) \/ ((f_is_pos_zero_D v2))) in let (result : bool) = (if ((((((s1 = (0b0w : 1 words$word)))) /\ (((s2 = (0b0w : 1 words$word))))))) then if (((e1 = e2))) then ((lem$w2ui m1)) <= ((lem$w2ui m2)) else ((lem$w2ui e1)) < ((lem$w2ui e2)) else if ((((((s1 = (0b0w : 1 words$word)))) /\ (((s2 = (0b1w : 1 words$word))))))) then (v1Is0 /\ v2Is0) else if ((((((s1 = (0b1w : 1 words$word)))) /\ (((s2 = (0b0w : 1 words$word))))))) then T else if (((e1 = e2))) then ((lem$w2ui m1)) >= ((lem$w2ui m2)) else ((lem$w2ui e1)) > ((lem$w2ui e2))) in let fflags = (if is_quiet then if (((((f_is_SNaN_D v1)) \/ ((f_is_SNaN_D v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word) else if (((((f_is_NaN_D v1)) \/ ((f_is_NaN_D v2))))) then (nvFlag () : 5 words$word) else (zeros_implicit (( 5 : int):ii) : 5 words$word)) in (result, fflags)))`; (*val f_madd_type_mnemonic_D_forwards : f_madd_op_D -> string*) (*val f_madd_type_mnemonic_D_backwards : string -> M f_madd_op_D*) (*val f_madd_type_mnemonic_D_forwards_matches : f_madd_op_D -> bool*) (*val f_madd_type_mnemonic_D_backwards_matches : string -> bool*) (*val f_madd_type_mnemonic_D_matches_prefix : string -> maybe ((f_madd_op_D * ii))*) val _ = Define ` ((f_madd_type_mnemonic_D_forwards:f_madd_op_D -> string) arg_= ((case arg_ of FMADD_D => "fmadd.d" | FMSUB_D => "fmsub.d" | FNMSUB_D => "fnmsub.d" | FNMADD_D => "fnmadd.d" )))`; val _ = Define ` ((f_madd_type_mnemonic_D_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_madd_op_D),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fmadd.d"))) then sail2_state_monad$returnS FMADD_D else if (((p0_ = "fmsub.d"))) then sail2_state_monad$returnS FMSUB_D else if (((p0_ = "fnmsub.d"))) then sail2_state_monad$returnS FNMSUB_D else if (((p0_ = "fnmadd.d"))) then sail2_state_monad$returnS FNMADD_D else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_madd_type_mnemonic_D_forwards_matches:f_madd_op_D -> bool) arg_= ((case arg_ of FMADD_D => T | FMSUB_D => T | FNMSUB_D => T | FNMADD_D => T )))`; val _ = Define ` ((f_madd_type_mnemonic_D_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fmadd.d"))) then T else if (((p0_ = "fmsub.d"))) then T else if (((p0_ = "fnmsub.d"))) then T else if (((p0_ = "fnmadd.d"))) then T else F))`; (*val _s1226_ : string -> maybe string*) val _ = Define ` ((s1226_:string ->(string)option) s1227_0= (let s1228_0 = s1227_0 in if ((string_startswith s1228_0 "fnmadd.d")) then (case ((string_drop s1228_0 ((string_length "fnmadd.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1222_ : string -> maybe string*) val _ = Define ` ((s1222_:string ->(string)option) s1223_0= (let s1224_0 = s1223_0 in if ((string_startswith s1224_0 "fnmsub.d")) then (case ((string_drop s1224_0 ((string_length "fnmsub.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1218_ : string -> maybe string*) val _ = Define ` ((s1218_:string ->(string)option) s1219_0= (let s1220_0 = s1219_0 in if ((string_startswith s1220_0 "fmsub.d")) then (case ((string_drop s1220_0 ((string_length "fmsub.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1214_ : string -> maybe string*) val _ = Define ` ((s1214_:string ->(string)option) s1215_0= (let s1216_0 = s1215_0 in if ((string_startswith s1216_0 "fmadd.d")) then (case ((string_drop s1216_0 ((string_length "fmadd.d")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_madd_type_mnemonic_D_matches_prefix:string ->(f_madd_op_D#int)option) arg_= (let s1217_0 = arg_ in if ((case ((s1214_ s1217_0)) of SOME (s_) => T | _ => F )) then (case s1214_ s1217_0 of (SOME (s_)) => SOME (FMADD_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1218_ s1217_0)) of SOME (s_) => T | _ => F )) then (case s1218_ s1217_0 of (SOME (s_)) => SOME (FMSUB_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1222_ s1217_0)) of SOME (s_) => T | _ => F )) then (case s1222_ s1217_0 of (SOME (s_)) => SOME (FNMSUB_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1226_ s1217_0)) of SOME (s_) => T | _ => F )) then (case s1226_ s1217_0 of (SOME (s_)) => SOME (FNMADD_D, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val f_bin_rm_type_mnemonic_D_forwards : f_bin_rm_op_D -> string*) (*val f_bin_rm_type_mnemonic_D_backwards : string -> M f_bin_rm_op_D*) (*val f_bin_rm_type_mnemonic_D_forwards_matches : f_bin_rm_op_D -> bool*) (*val f_bin_rm_type_mnemonic_D_backwards_matches : string -> bool*) (*val f_bin_rm_type_mnemonic_D_matches_prefix : string -> maybe ((f_bin_rm_op_D * ii))*) val _ = Define ` ((f_bin_rm_type_mnemonic_D_forwards:f_bin_rm_op_D -> string) arg_= ((case arg_ of FADD_D => "fadd.d" | FSUB_D => "fsub.d" | FMUL_D => "fmul.d" | FDIV_D => "fdiv.d" )))`; val _ = Define ` ((f_bin_rm_type_mnemonic_D_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_bin_rm_op_D),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fadd.d"))) then sail2_state_monad$returnS FADD_D else if (((p0_ = "fsub.d"))) then sail2_state_monad$returnS FSUB_D else if (((p0_ = "fmul.d"))) then sail2_state_monad$returnS FMUL_D else if (((p0_ = "fdiv.d"))) then sail2_state_monad$returnS FDIV_D else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_bin_rm_type_mnemonic_D_forwards_matches:f_bin_rm_op_D -> bool) arg_= ((case arg_ of FADD_D => T | FSUB_D => T | FMUL_D => T | FDIV_D => T )))`; val _ = Define ` ((f_bin_rm_type_mnemonic_D_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fadd.d"))) then T else if (((p0_ = "fsub.d"))) then T else if (((p0_ = "fmul.d"))) then T else if (((p0_ = "fdiv.d"))) then T else F))`; (*val _s1242_ : string -> maybe string*) val _ = Define ` ((s1242_:string ->(string)option) s1243_0= (let s1244_0 = s1243_0 in if ((string_startswith s1244_0 "fdiv.d")) then (case ((string_drop s1244_0 ((string_length "fdiv.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1238_ : string -> maybe string*) val _ = Define ` ((s1238_:string ->(string)option) s1239_0= (let s1240_0 = s1239_0 in if ((string_startswith s1240_0 "fmul.d")) then (case ((string_drop s1240_0 ((string_length "fmul.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1234_ : string -> maybe string*) val _ = Define ` ((s1234_:string ->(string)option) s1235_0= (let s1236_0 = s1235_0 in if ((string_startswith s1236_0 "fsub.d")) then (case ((string_drop s1236_0 ((string_length "fsub.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1230_ : string -> maybe string*) val _ = Define ` ((s1230_:string ->(string)option) s1231_0= (let s1232_0 = s1231_0 in if ((string_startswith s1232_0 "fadd.d")) then (case ((string_drop s1232_0 ((string_length "fadd.d")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_bin_rm_type_mnemonic_D_matches_prefix:string ->(f_bin_rm_op_D#int)option) arg_= (let s1233_0 = arg_ in if ((case ((s1230_ s1233_0)) of SOME (s_) => T | _ => F )) then (case s1230_ s1233_0 of (SOME (s_)) => SOME (FADD_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1234_ s1233_0)) of SOME (s_) => T | _ => F )) then (case s1234_ s1233_0 of (SOME (s_)) => SOME (FSUB_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1238_ s1233_0)) of SOME (s_) => T | _ => F )) then (case s1238_ s1233_0 of (SOME (s_)) => SOME (FMUL_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1242_ s1233_0)) of SOME (s_) => T | _ => F )) then (case s1242_ s1233_0 of (SOME (s_)) => SOME (FDIV_D, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val f_un_rm_type_mnemonic_D_forwards : f_un_rm_op_D -> string*) (*val f_un_rm_type_mnemonic_D_backwards : string -> M f_un_rm_op_D*) (*val f_un_rm_type_mnemonic_D_forwards_matches : f_un_rm_op_D -> bool*) (*val f_un_rm_type_mnemonic_D_backwards_matches : string -> bool*) (*val f_un_rm_type_mnemonic_D_matches_prefix : string -> maybe ((f_un_rm_op_D * ii))*) val _ = Define ` ((f_un_rm_type_mnemonic_D_forwards:f_un_rm_op_D -> string) arg_= ((case arg_ of FSQRT_D => "fsqrt.d" | FCVT_W_D => "fcvt.w.d" | FCVT_WU_D => "fcvt.wu.d" | FCVT_D_W => "fcvt.d.w" | FCVT_D_WU => "fcvt.d.wu" | FCVT_L_D => "fcvt.l.d" | FCVT_LU_D => "fcvt.lu.d" | FCVT_D_L => "fcvt.d.l" | FCVT_D_LU => "fcvt.d.lu" | FCVT_S_D => "fcvt.s.d" | FCVT_D_S => "fcvt.d.s" )))`; val _ = Define ` ((f_un_rm_type_mnemonic_D_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_un_rm_op_D),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fsqrt.d"))) then sail2_state_monad$returnS FSQRT_D else if (((p0_ = "fcvt.w.d"))) then sail2_state_monad$returnS FCVT_W_D else if (((p0_ = "fcvt.wu.d"))) then sail2_state_monad$returnS FCVT_WU_D else if (((p0_ = "fcvt.d.w"))) then sail2_state_monad$returnS FCVT_D_W else if (((p0_ = "fcvt.d.wu"))) then sail2_state_monad$returnS FCVT_D_WU else if (((p0_ = "fcvt.l.d"))) then sail2_state_monad$returnS FCVT_L_D else if (((p0_ = "fcvt.lu.d"))) then sail2_state_monad$returnS FCVT_LU_D else if (((p0_ = "fcvt.d.l"))) then sail2_state_monad$returnS FCVT_D_L else if (((p0_ = "fcvt.d.lu"))) then sail2_state_monad$returnS FCVT_D_LU else if (((p0_ = "fcvt.s.d"))) then sail2_state_monad$returnS FCVT_S_D else if (((p0_ = "fcvt.d.s"))) then sail2_state_monad$returnS FCVT_D_S else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_un_rm_type_mnemonic_D_forwards_matches:f_un_rm_op_D -> bool) arg_= ((case arg_ of FSQRT_D => T | FCVT_W_D => T | FCVT_WU_D => T | FCVT_D_W => T | FCVT_D_WU => T | FCVT_L_D => T | FCVT_LU_D => T | FCVT_D_L => T | FCVT_D_LU => T | FCVT_S_D => T | FCVT_D_S => T )))`; val _ = Define ` ((f_un_rm_type_mnemonic_D_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fsqrt.d"))) then T else if (((p0_ = "fcvt.w.d"))) then T else if (((p0_ = "fcvt.wu.d"))) then T else if (((p0_ = "fcvt.d.w"))) then T else if (((p0_ = "fcvt.d.wu"))) then T else if (((p0_ = "fcvt.l.d"))) then T else if (((p0_ = "fcvt.lu.d"))) then T else if (((p0_ = "fcvt.d.l"))) then T else if (((p0_ = "fcvt.d.lu"))) then T else if (((p0_ = "fcvt.s.d"))) then T else if (((p0_ = "fcvt.d.s"))) then T else F))`; (*val _s1286_ : string -> maybe string*) val _ = Define ` ((s1286_:string ->(string)option) s1287_0= (let s1288_0 = s1287_0 in if ((string_startswith s1288_0 "fcvt.d.s")) then (case ((string_drop s1288_0 ((string_length "fcvt.d.s")))) of s_ => SOME s_ ) else NONE))`; (*val _s1282_ : string -> maybe string*) val _ = Define ` ((s1282_:string ->(string)option) s1283_0= (let s1284_0 = s1283_0 in if ((string_startswith s1284_0 "fcvt.s.d")) then (case ((string_drop s1284_0 ((string_length "fcvt.s.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1278_ : string -> maybe string*) val _ = Define ` ((s1278_:string ->(string)option) s1279_0= (let s1280_0 = s1279_0 in if ((string_startswith s1280_0 "fcvt.d.lu")) then (case ((string_drop s1280_0 ((string_length "fcvt.d.lu")))) of s_ => SOME s_ ) else NONE))`; (*val _s1274_ : string -> maybe string*) val _ = Define ` ((s1274_:string ->(string)option) s1275_0= (let s1276_0 = s1275_0 in if ((string_startswith s1276_0 "fcvt.d.l")) then (case ((string_drop s1276_0 ((string_length "fcvt.d.l")))) of s_ => SOME s_ ) else NONE))`; (*val _s1270_ : string -> maybe string*) val _ = Define ` ((s1270_:string ->(string)option) s1271_0= (let s1272_0 = s1271_0 in if ((string_startswith s1272_0 "fcvt.lu.d")) then (case ((string_drop s1272_0 ((string_length "fcvt.lu.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1266_ : string -> maybe string*) val _ = Define ` ((s1266_:string ->(string)option) s1267_0= (let s1268_0 = s1267_0 in if ((string_startswith s1268_0 "fcvt.l.d")) then (case ((string_drop s1268_0 ((string_length "fcvt.l.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1262_ : string -> maybe string*) val _ = Define ` ((s1262_:string ->(string)option) s1263_0= (let s1264_0 = s1263_0 in if ((string_startswith s1264_0 "fcvt.d.wu")) then (case ((string_drop s1264_0 ((string_length "fcvt.d.wu")))) of s_ => SOME s_ ) else NONE))`; (*val _s1258_ : string -> maybe string*) val _ = Define ` ((s1258_:string ->(string)option) s1259_0= (let s1260_0 = s1259_0 in if ((string_startswith s1260_0 "fcvt.d.w")) then (case ((string_drop s1260_0 ((string_length "fcvt.d.w")))) of s_ => SOME s_ ) else NONE))`; (*val _s1254_ : string -> maybe string*) val _ = Define ` ((s1254_:string ->(string)option) s1255_0= (let s1256_0 = s1255_0 in if ((string_startswith s1256_0 "fcvt.wu.d")) then (case ((string_drop s1256_0 ((string_length "fcvt.wu.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1250_ : string -> maybe string*) val _ = Define ` ((s1250_:string ->(string)option) s1251_0= (let s1252_0 = s1251_0 in if ((string_startswith s1252_0 "fcvt.w.d")) then (case ((string_drop s1252_0 ((string_length "fcvt.w.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1246_ : string -> maybe string*) val _ = Define ` ((s1246_:string ->(string)option) s1247_0= (let s1248_0 = s1247_0 in if ((string_startswith s1248_0 "fsqrt.d")) then (case ((string_drop s1248_0 ((string_length "fsqrt.d")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_un_rm_type_mnemonic_D_matches_prefix:string ->(f_un_rm_op_D#int)option) arg_= (let s1249_0 = arg_ in if ((case ((s1246_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1246_ s1249_0 of (SOME (s_)) => SOME (FSQRT_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1250_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1250_ s1249_0 of (SOME (s_)) => SOME (FCVT_W_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1254_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1254_ s1249_0 of (SOME (s_)) => SOME (FCVT_WU_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1258_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1258_ s1249_0 of (SOME (s_)) => SOME (FCVT_D_W, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1262_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1262_ s1249_0 of (SOME (s_)) => SOME (FCVT_D_WU, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1266_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1266_ s1249_0 of (SOME (s_)) => SOME (FCVT_L_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1270_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1270_ s1249_0 of (SOME (s_)) => SOME (FCVT_LU_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1274_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1274_ s1249_0 of (SOME (s_)) => SOME (FCVT_D_L, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1278_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1278_ s1249_0 of (SOME (s_)) => SOME (FCVT_D_LU, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1282_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1282_ s1249_0 of (SOME (s_)) => SOME (FCVT_S_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1286_ s1249_0)) of SOME (s_) => T | _ => F )) then (case s1286_ s1249_0 of (SOME (s_)) => SOME (FCVT_D_S, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val f_bin_type_mnemonic_D_forwards : f_bin_op_D -> string*) (*val f_bin_type_mnemonic_D_backwards : string -> M f_bin_op_D*) (*val f_bin_type_mnemonic_D_forwards_matches : f_bin_op_D -> bool*) (*val f_bin_type_mnemonic_D_backwards_matches : string -> bool*) (*val f_bin_type_mnemonic_D_matches_prefix : string -> maybe ((f_bin_op_D * ii))*) val _ = Define ` ((f_bin_type_mnemonic_D_forwards:f_bin_op_D -> string) arg_= ((case arg_ of FSGNJ_D => "fsgnj.d" | FSGNJN_D => "fsgnjn.d" | FSGNJX_D => "fsgnjx.d" | FMIN_D => "fmin.d" | FMAX_D => "fmax.d" | FEQ_D => "feq.d" | FLT_D => "flt.d" | FLE_D => "fle.d" )))`; val _ = Define ` ((f_bin_type_mnemonic_D_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_bin_op_D),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fsgnj.d"))) then sail2_state_monad$returnS FSGNJ_D else if (((p0_ = "fsgnjn.d"))) then sail2_state_monad$returnS FSGNJN_D else if (((p0_ = "fsgnjx.d"))) then sail2_state_monad$returnS FSGNJX_D else if (((p0_ = "fmin.d"))) then sail2_state_monad$returnS FMIN_D else if (((p0_ = "fmax.d"))) then sail2_state_monad$returnS FMAX_D else if (((p0_ = "feq.d"))) then sail2_state_monad$returnS FEQ_D else if (((p0_ = "flt.d"))) then sail2_state_monad$returnS FLT_D else if (((p0_ = "fle.d"))) then sail2_state_monad$returnS FLE_D else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_bin_type_mnemonic_D_forwards_matches:f_bin_op_D -> bool) arg_= ((case arg_ of FSGNJ_D => T | FSGNJN_D => T | FSGNJX_D => T | FMIN_D => T | FMAX_D => T | FEQ_D => T | FLT_D => T | FLE_D => T )))`; val _ = Define ` ((f_bin_type_mnemonic_D_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fsgnj.d"))) then T else if (((p0_ = "fsgnjn.d"))) then T else if (((p0_ = "fsgnjx.d"))) then T else if (((p0_ = "fmin.d"))) then T else if (((p0_ = "fmax.d"))) then T else if (((p0_ = "feq.d"))) then T else if (((p0_ = "flt.d"))) then T else if (((p0_ = "fle.d"))) then T else F))`; (*val _s1318_ : string -> maybe string*) val _ = Define ` ((s1318_:string ->(string)option) s1319_0= (let s1320_0 = s1319_0 in if ((string_startswith s1320_0 "fle.d")) then (case ((string_drop s1320_0 ((string_length "fle.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1314_ : string -> maybe string*) val _ = Define ` ((s1314_:string ->(string)option) s1315_0= (let s1316_0 = s1315_0 in if ((string_startswith s1316_0 "flt.d")) then (case ((string_drop s1316_0 ((string_length "flt.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1310_ : string -> maybe string*) val _ = Define ` ((s1310_:string ->(string)option) s1311_0= (let s1312_0 = s1311_0 in if ((string_startswith s1312_0 "feq.d")) then (case ((string_drop s1312_0 ((string_length "feq.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1306_ : string -> maybe string*) val _ = Define ` ((s1306_:string ->(string)option) s1307_0= (let s1308_0 = s1307_0 in if ((string_startswith s1308_0 "fmax.d")) then (case ((string_drop s1308_0 ((string_length "fmax.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1302_ : string -> maybe string*) val _ = Define ` ((s1302_:string ->(string)option) s1303_0= (let s1304_0 = s1303_0 in if ((string_startswith s1304_0 "fmin.d")) then (case ((string_drop s1304_0 ((string_length "fmin.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1298_ : string -> maybe string*) val _ = Define ` ((s1298_:string ->(string)option) s1299_0= (let s1300_0 = s1299_0 in if ((string_startswith s1300_0 "fsgnjx.d")) then (case ((string_drop s1300_0 ((string_length "fsgnjx.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1294_ : string -> maybe string*) val _ = Define ` ((s1294_:string ->(string)option) s1295_0= (let s1296_0 = s1295_0 in if ((string_startswith s1296_0 "fsgnjn.d")) then (case ((string_drop s1296_0 ((string_length "fsgnjn.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1290_ : string -> maybe string*) val _ = Define ` ((s1290_:string ->(string)option) s1291_0= (let s1292_0 = s1291_0 in if ((string_startswith s1292_0 "fsgnj.d")) then (case ((string_drop s1292_0 ((string_length "fsgnj.d")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_bin_type_mnemonic_D_matches_prefix:string ->(f_bin_op_D#int)option) arg_= (let s1293_0 = arg_ in if ((case ((s1290_ s1293_0)) of SOME (s_) => T | _ => F )) then (case s1290_ s1293_0 of (SOME (s_)) => SOME (FSGNJ_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1294_ s1293_0)) of SOME (s_) => T | _ => F )) then (case s1294_ s1293_0 of (SOME (s_)) => SOME (FSGNJN_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1298_ s1293_0)) of SOME (s_) => T | _ => F )) then (case s1298_ s1293_0 of (SOME (s_)) => SOME (FSGNJX_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1302_ s1293_0)) of SOME (s_) => T | _ => F )) then (case s1302_ s1293_0 of (SOME (s_)) => SOME (FMIN_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1306_ s1293_0)) of SOME (s_) => T | _ => F )) then (case s1306_ s1293_0 of (SOME (s_)) => SOME (FMAX_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1310_ s1293_0)) of SOME (s_) => T | _ => F )) then (case s1310_ s1293_0 of (SOME (s_)) => SOME (FEQ_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1314_ s1293_0)) of SOME (s_) => T | _ => F )) then (case s1314_ s1293_0 of (SOME (s_)) => SOME (FLT_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1318_ s1293_0)) of SOME (s_) => T | _ => F )) then (case s1318_ s1293_0 of (SOME (s_)) => SOME (FLE_D, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; (*val f_un_type_mnemonic_D_forwards : f_un_op_D -> string*) (*val f_un_type_mnemonic_D_backwards : string -> M f_un_op_D*) (*val f_un_type_mnemonic_D_forwards_matches : f_un_op_D -> bool*) (*val f_un_type_mnemonic_D_backwards_matches : string -> bool*) (*val f_un_type_mnemonic_D_matches_prefix : string -> maybe ((f_un_op_D * ii))*) val _ = Define ` ((f_un_type_mnemonic_D_forwards:f_un_op_D -> string) arg_= ((case arg_ of FMV_X_D => "fmv.x.d" | FCLASS_D => "fclass.d" | FMV_D_X => "fmv.d.x" )))`; val _ = Define ` ((f_un_type_mnemonic_D_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((f_un_op_D),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let p0_ = arg_ in if (((p0_ = "fmv.x.d"))) then sail2_state_monad$returnS FMV_X_D else if (((p0_ = "fclass.d"))) then sail2_state_monad$returnS FCLASS_D else if (((p0_ = "fmv.d.x"))) then sail2_state_monad$returnS FMV_D_X else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((f_un_type_mnemonic_D_forwards_matches:f_un_op_D -> bool) arg_= ((case arg_ of FMV_X_D => T | FCLASS_D => T | FMV_D_X => T )))`; val _ = Define ` ((f_un_type_mnemonic_D_backwards_matches:string -> bool) arg_= (let p0_ = arg_ in if (((p0_ = "fmv.x.d"))) then T else if (((p0_ = "fclass.d"))) then T else if (((p0_ = "fmv.d.x"))) then T else F))`; (*val _s1330_ : string -> maybe string*) val _ = Define ` ((s1330_:string ->(string)option) s1331_0= (let s1332_0 = s1331_0 in if ((string_startswith s1332_0 "fmv.d.x")) then (case ((string_drop s1332_0 ((string_length "fmv.d.x")))) of s_ => SOME s_ ) else NONE))`; (*val _s1326_ : string -> maybe string*) val _ = Define ` ((s1326_:string ->(string)option) s1327_0= (let s1328_0 = s1327_0 in if ((string_startswith s1328_0 "fclass.d")) then (case ((string_drop s1328_0 ((string_length "fclass.d")))) of s_ => SOME s_ ) else NONE))`; (*val _s1322_ : string -> maybe string*) val _ = Define ` ((s1322_:string ->(string)option) s1323_0= (let s1324_0 = s1323_0 in if ((string_startswith s1324_0 "fmv.x.d")) then (case ((string_drop s1324_0 ((string_length "fmv.x.d")))) of s_ => SOME s_ ) else NONE))`; val _ = Define ` ((f_un_type_mnemonic_D_matches_prefix:string ->(f_un_op_D#int)option) arg_= (let s1325_0 = arg_ in if ((case ((s1322_ s1325_0)) of SOME (s_) => T | _ => F )) then (case s1322_ s1325_0 of (SOME (s_)) => SOME (FMV_X_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1326_ s1325_0)) of SOME (s_) => T | _ => F )) then (case s1326_ s1325_0 of (SOME (s_)) => SOME (FCLASS_D, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s1330_ s1325_0)) of SOME (s_) => T | _ => F )) then (case s1330_ s1325_0 of (SOME (s_)) => SOME (FMV_D_X, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; val _ = Define ` ((encdec_forwards:ast ->(regstate)sail2_state_monad$sequential_state ->((((32)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= ((case arg_ of UTYPE ((imm, rd, op)) => sail2_state_monad$returnS ((concat_vec imm ((concat_vec rd ((encdec_uop_forwards op : 7 words$word)) : 12 words$word)) : 32 words$word)) | RISCV_JAL ((v__2, rd)) => if (((((subrange_vec_dec v__2 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) then let (imm_19 : 1 bits) = ((subrange_vec_dec v__2 (( 20 : int):ii) (( 20 : int):ii) : 1 words$word)) in let (imm_8 : 1 bits) = ((subrange_vec_dec v__2 (( 11 : int):ii) (( 11 : int):ii) : 1 words$word)) in let (imm_7_0 : 8 bits) = ((subrange_vec_dec v__2 (( 19 : int):ii) (( 12 : int):ii) : 8 words$word)) in let (imm_19 : 1 bits) = ((subrange_vec_dec v__2 (( 20 : int):ii) (( 20 : int):ii) : 1 words$word)) in let (imm_18_13 : 6 bits) = ((subrange_vec_dec v__2 (( 10 : int):ii) (( 5 : int):ii) : 6 words$word)) in let (imm_12_9 : 4 bits) = ((subrange_vec_dec v__2 (( 4 : int):ii) (( 1 : int):ii) : 4 words$word)) in sail2_state_monad$returnS ((concat_vec imm_19 ((concat_vec imm_18_13 ((concat_vec imm_12_9 ((concat_vec imm_8 ((concat_vec imm_7_0 ((concat_vec rd (0b1101111w : 7 words$word) : 12 words$word)) : 20 words$word)) : 21 words$word)) : 25 words$word)) : 31 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | RISCV_JALR ((imm, rs1, rd)) => sail2_state_monad$returnS ((concat_vec imm ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1100111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) | BTYPE ((v__4, rs2, rs1, op)) => if (((((subrange_vec_dec v__4 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) then let (imm7_6 : 1 bits) = ((subrange_vec_dec v__4 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm7_6 : 1 bits) = ((subrange_vec_dec v__4 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm7_5_0 : 6 bits) = ((subrange_vec_dec v__4 (( 10 : int):ii) (( 5 : int):ii) : 6 words$word)) in let (imm5_4_1 : 4 bits) = ((subrange_vec_dec v__4 (( 4 : int):ii) (( 1 : int):ii) : 4 words$word)) in let (imm5_0 : 1 bits) = ((subrange_vec_dec v__4 (( 11 : int):ii) (( 11 : int):ii) : 1 words$word)) in sail2_state_monad$returnS ((concat_vec imm7_6 ((concat_vec imm7_5_0 ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_bop_forwards op : 3 words$word)) ((concat_vec imm5_4_1 ((concat_vec imm5_0 (0b1100011w : 7 words$word) : 8 words$word)) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 31 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | ITYPE ((imm, rs1, rd, op)) => sail2_state_monad$returnS ((concat_vec imm ((concat_vec rs1 ((concat_vec ((encdec_iop_forwards op : 3 words$word)) ((concat_vec rd (0b0010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) | SHIFTIOP ((shamt, rs1, rd, RISCV_SLLI)) => sail2_state_monad$returnS ((concat_vec (0b000000w : 6 words$word) ((concat_vec shamt ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b0010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 26 words$word)) : 32 words$word)) | SHIFTIOP ((shamt, rs1, rd, RISCV_SRLI)) => sail2_state_monad$returnS ((concat_vec (0b000000w : 6 words$word) ((concat_vec shamt ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 26 words$word)) : 32 words$word)) | SHIFTIOP ((shamt, rs1, rd, RISCV_SRAI)) => sail2_state_monad$returnS ((concat_vec (0b010000w : 6 words$word) ((concat_vec shamt ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 26 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_ADD)) => sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_SLT)) => sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b010w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_SLTU)) => sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b011w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_AND)) => sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b111w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_OR)) => sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b110w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_XOR)) => sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b100w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_SLL)) => sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_SRL)) => sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_SUB)) => sail2_state_monad$returnS ((concat_vec (0b0100000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | RTYPE ((rs2, rs1, rd, RISCV_SRA)) => sail2_state_monad$returnS ((concat_vec (0b0100000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | LOAD ((imm, rs1, rd, is_unsigned, size1, F, F)) => if (((((((word_width_bytes size1)) < (( 8 : int):ii))) \/ (((((~ is_unsigned)) /\ ((((word_width_bytes size1)) <= (( 8 : int):ii))))))))) then sail2_state_monad$returnS ((concat_vec imm ((concat_vec rs1 ((concat_vec ((bool_bits_forwards is_unsigned : 1 words$word)) ((concat_vec ((size_bits_forwards size1 : 2 words$word)) ((concat_vec rd (0b0000011w : 7 words$word) : 12 words$word)) : 14 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | STORE ((v__6, rs2, rs1, size1, F, F)) => if ((((word_width_bytes size1)) <= (( 8 : int):ii))) then let (imm7 : 7 bits) = ((subrange_vec_dec v__6 (( 11 : int):ii) (( 5 : int):ii) : 7 words$word)) in let (imm7 : 7 bits) = ((subrange_vec_dec v__6 (( 11 : int):ii) (( 5 : int):ii) : 7 words$word)) in let (imm5 : 5 bits) = ((subrange_vec_dec v__6 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec imm7 ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b0w : 1 words$word) ((concat_vec ((size_bits_forwards size1 : 2 words$word)) ((concat_vec imm5 (0b0100011w : 7 words$word) : 12 words$word)) : 14 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | ADDIW ((imm, rs1, rd)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec imm ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b0011011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | SHIFTW ((shamt, rs1, rd, RISCV_SLLI)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec shamt ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b0011011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | SHIFTW ((shamt, rs1, rd, RISCV_SRLI)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec shamt ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0011011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | SHIFTW ((shamt, rs1, rd, RISCV_SRAI)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0100000w : 7 words$word) ((concat_vec shamt ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0011011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | RTYPEW ((rs2, rs1, rd, RISCV_ADDW)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b0111011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | RTYPEW ((rs2, rs1, rd, RISCV_SUBW)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0100000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b0111011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | RTYPEW ((rs2, rs1, rd, RISCV_SLLW)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b0111011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | RTYPEW ((rs2, rs1, rd, RISCV_SRLW)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0111011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | RTYPEW ((rs2, rs1, rd, RISCV_SRAW)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0100000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0111011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | SHIFTIWOP ((shamt, rs1, rd, RISCV_SLLIW)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec shamt ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b0011011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | SHIFTIWOP ((shamt, rs1, rd, RISCV_SRLIW)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec shamt ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0011011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | SHIFTIWOP ((shamt, rs1, rd, RISCV_SRAIW)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0100000w : 7 words$word) ((concat_vec shamt ((concat_vec rs1 ((concat_vec (0b101w : 3 words$word) ((concat_vec rd (0b0011011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | FENCE ((pred, succ)) => sail2_state_monad$returnS ((concat_vec (0x0w : 4 words$word) ((concat_vec pred ((concat_vec succ ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b0001111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 24 words$word)) : 28 words$word)) : 32 words$word)) | FENCE_TSO ((pred, succ)) => sail2_state_monad$returnS ((concat_vec (0x8w : 4 words$word) ((concat_vec pred ((concat_vec succ ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b0001111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 24 words$word)) : 28 words$word)) : 32 words$word)) | FENCEI (() ) => sail2_state_monad$returnS ((concat_vec (0x000w : 12 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b001w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b0001111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) | ECALL (() ) => sail2_state_monad$returnS ((concat_vec (0x000w : 12 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b1110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) | MRET (() ) => sail2_state_monad$returnS ((concat_vec (0b0011000w : 7 words$word) ((concat_vec (0b00010w : 5 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b1110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | SRET (() ) => sail2_state_monad$returnS ((concat_vec (0b0001000w : 7 words$word) ((concat_vec (0b00010w : 5 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b1110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | EBREAK (() ) => sail2_state_monad$returnS ((concat_vec (0x001w : 12 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b1110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) | WFI (() ) => sail2_state_monad$returnS ((concat_vec (0x105w : 12 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b1110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) | SFENCE_VMA ((rs1, rs2)) => sail2_state_monad$returnS ((concat_vec (0b0001001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b1110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | LOADRES ((aq, rl, rs1, size1, rd)) => if ((amo_width_valid size1)) then sail2_state_monad$returnS ((concat_vec (0b00010w : 5 words$word) ((concat_vec ((bool_bits_forwards aq : 1 words$word)) ((concat_vec ((bool_bits_forwards rl : 1 words$word)) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec (0b0w : 1 words$word) ((concat_vec ((size_bits_forwards size1 : 2 words$word)) ((concat_vec rd (0b0101111w : 7 words$word) : 12 words$word)) : 14 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 26 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | STORECON ((aq, rl, rs2, rs1, size1, rd)) => if ((amo_width_valid size1)) then sail2_state_monad$returnS ((concat_vec (0b00011w : 5 words$word) ((concat_vec ((bool_bits_forwards aq : 1 words$word)) ((concat_vec ((bool_bits_forwards rl : 1 words$word)) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b0w : 1 words$word) ((concat_vec ((size_bits_forwards size1 : 2 words$word)) ((concat_vec rd (0b0101111w : 7 words$word) : 12 words$word)) : 14 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 26 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | AMO ((op, aq, rl, rs2, rs1, size1, rd)) => if ((amo_width_valid size1)) then sail2_state_monad$returnS ((concat_vec ((encdec_amoop_forwards op : 5 words$word)) ((concat_vec ((bool_bits_forwards aq : 1 words$word)) ((concat_vec ((bool_bits_forwards rl : 1 words$word)) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b0w : 1 words$word) ((concat_vec ((size_bits_forwards size1 : 2 words$word)) ((concat_vec rd (0b0101111w : 7 words$word) : 12 words$word)) : 14 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 26 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | MUL ((rs2, rs1, rd, high, signed1, signed2)) => sail2_state_monad$returnS ((concat_vec (0b0000001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_mul_op_forwards (high, signed1, signed2) : 3 words$word)) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | DIV0 ((rs2, rs1, rd, s)) => sail2_state_monad$returnS ((concat_vec (0b0000001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b10w : 2 words$word) ((concat_vec ((bool_not_bits_forwards s : 1 words$word)) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 13 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | REM ((rs2, rs1, rd, s)) => sail2_state_monad$returnS ((concat_vec (0b0000001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b11w : 2 words$word) ((concat_vec ((bool_not_bits_forwards s : 1 words$word)) ((concat_vec rd (0b0110011w : 7 words$word) : 12 words$word)) : 13 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | MULW ((rs2, rs1, rd)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b0111011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | DIVW ((rs2, rs1, rd, s)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b10w : 2 words$word) ((concat_vec ((bool_not_bits_forwards s : 1 words$word)) ((concat_vec rd (0b0111011w : 7 words$word) : 12 words$word)) : 13 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | REMW ((rs2, rs1, rd, s)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b0000001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b11w : 2 words$word) ((concat_vec ((bool_not_bits_forwards s : 1 words$word)) ((concat_vec rd (0b0111011w : 7 words$word) : 12 words$word)) : 13 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | CSR ((csr, rs1, rd, is_imm, op)) => sail2_state_monad$returnS ((concat_vec csr ((concat_vec rs1 ((concat_vec ((bool_bits_forwards is_imm : 1 words$word)) ((concat_vec ((encdec_csrop_forwards op : 2 words$word)) ((concat_vec rd (0b1110011w : 7 words$word) : 12 words$word)) : 14 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) | URET (() ) => sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec (0b00010w : 5 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b00000w : 5 words$word) (0b1110011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) | FENCE_RESERVED ((fm, pred, succ, rs, rd)) => if (((((((((fm <> (0x0w : 4 words$word)))) /\ (((fm <> (0x8w : 4 words$word))))))) \/ ((((((rs <> (0b00000w : 5 words$word)))) \/ (((rd <> (0b00000w : 5 words$word)))))))))) then sail2_state_monad$returnS ((concat_vec fm ((concat_vec pred ((concat_vec succ ((concat_vec rs ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b0001111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 24 words$word)) : 28 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | FENCEI_RESERVED ((imm, rs, rd)) => if ((((((imm <> (0x000w : 12 words$word)))) \/ ((((((rs <> zreg))) \/ (((rd <> zreg))))))))) then sail2_state_monad$returnS ((concat_vec imm ((concat_vec rs ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b0001111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | LOAD_FP ((imm, rs1, rd, WORD)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__48 : bool) . if w__48 then sail2_state_monad$returnS ((concat_vec imm ((concat_vec rs1 ((concat_vec (0b010w : 3 words$word) ((concat_vec rd (0b0000111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | LOAD_FP ((imm, rs1, rd, DOUBLE)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__51 : bool) . if w__51 then sail2_state_monad$returnS ((concat_vec imm ((concat_vec rs1 ((concat_vec (0b011w : 3 words$word) ((concat_vec rd (0b0000111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | STORE_FP ((v__7, rs2, rs1, WORD)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__54 : bool) . if w__54 then let (imm7 : 7 bits) = ((subrange_vec_dec v__7 (( 11 : int):ii) (( 5 : int):ii) : 7 words$word)) in let (imm7 : 7 bits) = ((subrange_vec_dec v__7 (( 11 : int):ii) (( 5 : int):ii) : 7 words$word)) in let (imm5 : 5 bits) = ((subrange_vec_dec v__7 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec imm7 ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b010w : 3 words$word) ((concat_vec imm5 (0b0100111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | STORE_FP ((v__8, rs2, rs1, DOUBLE)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__57 : bool) . if w__57 then let (imm7 : 7 bits) = ((subrange_vec_dec v__8 (( 11 : int):ii) (( 5 : int):ii) : 7 words$word)) in let (imm7 : 7 bits) = ((subrange_vec_dec v__8 (( 11 : int):ii) (( 5 : int):ii) : 7 words$word)) in let (imm5 : 5 bits) = ((subrange_vec_dec v__8 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec imm7 ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b011w : 3 words$word) ((concat_vec imm5 (0b0100111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, FMADD_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__60 : bool) . if w__60 then sail2_state_monad$returnS ((concat_vec rs3 ((concat_vec (0b00w : 2 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1000011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, FMSUB_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__63 : bool) . if w__63 then sail2_state_monad$returnS ((concat_vec rs3 ((concat_vec (0b00w : 2 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1000111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, FNMSUB_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__66 : bool) . if w__66 then sail2_state_monad$returnS ((concat_vec rs3 ((concat_vec (0b00w : 2 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1001011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, FNMADD_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__69 : bool) . if w__69 then sail2_state_monad$returnS ((concat_vec rs3 ((concat_vec (0b00w : 2 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1001111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, FADD_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__72 : bool) . if w__72 then sail2_state_monad$returnS ((concat_vec (0b0000000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, FSUB_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__75 : bool) . if w__75 then sail2_state_monad$returnS ((concat_vec (0b0000100w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, FMUL_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__78 : bool) . if w__78 then sail2_state_monad$returnS ((concat_vec (0b0001000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, FDIV_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__81 : bool) . if w__81 then sail2_state_monad$returnS ((concat_vec (0b0001100w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_S ((rs1, rm, rd, FSQRT_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__84 : bool) . if w__84 then sail2_state_monad$returnS ((concat_vec (0b0101100w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_W_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__87 : bool) . if w__87 then sail2_state_monad$returnS ((concat_vec (0b1100000w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_WU_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__90 : bool) . if w__90 then sail2_state_monad$returnS ((concat_vec (0b1100000w : 7 words$word) ((concat_vec (0b00001w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_W)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__93 : bool) . if w__93 then sail2_state_monad$returnS ((concat_vec (0b1101000w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_WU)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__96 : bool) . if w__96 then sail2_state_monad$returnS ((concat_vec (0b1101000w : 7 words$word) ((concat_vec (0b00001w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_L_S)) => sail2_state_monad$bindS (is_RV64F () ) (\ (w__99 : bool) . if w__99 then sail2_state_monad$returnS ((concat_vec (0b1100000w : 7 words$word) ((concat_vec (0b00010w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_LU_S)) => sail2_state_monad$bindS (is_RV64F () ) (\ (w__102 : bool) . if w__102 then sail2_state_monad$returnS ((concat_vec (0b1100000w : 7 words$word) ((concat_vec (0b00011w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_L)) => sail2_state_monad$bindS (is_RV64F () ) (\ (w__105 : bool) . if w__105 then sail2_state_monad$returnS ((concat_vec (0b1101000w : 7 words$word) ((concat_vec (0b00010w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_LU)) => sail2_state_monad$bindS (is_RV64F () ) (\ (w__108 : bool) . if w__108 then sail2_state_monad$returnS ((concat_vec (0b1101000w : 7 words$word) ((concat_vec (0b00011w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJ_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__111 : bool) . if w__111 then sail2_state_monad$returnS ((concat_vec (0b0010000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJN_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__114 : bool) . if w__114 then sail2_state_monad$returnS ((concat_vec (0b0010000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJX_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__117 : bool) . if w__117 then sail2_state_monad$returnS ((concat_vec (0b0010000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b010w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_S ((rs2, rs1, rd, FMIN_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__120 : bool) . if w__120 then sail2_state_monad$returnS ((concat_vec (0b0010100w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_S ((rs2, rs1, rd, FMAX_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__123 : bool) . if w__123 then sail2_state_monad$returnS ((concat_vec (0b0010100w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_S ((rs2, rs1, rd, FEQ_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__126 : bool) . if w__126 then sail2_state_monad$returnS ((concat_vec (0b1010000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b010w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_S ((rs2, rs1, rd, FLT_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__129 : bool) . if w__129 then sail2_state_monad$returnS ((concat_vec (0b1010000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_S ((rs2, rs1, rd, FLE_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__132 : bool) . if w__132 then sail2_state_monad$returnS ((concat_vec (0b1010000w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_TYPE_S ((rs1, rd, FCLASS_S)) => sail2_state_monad$bindS (haveFExt () ) (\ (w__135 : bool) . if w__135 then sail2_state_monad$returnS ((concat_vec (0b1110000w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_TYPE_S ((rs1, rd, FMV_X_W)) => sail2_state_monad$bindS (haveFExt () ) (\ (w__138 : bool) . if w__138 then sail2_state_monad$returnS ((concat_vec (0b1110000w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_TYPE_S ((rs1, rd, FMV_W_X)) => sail2_state_monad$bindS (haveFExt () ) (\ (w__141 : bool) . if w__141 then sail2_state_monad$returnS ((concat_vec (0b1111000w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, FMADD_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__144 : bool) . if w__144 then sail2_state_monad$returnS ((concat_vec rs3 ((concat_vec (0b01w : 2 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1000011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, FMSUB_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__147 : bool) . if w__147 then sail2_state_monad$returnS ((concat_vec rs3 ((concat_vec (0b01w : 2 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1000111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, FNMSUB_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__150 : bool) . if w__150 then sail2_state_monad$returnS ((concat_vec rs3 ((concat_vec (0b01w : 2 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1001011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, FNMADD_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__153 : bool) . if w__153 then sail2_state_monad$returnS ((concat_vec rs3 ((concat_vec (0b01w : 2 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1001111w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 27 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, FADD_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__156 : bool) . if w__156 then sail2_state_monad$returnS ((concat_vec (0b0000001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, FSUB_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__159 : bool) . if w__159 then sail2_state_monad$returnS ((concat_vec (0b0000101w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, FMUL_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__162 : bool) . if w__162 then sail2_state_monad$returnS ((concat_vec (0b0001001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, FDIV_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__165 : bool) . if w__165 then sail2_state_monad$returnS ((concat_vec (0b0001101w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FSQRT_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__168 : bool) . if w__168 then sail2_state_monad$returnS ((concat_vec (0b0101101w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_W_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__171 : bool) . if w__171 then sail2_state_monad$returnS ((concat_vec (0b1100001w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_WU_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__174 : bool) . if w__174 then sail2_state_monad$returnS ((concat_vec (0b1100001w : 7 words$word) ((concat_vec (0b00001w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_W)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__177 : bool) . if w__177 then sail2_state_monad$returnS ((concat_vec (0b1101001w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_WU)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__180 : bool) . if w__180 then sail2_state_monad$returnS ((concat_vec (0b1101001w : 7 words$word) ((concat_vec (0b00001w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_S_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__183 : bool) . if w__183 then sail2_state_monad$returnS ((concat_vec (0b0100000w : 7 words$word) ((concat_vec (0b00001w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_S)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__186 : bool) . if w__186 then sail2_state_monad$returnS ((concat_vec (0b0100001w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_L_D)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__189 : bool) . if w__189 then sail2_state_monad$returnS ((concat_vec (0b1100001w : 7 words$word) ((concat_vec (0b00010w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_LU_D)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__192 : bool) . if w__192 then sail2_state_monad$returnS ((concat_vec (0b1100001w : 7 words$word) ((concat_vec (0b00011w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_L)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__195 : bool) . if w__195 then sail2_state_monad$returnS ((concat_vec (0b1101001w : 7 words$word) ((concat_vec (0b00010w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_LU)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__198 : bool) . if w__198 then sail2_state_monad$returnS ((concat_vec (0b1101001w : 7 words$word) ((concat_vec (0b00011w : 5 words$word) ((concat_vec rs1 ((concat_vec ((encdec_rounding_mode_forwards rm : 3 words$word)) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJ_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__201 : bool) . if w__201 then sail2_state_monad$returnS ((concat_vec (0b0010001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJN_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__204 : bool) . if w__204 then sail2_state_monad$returnS ((concat_vec (0b0010001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJX_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__207 : bool) . if w__207 then sail2_state_monad$returnS ((concat_vec (0b0010001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b010w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_D ((rs2, rs1, rd, FMIN_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__210 : bool) . if w__210 then sail2_state_monad$returnS ((concat_vec (0b0010101w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_D ((rs2, rs1, rd, FMAX_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__213 : bool) . if w__213 then sail2_state_monad$returnS ((concat_vec (0b0010101w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_D ((rs2, rs1, rd, FEQ_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__216 : bool) . if w__216 then sail2_state_monad$returnS ((concat_vec (0b1010001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b010w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_D ((rs2, rs1, rd, FLT_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__219 : bool) . if w__219 then sail2_state_monad$returnS ((concat_vec (0b1010001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_BIN_TYPE_D ((rs2, rs1, rd, FLE_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__222 : bool) . if w__222 then sail2_state_monad$returnS ((concat_vec (0b1010001w : 7 words$word) ((concat_vec rs2 ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_TYPE_D ((rs1, rd, FCLASS_D)) => sail2_state_monad$bindS (haveDExt () ) (\ (w__225 : bool) . if w__225 then sail2_state_monad$returnS ((concat_vec (0b1110001w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec (0b001w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_TYPE_D ((rs1, rd, FMV_X_D)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__228 : bool) . if w__228 then sail2_state_monad$returnS ((concat_vec (0b1110001w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | F_UN_TYPE_D ((rs1, rd, FMV_D_X)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__231 : bool) . if w__231 then sail2_state_monad$returnS ((concat_vec (0b1111001w : 7 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs1 ((concat_vec (0b000w : 3 words$word) ((concat_vec rd (0b1010011w : 7 words$word) : 12 words$word)) : 15 words$word)) : 20 words$word)) : 25 words$word)) : 32 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | ILLEGAL (s) => sail2_state_monad$returnS s | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) )))`; val _ = Define ` ((encdec_backwards:(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((ast),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let v__9 = arg_ in if (let (mappingpatterns_59_0 : 7 words$word) = ((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) in encdec_uop_backwards_matches mappingpatterns_59_0) then let (imm : 20 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 12 : int):ii) : 20 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 20 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 12 : int):ii) : 20 words$word)) in let (mappingpatterns_59_0 : 7 words$word) = ((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) in sail2_state_monad$bindS (encdec_uop_backwards mappingpatterns_59_0) (\ op . sail2_state_monad$returnS (UTYPE (imm, rd, op))) else if (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1101111w : 7 words$word)))) then let (imm_19 : 1 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 31 : int):ii) : 1 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm_8 : 1 bits) = ((subrange_vec_dec v__9 (( 20 : int):ii) (( 20 : int):ii) : 1 words$word)) in let (imm_7_0 : 8 bits) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 12 : int):ii) : 8 words$word)) in let (imm_19 : 1 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 31 : int):ii) : 1 words$word)) in let (imm_18_13 : 6 bits) = ((subrange_vec_dec v__9 (( 30 : int):ii) (( 25 : int):ii) : 6 words$word)) in let (imm_12_9 : 4 bits) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 21 : int):ii) : 4 words$word)) in sail2_state_monad$returnS (RISCV_JAL ((concat_vec imm_19 ((concat_vec imm_7_0 ((concat_vec imm_8 ((concat_vec imm_18_13 ((concat_vec imm_12_9 (0b0w : 1 words$word) : 5 words$word)) : 11 words$word)) : 12 words$word)) : 20 words$word)) : 21 words$word), rd)) else if ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1100111w : 7 words$word))))))) then let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in sail2_state_monad$returnS (RISCV_JALR (imm, rs1, rd)) else if ((((let (mappingpatterns_60_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in encdec_bop_backwards_matches mappingpatterns_60_0) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1100011w : 7 words$word))))))) then let (imm7_6 : 1 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 31 : int):ii) : 1 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (imm7_6 : 1 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 31 : int):ii) : 1 words$word)) in let (imm7_5_0 : 6 bits) = ((subrange_vec_dec v__9 (( 30 : int):ii) (( 25 : int):ii) : 6 words$word)) in let (imm5_4_1 : 4 bits) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 8 : int):ii) : 4 words$word)) in let (imm5_0 : 1 bits) = ((subrange_vec_dec v__9 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)) in let (mappingpatterns_60_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_bop_backwards mappingpatterns_60_0) (\ op . sail2_state_monad$returnS (BTYPE ((concat_vec imm7_6 ((concat_vec imm5_0 ((concat_vec imm7_5_0 ((concat_vec imm5_4_1 (0b0w : 1 words$word) : 5 words$word)) : 11 words$word)) : 12 words$word)) : 13 words$word), rs2, rs1, op))) else if ((((let (mappingpatterns_61_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in encdec_iop_backwards_matches mappingpatterns_61_0) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0010011w : 7 words$word))))))) then let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (mappingpatterns_61_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_iop_backwards mappingpatterns_61_0) (\ op . sail2_state_monad$returnS (ITYPE (imm, rs1, rd, op))) else if ((((let (shamt : 6 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 20 : int):ii) : 6 words$word)) in (((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((((access_vec_dec shamt (( 5 : int):ii))) = B0))))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 26 : int):ii) : 6 words$word)) = (0b000000w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0010011w : 7 words$word))))))))))))) then let (shamt : 6 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 20 : int):ii) : 6 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SHIFTIOP (shamt, rs1, rd, RISCV_SLLI)) else if ((((let (shamt : 6 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 20 : int):ii) : 6 words$word)) in (((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((((access_vec_dec shamt (( 5 : int):ii))) = B0))))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 26 : int):ii) : 6 words$word)) = (0b000000w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0010011w : 7 words$word))))))))))))) then let (shamt : 6 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 20 : int):ii) : 6 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SHIFTIOP (shamt, rs1, rd, RISCV_SRLI)) else if ((((let (shamt : 6 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 20 : int):ii) : 6 words$word)) in (((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((((access_vec_dec shamt (( 5 : int):ii))) = B0))))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 26 : int):ii) : 6 words$word)) = (0b010000w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0010011w : 7 words$word))))))))))))) then let (shamt : 6 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 20 : int):ii) : 6 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SHIFTIOP (shamt, rs1, rd, RISCV_SRAI)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_ADD)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_SLT)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_SLTU)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_AND)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b110w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_OR)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b100w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_XOR)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_SLL)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_SRL)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_SUB)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, RISCV_SRA)) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_63_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_62_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) in if ((size_bits_backwards_matches mappingpatterns_63_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_63_0) (\ size1 . if ((bool_bits_backwards_matches mappingpatterns_62_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_62_0) (\ is_unsigned . sail2_state_monad$returnS (((((((word_width_bytes size1)) < (( 8 : int):ii))) \/ (((((~ is_unsigned)) /\ ((((word_width_bytes size1)) <= (( 8 : int):ii)))))))))) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) (sail2_state_monad$returnS (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000011w : 7 words$word)))))) (\ (w__2 : bool) . if w__2 then let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (mappingpatterns_63_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_62_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_63_0) (\ size1 . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_62_0) (\ is_unsigned . sail2_state_monad$returnS (LOAD (imm, rs1, rd, is_unsigned, size1, F, F)))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_64_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in if ((size_bits_backwards_matches mappingpatterns_64_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_64_0) (\ size1 . sail2_state_monad$returnS ((((word_width_bytes size1)) <= (( 8 : int):ii)))) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0100011w : 7 words$word))))))))) (\ (w__4 : bool) . if w__4 then let (imm7 : 7 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (imm7 : 7 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) in let (imm5 : 5 bits) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_64_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_64_0) (\ size1 . sail2_state_monad$returnS (STORE ((concat_vec imm7 imm5 : 12 words$word), rs2, rs1, size1, F, F))) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word)))))))))) then let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in sail2_state_monad$returnS (ADDIW (imm, rs1, rd)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then let (shamt : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SHIFTW (shamt, rs1, rd, RISCV_SLLI)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then let (shamt : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SHIFTW (shamt, rs1, rd, RISCV_SRLI)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then let (shamt : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SHIFTW (shamt, rs1, rd, RISCV_SRAI)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPEW (rs2, rs1, rd, RISCV_ADDW)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPEW (rs2, rs1, rd, RISCV_SUBW)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPEW (rs2, rs1, rd, RISCV_SLLW)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPEW (rs2, rs1, rd, RISCV_SRLW)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (RTYPEW (rs2, rs1, rd, RISCV_SRAW)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then let (shamt : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SHIFTIWOP (shamt, rs1, rd, RISCV_SLLIW)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then let (shamt : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SHIFTIWOP (shamt, rs1, rd, RISCV_SRLIW)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then let (shamt : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SHIFTIWOP (shamt, rs1, rd, RISCV_SRAIW)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) = (0x0w : 4 words$word)))) /\ (((((subrange_vec_dec v__9 (( 19 : int):ii) (( 0 : int):ii) : 20 words$word)) = (0x0000Fw : 20 words$word))))))) then let (succ : 4 words$word) = ((subrange_vec_dec v__9 (( 23 : int):ii) (( 20 : int):ii) : 4 words$word)) in let (pred : 4 words$word) = ((subrange_vec_dec v__9 (( 27 : int):ii) (( 24 : int):ii) : 4 words$word)) in sail2_state_monad$returnS (FENCE (pred, succ)) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) = (0x8w : 4 words$word)))) /\ (((((subrange_vec_dec v__9 (( 19 : int):ii) (( 0 : int):ii) : 20 words$word)) = (0x0000Fw : 20 words$word))))))) then let (succ : 4 words$word) = ((subrange_vec_dec v__9 (( 23 : int):ii) (( 20 : int):ii) : 4 words$word)) in let (pred : 4 words$word) = ((subrange_vec_dec v__9 (( 27 : int):ii) (( 24 : int):ii) : 4 words$word)) in sail2_state_monad$returnS (FENCE_TSO (pred, succ)) else if (((v__9 = (0x0000100Fw : 32 words$word)))) then sail2_state_monad$returnS (FENCEI () ) else if (((v__9 = (0x00000073w : 32 words$word)))) then sail2_state_monad$returnS (ECALL () ) else if (((v__9 = (0x30200073w : 32 words$word)))) then sail2_state_monad$returnS (MRET () ) else if (((v__9 = (0x10200073w : 32 words$word)))) then sail2_state_monad$returnS (SRET () ) else if (((v__9 = (0x00100073w : 32 words$word)))) then sail2_state_monad$returnS (EBREAK () ) else if (((v__9 = (0x10500073w : 32 words$word)))) then sail2_state_monad$returnS (WFI () ) else if ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001001w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 14 : int):ii) (( 0 : int):ii) : 15 words$word)) = (0b000000001110011w : 15 words$word))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (SFENCE_VMA (rs1, rs2)) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_67_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_66_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_65_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in if ((size_bits_backwards_matches mappingpatterns_67_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_67_0) (\ size1 . if ((bool_bits_backwards_matches mappingpatterns_66_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_66_0) (\ rl . if ((bool_bits_backwards_matches mappingpatterns_65_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_65_0) (\ aq . sail2_state_monad$returnS ((amo_width_valid size1))) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) = (0b00010w : 5 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) = (0b00000w : 5 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0101111w : 7 words$word))))))))))))))) (\ (w__8 : bool) . if w__8 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_67_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_66_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_65_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_67_0) (\ size1 . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_66_0) (\ rl . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_65_0) (\ aq . sail2_state_monad$returnS (LOADRES (aq, rl, rs1, size1, rd))))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_70_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_69_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_68_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in if ((size_bits_backwards_matches mappingpatterns_70_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_70_0) (\ size1 . if ((bool_bits_backwards_matches mappingpatterns_69_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_69_0) (\ rl . if ((bool_bits_backwards_matches mappingpatterns_68_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_68_0) (\ aq . sail2_state_monad$returnS ((amo_width_valid size1))) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) = (0b00011w : 5 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0101111w : 7 words$word)))))))))))) (\ (w__12 : bool) . if w__12 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_70_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_69_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_68_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_70_0) (\ size1 . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_69_0) (\ rl . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_68_0) (\ aq . sail2_state_monad$returnS (STORECON (aq, rl, rs2, rs1, size1, rd))))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_71_0 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (mappingpatterns_74_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_73_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_72_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in let (mappingpatterns_71_0 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in if ((size_bits_backwards_matches mappingpatterns_74_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_74_0) (\ size1 . if ((bool_bits_backwards_matches mappingpatterns_73_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_73_0) (\ rl . if ((bool_bits_backwards_matches mappingpatterns_72_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_72_0) (\ aq . if ((encdec_amoop_backwards_matches mappingpatterns_71_0)) then sail2_state_monad$bindS (encdec_amoop_backwards mappingpatterns_71_0) (\ op . sail2_state_monad$returnS ((amo_width_valid size1))) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0101111w : 7 words$word))))))))) (\ (w__17 : bool) . if w__17 then let (mappingpatterns_71_0 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_74_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_73_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_72_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in let (mappingpatterns_71_0 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_74_0) (\ size1 . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_73_0) (\ rl . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_72_0) (\ aq . sail2_state_monad$bindS (encdec_amoop_backwards mappingpatterns_71_0) (\ op . sail2_state_monad$returnS (AMO (op, aq, rl, rs2, rs1, size1, rd)))))) else if ((((let (mappingpatterns_75_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in encdec_mul_op_backwards_matches mappingpatterns_75_0) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_75_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_mul_op_backwards mappingpatterns_75_0) (\ varstup . let (high, signed1, signed2) = varstup in sail2_state_monad$returnS (MUL (rs2, rs1, rd, high, signed1, signed2))) else if ((((let (mappingpatterns_76_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in bool_not_bits_backwards_matches mappingpatterns_76_0) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word))))))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_76_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_76_0) (\ s . sail2_state_monad$returnS (DIV0 (rs2, rs1, rd, s))) else if ((((let (mappingpatterns_77_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in bool_not_bits_backwards_matches mappingpatterns_77_0) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word))))))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_77_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_77_0) (\ s . sail2_state_monad$returnS (REM (rs2, rs1, rd, s))) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (MULW (rs2, rs1, rd)) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_78_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in if ((bool_not_bits_backwards_matches mappingpatterns_78_0)) then sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_78_0) (\ s . sail2_state_monad$returnS ((((( 64 : int):ii) = (( 64 : int):ii))))) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word)))))))))))) (\ (w__19 : bool) . if w__19 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_78_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_78_0) (\ s . sail2_state_monad$returnS (DIVW (rs2, rs1, rd, s))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_79_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in if ((bool_not_bits_backwards_matches mappingpatterns_79_0)) then sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_79_0) (\ s . sail2_state_monad$returnS ((((( 64 : int):ii) = (( 64 : int):ii))))) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word)))))))))))) (\ (w__21 : bool) . if w__21 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_79_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_79_0) (\ s . sail2_state_monad$returnS (REMW (rs2, rs1, rd, s))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_81_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_80_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) in if ((encdec_csrop_backwards_matches mappingpatterns_81_0)) then sail2_state_monad$bindS (encdec_csrop_backwards mappingpatterns_81_0) (\ op . sail2_state_monad$returnS ((bool_bits_backwards_matches mappingpatterns_80_0))) else sail2_state_monad$returnS F) (sail2_state_monad$returnS (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1110011w : 7 words$word)))))) (\ (w__23 : bool) . if w__23 then let (csr : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (csr : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (mappingpatterns_81_0 : 2 words$word) = ((subrange_vec_dec v__9 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_80_0 : 1 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (encdec_csrop_backwards mappingpatterns_81_0) (\ op . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_80_0) (\ is_imm . sail2_state_monad$returnS (CSR (csr, rs1, rd, is_imm, op)))) else if (((v__9 = (0x00200073w : 32 words$word)))) then sail2_state_monad$returnS (URET () ) else if ((((let (fm : 4 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) in let (rs : regidx) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (fm : 4 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) in (((((((fm <> (0x0w : 4 words$word)))) /\ (((fm <> (0x8w : 4 words$word))))))) \/ ((((((rs <> (0b00000w : 5 words$word)))) \/ (((rd <> (0b00000w : 5 words$word))))))))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0001111w : 7 words$word)))))))))) then let (fm : 4 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) in let (succ : 4 bits) = ((subrange_vec_dec v__9 (( 23 : int):ii) (( 20 : int):ii) : 4 words$word)) in let (rs : regidx) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (pred : 4 bits) = ((subrange_vec_dec v__9 (( 27 : int):ii) (( 24 : int):ii) : 4 words$word)) in let (fm : 4 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) in sail2_state_monad$returnS (FENCE_RESERVED (fm, pred, succ, rs, rd)) else if ((((let (imm : 12 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs : regidx) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 12 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in ((((imm <> (0x000w : 12 words$word)))) \/ ((((((rs <> zreg))) \/ (((rd <> zreg)))))))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0001111w : 7 words$word)))))))))) then let (imm : 12 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs : regidx) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 12 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in sail2_state_monad$returnS (FENCEI_RESERVED (imm, rs, rd)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000111w : 7 words$word))))))))) (\ (w__25 : bool) . if w__25 then let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in sail2_state_monad$returnS (LOAD_FP (imm, rs1, rd, WORD)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000111w : 7 words$word))))))))) (\ (w__27 : bool) . if w__27 then let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 12 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in sail2_state_monad$returnS (LOAD_FP (imm, rs1, rd, DOUBLE)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0100111w : 7 words$word))))))))) (\ (w__29 : bool) . if w__29 then let (imm7 : 7 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (imm7 : 7 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) in let (imm5 : 5 bits) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (STORE_FP ((concat_vec imm7 imm5 : 12 words$word), rs2, rs1, WORD)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0100111w : 7 words$word))))))))) (\ (w__31 : bool) . if w__31 then let (imm7 : 7 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (imm7 : 7 bits) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) in let (imm5 : 5 bits) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (STORE_FP ((concat_vec imm7 imm5 : 12 words$word), rs2, rs1, DOUBLE)) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_82_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_82_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_82_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1000011w : 7 words$word))))))))) (\ (w__34 : bool) . if w__34 then let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_82_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_82_0) (\ rm . sail2_state_monad$returnS (F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FMADD_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_83_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_83_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_83_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1000111w : 7 words$word))))))))) (\ (w__37 : bool) . if w__37 then let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_83_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_83_0) (\ rm . sail2_state_monad$returnS (F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FMSUB_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_84_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_84_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_84_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1001011w : 7 words$word))))))))) (\ (w__40 : bool) . if w__40 then let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_84_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_84_0) (\ rm . sail2_state_monad$returnS (F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FNMSUB_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_85_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_85_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_85_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1001111w : 7 words$word))))))))) (\ (w__43 : bool) . if w__43 then let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_85_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_85_0) (\ rm . sail2_state_monad$returnS (F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, FNMADD_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_86_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_86_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_86_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__46 : bool) . if w__46 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_86_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_86_0) (\ rm . sail2_state_monad$returnS (F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FADD_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_87_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_87_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_87_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000100w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__49 : bool) . if w__49 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_87_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_87_0) (\ rm . sail2_state_monad$returnS (F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FSUB_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_88_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_88_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_88_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001000w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__52 : bool) . if w__52 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_88_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_88_0) (\ rm . sail2_state_monad$returnS (F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FMUL_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_89_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_89_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_89_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001100w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__55 : bool) . if w__55 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_89_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_89_0) (\ rm . sail2_state_monad$returnS (F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, FDIV_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_90_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_90_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_90_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0x580w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__58 : bool) . if w__58 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_90_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_90_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FSQRT_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_91_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_91_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_91_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC00w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__61 : bool) . if w__61 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_91_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_91_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_W_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_92_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_92_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_92_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC01w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__64 : bool) . if w__64 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_92_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_92_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_WU_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_93_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_93_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_93_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD00w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__67 : bool) . if w__67 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_93_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_93_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_W))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_94_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_94_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_94_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD01w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__70 : bool) . if w__70 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_94_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_94_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_WU))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_95_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_95_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_95_0) (\ rm . is_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC02w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__73 : bool) . if w__73 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_95_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_95_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_L_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_96_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_96_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_96_0) (\ rm . is_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC03w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__76 : bool) . if w__76 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_96_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_96_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_LU_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_97_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_97_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_97_0) (\ rm . is_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD02w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__79 : bool) . if w__79 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_97_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_97_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_L))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_98_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_98_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_98_0) (\ rm . is_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD03w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__82 : bool) . if w__82 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_98_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_98_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_LU))) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__84 : bool) . if w__84 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FSGNJ_S)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__86 : bool) . if w__86 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FSGNJN_S)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__88 : bool) . if w__88 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FSGNJX_S)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010100w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__90 : bool) . if w__90 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FMIN_S)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010100w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__92 : bool) . if w__92 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FMAX_S)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__94 : bool) . if w__94 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FEQ_S)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__96 : bool) . if w__96 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FLT_S)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__98 : bool) . if w__98 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FLE_S)) else sail2_state_monad$bindS (sail2_state$and_boolS ((haveFExt () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xE00w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__100 : bool) . if w__100 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_UN_TYPE_S (rs1, rd, FCLASS_S)) else sail2_state_monad$bindS (sail2_state$and_boolS ((haveFExt () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xE00w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__102 : bool) . if w__102 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_UN_TYPE_S (rs1, rd, FMV_X_W)) else sail2_state_monad$bindS (sail2_state$and_boolS ((haveFExt () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xF00w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__104 : bool) . if w__104 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_UN_TYPE_S (rs1, rd, FMV_W_X)) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_99_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_99_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_99_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1000011w : 7 words$word))))))))) (\ (w__107 : bool) . if w__107 then let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_99_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_99_0) (\ rm . sail2_state_monad$returnS (F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FMADD_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_100_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_100_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_100_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1000111w : 7 words$word))))))))) (\ (w__110 : bool) . if w__110 then let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_100_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_100_0) (\ rm . sail2_state_monad$returnS (F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FMSUB_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_101_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_101_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_101_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1001011w : 7 words$word))))))))) (\ (w__113 : bool) . if w__113 then let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_101_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_101_0) (\ rm . sail2_state_monad$returnS (F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FNMSUB_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_102_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_102_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_102_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1001111w : 7 words$word))))))))) (\ (w__116 : bool) . if w__116 then let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs3 : 5 words$word) = ((subrange_vec_dec v__9 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_102_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_102_0) (\ rm . sail2_state_monad$returnS (F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, FNMADD_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_103_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_103_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_103_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__119 : bool) . if w__119 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_103_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_103_0) (\ rm . sail2_state_monad$returnS (F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FADD_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_104_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_104_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_104_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000101w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__122 : bool) . if w__122 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_104_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_104_0) (\ rm . sail2_state_monad$returnS (F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FSUB_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_105_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_105_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_105_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001001w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__125 : bool) . if w__125 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_105_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_105_0) (\ rm . sail2_state_monad$returnS (F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FMUL_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_106_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_106_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_106_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001101w : 7 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__128 : bool) . if w__128 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_106_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_106_0) (\ rm . sail2_state_monad$returnS (F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, FDIV_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_107_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_107_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_107_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0x5A0w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__131 : bool) . if w__131 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_107_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_107_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FSQRT_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_108_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_108_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_108_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC20w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__134 : bool) . if w__134 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_108_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_108_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_W_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_109_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_109_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_109_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC21w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__137 : bool) . if w__137 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_109_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_109_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_WU_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_110_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_110_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_110_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD20w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__140 : bool) . if w__140 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_110_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_110_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_W))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_111_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_111_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_111_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD21w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__143 : bool) . if w__143 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_111_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_111_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_WU))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_112_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_112_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_112_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0x401w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__146 : bool) . if w__146 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_112_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_112_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_S_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_113_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_113_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_113_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0x420w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__149 : bool) . if w__149 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_113_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_113_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_S))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_114_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_114_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_114_0) (\ rm . is_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC22w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__152 : bool) . if w__152 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_114_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_114_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_L_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_115_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_115_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_115_0) (\ rm . is_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC23w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__155 : bool) . if w__155 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_115_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_115_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_LU_D))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_116_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_116_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_116_0) (\ rm . is_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD22w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__158 : bool) . if w__158 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_116_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_116_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_L))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_117_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_117_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_117_0) (\ rm . is_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD23w : 12 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__161 : bool) . if w__161 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (mappingpatterns_117_0 : 3 words$word) = ((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_117_0) (\ rm . sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_LU))) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__163 : bool) . if w__163 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FSGNJ_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__165 : bool) . if w__165 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FSGNJN_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__167 : bool) . if w__167 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FSGNJX_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010101w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__169 : bool) . if w__169 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FMIN_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010101w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__171 : bool) . if w__171 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FMAX_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__173 : bool) . if w__173 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FEQ_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__175 : bool) . if w__175 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FLT_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__177 : bool) . if w__177 then let (rs2 : 5 words$word) = ((subrange_vec_dec v__9 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) in let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FLE_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((haveDExt () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xE20w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__179 : bool) . if w__179 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_UN_TYPE_D (rs1, rd, FCLASS_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xE20w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__181 : bool) . if w__181 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (F_UN_TYPE_D (rs1, rd, FMV_X_D)) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__9 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xF20w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__9 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__9 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__183 : bool) . sail2_state_monad$returnS (if w__183 then let (rs1 : 5 words$word) = ((subrange_vec_dec v__9 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : 5 words$word) = ((subrange_vec_dec v__9 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in F_UN_TYPE_D (rs1, rd, FMV_D_X) else ILLEGAL v__9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))`; val _ = Define ` ((encdec_forwards_matches:ast ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= ((case arg_ of UTYPE ((imm, rd, op)) => sail2_state_monad$returnS T | RISCV_JAL ((v__462, rd)) => sail2_state_monad$returnS (if (((((subrange_vec_dec v__462 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) then T else F) | RISCV_JALR ((imm, rs1, rd)) => sail2_state_monad$returnS T | BTYPE ((v__464, rs2, rs1, op)) => sail2_state_monad$returnS (if (((((subrange_vec_dec v__464 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) then T else F) | ITYPE ((imm, rs1, rd, op)) => sail2_state_monad$returnS T | SHIFTIOP ((shamt, rs1, rd, RISCV_SLLI)) => sail2_state_monad$returnS T | SHIFTIOP ((shamt, rs1, rd, RISCV_SRLI)) => sail2_state_monad$returnS T | SHIFTIOP ((shamt, rs1, rd, RISCV_SRAI)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_ADD)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_SLT)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_SLTU)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_AND)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_OR)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_XOR)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_SLL)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_SRL)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_SUB)) => sail2_state_monad$returnS T | RTYPE ((rs2, rs1, rd, RISCV_SRA)) => sail2_state_monad$returnS T | LOAD ((imm, rs1, rd, is_unsigned, size1, F, F)) => sail2_state_monad$returnS (if (((((((word_width_bytes size1)) < (( 8 : int):ii))) \/ (((((~ is_unsigned)) /\ ((((word_width_bytes size1)) <= (( 8 : int):ii))))))))) then T else F) | STORE ((v__466, rs2, rs1, size1, F, F)) => sail2_state_monad$returnS (if ((((word_width_bytes size1)) <= (( 8 : int):ii))) then T else F) | ADDIW ((imm, rs1, rd)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | SHIFTW ((shamt, rs1, rd, RISCV_SLLI)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | SHIFTW ((shamt, rs1, rd, RISCV_SRLI)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | SHIFTW ((shamt, rs1, rd, RISCV_SRAI)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | RTYPEW ((rs2, rs1, rd, RISCV_ADDW)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | RTYPEW ((rs2, rs1, rd, RISCV_SUBW)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | RTYPEW ((rs2, rs1, rd, RISCV_SLLW)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | RTYPEW ((rs2, rs1, rd, RISCV_SRLW)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | RTYPEW ((rs2, rs1, rd, RISCV_SRAW)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | SHIFTIWOP ((shamt, rs1, rd, RISCV_SLLIW)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | SHIFTIWOP ((shamt, rs1, rd, RISCV_SRLIW)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | SHIFTIWOP ((shamt, rs1, rd, RISCV_SRAIW)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | FENCE ((pred, succ)) => sail2_state_monad$returnS T | FENCE_TSO ((pred, succ)) => sail2_state_monad$returnS T | FENCEI (() ) => sail2_state_monad$returnS T | ECALL (() ) => sail2_state_monad$returnS T | MRET (() ) => sail2_state_monad$returnS T | SRET (() ) => sail2_state_monad$returnS T | EBREAK (() ) => sail2_state_monad$returnS T | WFI (() ) => sail2_state_monad$returnS T | SFENCE_VMA ((rs1, rs2)) => sail2_state_monad$returnS T | LOADRES ((aq, rl, rs1, size1, rd)) => sail2_state_monad$returnS (if ((amo_width_valid size1)) then T else F) | STORECON ((aq, rl, rs2, rs1, size1, rd)) => sail2_state_monad$returnS (if ((amo_width_valid size1)) then T else F) | AMO ((op, aq, rl, rs2, rs1, size1, rd)) => sail2_state_monad$returnS (if ((amo_width_valid size1)) then T else F) | MUL ((rs2, rs1, rd, high, signed1, signed2)) => sail2_state_monad$returnS T | DIV0 ((rs2, rs1, rd, s)) => sail2_state_monad$returnS T | REM ((rs2, rs1, rd, s)) => sail2_state_monad$returnS T | MULW ((rs2, rs1, rd)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | DIVW ((rs2, rs1, rd, s)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | REMW ((rs2, rs1, rd, s)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | CSR ((csr, rs1, rd, is_imm, op)) => sail2_state_monad$returnS T | URET (() ) => sail2_state_monad$returnS T | FENCE_RESERVED ((fm, pred, succ, rs, rd)) => sail2_state_monad$returnS (if (((((((((fm <> (0x0w : 4 words$word)))) /\ (((fm <> (0x8w : 4 words$word))))))) \/ ((((((rs <> (0b00000w : 5 words$word)))) \/ (((rd <> (0b00000w : 5 words$word)))))))))) then T else F) | FENCEI_RESERVED ((imm, rs, rd)) => sail2_state_monad$returnS (if ((((((imm <> (0x000w : 12 words$word)))) \/ ((((((rs <> zreg))) \/ (((rd <> zreg))))))))) then T else F) | LOAD_FP ((imm, rs1, rd, WORD)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__0 : bool) . sail2_state_monad$returnS (if w__0 then T else F)) | LOAD_FP ((imm, rs1, rd, DOUBLE)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__1 : bool) . sail2_state_monad$returnS (if w__1 then T else F)) | STORE_FP ((v__467, rs2, rs1, WORD)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__2 : bool) . sail2_state_monad$returnS (if w__2 then T else F)) | STORE_FP ((v__468, rs2, rs1, DOUBLE)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__3 : bool) . sail2_state_monad$returnS (if w__3 then T else F)) | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, FMADD_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__4 : bool) . sail2_state_monad$returnS (if w__4 then T else F)) | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, FMSUB_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__5 : bool) . sail2_state_monad$returnS (if w__5 then T else F)) | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, FNMSUB_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__6 : bool) . sail2_state_monad$returnS (if w__6 then T else F)) | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, FNMADD_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__7 : bool) . sail2_state_monad$returnS (if w__7 then T else F)) | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, FADD_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__8 : bool) . sail2_state_monad$returnS (if w__8 then T else F)) | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, FSUB_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__9 : bool) . sail2_state_monad$returnS (if w__9 then T else F)) | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, FMUL_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__10 : bool) . sail2_state_monad$returnS (if w__10 then T else F)) | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, FDIV_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__11 : bool) . sail2_state_monad$returnS (if w__11 then T else F)) | F_UN_RM_TYPE_S ((rs1, rm, rd, FSQRT_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__12 : bool) . sail2_state_monad$returnS (if w__12 then T else F)) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_W_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__13 : bool) . sail2_state_monad$returnS (if w__13 then T else F)) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_WU_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__14 : bool) . sail2_state_monad$returnS (if w__14 then T else F)) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_W)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__15 : bool) . sail2_state_monad$returnS (if w__15 then T else F)) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_WU)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__16 : bool) . sail2_state_monad$returnS (if w__16 then T else F)) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_L_S)) => sail2_state_monad$bindS (is_RV64F () ) (\ (w__17 : bool) . sail2_state_monad$returnS (if w__17 then T else F)) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_LU_S)) => sail2_state_monad$bindS (is_RV64F () ) (\ (w__18 : bool) . sail2_state_monad$returnS (if w__18 then T else F)) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_L)) => sail2_state_monad$bindS (is_RV64F () ) (\ (w__19 : bool) . sail2_state_monad$returnS (if w__19 then T else F)) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_LU)) => sail2_state_monad$bindS (is_RV64F () ) (\ (w__20 : bool) . sail2_state_monad$returnS (if w__20 then T else F)) | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJ_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__21 : bool) . sail2_state_monad$returnS (if w__21 then T else F)) | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJN_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__22 : bool) . sail2_state_monad$returnS (if w__22 then T else F)) | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJX_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__23 : bool) . sail2_state_monad$returnS (if w__23 then T else F)) | F_BIN_TYPE_S ((rs2, rs1, rd, FMIN_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__24 : bool) . sail2_state_monad$returnS (if w__24 then T else F)) | F_BIN_TYPE_S ((rs2, rs1, rd, FMAX_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__25 : bool) . sail2_state_monad$returnS (if w__25 then T else F)) | F_BIN_TYPE_S ((rs2, rs1, rd, FEQ_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__26 : bool) . sail2_state_monad$returnS (if w__26 then T else F)) | F_BIN_TYPE_S ((rs2, rs1, rd, FLT_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__27 : bool) . sail2_state_monad$returnS (if w__27 then T else F)) | F_BIN_TYPE_S ((rs2, rs1, rd, FLE_S)) => sail2_state_monad$bindS (is_RV32F_or_RV64F () ) (\ (w__28 : bool) . sail2_state_monad$returnS (if w__28 then T else F)) | F_UN_TYPE_S ((rs1, rd, FCLASS_S)) => sail2_state_monad$bindS (haveFExt () ) (\ (w__29 : bool) . sail2_state_monad$returnS (if w__29 then T else F)) | F_UN_TYPE_S ((rs1, rd, FMV_X_W)) => sail2_state_monad$bindS (haveFExt () ) (\ (w__30 : bool) . sail2_state_monad$returnS (if w__30 then T else F)) | F_UN_TYPE_S ((rs1, rd, FMV_W_X)) => sail2_state_monad$bindS (haveFExt () ) (\ (w__31 : bool) . sail2_state_monad$returnS (if w__31 then T else F)) | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, FMADD_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__32 : bool) . sail2_state_monad$returnS (if w__32 then T else F)) | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, FMSUB_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__33 : bool) . sail2_state_monad$returnS (if w__33 then T else F)) | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, FNMSUB_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__34 : bool) . sail2_state_monad$returnS (if w__34 then T else F)) | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, FNMADD_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__35 : bool) . sail2_state_monad$returnS (if w__35 then T else F)) | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, FADD_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__36 : bool) . sail2_state_monad$returnS (if w__36 then T else F)) | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, FSUB_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__37 : bool) . sail2_state_monad$returnS (if w__37 then T else F)) | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, FMUL_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__38 : bool) . sail2_state_monad$returnS (if w__38 then T else F)) | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, FDIV_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__39 : bool) . sail2_state_monad$returnS (if w__39 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FSQRT_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__40 : bool) . sail2_state_monad$returnS (if w__40 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_W_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__41 : bool) . sail2_state_monad$returnS (if w__41 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_WU_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__42 : bool) . sail2_state_monad$returnS (if w__42 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_W)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__43 : bool) . sail2_state_monad$returnS (if w__43 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_WU)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__44 : bool) . sail2_state_monad$returnS (if w__44 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_S_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__45 : bool) . sail2_state_monad$returnS (if w__45 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_S)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__46 : bool) . sail2_state_monad$returnS (if w__46 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_L_D)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__47 : bool) . sail2_state_monad$returnS (if w__47 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_LU_D)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__48 : bool) . sail2_state_monad$returnS (if w__48 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_L)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__49 : bool) . sail2_state_monad$returnS (if w__49 then T else F)) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_LU)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__50 : bool) . sail2_state_monad$returnS (if w__50 then T else F)) | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJ_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__51 : bool) . sail2_state_monad$returnS (if w__51 then T else F)) | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJN_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__52 : bool) . sail2_state_monad$returnS (if w__52 then T else F)) | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJX_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__53 : bool) . sail2_state_monad$returnS (if w__53 then T else F)) | F_BIN_TYPE_D ((rs2, rs1, rd, FMIN_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__54 : bool) . sail2_state_monad$returnS (if w__54 then T else F)) | F_BIN_TYPE_D ((rs2, rs1, rd, FMAX_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__55 : bool) . sail2_state_monad$returnS (if w__55 then T else F)) | F_BIN_TYPE_D ((rs2, rs1, rd, FEQ_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__56 : bool) . sail2_state_monad$returnS (if w__56 then T else F)) | F_BIN_TYPE_D ((rs2, rs1, rd, FLT_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__57 : bool) . sail2_state_monad$returnS (if w__57 then T else F)) | F_BIN_TYPE_D ((rs2, rs1, rd, FLE_D)) => sail2_state_monad$bindS (is_RV32D_or_RV64D () ) (\ (w__58 : bool) . sail2_state_monad$returnS (if w__58 then T else F)) | F_UN_TYPE_D ((rs1, rd, FCLASS_D)) => sail2_state_monad$bindS (haveDExt () ) (\ (w__59 : bool) . sail2_state_monad$returnS (if w__59 then T else F)) | F_UN_TYPE_D ((rs1, rd, FMV_X_D)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__60 : bool) . sail2_state_monad$returnS (if w__60 then T else F)) | F_UN_TYPE_D ((rs1, rd, FMV_D_X)) => sail2_state_monad$bindS (is_RV64D () ) (\ (w__61 : bool) . sail2_state_monad$returnS (if w__61 then T else F)) | ILLEGAL (s) => sail2_state_monad$returnS T | _ => sail2_state_monad$returnS F )))`; val _ = Define ` ((encdec_backwards_matches:(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let v__469 = arg_ in if (let (mappingpatterns_0_0 : 7 words$word) = ((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) in encdec_uop_backwards_matches mappingpatterns_0_0) then let (mappingpatterns_0_0 : 7 words$word) = ((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) in sail2_state_monad$bindS (encdec_uop_backwards mappingpatterns_0_0) (\ op . sail2_state_monad$returnS T) else if (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1101111w : 7 words$word)))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1100111w : 7 words$word))))))) then sail2_state_monad$returnS T else if ((((let (mappingpatterns_1_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in encdec_bop_backwards_matches mappingpatterns_1_0) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1100011w : 7 words$word))))))) then let (mappingpatterns_1_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_bop_backwards mappingpatterns_1_0) (\ op . sail2_state_monad$returnS T) else if ((((let (mappingpatterns_2_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in encdec_iop_backwards_matches mappingpatterns_2_0) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0010011w : 7 words$word))))))) then let (mappingpatterns_2_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_iop_backwards mappingpatterns_2_0) (\ op . sail2_state_monad$returnS T) else if ((((let (shamt : 6 words$word) = ((subrange_vec_dec v__469 (( 25 : int):ii) (( 20 : int):ii) : 6 words$word)) in (((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((((access_vec_dec shamt (( 5 : int):ii))) = B0))))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 26 : int):ii) : 6 words$word)) = (0b000000w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0010011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((let (shamt : 6 words$word) = ((subrange_vec_dec v__469 (( 25 : int):ii) (( 20 : int):ii) : 6 words$word)) in (((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((((access_vec_dec shamt (( 5 : int):ii))) = B0))))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 26 : int):ii) : 6 words$word)) = (0b000000w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0010011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((let (shamt : 6 words$word) = ((subrange_vec_dec v__469 (( 25 : int):ii) (( 20 : int):ii) : 6 words$word)) in (((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((((access_vec_dec shamt (( 5 : int):ii))) = B0))))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 26 : int):ii) : 6 words$word)) = (0b010000w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0010011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b110w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b100w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_4_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_3_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) in if ((size_bits_backwards_matches mappingpatterns_4_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_4_0) (\ size1 . if ((bool_bits_backwards_matches mappingpatterns_3_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_3_0) (\ is_unsigned . sail2_state_monad$returnS (((((((word_width_bytes size1)) < (( 8 : int):ii))) \/ (((((~ is_unsigned)) /\ ((((word_width_bytes size1)) <= (( 8 : int):ii)))))))))) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) (sail2_state_monad$returnS (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000011w : 7 words$word)))))) (\ (w__2 : bool) . if w__2 then let (mappingpatterns_4_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_3_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_4_0) (\ size1 . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_3_0) (\ is_unsigned . sail2_state_monad$returnS T)) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_5_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in if ((size_bits_backwards_matches mappingpatterns_5_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_5_0) (\ size1 . sail2_state_monad$returnS ((((word_width_bytes size1)) <= (( 8 : int):ii)))) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0100011w : 7 words$word))))))))) (\ (w__4 : bool) . if w__4 then let (mappingpatterns_5_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_5_0) (\ size1 . sail2_state_monad$returnS T) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0100000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0011011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) = (0x0w : 4 words$word)))) /\ (((((subrange_vec_dec v__469 (( 19 : int):ii) (( 0 : int):ii) : 20 words$word)) = (0x0000Fw : 20 words$word))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) = (0x8w : 4 words$word)))) /\ (((((subrange_vec_dec v__469 (( 19 : int):ii) (( 0 : int):ii) : 20 words$word)) = (0x0000Fw : 20 words$word))))))) then sail2_state_monad$returnS T else if (((v__469 = (0x0000100Fw : 32 words$word)))) then sail2_state_monad$returnS T else if (((v__469 = (0x00000073w : 32 words$word)))) then sail2_state_monad$returnS T else if (((v__469 = (0x30200073w : 32 words$word)))) then sail2_state_monad$returnS T else if (((v__469 = (0x10200073w : 32 words$word)))) then sail2_state_monad$returnS T else if (((v__469 = (0x00100073w : 32 words$word)))) then sail2_state_monad$returnS T else if (((v__469 = (0x10500073w : 32 words$word)))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001001w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 14 : int):ii) (( 0 : int):ii) : 15 words$word)) = (0b000000001110011w : 15 words$word))))))) then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_8_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_7_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_6_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in if ((size_bits_backwards_matches mappingpatterns_8_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_8_0) (\ size1 . if ((bool_bits_backwards_matches mappingpatterns_7_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_7_0) (\ rl . if ((bool_bits_backwards_matches mappingpatterns_6_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_6_0) (\ aq . sail2_state_monad$returnS ((amo_width_valid size1))) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) = (0b00010w : 5 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 24 : int):ii) (( 20 : int):ii) : 5 words$word)) = (0b00000w : 5 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0101111w : 7 words$word))))))))))))))) (\ (w__8 : bool) . if w__8 then let (mappingpatterns_8_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_7_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_6_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_8_0) (\ size1 . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_7_0) (\ rl . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_6_0) (\ aq . sail2_state_monad$returnS T))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_9_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in let (mappingpatterns_11_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_10_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in if ((size_bits_backwards_matches mappingpatterns_11_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_11_0) (\ size1 . if ((bool_bits_backwards_matches mappingpatterns_10_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_10_0) (\ rl . if ((bool_bits_backwards_matches mappingpatterns_9_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_9_0) (\ aq . sail2_state_monad$returnS ((amo_width_valid size1))) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) = (0b00011w : 5 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0101111w : 7 words$word)))))))))))) (\ (w__12 : bool) . if w__12 then let (mappingpatterns_9_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in let (mappingpatterns_11_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_10_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_11_0) (\ size1 . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_10_0) (\ rl . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_9_0) (\ aq . sail2_state_monad$returnS T))) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_12_0 : 5 words$word) = ((subrange_vec_dec v__469 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (mappingpatterns_15_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_14_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_13_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in let (mappingpatterns_12_0 : 5 words$word) = ((subrange_vec_dec v__469 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in if ((size_bits_backwards_matches mappingpatterns_15_0)) then sail2_state_monad$bindS (size_bits_backwards mappingpatterns_15_0) (\ size1 . if ((bool_bits_backwards_matches mappingpatterns_14_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_14_0) (\ rl . if ((bool_bits_backwards_matches mappingpatterns_13_0)) then sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_13_0) (\ aq . if ((encdec_amoop_backwards_matches mappingpatterns_12_0)) then sail2_state_monad$bindS (encdec_amoop_backwards mappingpatterns_12_0) (\ op . sail2_state_monad$returnS ((amo_width_valid size1))) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0101111w : 7 words$word))))))))) (\ (w__17 : bool) . if w__17 then let (mappingpatterns_12_0 : 5 words$word) = ((subrange_vec_dec v__469 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in let (mappingpatterns_15_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_14_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 25 : int):ii) (( 25 : int):ii) : 1 words$word)) in let (mappingpatterns_13_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 26 : int):ii) (( 26 : int):ii) : 1 words$word)) in let (mappingpatterns_12_0 : 5 words$word) = ((subrange_vec_dec v__469 (( 31 : int):ii) (( 27 : int):ii) : 5 words$word)) in sail2_state_monad$bindS (size_bits_backwards mappingpatterns_15_0) (\ size1 . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_14_0) (\ rl . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_13_0) (\ aq . sail2_state_monad$bindS (encdec_amoop_backwards mappingpatterns_12_0) (\ op . sail2_state_monad$returnS T)))) else if ((((let (mappingpatterns_16_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in encdec_mul_op_backwards_matches mappingpatterns_16_0) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word)))))))))) then let (mappingpatterns_16_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_mul_op_backwards mappingpatterns_16_0) (\ varstup . let (high, signed1, signed2) = varstup in sail2_state_monad$returnS T) else if ((((let (mappingpatterns_17_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in bool_not_bits_backwards_matches mappingpatterns_17_0) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word))))))))))))) then let (mappingpatterns_17_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_17_0) (\ s . sail2_state_monad$returnS T) else if ((((let (mappingpatterns_18_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in bool_not_bits_backwards_matches mappingpatterns_18_0) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0110011w : 7 words$word))))))))))))) then let (mappingpatterns_18_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_18_0) (\ s . sail2_state_monad$returnS T) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word))))))))))))) then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_19_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in if ((bool_not_bits_backwards_matches mappingpatterns_19_0)) then sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_19_0) (\ s . sail2_state_monad$returnS ((((( 64 : int):ii) = (( 64 : int):ii))))) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word)))))))))))) (\ (w__19 : bool) . if w__19 then let (mappingpatterns_19_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_19_0) (\ s . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_20_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in if ((bool_not_bits_backwards_matches mappingpatterns_20_0)) then sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_20_0) (\ s . sail2_state_monad$returnS ((((( 64 : int):ii) = (( 64 : int):ii))))) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 13 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0111011w : 7 words$word)))))))))))) (\ (w__21 : bool) . if w__21 then let (mappingpatterns_20_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (bool_not_bits_backwards mappingpatterns_20_0) (\ s . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_22_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_21_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) in if ((encdec_csrop_backwards_matches mappingpatterns_22_0)) then sail2_state_monad$bindS (encdec_csrop_backwards mappingpatterns_22_0) (\ op . sail2_state_monad$returnS ((bool_bits_backwards_matches mappingpatterns_21_0))) else sail2_state_monad$returnS F) (sail2_state_monad$returnS (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1110011w : 7 words$word)))))) (\ (w__23 : bool) . if w__23 then let (mappingpatterns_22_0 : 2 words$word) = ((subrange_vec_dec v__469 (( 13 : int):ii) (( 12 : int):ii) : 2 words$word)) in let (mappingpatterns_21_0 : 1 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 14 : int):ii) : 1 words$word)) in sail2_state_monad$bindS (encdec_csrop_backwards mappingpatterns_22_0) (\ op . sail2_state_monad$bindS (bool_bits_backwards mappingpatterns_21_0) (\ is_imm . sail2_state_monad$returnS T)) else if (((v__469 = (0x00200073w : 32 words$word)))) then sail2_state_monad$returnS T else if ((((let (fm : 4 bits) = ((subrange_vec_dec v__469 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) in let (rs : regidx) = ((subrange_vec_dec v__469 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__469 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (fm : 4 bits) = ((subrange_vec_dec v__469 (( 31 : int):ii) (( 28 : int):ii) : 4 words$word)) in (((((((fm <> (0x0w : 4 words$word)))) /\ (((fm <> (0x8w : 4 words$word))))))) \/ ((((((rs <> (0b00000w : 5 words$word)))) \/ (((rd <> (0b00000w : 5 words$word))))))))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0001111w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (imm : 12 bits) = ((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in let (rs : regidx) = ((subrange_vec_dec v__469 (( 19 : int):ii) (( 15 : int):ii) : 5 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__469 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm : 12 bits) = ((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) in ((((imm <> (0x000w : 12 words$word)))) \/ ((((((rs <> zreg))) \/ (((rd <> zreg)))))))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0001111w : 7 words$word)))))))))) then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000111w : 7 words$word))))))))) (\ (w__25 : bool) . if w__25 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000111w : 7 words$word))))))))) (\ (w__27 : bool) . if w__27 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0100111w : 7 words$word))))))))) (\ (w__29 : bool) . if w__29 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0100111w : 7 words$word))))))))) (\ (w__31 : bool) . if w__31 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_23_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_23_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_23_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1000011w : 7 words$word))))))))) (\ (w__34 : bool) . if w__34 then let (mappingpatterns_23_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_23_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_24_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_24_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_24_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1000111w : 7 words$word))))))))) (\ (w__37 : bool) . if w__37 then let (mappingpatterns_24_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_24_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_25_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_25_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_25_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1001011w : 7 words$word))))))))) (\ (w__40 : bool) . if w__40 then let (mappingpatterns_25_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_25_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_26_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_26_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_26_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1001111w : 7 words$word))))))))) (\ (w__43 : bool) . if w__43 then let (mappingpatterns_26_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_26_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_27_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_27_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_27_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000000w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__46 : bool) . if w__46 then let (mappingpatterns_27_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_27_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_28_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_28_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_28_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000100w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__49 : bool) . if w__49 then let (mappingpatterns_28_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_28_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_29_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_29_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_29_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001000w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__52 : bool) . if w__52 then let (mappingpatterns_29_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_29_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_30_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_30_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_30_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001100w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__55 : bool) . if w__55 then let (mappingpatterns_30_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_30_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_31_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_31_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_31_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0x580w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__58 : bool) . if w__58 then let (mappingpatterns_31_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_31_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_32_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_32_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_32_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC00w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__61 : bool) . if w__61 then let (mappingpatterns_32_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_32_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_33_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_33_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_33_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC01w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__64 : bool) . if w__64 then let (mappingpatterns_33_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_33_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_34_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_34_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_34_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD00w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__67 : bool) . if w__67 then let (mappingpatterns_34_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_34_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_35_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_35_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_35_0) (\ rm . is_RV32F_or_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD01w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__70 : bool) . if w__70 then let (mappingpatterns_35_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_35_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_36_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_36_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_36_0) (\ rm . is_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC02w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__73 : bool) . if w__73 then let (mappingpatterns_36_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_36_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_37_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_37_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_37_0) (\ rm . is_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC03w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__76 : bool) . if w__76 then let (mappingpatterns_37_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_37_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_38_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_38_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_38_0) (\ rm . is_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD02w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__79 : bool) . if w__79 then let (mappingpatterns_38_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_38_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_39_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_39_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_39_0) (\ rm . is_RV64F () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD03w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__82 : bool) . if w__82 then let (mappingpatterns_39_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_39_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__84 : bool) . if w__84 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__86 : bool) . if w__86 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__88 : bool) . if w__88 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010100w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__90 : bool) . if w__90 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010100w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__92 : bool) . if w__92 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__94 : bool) . if w__94 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__96 : bool) . if w__96 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32F_or_RV64F () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010000w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__98 : bool) . if w__98 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((haveFExt () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xE00w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__100 : bool) . if w__100 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((haveFExt () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xE00w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__102 : bool) . if w__102 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((haveFExt () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xF00w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__104 : bool) . if w__104 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_40_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_40_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_40_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1000011w : 7 words$word))))))))) (\ (w__107 : bool) . if w__107 then let (mappingpatterns_40_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_40_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_41_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_41_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_41_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1000111w : 7 words$word))))))))) (\ (w__110 : bool) . if w__110 then let (mappingpatterns_41_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_41_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_42_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_42_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_42_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1001011w : 7 words$word))))))))) (\ (w__113 : bool) . if w__113 then let (mappingpatterns_42_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_42_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_43_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_43_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_43_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 26 : int):ii) (( 25 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1001111w : 7 words$word))))))))) (\ (w__116 : bool) . if w__116 then let (mappingpatterns_43_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_43_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_44_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_44_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_44_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__119 : bool) . if w__119 then let (mappingpatterns_44_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_44_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_45_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_45_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_45_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0000101w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__122 : bool) . if w__122 then let (mappingpatterns_45_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_45_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_46_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_46_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_46_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001001w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__125 : bool) . if w__125 then let (mappingpatterns_46_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_46_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_47_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_47_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_47_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0001101w : 7 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__128 : bool) . if w__128 then let (mappingpatterns_47_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_47_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_48_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_48_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_48_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0x5A0w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__131 : bool) . if w__131 then let (mappingpatterns_48_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_48_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_49_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_49_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_49_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC20w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__134 : bool) . if w__134 then let (mappingpatterns_49_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_49_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_50_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_50_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_50_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC21w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__137 : bool) . if w__137 then let (mappingpatterns_50_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_50_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_51_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_51_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_51_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD20w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__140 : bool) . if w__140 then let (mappingpatterns_51_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_51_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_52_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_52_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_52_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD21w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__143 : bool) . if w__143 then let (mappingpatterns_52_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_52_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_53_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_53_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_53_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0x401w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__146 : bool) . if w__146 then let (mappingpatterns_53_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_53_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_54_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_54_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_54_0) (\ rm . is_RV32D_or_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0x420w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__149 : bool) . if w__149 then let (mappingpatterns_54_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_54_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_55_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_55_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_55_0) (\ rm . is_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC22w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__152 : bool) . if w__152 then let (mappingpatterns_55_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_55_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_56_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_56_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_56_0) (\ rm . is_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xC23w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__155 : bool) . if w__155 then let (mappingpatterns_56_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_56_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_57_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_57_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_57_0) (\ rm . is_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD22w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__158 : bool) . if w__158 then let (mappingpatterns_57_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_57_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS (let (mappingpatterns_58_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in if ((encdec_rounding_mode_backwards_matches mappingpatterns_58_0)) then sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_58_0) (\ rm . is_RV64D () ) else sail2_state_monad$returnS F) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xD23w : 12 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word))))))))) (\ (w__161 : bool) . if w__161 then let (mappingpatterns_58_0 : 3 words$word) = ((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) in sail2_state_monad$bindS (encdec_rounding_mode_backwards mappingpatterns_58_0) (\ rm . sail2_state_monad$returnS T) else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__163 : bool) . if w__163 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__165 : bool) . if w__165 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__167 : bool) . if w__167 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010101w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__169 : bool) . if w__169 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b0010101w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__171 : bool) . if w__171 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__173 : bool) . if w__173 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__175 : bool) . if w__175 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV32D_or_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 25 : int):ii) : 7 words$word)) = (0b1010001w : 7 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__177 : bool) . if w__177 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((haveDExt () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xE20w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__179 : bool) . if w__179 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xE20w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__181 : bool) . if w__181 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS ((is_RV64D () )) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__469 (( 31 : int):ii) (( 20 : int):ii) : 12 words$word)) = (0xF20w : 12 words$word)))) /\ ((((((((subrange_vec_dec v__469 (( 14 : int):ii) (( 12 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__469 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b1010011w : 7 words$word)))))))))))) (\ (w__183 : bool) . sail2_state_monad$returnS (if w__183 then T else T)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))`; val _ = Define ` ((encdec_compressed_forwards:ast ->(regstate)sail2_state_monad$sequential_state ->((((16)words$word),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= ((case arg_ of C_NOP (() ) => sail2_state_monad$returnS ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b00000w : 5 words$word) (0b01w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_ADDI4SPN ((rd, v__922)) => if (let (nz96 : 4 bits) = ((subrange_vec_dec v__922 (( 7 : int):ii) (( 4 : int):ii) : 4 words$word)) in let (nz96 : 4 bits) = ((subrange_vec_dec v__922 (( 7 : int):ii) (( 4 : int):ii) : 4 words$word)) in let (nz54 : 2 bits) = ((subrange_vec_dec v__922 (( 3 : int):ii) (( 2 : int):ii) : 2 words$word)) in let (nz3 : 1 bits) = ((subrange_vec_dec v__922 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)) in let (nz2 : 1 bits) = ((subrange_vec_dec v__922 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in (((concat_vec nz96 ((concat_vec nz54 ((concat_vec nz3 nz2 : 2 words$word)) : 4 words$word)) : 8 words$word)) <> (0x00w : 8 words$word))) then let (nz96 : 4 bits) = ((subrange_vec_dec v__922 (( 7 : int):ii) (( 4 : int):ii) : 4 words$word)) in let (nz96 : 4 bits) = ((subrange_vec_dec v__922 (( 7 : int):ii) (( 4 : int):ii) : 4 words$word)) in let (nz54 : 2 bits) = ((subrange_vec_dec v__922 (( 3 : int):ii) (( 2 : int):ii) : 2 words$word)) in let (nz3 : 1 bits) = ((subrange_vec_dec v__922 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)) in let (nz2 : 1 bits) = ((subrange_vec_dec v__922 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in sail2_state_monad$returnS ((concat_vec (0b000w : 3 words$word) ((concat_vec nz54 ((concat_vec nz96 ((concat_vec nz2 ((concat_vec nz3 ((concat_vec rd (0b00w : 2 words$word) : 5 words$word)) : 6 words$word)) : 7 words$word)) : 11 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LW ((v__923, rs1, rd)) => let (ui6 : 1 bits) = ((subrange_vec_dec v__923 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (ui6 : 1 bits) = ((subrange_vec_dec v__923 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__923 (( 3 : int):ii) (( 1 : int):ii) : 3 words$word)) in let (ui2 : 1 bits) = ((subrange_vec_dec v__923 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in sail2_state_monad$returnS ((concat_vec (0b010w : 3 words$word) ((concat_vec ui53 ((concat_vec rs1 ((concat_vec ui2 ((concat_vec ui6 ((concat_vec rd (0b00w : 2 words$word) : 5 words$word)) : 6 words$word)) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) | C_LD ((v__924, rs1, rd)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then let (ui76 : 2 bits) = ((subrange_vec_dec v__924 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (ui76 : 2 bits) = ((subrange_vec_dec v__924 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__924 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in sail2_state_monad$returnS ((concat_vec (0b011w : 3 words$word) ((concat_vec ui53 ((concat_vec rs1 ((concat_vec ui76 ((concat_vec rd (0b00w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SW ((v__925, rs1, rs2)) => let (ui6 : 1 bits) = ((subrange_vec_dec v__925 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (ui6 : 1 bits) = ((subrange_vec_dec v__925 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__925 (( 3 : int):ii) (( 1 : int):ii) : 3 words$word)) in let (ui2 : 1 bits) = ((subrange_vec_dec v__925 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in sail2_state_monad$returnS ((concat_vec (0b110w : 3 words$word) ((concat_vec ui53 ((concat_vec rs1 ((concat_vec ui2 ((concat_vec ui6 ((concat_vec rs2 (0b00w : 2 words$word) : 5 words$word)) : 6 words$word)) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) | C_SD ((v__926, rs1, rs2)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then let (ui76 : 2 bits) = ((subrange_vec_dec v__926 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (ui76 : 2 bits) = ((subrange_vec_dec v__926 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__926 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in sail2_state_monad$returnS ((concat_vec (0b111w : 3 words$word) ((concat_vec ui53 ((concat_vec rs1 ((concat_vec ui76 ((concat_vec rs2 (0b00w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADDI ((v__927, rsd)) => if (let (nzi5 : 1 bits) = ((subrange_vec_dec v__927 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__927 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi40 : 5 bits) = ((subrange_vec_dec v__927 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in ((((((concat_vec nzi5 nzi40 : 6 words$word)) <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg))))) then let (nzi5 : 1 bits) = ((subrange_vec_dec v__927 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__927 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi40 : 5 bits) = ((subrange_vec_dec v__927 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b000w : 3 words$word) ((concat_vec nzi5 ((concat_vec rsd ((concat_vec nzi40 (0b01w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_JAL (v__928) => if ((((( 64 : int):ii) = (( 32 : int):ii)))) then let (i11 : 1 bits) = ((subrange_vec_dec v__928 (( 10 : int):ii) (( 10 : int):ii) : 1 words$word)) in let (i98 : 2 bits) = ((subrange_vec_dec v__928 (( 8 : int):ii) (( 7 : int):ii) : 2 words$word)) in let (i7 : 1 bits) = ((subrange_vec_dec v__928 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in let (i6 : 1 bits) = ((subrange_vec_dec v__928 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__928 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (i4 : 1 bits) = ((subrange_vec_dec v__928 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)) in let (i31 : 3 bits) = ((subrange_vec_dec v__928 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in let (i11 : 1 bits) = ((subrange_vec_dec v__928 (( 10 : int):ii) (( 10 : int):ii) : 1 words$word)) in let (i10 : 1 bits) = ((subrange_vec_dec v__928 (( 9 : int):ii) (( 9 : int):ii) : 1 words$word)) in sail2_state_monad$returnS ((concat_vec (0b001w : 3 words$word) ((concat_vec i11 ((concat_vec i4 ((concat_vec i98 ((concat_vec i10 ((concat_vec i6 ((concat_vec i7 ((concat_vec i31 ((concat_vec i5 (0b01w : 2 words$word) : 3 words$word)) : 6 words$word)) : 7 words$word)) : 8 words$word)) : 9 words$word)) : 11 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADDIW ((v__929, rsd)) => if ((((((rsd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii))))))) then let (imm5 : 1 bits) = ((subrange_vec_dec v__929 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm5 : 1 bits) = ((subrange_vec_dec v__929 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm40 : 5 bits) = ((subrange_vec_dec v__929 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b001w : 3 words$word) ((concat_vec imm5 ((concat_vec rsd ((concat_vec imm40 (0b01w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LI ((v__930, rd)) => if (((rd <> zreg))) then let (imm5 : 1 bits) = ((subrange_vec_dec v__930 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm5 : 1 bits) = ((subrange_vec_dec v__930 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm40 : 5 bits) = ((subrange_vec_dec v__930 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b010w : 3 words$word) ((concat_vec imm5 ((concat_vec rd ((concat_vec imm40 (0b01w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADDI16SP (v__931) => if (let (nzi9 : 1 bits) = ((subrange_vec_dec v__931 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi9 : 1 bits) = ((subrange_vec_dec v__931 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi87 : 2 bits) = ((subrange_vec_dec v__931 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (nzi6 : 1 bits) = ((subrange_vec_dec v__931 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__931 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)) in let (nzi4 : 1 bits) = ((subrange_vec_dec v__931 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in (((concat_vec nzi9 ((concat_vec nzi87 ((concat_vec nzi6 ((concat_vec nzi5 nzi4 : 2 words$word)) : 3 words$word)) : 5 words$word)) : 6 words$word)) <> (0b000000w : 6 words$word))) then let (nzi9 : 1 bits) = ((subrange_vec_dec v__931 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi9 : 1 bits) = ((subrange_vec_dec v__931 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi87 : 2 bits) = ((subrange_vec_dec v__931 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (nzi6 : 1 bits) = ((subrange_vec_dec v__931 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__931 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)) in let (nzi4 : 1 bits) = ((subrange_vec_dec v__931 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in sail2_state_monad$returnS ((concat_vec (0b011w : 3 words$word) ((concat_vec nzi9 ((concat_vec (0b00010w : 5 words$word) ((concat_vec nzi4 ((concat_vec nzi6 ((concat_vec nzi87 ((concat_vec nzi5 (0b01w : 2 words$word) : 3 words$word)) : 5 words$word)) : 6 words$word)) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LUI ((v__932, rd)) => if (let (imm17 : 1 bits) = ((subrange_vec_dec v__932 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm17 : 1 bits) = ((subrange_vec_dec v__932 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__932 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in ((((rd <> zreg))) /\ ((((((rd <> sp))) /\ (((((concat_vec imm17 imm1612 : 6 words$word)) <> (0b000000w : 6 words$word))))))))) then let (imm17 : 1 bits) = ((subrange_vec_dec v__932 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm17 : 1 bits) = ((subrange_vec_dec v__932 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__932 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b011w : 3 words$word) ((concat_vec imm17 ((concat_vec rd ((concat_vec imm1612 (0b01w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SRLI ((v__933, rsd)) => if (let (nzui5 : 1 bits) = ((subrange_vec_dec v__933 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__933 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__933 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word))) then let (nzui5 : 1 bits) = ((subrange_vec_dec v__933 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__933 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__933 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec nzui5 ((concat_vec (0b00w : 2 words$word) ((concat_vec rsd ((concat_vec nzui40 (0b01w : 2 words$word) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SRAI ((v__934, rsd)) => if (let (nzui5 : 1 bits) = ((subrange_vec_dec v__934 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__934 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__934 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word))) then let (nzui5 : 1 bits) = ((subrange_vec_dec v__934 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__934 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__934 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec nzui5 ((concat_vec (0b01w : 2 words$word) ((concat_vec rsd ((concat_vec nzui40 (0b01w : 2 words$word) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ANDI ((v__935, rsd)) => let (i5 : 1 bits) = ((subrange_vec_dec v__935 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__935 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (i40 : 5 bits) = ((subrange_vec_dec v__935 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec i5 ((concat_vec (0b10w : 2 words$word) ((concat_vec rsd ((concat_vec i40 (0b01w : 2 words$word) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_SUB ((rsd, rs2)) => sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec (0b11w : 2 words$word) ((concat_vec rsd ((concat_vec (0b00w : 2 words$word) ((concat_vec rs2 (0b01w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_XOR ((rsd, rs2)) => sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec (0b11w : 2 words$word) ((concat_vec rsd ((concat_vec (0b01w : 2 words$word) ((concat_vec rs2 (0b01w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_OR ((rsd, rs2)) => sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec (0b11w : 2 words$word) ((concat_vec rsd ((concat_vec (0b10w : 2 words$word) ((concat_vec rs2 (0b01w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_AND ((rsd, rs2)) => sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec (0b11w : 2 words$word) ((concat_vec rsd ((concat_vec (0b11w : 2 words$word) ((concat_vec rs2 (0b01w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_SUBW ((rsd, rs2)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b1w : 1 words$word) ((concat_vec (0b11w : 2 words$word) ((concat_vec rsd ((concat_vec (0b00w : 2 words$word) ((concat_vec rs2 (0b01w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADDW ((rsd, rs2)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b1w : 1 words$word) ((concat_vec (0b11w : 2 words$word) ((concat_vec rsd ((concat_vec (0b01w : 2 words$word) ((concat_vec rs2 (0b01w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_J (v__936) => let (i11 : 1 bits) = ((subrange_vec_dec v__936 (( 10 : int):ii) (( 10 : int):ii) : 1 words$word)) in let (i98 : 2 bits) = ((subrange_vec_dec v__936 (( 8 : int):ii) (( 7 : int):ii) : 2 words$word)) in let (i7 : 1 bits) = ((subrange_vec_dec v__936 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in let (i6 : 1 bits) = ((subrange_vec_dec v__936 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__936 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (i4 : 1 bits) = ((subrange_vec_dec v__936 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)) in let (i31 : 3 bits) = ((subrange_vec_dec v__936 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in let (i11 : 1 bits) = ((subrange_vec_dec v__936 (( 10 : int):ii) (( 10 : int):ii) : 1 words$word)) in let (i10 : 1 bits) = ((subrange_vec_dec v__936 (( 9 : int):ii) (( 9 : int):ii) : 1 words$word)) in sail2_state_monad$returnS ((concat_vec (0b101w : 3 words$word) ((concat_vec i11 ((concat_vec i4 ((concat_vec i98 ((concat_vec i10 ((concat_vec i6 ((concat_vec i7 ((concat_vec i31 ((concat_vec i5 (0b01w : 2 words$word) : 3 words$word)) : 6 words$word)) : 7 words$word)) : 8 words$word)) : 9 words$word)) : 11 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_BEQZ ((v__937, rs)) => let (i8 : 1 bits) = ((subrange_vec_dec v__937 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)) in let (i8 : 1 bits) = ((subrange_vec_dec v__937 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)) in let (i76 : 2 bits) = ((subrange_vec_dec v__937 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__937 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (i43 : 2 bits) = ((subrange_vec_dec v__937 (( 3 : int):ii) (( 2 : int):ii) : 2 words$word)) in let (i21 : 2 bits) = ((subrange_vec_dec v__937 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) in sail2_state_monad$returnS ((concat_vec (0b110w : 3 words$word) ((concat_vec i8 ((concat_vec i43 ((concat_vec rs ((concat_vec i76 ((concat_vec i21 ((concat_vec i5 (0b01w : 2 words$word) : 3 words$word)) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_BNEZ ((v__938, rs)) => let (i8 : 1 bits) = ((subrange_vec_dec v__938 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)) in let (i8 : 1 bits) = ((subrange_vec_dec v__938 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)) in let (i76 : 2 bits) = ((subrange_vec_dec v__938 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__938 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (i43 : 2 bits) = ((subrange_vec_dec v__938 (( 3 : int):ii) (( 2 : int):ii) : 2 words$word)) in let (i21 : 2 bits) = ((subrange_vec_dec v__938 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) in sail2_state_monad$returnS ((concat_vec (0b111w : 3 words$word) ((concat_vec i8 ((concat_vec i43 ((concat_vec rs ((concat_vec i76 ((concat_vec i21 ((concat_vec i5 (0b01w : 2 words$word) : 3 words$word)) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_SLLI ((v__939, rsd)) => if (let (nzui5 : 1 bits) = ((subrange_vec_dec v__939 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__939 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__939 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in ((((((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word)))) /\ ((((((rsd <> zreg))) /\ (((((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((nzui5 = (0b0w : 1 words$word)))))))))))) then let (nzui5 : 1 bits) = ((subrange_vec_dec v__939 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__939 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__939 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b000w : 3 words$word) ((concat_vec nzui5 ((concat_vec rsd ((concat_vec nzui40 (0b10w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LWSP ((v__940, rd)) => if (((rd <> zreg))) then let (ui76 : 2 bits) = ((subrange_vec_dec v__940 (( 5 : int):ii) (( 4 : int):ii) : 2 words$word)) in let (ui76 : 2 bits) = ((subrange_vec_dec v__940 (( 5 : int):ii) (( 4 : int):ii) : 2 words$word)) in let (ui5 : 1 bits) = ((subrange_vec_dec v__940 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)) in let (ui42 : 3 bits) = ((subrange_vec_dec v__940 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in sail2_state_monad$returnS ((concat_vec (0b010w : 3 words$word) ((concat_vec ui5 ((concat_vec rd ((concat_vec ui42 ((concat_vec ui76 (0b10w : 2 words$word) : 4 words$word)) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LDSP ((v__941, rd)) => if ((((((rd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii))))))) then let (ui86 : 3 bits) = ((subrange_vec_dec v__941 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (ui86 : 3 bits) = ((subrange_vec_dec v__941 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (ui5 : 1 bits) = ((subrange_vec_dec v__941 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (ui43 : 2 bits) = ((subrange_vec_dec v__941 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) in sail2_state_monad$returnS ((concat_vec (0b011w : 3 words$word) ((concat_vec ui5 ((concat_vec rd ((concat_vec ui43 ((concat_vec ui86 (0b10w : 2 words$word) : 5 words$word)) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SWSP ((v__942, rs2)) => let (ui76 : 2 bits) = ((subrange_vec_dec v__942 (( 5 : int):ii) (( 4 : int):ii) : 2 words$word)) in let (ui76 : 2 bits) = ((subrange_vec_dec v__942 (( 5 : int):ii) (( 4 : int):ii) : 2 words$word)) in let (ui52 : 4 bits) = ((subrange_vec_dec v__942 (( 3 : int):ii) (( 0 : int):ii) : 4 words$word)) in sail2_state_monad$returnS ((concat_vec (0b110w : 3 words$word) ((concat_vec ui52 ((concat_vec ui76 ((concat_vec rs2 (0b10w : 2 words$word) : 7 words$word)) : 9 words$word)) : 13 words$word)) : 16 words$word)) | C_SDSP ((v__943, rs2)) => if ((((( 64 : int):ii) = (( 64 : int):ii)))) then let (ui86 : 3 bits) = ((subrange_vec_dec v__943 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (ui86 : 3 bits) = ((subrange_vec_dec v__943 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__943 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in sail2_state_monad$returnS ((concat_vec (0b111w : 3 words$word) ((concat_vec ui53 ((concat_vec ui86 ((concat_vec rs2 (0b10w : 2 words$word) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_JR (rs1) => if (((rs1 <> zreg))) then sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec rs1 ((concat_vec (0b00000w : 5 words$word) (0b10w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_JALR (rs1) => if (((rs1 <> zreg))) then sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b1w : 1 words$word) ((concat_vec rs1 ((concat_vec (0b00000w : 5 words$word) (0b10w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_MV ((rd, rs2)) => if ((((((rd <> zreg))) /\ (((rs2 <> zreg)))))) then sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec rd ((concat_vec rs2 (0b10w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_EBREAK (() ) => sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b1w : 1 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec (0b00000w : 5 words$word) (0b10w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_ADD ((rsd, rs2)) => if ((((((rsd <> zreg))) /\ (((rs2 <> zreg)))))) then sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b1w : 1 words$word) ((concat_vec rsd ((concat_vec rs2 (0b10w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_NOP_HINT (v__944) => if (let (im5 : 1 bits) = ((subrange_vec_dec v__944 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (im5 : 1 bits) = ((subrange_vec_dec v__944 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (im40 : 5 bits) = ((subrange_vec_dec v__944 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((concat_vec im5 im40 : 6 words$word)) <> (0b000000w : 6 words$word))) then let (im5 : 1 bits) = ((subrange_vec_dec v__944 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (im5 : 1 bits) = ((subrange_vec_dec v__944 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (im40 : 5 bits) = ((subrange_vec_dec v__944 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b000w : 3 words$word) ((concat_vec im5 ((concat_vec (0b00000w : 5 words$word) ((concat_vec im40 (0b01w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADDI_HINT (rsd) => if (((rsd <> zreg))) then sail2_state_monad$returnS ((concat_vec (0b000w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec rsd ((concat_vec (0b00000w : 5 words$word) (0b01w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LI_HINT (v__945) => let (imm5 : 1 bits) = ((subrange_vec_dec v__945 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm5 : 1 bits) = ((subrange_vec_dec v__945 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm40 : 5 bits) = ((subrange_vec_dec v__945 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b010w : 3 words$word) ((concat_vec imm5 ((concat_vec (0b00000w : 5 words$word) ((concat_vec imm40 (0b01w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_LUI_HINT (v__946) => if (let (imm17 : 1 bits) = ((subrange_vec_dec v__946 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm17 : 1 bits) = ((subrange_vec_dec v__946 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__946 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((concat_vec imm17 imm1612 : 6 words$word)) <> (0b000000w : 6 words$word))) then let (imm17 : 1 bits) = ((subrange_vec_dec v__946 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm17 : 1 bits) = ((subrange_vec_dec v__946 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__946 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b011w : 3 words$word) ((concat_vec imm17 ((concat_vec (0b00000w : 5 words$word) ((concat_vec imm1612 (0b01w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_MV_HINT (rs2) => if (((rs2 <> zreg))) then sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs2 (0b10w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADD_HINT (rs2) => if (((rs2 <> zreg))) then sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b1w : 1 words$word) ((concat_vec (0b00000w : 5 words$word) ((concat_vec rs2 (0b10w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SLLI_HINT ((v__947, rsd)) => if (let (nzui5 : 1 bits) = ((subrange_vec_dec v__947 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__947 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__947 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((((((((concat_vec nzui5 nzui40 : 6 words$word)) = (0b000000w : 6 words$word)))) \/ (((rsd = zreg)))))) /\ (((((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((nzui5 = (0b0w : 1 words$word))))))))) then let (nzui5 : 1 bits) = ((subrange_vec_dec v__947 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__947 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__947 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in sail2_state_monad$returnS ((concat_vec (0b000w : 3 words$word) ((concat_vec nzui5 ((concat_vec rsd ((concat_vec nzui40 (0b10w : 2 words$word) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SRLI_HINT (rsd) => sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec (0b00w : 2 words$word) ((concat_vec rsd ((concat_vec (0b00000w : 5 words$word) (0b01w : 2 words$word) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_SRAI_HINT (rsd) => sail2_state_monad$returnS ((concat_vec (0b100w : 3 words$word) ((concat_vec (0b0w : 1 words$word) ((concat_vec (0b01w : 2 words$word) ((concat_vec rsd ((concat_vec (0b00000w : 5 words$word) (0b01w : 2 words$word) : 7 words$word)) : 10 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) | C_FLWSP ((v__948, rd)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (\ (w__57 : bool) . if w__57 then let (ui76 : 2 bits) = ((subrange_vec_dec v__948 (( 5 : int):ii) (( 4 : int):ii) : 2 words$word)) in let (ui76 : 2 bits) = ((subrange_vec_dec v__948 (( 5 : int):ii) (( 4 : int):ii) : 2 words$word)) in let (ui5 : 1 bits) = ((subrange_vec_dec v__948 (( 3 : int):ii) (( 3 : int):ii) : 1 words$word)) in let (ui42 : 3 bits) = ((subrange_vec_dec v__948 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in sail2_state_monad$returnS ((concat_vec (0b011w : 3 words$word) ((concat_vec ui5 ((concat_vec rd ((concat_vec ui42 ((concat_vec ui76 (0b10w : 2 words$word) : 4 words$word)) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | C_FSWSP ((v__949, rs2)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (\ (w__63 : bool) . if w__63 then let (ui76 : 2 bits) = ((subrange_vec_dec v__949 (( 5 : int):ii) (( 4 : int):ii) : 2 words$word)) in let (ui76 : 2 bits) = ((subrange_vec_dec v__949 (( 5 : int):ii) (( 4 : int):ii) : 2 words$word)) in let (ui52 : 4 bits) = ((subrange_vec_dec v__949 (( 3 : int):ii) (( 0 : int):ii) : 4 words$word)) in sail2_state_monad$returnS ((concat_vec (0b111w : 3 words$word) ((concat_vec ui52 ((concat_vec ui76 ((concat_vec rs2 (0b10w : 2 words$word) : 7 words$word)) : 9 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | C_FLW ((v__950, rs1, rd)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (\ (w__69 : bool) . if w__69 then let (ui6 : 1 bits) = ((subrange_vec_dec v__950 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (ui6 : 1 bits) = ((subrange_vec_dec v__950 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__950 (( 3 : int):ii) (( 1 : int):ii) : 3 words$word)) in let (ui2 : 1 bits) = ((subrange_vec_dec v__950 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in sail2_state_monad$returnS ((concat_vec (0b011w : 3 words$word) ((concat_vec ui53 ((concat_vec rs1 ((concat_vec ui2 ((concat_vec ui6 ((concat_vec rd (0b00w : 2 words$word) : 5 words$word)) : 6 words$word)) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | C_FSW ((v__951, rs1, rs2)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (\ (w__75 : bool) . if w__75 then let (ui6 : 1 bits) = ((subrange_vec_dec v__951 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (ui6 : 1 bits) = ((subrange_vec_dec v__951 (( 4 : int):ii) (( 4 : int):ii) : 1 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__951 (( 3 : int):ii) (( 1 : int):ii) : 3 words$word)) in let (ui2 : 1 bits) = ((subrange_vec_dec v__951 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in sail2_state_monad$returnS ((concat_vec (0b111w : 3 words$word) ((concat_vec ui53 ((concat_vec rs1 ((concat_vec ui2 ((concat_vec ui6 ((concat_vec rs2 (0b00w : 2 words$word) : 5 words$word)) : 6 words$word)) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | C_FLDSP ((v__952, rd)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (\ (w__81 : bool) . if w__81 then let (ui86 : 3 bits) = ((subrange_vec_dec v__952 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (ui86 : 3 bits) = ((subrange_vec_dec v__952 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (ui5 : 1 bits) = ((subrange_vec_dec v__952 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (ui43 : 2 bits) = ((subrange_vec_dec v__952 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) in sail2_state_monad$returnS ((concat_vec (0b001w : 3 words$word) ((concat_vec ui5 ((concat_vec rd ((concat_vec ui43 ((concat_vec ui86 (0b10w : 2 words$word) : 5 words$word)) : 7 words$word)) : 12 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | C_FSDSP ((v__953, rs2)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (\ (w__87 : bool) . if w__87 then let (ui86 : 3 bits) = ((subrange_vec_dec v__953 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (ui86 : 3 bits) = ((subrange_vec_dec v__953 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__953 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in sail2_state_monad$returnS ((concat_vec (0b101w : 3 words$word) ((concat_vec ui53 ((concat_vec ui86 ((concat_vec rs2 (0b10w : 2 words$word) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | C_FLD ((v__954, rs1, rd)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (\ (w__93 : bool) . if w__93 then let (ui76 : 2 bits) = ((subrange_vec_dec v__954 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (ui76 : 2 bits) = ((subrange_vec_dec v__954 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__954 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in sail2_state_monad$returnS ((concat_vec (0b001w : 3 words$word) ((concat_vec ui53 ((concat_vec rs1 ((concat_vec ui76 ((concat_vec rd (0b00w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | C_FSD ((v__955, rs1, rs2)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (\ (w__99 : bool) . if w__99 then let (ui76 : 2 bits) = ((subrange_vec_dec v__955 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (ui76 : 2 bits) = ((subrange_vec_dec v__955 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__955 (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) in sail2_state_monad$returnS ((concat_vec (0b101w : 3 words$word) ((concat_vec ui53 ((concat_vec rs1 ((concat_vec ui76 ((concat_vec rs2 (0b00w : 2 words$word) : 5 words$word)) : 7 words$word)) : 10 words$word)) : 13 words$word)) : 16 words$word)) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )) | C_ILLEGAL (s) => sail2_state_monad$returnS s | _ => sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) )))`; val _ = Define ` ((encdec_compressed_backwards:(16)words$word ->(regstate)sail2_state_monad$sequential_state ->(((ast),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let v__956 = arg_ in if (((v__956 = (0x0001w : 16 words$word)))) then sail2_state_monad$returnS (C_NOP () ) else if ((((let (nz96 : 4 bits) = ((subrange_vec_dec v__956 (( 10 : int):ii) (( 7 : int):ii) : 4 words$word)) in let (nz54 : 2 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 11 : int):ii) : 2 words$word)) in let (nz3 : 1 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nz2 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in (((concat_vec nz96 ((concat_vec nz54 ((concat_vec nz3 nz2 : 2 words$word)) : 4 words$word)) : 8 words$word)) <> (0x00w : 8 words$word))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))))))))) then let (rd : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in let (nz96 : 4 bits) = ((subrange_vec_dec v__956 (( 10 : int):ii) (( 7 : int):ii) : 4 words$word)) in let (nz54 : 2 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 11 : int):ii) : 2 words$word)) in let (nz3 : 1 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nz2 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in sail2_state_monad$returnS (C_ADDI4SPN (rd, (concat_vec nz96 ((concat_vec nz54 ((concat_vec nz3 nz2 : 2 words$word)) : 4 words$word)) : 8 words$word))) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))) then let (ui6 : 1 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (ui2 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in let (rs1 : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rd : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_LW ((concat_vec ui6 ((concat_vec ui53 ui2 : 4 words$word)) : 5 words$word), rs1, rd)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))))))))) then let (ui76 : 2 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (rs1 : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rd : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_LD ((concat_vec ui76 ui53 : 5 words$word), rs1, rd)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b110w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))) then let (ui6 : 1 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (ui2 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in let (rs2 : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in let (rs1 : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_SW ((concat_vec ui6 ((concat_vec ui53 ui2 : 4 words$word)) : 5 words$word), rs1, rs2)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))))))))) then let (ui76 : 2 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (rs2 : 3 bits) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in let (rs1 : 3 bits) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_SD ((concat_vec ui76 ui53 : 5 words$word), rs1, rs2)) else if ((((let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzi40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in ((((((concat_vec nzi5 nzi40 : 6 words$word)) <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg))))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzi40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_ADDI ((concat_vec nzi5 nzi40 : 6 words$word), rsd)) else if (((((((( 64 : int):ii) = (( 32 : int):ii)))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (i98 : 2 bits) = ((subrange_vec_dec v__956 (( 10 : int):ii) (( 9 : int):ii) : 2 words$word)) in let (i7 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in let (i6 : 1 bits) = ((subrange_vec_dec v__956 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__956 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (i4 : 1 bits) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 11 : int):ii) : 1 words$word)) in let (i31 : 3 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (i11 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (i10 : 1 bits) = ((subrange_vec_dec v__956 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)) in sail2_state_monad$returnS (C_JAL ((concat_vec i11 ((concat_vec i10 ((concat_vec i98 ((concat_vec i7 ((concat_vec i6 ((concat_vec i5 ((concat_vec i4 i31 : 4 words$word)) : 5 words$word)) : 6 words$word)) : 7 words$word)) : 9 words$word)) : 10 words$word)) : 11 words$word))) else if ((((let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in ((((rsd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii)))))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_ADDIW ((concat_vec imm5 imm40 : 6 words$word), rsd)) else if ((((let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rd <> zreg)) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_LI ((concat_vec imm5 imm40 : 6 words$word), rd)) else if ((((let (nzi9 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzi87 : 2 bits) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (nzi6 : 1 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__956 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (nzi4 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in (((concat_vec nzi9 ((concat_vec nzi87 ((concat_vec nzi6 ((concat_vec nzi5 nzi4 : 2 words$word)) : 3 words$word)) : 5 words$word)) : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) = (0b00010w : 5 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then let (nzi9 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzi87 : 2 bits) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (nzi6 : 1 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__956 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (nzi4 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in sail2_state_monad$returnS (C_ADDI16SP ((concat_vec nzi9 ((concat_vec nzi87 ((concat_vec nzi6 ((concat_vec nzi5 nzi4 : 2 words$word)) : 3 words$word)) : 5 words$word)) : 6 words$word))) else if ((((let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm17 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in ((((rd <> zreg))) /\ ((((((rd <> sp))) /\ (((((concat_vec imm17 imm1612 : 6 words$word)) <> (0b000000w : 6 words$word))))))))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm17 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_LUI ((concat_vec imm17 imm1612 : 6 words$word), rd)) else if ((((let (nzui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b100w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 11 : int):ii) (( 10 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_SRLI ((concat_vec nzui5 nzui40 : 6 words$word), rsd)) else if ((((let (nzui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b100w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 11 : int):ii) (( 10 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_SRAI ((concat_vec nzui5 nzui40 : 6 words$word), rsd)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b100w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 11 : int):ii) (( 10 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (i40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_ANDI ((concat_vec i5 i40 : 6 words$word), rsd)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100011w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rs2 : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_SUB (rsd, rs2)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100011w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rs2 : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_XOR (rsd, rs2)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100011w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rs2 : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_OR (rsd, rs2)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100011w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rs2 : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_AND (rsd, rs2)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100111w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rs2 : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_SUBW (rsd, rs2)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100111w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rs2 : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_ADDW (rsd, rs2)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then let (i98 : 2 bits) = ((subrange_vec_dec v__956 (( 10 : int):ii) (( 9 : int):ii) : 2 words$word)) in let (i7 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in let (i6 : 1 bits) = ((subrange_vec_dec v__956 (( 7 : int):ii) (( 7 : int):ii) : 1 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__956 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (i4 : 1 bits) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 11 : int):ii) : 1 words$word)) in let (i31 : 3 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 3 : int):ii) : 3 words$word)) in let (i11 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (i10 : 1 bits) = ((subrange_vec_dec v__956 (( 8 : int):ii) (( 8 : int):ii) : 1 words$word)) in sail2_state_monad$returnS (C_J ((concat_vec i11 ((concat_vec i10 ((concat_vec i98 ((concat_vec i7 ((concat_vec i6 ((concat_vec i5 ((concat_vec i4 i31 : 4 words$word)) : 5 words$word)) : 6 words$word)) : 7 words$word)) : 9 words$word)) : 10 words$word)) : 11 words$word))) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b110w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then let (rs : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (i8 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (i76 : 2 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__956 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (i43 : 2 bits) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 10 : int):ii) : 2 words$word)) in let (i21 : 2 bits) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in sail2_state_monad$returnS (C_BEQZ ((concat_vec i8 ((concat_vec i76 ((concat_vec i5 ((concat_vec i43 i21 : 4 words$word)) : 5 words$word)) : 7 words$word)) : 8 words$word), rs)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then let (rs : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (i8 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (i76 : 2 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (i5 : 1 bits) = ((subrange_vec_dec v__956 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (i43 : 2 bits) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 10 : int):ii) : 2 words$word)) in let (i21 : 2 bits) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in sail2_state_monad$returnS (C_BNEZ ((concat_vec i8 ((concat_vec i76 ((concat_vec i5 ((concat_vec i43 i21 : 4 words$word)) : 5 words$word)) : 7 words$word)) : 8 words$word), rs)) else if ((((let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in ((((((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word)))) /\ ((((((rsd <> zreg))) /\ (((((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((nzui5 = (0b0w : 1 words$word)))))))))))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_SLLI ((concat_vec nzui5 nzui40 : 6 words$word), rsd)) else if ((((let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rd <> zreg)) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then let (ui76 : 2 bits) = ((subrange_vec_dec v__956 (( 3 : int):ii) (( 2 : int):ii) : 2 words$word)) in let (ui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (ui42 : 3 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 4 : int):ii) : 3 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_LWSP ((concat_vec ui76 ((concat_vec ui5 ui42 : 4 words$word)) : 6 words$word), rd)) else if ((((let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in ((((rd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii)))))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then let (ui86 : 3 bits) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in let (ui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (ui43 : 2 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_LDSP ((concat_vec ui86 ((concat_vec ui5 ui43 : 3 words$word)) : 6 words$word), rd)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b110w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))) then let (ui76 : 2 bits) = ((subrange_vec_dec v__956 (( 8 : int):ii) (( 7 : int):ii) : 2 words$word)) in let (ui52 : 4 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 9 : int):ii) : 4 words$word)) in let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_SWSP ((concat_vec ui76 ui52 : 6 words$word), rs2)) else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then let (ui86 : 3 bits) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_SDSP ((concat_vec ui86 ui53 : 6 words$word), rs2)) else if ((((let (rs1 : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rs1 <> zreg)) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x8w : 4 words$word)))) /\ (((((subrange_vec_dec v__956 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000010w : 7 words$word)))))))))) then let (rs1 : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_JR rs1) else if ((((let (rs1 : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rs1 <> zreg)) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x9w : 4 words$word)))) /\ (((((subrange_vec_dec v__956 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000010w : 7 words$word)))))))))) then let (rs1 : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_JALR rs1) else if ((((let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in ((((rd <> zreg))) /\ (((rs2 <> zreg))))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x8w : 4 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_MV (rd, rs2)) else if (((v__956 = (0x9002w : 16 words$word)))) then sail2_state_monad$returnS (C_EBREAK () ) else if ((((let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in ((((rsd <> zreg))) /\ (((rs2 <> zreg))))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x9w : 4 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_ADD (rsd, rs2)) else if ((((let (im5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (im40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((concat_vec im5 im40 : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) = (0b00000w : 5 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then let (im5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (im40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_NOP_HINT ((concat_vec im5 im40 : 6 words$word))) else if ((((let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rsd <> zreg)) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x0w : 4 words$word)))) /\ (((((subrange_vec_dec v__956 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))))))))) then let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_ADDI_HINT rsd) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) = (0b00000w : 5 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then let (imm5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_LI_HINT ((concat_vec imm5 imm40 : 6 words$word))) else if ((((let (imm17 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((concat_vec imm17 imm1612 : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) = (0b00000w : 5 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then let (imm17 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_LUI_HINT ((concat_vec imm17 imm1612 : 6 words$word))) else if ((((let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (rs2 <> zreg)) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 7 : int):ii) : 9 words$word)) = (0b100000000w : 9 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_MV_HINT rs2) else if ((((let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (rs2 <> zreg)) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 7 : int):ii) : 9 words$word)) = (0b100100000w : 9 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_ADD_HINT rs2) else if ((((let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((((((((concat_vec nzui5 nzui40 : 6 words$word)) = (0b000000w : 6 words$word)))) \/ (((rsd = zreg)))))) /\ (((((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((nzui5 = (0b0w : 1 words$word))))))))) /\ ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then let (rsd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_SLLI_HINT ((concat_vec nzui5 nzui40 : 6 words$word), rsd)) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100000w : 6 words$word)))) /\ (((((subrange_vec_dec v__956 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_SRLI_HINT rsd) else if ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100001w : 6 words$word)))) /\ (((((subrange_vec_dec v__956 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word))))))) then let (rsd : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_SRAI_HINT rsd) else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))))) (\ (w__4 : bool) . if w__4 then let (ui76 : 2 bits) = ((subrange_vec_dec v__956 (( 3 : int):ii) (( 2 : int):ii) : 2 words$word)) in let (ui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (ui42 : 3 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 4 : int):ii) : 3 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_FLWSP ((concat_vec ui76 ((concat_vec ui5 ui42 : 4 words$word)) : 6 words$word), rd)) else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))))) (\ (w__9 : bool) . if w__9 then let (ui76 : 2 bits) = ((subrange_vec_dec v__956 (( 8 : int):ii) (( 7 : int):ii) : 2 words$word)) in let (ui52 : 4 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 9 : int):ii) : 4 words$word)) in let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_FSWSP ((concat_vec ui76 ui52 : 6 words$word), rs2)) else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))))) (\ (w__14 : bool) . if w__14 then let (ui6 : 1 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (ui2 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in let (rs1 : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rd : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_FLW ((concat_vec ui6 ((concat_vec ui53 ui2 : 4 words$word)) : 5 words$word), rs1, rd)) else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))))) (\ (w__19 : bool) . if w__19 then let (ui6 : 1 bits) = ((subrange_vec_dec v__956 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (ui2 : 1 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in let (rs2 : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in let (rs1 : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_FSW ((concat_vec ui6 ((concat_vec ui53 ui2 : 4 words$word)) : 5 words$word), rs1, rs2)) else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))))) (\ (w__24 : bool) . if w__24 then let (ui86 : 3 bits) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in let (ui5 : 1 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (ui43 : 2 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__956 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_FLDSP ((concat_vec ui86 ((concat_vec ui5 ui43 : 3 words$word)) : 6 words$word), rd)) else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))))) (\ (w__29 : bool) . if w__29 then let (ui86 : 3 bits) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (rs2 : regidx) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in sail2_state_monad$returnS (C_FSDSP ((concat_vec ui86 ui53 : 6 words$word), rs2)) else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))))) (\ (w__34 : bool) . if w__34 then let (ui76 : 2 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (rs1 : cregidx) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in let (rd : cregidx) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in sail2_state_monad$returnS (C_FLD ((concat_vec ui76 ui53 : 5 words$word), rs1, rd)) else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__956 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__956 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))))) (\ (w__39 : bool) . sail2_state_monad$returnS (if w__39 then let (ui76 : 2 bits) = ((subrange_vec_dec v__956 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) in let (ui53 : 3 bits) = ((subrange_vec_dec v__956 (( 12 : int):ii) (( 10 : int):ii) : 3 words$word)) in let (rs2 : 3 bits) = ((subrange_vec_dec v__956 (( 4 : int):ii) (( 2 : int):ii) : 3 words$word)) in let (rs1 : 3 bits) = ((subrange_vec_dec v__956 (( 9 : int):ii) (( 7 : int):ii) : 3 words$word)) in C_FSD ((concat_vec ui76 ui53 : 5 words$word), rs1, rs2) else C_ILLEGAL v__956)))))))))))`; val _ = Define ` ((encdec_compressed_forwards_matches:ast ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= ((case arg_ of C_NOP (() ) => sail2_state_monad$returnS T | C_ADDI4SPN ((rd, v__1158)) => sail2_state_monad$returnS (if (let (nz96 : 4 bits) = ((subrange_vec_dec v__1158 (( 7 : int):ii) (( 4 : int):ii) : 4 words$word)) in let (nz96 : 4 bits) = ((subrange_vec_dec v__1158 (( 7 : int):ii) (( 4 : int):ii) : 4 words$word)) in let (nz54 : 2 bits) = ((subrange_vec_dec v__1158 (( 3 : int):ii) (( 2 : int):ii) : 2 words$word)) in let (nz3 : 1 bits) = ((subrange_vec_dec v__1158 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)) in let (nz2 : 1 bits) = ((subrange_vec_dec v__1158 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in (((concat_vec nz96 ((concat_vec nz54 ((concat_vec nz3 nz2 : 2 words$word)) : 4 words$word)) : 8 words$word)) <> (0x00w : 8 words$word))) then T else F) | C_LW ((v__1159, rs1, rd)) => sail2_state_monad$returnS T | C_LD ((v__1160, rs1, rd)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | C_SW ((v__1161, rs1, rs2)) => sail2_state_monad$returnS T | C_SD ((v__1162, rs1, rs2)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | C_ADDI ((v__1163, rsd)) => sail2_state_monad$returnS (if (let (nzi5 : 1 bits) = ((subrange_vec_dec v__1163 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__1163 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi40 : 5 bits) = ((subrange_vec_dec v__1163 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in ((((((concat_vec nzi5 nzi40 : 6 words$word)) <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg))))) then T else F) | C_JAL (v__1164) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 32 : int):ii)))) then T else F) | C_ADDIW ((v__1165, rsd)) => sail2_state_monad$returnS (if ((((((rsd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii))))))) then T else F) | C_LI ((v__1166, rd)) => sail2_state_monad$returnS (if (((rd <> zreg))) then T else F) | C_ADDI16SP (v__1167) => sail2_state_monad$returnS (if (let (nzi9 : 1 bits) = ((subrange_vec_dec v__1167 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi9 : 1 bits) = ((subrange_vec_dec v__1167 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi87 : 2 bits) = ((subrange_vec_dec v__1167 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (nzi6 : 1 bits) = ((subrange_vec_dec v__1167 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__1167 (( 1 : int):ii) (( 1 : int):ii) : 1 words$word)) in let (nzi4 : 1 bits) = ((subrange_vec_dec v__1167 (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) in (((concat_vec nzi9 ((concat_vec nzi87 ((concat_vec nzi6 ((concat_vec nzi5 nzi4 : 2 words$word)) : 3 words$word)) : 5 words$word)) : 6 words$word)) <> (0b000000w : 6 words$word))) then T else F) | C_LUI ((v__1168, rd)) => sail2_state_monad$returnS (if (let (imm17 : 1 bits) = ((subrange_vec_dec v__1168 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm17 : 1 bits) = ((subrange_vec_dec v__1168 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__1168 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in ((((rd <> zreg))) /\ ((((((rd <> sp))) /\ (((((concat_vec imm17 imm1612 : 6 words$word)) <> (0b000000w : 6 words$word))))))))) then T else F) | C_SRLI ((v__1169, rsd)) => sail2_state_monad$returnS (if (let (nzui5 : 1 bits) = ((subrange_vec_dec v__1169 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__1169 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__1169 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word))) then T else F) | C_SRAI ((v__1170, rsd)) => sail2_state_monad$returnS (if (let (nzui5 : 1 bits) = ((subrange_vec_dec v__1170 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__1170 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__1170 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word))) then T else F) | C_ANDI ((v__1171, rsd)) => sail2_state_monad$returnS T | C_SUB ((rsd, rs2)) => sail2_state_monad$returnS T | C_XOR ((rsd, rs2)) => sail2_state_monad$returnS T | C_OR ((rsd, rs2)) => sail2_state_monad$returnS T | C_AND ((rsd, rs2)) => sail2_state_monad$returnS T | C_SUBW ((rsd, rs2)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | C_ADDW ((rsd, rs2)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | C_J (v__1172) => sail2_state_monad$returnS T | C_BEQZ ((v__1173, rs)) => sail2_state_monad$returnS T | C_BNEZ ((v__1174, rs)) => sail2_state_monad$returnS T | C_SLLI ((v__1175, rsd)) => sail2_state_monad$returnS (if (let (nzui5 : 1 bits) = ((subrange_vec_dec v__1175 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__1175 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__1175 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in ((((((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word)))) /\ ((((((rsd <> zreg))) /\ (((((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((nzui5 = (0b0w : 1 words$word)))))))))))) then T else F) | C_LWSP ((v__1176, rd)) => sail2_state_monad$returnS (if (((rd <> zreg))) then T else F) | C_LDSP ((v__1177, rd)) => sail2_state_monad$returnS (if ((((((rd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii))))))) then T else F) | C_SWSP ((v__1178, rs2)) => sail2_state_monad$returnS T | C_SDSP ((v__1179, rs2)) => sail2_state_monad$returnS (if ((((( 64 : int):ii) = (( 64 : int):ii)))) then T else F) | C_JR (rs1) => sail2_state_monad$returnS (if (((rs1 <> zreg))) then T else F) | C_JALR (rs1) => sail2_state_monad$returnS (if (((rs1 <> zreg))) then T else F) | C_MV ((rd, rs2)) => sail2_state_monad$returnS (if ((((((rd <> zreg))) /\ (((rs2 <> zreg)))))) then T else F) | C_EBREAK (() ) => sail2_state_monad$returnS T | C_ADD ((rsd, rs2)) => sail2_state_monad$returnS (if ((((((rsd <> zreg))) /\ (((rs2 <> zreg)))))) then T else F) | C_NOP_HINT (v__1180) => sail2_state_monad$returnS (if (let (im5 : 1 bits) = ((subrange_vec_dec v__1180 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (im5 : 1 bits) = ((subrange_vec_dec v__1180 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (im40 : 5 bits) = ((subrange_vec_dec v__1180 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((concat_vec im5 im40 : 6 words$word)) <> (0b000000w : 6 words$word))) then T else F) | C_ADDI_HINT (rsd) => sail2_state_monad$returnS (if (((rsd <> zreg))) then T else F) | C_LI_HINT (v__1181) => sail2_state_monad$returnS T | C_LUI_HINT (v__1182) => sail2_state_monad$returnS (if (let (imm17 : 1 bits) = ((subrange_vec_dec v__1182 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm17 : 1 bits) = ((subrange_vec_dec v__1182 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__1182 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((concat_vec imm17 imm1612 : 6 words$word)) <> (0b000000w : 6 words$word))) then T else F) | C_MV_HINT (rs2) => sail2_state_monad$returnS (if (((rs2 <> zreg))) then T else F) | C_ADD_HINT (rs2) => sail2_state_monad$returnS (if (((rs2 <> zreg))) then T else F) | C_SLLI_HINT ((v__1183, rsd)) => sail2_state_monad$returnS (if (let (nzui5 : 1 bits) = ((subrange_vec_dec v__1183 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__1183 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__1183 (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) in (((((((((concat_vec nzui5 nzui40 : 6 words$word)) = (0b000000w : 6 words$word)))) \/ (((rsd = zreg)))))) /\ (((((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((nzui5 = (0b0w : 1 words$word))))))))) then T else F) | C_SRLI_HINT (rsd) => sail2_state_monad$returnS T | C_SRAI_HINT (rsd) => sail2_state_monad$returnS T | C_FLWSP ((v__1184, rd)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (\ (w__3 : bool) . sail2_state_monad$returnS (if w__3 then T else F)) | C_FSWSP ((v__1185, rs2)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (\ (w__7 : bool) . sail2_state_monad$returnS (if w__7 then T else F)) | C_FLW ((v__1186, rs1, rd)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (\ (w__11 : bool) . sail2_state_monad$returnS (if w__11 then T else F)) | C_FSW ((v__1187, rs1, rs2)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (\ (w__15 : bool) . sail2_state_monad$returnS (if w__15 then T else F)) | C_FLDSP ((v__1188, rd)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (\ (w__19 : bool) . sail2_state_monad$returnS (if w__19 then T else F)) | C_FSDSP ((v__1189, rs2)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (\ (w__23 : bool) . sail2_state_monad$returnS (if w__23 then T else F)) | C_FLD ((v__1190, rs1, rd)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (\ (w__27 : bool) . sail2_state_monad$returnS (if w__27 then T else F)) | C_FSD ((v__1191, rs1, rs2)) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (\ (w__31 : bool) . sail2_state_monad$returnS (if w__31 then T else F)) | C_ILLEGAL (s) => sail2_state_monad$returnS T | _ => sail2_state_monad$returnS F )))`; val _ = Define ` ((encdec_compressed_backwards_matches:(16)words$word ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let v__1192 = arg_ in if (((v__1192 = (0x0001w : 16 words$word)))) then sail2_state_monad$returnS T else if ((((let (nz96 : 4 bits) = ((subrange_vec_dec v__1192 (( 10 : int):ii) (( 7 : int):ii) : 4 words$word)) in let (nz54 : 2 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 11 : int):ii) : 2 words$word)) in let (nz3 : 1 bits) = ((subrange_vec_dec v__1192 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nz2 : 1 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in (((concat_vec nz96 ((concat_vec nz54 ((concat_vec nz3 nz2 : 2 words$word)) : 4 words$word)) : 8 words$word)) <> (0x00w : 8 words$word))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b110w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rsd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzi40 : 5 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in ((((((concat_vec nzi5 nzi40 : 6 words$word)) <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg))))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 32 : int):ii)))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rsd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in ((((rsd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii)))))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rd <> zreg)) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (nzi9 : 1 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzi87 : 2 bits) = ((subrange_vec_dec v__1192 (( 4 : int):ii) (( 3 : int):ii) : 2 words$word)) in let (nzi6 : 1 bits) = ((subrange_vec_dec v__1192 (( 5 : int):ii) (( 5 : int):ii) : 1 words$word)) in let (nzi5 : 1 bits) = ((subrange_vec_dec v__1192 (( 2 : int):ii) (( 2 : int):ii) : 1 words$word)) in let (nzi4 : 1 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 6 : int):ii) : 1 words$word)) in (((concat_vec nzi9 ((concat_vec nzi87 ((concat_vec nzi6 ((concat_vec nzi5 nzi4 : 2 words$word)) : 3 words$word)) : 5 words$word)) : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) = (0b00010w : 5 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((let (rd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (imm17 : 1 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in ((((rd <> zreg))) /\ ((((((rd <> sp))) /\ (((((concat_vec imm17 imm1612 : 6 words$word)) <> (0b000000w : 6 words$word))))))))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (nzui5 : 1 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b100w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 11 : int):ii) (( 10 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((let (nzui5 : 1 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b100w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 11 : int):ii) (( 10 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b100w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 11 : int):ii) (( 10 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100011w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100011w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100011w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100011w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100111w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100111w : 6 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 5 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b110w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then sail2_state_monad$returnS T else if ((((let (rsd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in ((((((concat_vec nzui5 nzui40 : 6 words$word)) <> (0b000000w : 6 words$word)))) /\ ((((((rsd <> zreg))) /\ (((((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((nzui5 = (0b0w : 1 words$word)))))))))))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rd <> zreg)) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in ((((rd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii)))))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b110w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))) then sail2_state_monad$returnS T else if (((((((( 64 : int):ii) = (( 64 : int):ii)))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rs1 : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rs1 <> zreg)) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x8w : 4 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000010w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rs1 : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rs1 <> zreg)) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x9w : 4 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000010w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rs2 : regidx) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in let (rd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in ((((rd <> zreg))) /\ (((rs2 <> zreg))))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x8w : 4 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if (((v__1192 = (0x9002w : 16 words$word)))) then sail2_state_monad$returnS T else if ((((let (rsd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (rs2 : regidx) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in ((((rsd <> zreg))) /\ (((rs2 <> zreg))))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x9w : 4 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (im5 : 1 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (im40 : 5 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((concat_vec im5 im40 : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) = (0b00000w : 5 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((let (rsd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in (rsd <> zreg)) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 12 : int):ii) : 4 words$word)) = (0x0w : 4 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b010w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) = (0b00000w : 5 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (imm17 : 1 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (imm1612 : 5 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((concat_vec imm17 imm1612 : 6 words$word)) <> (0b000000w : 6 words$word))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ ((((((((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) = (0b00000w : 5 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))))))))) then sail2_state_monad$returnS T else if ((((let (rs2 : regidx) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (rs2 <> zreg)) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 7 : int):ii) : 9 words$word)) = (0b100000000w : 9 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rs2 : regidx) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (rs2 <> zreg)) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 7 : int):ii) : 9 words$word)) = (0b100100000w : 9 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((let (rsd : regidx) = ((subrange_vec_dec v__1192 (( 11 : int):ii) (( 7 : int):ii) : 5 words$word)) in let (nzui5 : 1 bits) = ((subrange_vec_dec v__1192 (( 12 : int):ii) (( 12 : int):ii) : 1 words$word)) in let (nzui40 : 5 bits) = ((subrange_vec_dec v__1192 (( 6 : int):ii) (( 2 : int):ii) : 5 words$word)) in (((((((((concat_vec nzui5 nzui40 : 6 words$word)) = (0b000000w : 6 words$word)))) \/ (((rsd = zreg)))))) /\ (((((((( 64 : int):ii) = (( 64 : int):ii)))) \/ (((nzui5 = (0b0w : 1 words$word))))))))) /\ ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100000w : 6 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word))))))) then sail2_state_monad$returnS T else if ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 10 : int):ii) : 6 words$word)) = (0b100001w : 6 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 6 : int):ii) (( 0 : int):ii) : 7 words$word)) = (0b0000001w : 7 words$word))))))) then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))))) (\ (w__4 : bool) . if w__4 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))))) (\ (w__9 : bool) . if w__9 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b011w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))))) (\ (w__14 : bool) . if w__14 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS ((((( 64 : int):ii) = (( 32 : int):ii))))) (sail2_state$and_boolS ((haveRVC () )) ((haveFExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b111w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))))) (\ (w__19 : bool) . if w__19 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))))) (\ (w__24 : bool) . if w__24 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))))) (\ (w__29 : bool) . if w__29 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b001w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))))) (\ (w__34 : bool) . if w__34 then sail2_state_monad$returnS T else sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state$and_boolS (sail2_state_monad$returnS (((((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii)))))))) (sail2_state$and_boolS ((haveRVC () )) ((haveDExt () )))) (sail2_state_monad$returnS ((((((((subrange_vec_dec v__1192 (( 15 : int):ii) (( 13 : int):ii) : 3 words$word)) = (0b101w : 3 words$word)))) /\ (((((subrange_vec_dec v__1192 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))))) (\ (w__39 : bool) . sail2_state_monad$returnS (if w__39 then T else T)))))))))))`; (*val execute_WFI : unit -> M Retired*) val _ = Define ` ((execute_WFI:unit ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__0 : Privilege) . (case w__0 of Machine => sail2_state_monad$seqS (platform_wfi () ) (sail2_state_monad$returnS RETIRE_SUCCESS) | Supervisor => sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__1 : Mstatus) . if (((((get_Mstatus_TW w__1 : 1 words$word)) = (0b1w : 1 words$word)))) then sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$seqS (platform_wfi () ) (sail2_state_monad$returnS RETIRE_SUCCESS)) | User => sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) ))))`; (*val execute_UTYPE : mword ty20 -> mword ty5 -> uop -> M Retired*) val _ = Define ` ((execute_UTYPE:(20)words$word ->(5)words$word -> uop ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rd op= (let (off : xlenbits) = ((EXTS (( 64 : int):ii) ((concat_vec imm (0x000w : 12 words$word) : 32 words$word)) : 64 words$word)) in sail2_state_monad$bindS (case op of RISCV_LUI => sail2_state_monad$returnS off | RISCV_AUIPC => sail2_state_monad$bindS (get_arch_pc () : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$returnS ((add_vec w__0 off : 64 words$word))) ) (\ (ret : xlenbits) . sail2_state_monad$seqS (wX_bits rd ret) (sail2_state_monad$returnS RETIRE_SUCCESS))))`; (*val execute_URET : unit -> M Retired*) val _ = Define ` ((execute_URET:unit ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state$or_boolS ( sail2_state_monad$bindS(haveUsrMode () ) (\ (w__0 : bool) . sail2_state_monad$returnS ((~ w__0)))) (sail2_state_monad$returnS ((~ ((sys_enable_next () )))))) (\ (w__1 : bool) . sail2_state_monad$seqS (if w__1 then handle_illegal () else if ((~ ((ext_check_xret_priv User)))) then sail2_state_monad$returnS ((ext_fail_xret_priv () )) else sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__2 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__3 : 64 words$word) . sail2_state_monad$bindS (exception_handler w__2 (CTL_URET () ) w__3 : ( 64 words$word) M) (\ (w__4 : 64 words$word) . set_next_pc w__4)))) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_STORE_FP : mword ty12 -> mword ty5 -> mword ty5 -> word_width -> M Retired*) val _ = Define ` ((execute_STORE_FP:(12)words$word ->(5)words$word ->(5)words$word -> word_width ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rs2 rs1 width= (let (offset : xlenbits) = ((EXTS (( 64 : int):ii) imm : 64 words$word)) in let (aq, rl, con) = (F, F, F) in sail2_state_monad$bindS (ext_data_get_addr rs1 offset (Write Data) width) (\ (w__0 : unit Ext_DataAddr_Check) . (case w__0 of Ext_DataAddr_Error (e) => let (_ : unit) = (ext_handle_data_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_DataAddr_OK (vaddr) => if ((check_misaligned vaddr width)) then sail2_state_monad$seqS (handle_mem_exception vaddr (E_SAMO_Addr_Align () )) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$bindS (translateAddr vaddr (Write Data) : ( (( 64 words$word), ExceptionType)TR_Result) M) (\ (w__1 : (( 64 words$word), ExceptionType) TR_Result) . (case w__1 of TR_Failure ((e, _)) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) | TR_Address ((addr, _)) => sail2_state_monad$bindS (case width of BYTE => sail2_state_monad$returnS (MemValue () ) | HALF => sail2_state_monad$returnS (MemValue () ) | WORD => mem_write_ea addr (( 4 : int):ii) aq rl F | DOUBLE => mem_write_ea addr (( 8 : int):ii) aq rl F ) (\ (eares : unit MemoryOpResult) . (case eares of MemException (e) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS RETIRE_FAIL) | MemValue (_) => sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val . (case (width, (( 64 : int): ii)) of (BYTE, g__332) => sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) | (HALF, g__333) => sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) | (WORD, g__334) => sail2_state_monad$bindS (mem_write_value addr (( 4 : int): ii) ((subrange_vec_dec rs2_val (( 31 : int): ii) (( 0 : int): ii) : 32 words$word)) aq rl con) (\ (w__4 : bool MemoryOpResult) . process_fstore vaddr w__4) | (DOUBLE, l__9) => if (((l__9 = (( 64 : int): ii)))) then sail2_state_monad$bindS (mem_write_value addr (( 8 : int): ii) rs2_val aq rl con) (\ (w__6 : bool MemoryOpResult) . process_fstore vaddr w__6) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_insts_fext.sail 401:14 - 406:15") (sail2_state_monad$exitS () ) )) )) )) ))))`; (*val execute_STORECON : bool -> bool -> mword ty5 -> mword ty5 -> word_width -> mword ty5 -> M Retired*) val _ = Define ` ((execute_STORECON:bool -> bool ->(5)words$word ->(5)words$word -> word_width ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) aq rl rs2 rs1 width rd= (sail2_state_monad$bindS (speculate_conditional_success () ) (\ (w__0 : bool) . if (((w__0 = F))) then sail2_state_monad$seqS (wX_bits rd ((EXTZ (( 64 : int):ii) (0b1w : 1 words$word) : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS) else sail2_state_monad$bindS (haveAtomics () ) (\ (w__1 : bool) . if w__1 then sail2_state_monad$bindS (ext_data_get_addr rs1 ((zeros_implicit (( 64 : int):ii) : 64 words$word)) (Write Data) width) (\ (w__2 : unit Ext_DataAddr_Check) . (case w__2 of Ext_DataAddr_Error (e) => let (_ : unit) = (ext_handle_data_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_DataAddr_OK (vaddr) => let (aligned : bool) = ((case width of BYTE => T | HALF => (((subrange_vec_dec vaddr (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)) | WORD => (((subrange_vec_dec vaddr (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)) | DOUBLE => (((subrange_vec_dec vaddr (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)) )) in if ((~ aligned)) then sail2_state_monad$seqS (handle_mem_exception vaddr (E_SAMO_Addr_Align () )) (sail2_state_monad$returnS RETIRE_FAIL) else if (((((match_reservation vaddr)) = F))) then sail2_state_monad$seqS (wX_bits rd ((EXTZ (( 64 : int):ii) (0b1w : 1 words$word) : 64 words$word))) (let (_ : unit) = (cancel_reservation () ) in sail2_state_monad$returnS RETIRE_SUCCESS) else sail2_state_monad$bindS (translateAddr vaddr (Write Data) : ( (( 64 words$word), ExceptionType)TR_Result) M) (\ (w__3 : (( 64 words$word), ExceptionType) TR_Result) . (case w__3 of TR_Failure ((e, _)) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) | TR_Address ((addr, _)) => sail2_state_monad$bindS (case (width, (( 64 : int): ii)) of (BYTE, g__317) => mem_write_ea addr (( 1 : int): ii) (((aq /\ rl))) rl T | (HALF, g__318) => mem_write_ea addr (( 2 : int): ii) (((aq /\ rl))) rl T | (WORD, g__319) => mem_write_ea addr (( 4 : int): ii) (((aq /\ rl))) rl T | (DOUBLE, l__4) => if (((l__4 = (( 64 : int): ii)))) then mem_write_ea addr (( 8 : int): ii) (((aq /\ rl))) rl T else internal_error "STORECON expected word or double" ) (\ (eares : unit MemoryOpResult) . (case eares of MemException (e) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS RETIRE_FAIL) | MemValue (_) => sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ rs2_val . sail2_state_monad$bindS (case (width, (( 64 : int): ii)) of (BYTE, g__314) => mem_write_value addr (( 1 : int): ii) ((subrange_vec_dec rs2_val (( 7 : int): ii) (( 0 : int): ii) : 8 words$word)) (((aq /\ rl))) rl T | (HALF, g__315) => mem_write_value addr (( 2 : int): ii) ((subrange_vec_dec rs2_val (( 15 : int): ii) (( 0 : int): ii) : 16 words$word)) (((aq /\ rl))) rl T | (WORD, g__316) => mem_write_value addr (( 4 : int): ii) ((subrange_vec_dec rs2_val (( 31 : int): ii) (( 0 : int): ii) : 32 words$word)) (((aq /\ rl))) rl T | (DOUBLE, l__3) => if (((l__3 = (( 64 : int): ii)))) then mem_write_value addr (( 8 : int): ii) rs2_val (((aq /\ rl))) rl T else internal_error "STORECON expected word or double" ) (\ (res : bool MemoryOpResult) . (case res of MemValue (T) => sail2_state_monad$seqS (wX_bits rd ((EXTZ (( 64 : int):ii) (0b0w : 1 words$word) : 64 words$word))) (let (_ : unit) = (cancel_reservation () ) in sail2_state_monad$returnS RETIRE_SUCCESS) | MemValue (F) => sail2_state_monad$seqS (wX_bits rd ((EXTZ (( 64 : int):ii) (0b1w : 1 words$word) : 64 words$word))) (let (_ : unit) = (cancel_reservation () ) in sail2_state_monad$returnS RETIRE_SUCCESS) | MemException (e) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS RETIRE_FAIL) ))) )) )) )) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL)))))`; (*val execute_STORE : mword ty12 -> mword ty5 -> mword ty5 -> word_width -> bool -> bool -> M Retired*) val _ = Define ` ((execute_STORE:(12)words$word ->(5)words$word ->(5)words$word -> word_width -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rs2 rs1 width aq rl= (let (offset : xlenbits) = ((EXTS (( 64 : int):ii) imm : 64 words$word)) in sail2_state_monad$bindS (ext_data_get_addr rs1 offset (Write Data) width) (\ (w__0 : unit Ext_DataAddr_Check) . (case w__0 of Ext_DataAddr_Error (e) => let (_ : unit) = (ext_handle_data_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_DataAddr_OK (vaddr) => if ((check_misaligned vaddr width)) then sail2_state_monad$seqS (handle_mem_exception vaddr (E_SAMO_Addr_Align () )) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$bindS (translateAddr vaddr (Write Data) : ( (( 64 words$word), ExceptionType)TR_Result) M) (\ (w__1 : (( 64 words$word), ExceptionType) TR_Result) . (case w__1 of TR_Failure ((e, _)) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) | TR_Address ((paddr, _)) => sail2_state_monad$bindS (case width of BYTE => mem_write_ea paddr (( 1 : int):ii) aq rl F | HALF => mem_write_ea paddr (( 2 : int):ii) aq rl F | WORD => mem_write_ea paddr (( 4 : int):ii) aq rl F | DOUBLE => mem_write_ea paddr (( 8 : int):ii) aq rl F ) (\ (eares : unit MemoryOpResult) . (case eares of MemException (e) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) | MemValue (_) => sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ rs2_val . sail2_state_monad$bindS (case (width, (( 64 : int): ii)) of (BYTE, g__306) => mem_write_value paddr (( 1 : int): ii) ((subrange_vec_dec rs2_val (( 7 : int): ii) (( 0 : int): ii) : 8 words$word)) aq rl F | (HALF, g__307) => mem_write_value paddr (( 2 : int): ii) ((subrange_vec_dec rs2_val (( 15 : int): ii) (( 0 : int): ii) : 16 words$word)) aq rl F | (WORD, g__308) => mem_write_value paddr (( 4 : int): ii) ((subrange_vec_dec rs2_val (( 31 : int): ii) (( 0 : int): ii) : 32 words$word)) aq rl F | (DOUBLE, l__1) => if (((l__1 = (( 64 : int): ii)))) then mem_write_value paddr (( 8 : int): ii) rs2_val aq rl F else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_insts_base.sail 394:47 - 399:15") (sail2_state_monad$exitS () ) ) (\ (res : bool MemoryOpResult) . (case res of MemValue (T) => sail2_state_monad$returnS RETIRE_SUCCESS | MemValue (F) => internal_error "store got false from mem_write_value" | MemException (e) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) ))) )) )) ))))`; (*val execute_SRET : unit -> M Retired*) val _ = Define ` ((execute_SRET:unit ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__0 : Privilege) . sail2_state_monad$bindS (case w__0 of User => sail2_state_monad$returnS T | Supervisor => sail2_state$or_boolS ( sail2_state_monad$bindS(haveSupMode () ) (\ (w__1 : bool) . sail2_state_monad$returnS ((~ w__1)))) ( sail2_state_monad$bindS(sail2_state_monad$read_regS mstatus_ref) (\ (w__2 : Mstatus) . sail2_state_monad$returnS (((((get_Mstatus_TSR w__2 : 1 words$word)) = (0b1w : 1 words$word)))))) | Machine => sail2_state_monad$bindS (haveSupMode () ) (\ (w__4 : bool) . sail2_state_monad$returnS ((~ w__4))) ) (\ (sret_illegal : bool) . if sret_illegal then sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) else if ((~ ((ext_check_xret_priv Supervisor)))) then let (_ : unit) = (ext_fail_xret_priv () ) in sail2_state_monad$returnS RETIRE_FAIL else sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__5 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__6 : 64 words$word) . sail2_state_monad$bindS (exception_handler w__5 (CTL_SRET () ) w__6 : ( 64 words$word) M) (\ (w__7 : 64 words$word) . sail2_state_monad$seqS (set_next_pc w__7) (sail2_state_monad$returnS RETIRE_SUCCESS))))))))`; (*val execute_SHIFTW : mword ty5 -> mword ty5 -> mword ty5 -> sop -> M Retired*) val _ = Define ` ((execute_SHIFTW:(5)words$word ->(5)words$word ->(5)words$word -> sop ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) shamt rs1 rd op= (sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val = ((subrange_vec_dec w__0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in let (result : 32 bits) = ((case op of RISCV_SLLI => (shift_bits_left rs1_val shamt : 32 words$word) | RISCV_SRLI => (shift_bits_right rs1_val shamt : 32 words$word) | RISCV_SRAI => (shift_right_arith32 rs1_val shamt : 32 words$word) )) in sail2_state_monad$seqS (wX_bits rd ((EXTS (( 64 : int):ii) result : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))))`; (*val execute_SHIFTIWOP : mword ty5 -> mword ty5 -> mword ty5 -> sopw -> M Retired*) val _ = Define ` ((execute_SHIFTIWOP:(5)words$word ->(5)words$word ->(5)words$word -> sopw ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) shamt rs1 rd op= (sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val . let (result : 32 bits) = ((case op of RISCV_SLLIW => (shift_bits_left ((subrange_vec_dec rs1_val (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) shamt : 32 words$word) | RISCV_SRLIW => (shift_bits_right ((subrange_vec_dec rs1_val (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) shamt : 32 words$word) | RISCV_SRAIW => (shift_right_arith32 ((subrange_vec_dec rs1_val (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) shamt : 32 words$word) )) in sail2_state_monad$seqS (wX_bits rd ((EXTS (( 64 : int):ii) result : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))))`; (*val execute_SHIFTIOP : mword ty6 -> mword ty5 -> mword ty5 -> sop -> M Retired*) val _ = Define ` ((execute_SHIFTIOP:(6)words$word ->(5)words$word ->(5)words$word -> sop ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) shamt rs1 rd op= (sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val . let (result : xlenbits) = ((case op of RISCV_SLLI => (shift_bits_left rs1_val shamt : 64 words$word) | RISCV_SRLI => (shift_bits_right rs1_val shamt : 64 words$word) | RISCV_SRAI => (shift_right_arith64 rs1_val shamt : 64 words$word) )) in sail2_state_monad$seqS (wX_bits rd result) (sail2_state_monad$returnS RETIRE_SUCCESS))))`; (*val execute_SFENCE_VMA : mword ty5 -> mword ty5 -> M Retired*) val _ = Define ` ((execute_SFENCE_VMA:(5)words$word ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs1 rs2= (sail2_state_monad$bindS (if (((rs1 = (0b00000w : 5 words$word)))) then sail2_state_monad$returnS NONE else sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$returnS (SOME w__0))) (\ (addr : xlenbits option) . sail2_state_monad$bindS (if (((rs2 = (0b00000w : 5 words$word)))) then sail2_state_monad$returnS NONE else sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . sail2_state_monad$returnS (SOME w__1))) (\ (asid : xlenbits option) . sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__2 : Privilege) . (case w__2 of User => sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) | Supervisor => sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__3 : Mstatus) . sail2_state_monad$bindS (sail2_state_monad$read_regS mstatus_ref) (\ (w__4 : Mstatus) . let p__310 = (architecture ((get_mstatus_SXL w__3 : 2 words$word)), (get_Mstatus_TVM w__4 : 1 words$word)) in (case p__310 of (SOME (g__309), b__0) => if (((b__0 = (0b1w : 1 words$word)))) then sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) else if (((b__0 = (0b0w : 1 words$word)))) then sail2_state_monad$seqS (flush_TLB asid addr) (sail2_state_monad$returnS RETIRE_SUCCESS) else (case (SOME g__309, b__0) of (_, _) => internal_error "unimplemented sfence architecture" ) | (_, _) => internal_error "unimplemented sfence architecture" ))) | Machine => sail2_state_monad$seqS (flush_TLB asid addr) (sail2_state_monad$returnS RETIRE_SUCCESS) ))))))`; (*val execute_RTYPEW : mword ty5 -> mword ty5 -> mword ty5 -> ropw -> M Retired*) val _ = Define ` ((execute_RTYPEW:(5)words$word ->(5)words$word ->(5)words$word -> ropw ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rd op= (sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val = ((subrange_vec_dec w__0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val = ((subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in let (result : 32 bits) = ((case op of RISCV_ADDW => (add_vec rs1_val rs2_val : 32 words$word) | RISCV_SUBW => (sub_vec rs1_val rs2_val : 32 words$word) | RISCV_SLLW => (shift_bits_left rs1_val ((subrange_vec_dec rs2_val (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) : 32 words$word) | RISCV_SRLW => (shift_bits_right rs1_val ((subrange_vec_dec rs2_val (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) : 32 words$word) | RISCV_SRAW => (shift_right_arith32 rs1_val ((subrange_vec_dec rs2_val (( 4 : int):ii) (( 0 : int):ii) : 5 words$word)) : 32 words$word) )) in sail2_state_monad$seqS (wX_bits rd ((EXTS (( 64 : int):ii) result : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS)))))`; (*val execute_RTYPE : mword ty5 -> mword ty5 -> mword ty5 -> rop -> M Retired*) val _ = Define ` ((execute_RTYPE:(5)words$word ->(5)words$word ->(5)words$word -> rop ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rd op= (sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val . sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ rs2_val . let (result : xlenbits) = ((case op of RISCV_ADD => (add_vec rs1_val rs2_val : 64 words$word) | RISCV_SLT => (EXTZ (( 64 : int):ii) ((bool_to_bits ((zopz0zI_s rs1_val rs2_val)) : 1 words$word)) : 64 words$word) | RISCV_SLTU => (EXTZ (( 64 : int):ii) ((bool_to_bits ((zopz0zI_u rs1_val rs2_val)) : 1 words$word)) : 64 words$word) | RISCV_AND => (and_vec rs1_val rs2_val : 64 words$word) | RISCV_OR => (or_vec rs1_val rs2_val : 64 words$word) | RISCV_XOR => (xor_vec rs1_val rs2_val : 64 words$word) | RISCV_SLL => (shift_bits_left rs1_val ((subrange_vec_dec rs2_val (( 5 : int):ii) (( 0 : int):ii) : 6 words$word)) : 64 words$word) | RISCV_SRL => (shift_bits_right rs1_val ((subrange_vec_dec rs2_val (( 5 : int):ii) (( 0 : int):ii) : 6 words$word)) : 64 words$word) | RISCV_SUB => (sub_vec rs1_val rs2_val : 64 words$word) | RISCV_SRA => (shift_right_arith64 rs1_val ((subrange_vec_dec rs2_val (( 5 : int):ii) (( 0 : int):ii) : 6 words$word)) : 64 words$word) )) in sail2_state_monad$seqS (wX_bits rd result) (sail2_state_monad$returnS RETIRE_SUCCESS)))))`; (*val execute_RISCV_JALR : mword ty12 -> mword ty5 -> mword ty5 -> M Retired*) val _ = Define ` ((execute_RISCV_JALR:(12)words$word ->(5)words$word ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rs1 rd= (sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let (t : xlenbits) = ((add_vec w__0 ((EXTS (( 64 : int):ii) imm : 64 words$word)) : 64 words$word)) in (case ((ext_control_check_addr t)) of Ext_ControlAddr_Error (e) => let (_ : unit) = (ext_handle_control_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_ControlAddr_OK (addr) => let target = ((update_vec_dec addr (( 0 : int):ii) B0 : 64 words$word)) in sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((bit_to_bool ((access_vec_dec target (( 1 : int):ii)))))) ( sail2_state_monad$bindS(haveRVC () ) (\ (w__1 : bool) . sail2_state_monad$returnS ((~ w__1))))) (\ (w__2 : bool) . if w__2 then sail2_state_monad$seqS (handle_mem_exception target (E_Fetch_Addr_Align () )) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$bindS (get_next_pc () : ( 64 words$word) M) (\ (w__3 : 64 words$word) . sail2_state_monad$seqS (sail2_state_monad$seqS (wX_bits rd w__3) (set_next_pc target)) (sail2_state_monad$returnS RETIRE_SUCCESS))) ))))`; (*val execute_RISCV_JAL : mword ty21 -> mword ty5 -> M Retired*) val _ = Define ` ((execute_RISCV_JAL:(21)words$word ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rd= (sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let (t : xlenbits) = ((add_vec w__0 ((EXTS (( 64 : int):ii) imm : 64 words$word)) : 64 words$word)) in (case ((ext_control_check_pc t)) of Ext_ControlAddr_Error (e) => let (_ : unit) = (ext_handle_control_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_ControlAddr_OK (target) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((bit_to_bool ((access_vec_dec target (( 1 : int):ii)))))) ( sail2_state_monad$bindS(haveRVC () ) (\ (w__1 : bool) . sail2_state_monad$returnS ((~ w__1))))) (\ (w__2 : bool) . if w__2 then sail2_state_monad$seqS (handle_mem_exception target (E_Fetch_Addr_Align () )) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$bindS (get_next_pc () : ( 64 words$word) M) (\ (w__3 : 64 words$word) . sail2_state_monad$seqS (sail2_state_monad$seqS (wX_bits rd w__3) (set_next_pc target)) (sail2_state_monad$returnS RETIRE_SUCCESS))) ))))`; (*val execute_REMW : mword ty5 -> mword ty5 -> mword ty5 -> bool -> M Retired*) val _ = Define ` ((execute_REMW:(5)words$word ->(5)words$word ->(5)words$word -> bool ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rd s= (sail2_state_monad$bindS (haveMulDiv () ) (\ (w__0 : bool) . if w__0 then sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs1_val = ((subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__2 : 64 words$word) . let rs2_val = ((subrange_vec_dec w__2 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in let (rs1_int : ii) = (if s then integer_word$w2i rs1_val else lem$w2ui rs1_val) in let (rs2_int : ii) = (if s then integer_word$w2i rs2_val else lem$w2ui rs2_val) in let (r : ii) = (if (((rs2_int = (( 0 : int):ii)))) then rs1_int else hardware_mod rs1_int rs2_int) in sail2_state_monad$seqS (wX_bits rd ((EXTS (( 64 : int):ii) ((to_bits (( 32 : int):ii) r : 32 words$word)) : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_REM : mword ty5 -> mword ty5 -> mword ty5 -> bool -> M Retired*) val _ = Define ` ((execute_REM:(5)words$word ->(5)words$word ->(5)words$word -> bool ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rd s= (sail2_state_monad$bindS (haveMulDiv () ) (\ (w__0 : bool) . if w__0 then sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val . sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ rs2_val . let (rs1_int : ii) = (if s then integer_word$w2i rs1_val else lem$w2ui rs1_val) in let (rs2_int : ii) = (if s then integer_word$w2i rs2_val else lem$w2ui rs2_val) in let (r : ii) = (if (((rs2_int = (( 0 : int):ii)))) then rs1_int else hardware_mod rs1_int rs2_int) in sail2_state_monad$seqS (wX_bits rd ((to_bits (( 64 : int):ii) r : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_MULW : mword ty5 -> mword ty5 -> mword ty5 -> M Retired*) val _ = Define ` ((execute_MULW:(5)words$word ->(5)words$word ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rd= (sail2_state_monad$bindS (haveMulDiv () ) (\ (w__0 : bool) . if w__0 then sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs1_val = ((subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__2 : 64 words$word) . let rs2_val = ((subrange_vec_dec w__2 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in let (rs1_int : ii) = (integer_word$w2i rs1_val) in let (rs2_int : ii) = (integer_word$w2i rs2_val) in let result32 = ((subrange_vec_dec ((to_bits (( 64 : int):ii) ((rs1_int * rs2_int)) : 64 words$word)) (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in let (result : xlenbits) = ((EXTS (( 64 : int):ii) result32 : 64 words$word)) in sail2_state_monad$seqS (wX_bits rd result) (sail2_state_monad$returnS RETIRE_SUCCESS))) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_MUL : mword ty5 -> mword ty5 -> mword ty5 -> bool -> bool -> bool -> M Retired*) val _ = Define ` ((execute_MUL:(5)words$word ->(5)words$word ->(5)words$word -> bool -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rd high signed1 signed2= (sail2_state_monad$bindS (haveMulDiv () ) (\ (w__0 : bool) . if w__0 then sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val . sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ rs2_val . let (rs1_int : ii) = (if signed1 then integer_word$w2i rs1_val else lem$w2ui rs1_val) in let (rs2_int : ii) = (if signed2 then integer_word$w2i rs2_val else lem$w2ui rs2_val) in let result_wide = ((to_bits (((( 2 : int):ii) * (( 64 : int):ii))) ((rs1_int * rs2_int)) : 128 words$word)) in let result = (if high then (subrange_vec_dec result_wide (((((( 2 : int):ii) * (( 64 : int):ii))) - (( 1 : int):ii))) (( 64 : int):ii) : 64 words$word) else (subrange_vec_dec result_wide (((( 64 : int):ii) - (( 1 : int):ii))) (( 0 : int):ii) : 64 words$word)) in sail2_state_monad$seqS (wX_bits rd result) (sail2_state_monad$returnS RETIRE_SUCCESS))) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_MRET : unit -> M Retired*) val _ = Define ` ((execute_MRET:unit ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__0 : Privilege) . if (((w__0 <> Machine))) then sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) else if ((~ ((ext_check_xret_priv Machine)))) then let (_ : unit) = (ext_fail_xret_priv () ) in sail2_state_monad$returnS RETIRE_FAIL else sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__1 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . sail2_state_monad$bindS (exception_handler w__1 (CTL_MRET () ) w__2 : ( 64 words$word) M) (\ (w__3 : 64 words$word) . sail2_state_monad$seqS (set_next_pc w__3) (sail2_state_monad$returnS RETIRE_SUCCESS)))))))`; (*val execute_LOAD_FP : mword ty12 -> mword ty5 -> mword ty5 -> word_width -> M Retired*) val _ = Define ` ((execute_LOAD_FP:(12)words$word ->(5)words$word ->(5)words$word -> word_width ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rs1 rd width= (let (offset : xlenbits) = ((EXTS (( 64 : int):ii) imm : 64 words$word)) in sail2_state_monad$bindS (ext_data_get_addr rs1 offset (Read Data) width) (\ (w__0 : unit Ext_DataAddr_Check) . (case w__0 of Ext_DataAddr_Error (e) => let (_ : unit) = (ext_handle_data_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_DataAddr_OK (vaddr) => if ((check_misaligned vaddr width)) then sail2_state_monad$seqS (handle_mem_exception vaddr (E_Load_Addr_Align () )) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$bindS (translateAddr vaddr (Read Data) : ( (( 64 words$word), ExceptionType)TR_Result) M) (\ (w__1 : (( 64 words$word), ExceptionType) TR_Result) . (case w__1 of TR_Failure ((e, _)) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) | TR_Address ((addr, _)) => let (aq, rl, res) = (F, F, F) in (case (width, (( 64 : int): ii)) of (BYTE, g__329) => sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) | (HALF, g__330) => sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) | (WORD, g__331) => sail2_state_monad$bindS (mem_read (Read Data) addr (( 4 : int): ii) aq rl res : ( ( 32 words$word) MemoryOpResult) M) (\ (w__2 : ( 32 words$word) MemoryOpResult) . process_fload32 rd vaddr w__2) | (DOUBLE, l__8) => if (((l__8 = (( 64 : int): ii)))) then sail2_state_monad$bindS (mem_read (Read Data) addr (( 8 : int): ii) aq rl res : ( ( 64 words$word) MemoryOpResult) M) (\ (w__4 : ( 64 words$word) MemoryOpResult) . process_fload64 rd vaddr w__4) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_insts_fext.sail 331:10 - 338:11") (sail2_state_monad$exitS () ) ) )) ))))`; (*val execute_LOADRES : bool -> bool -> mword ty5 -> word_width -> mword ty5 -> M Retired*) val _ = Define ` ((execute_LOADRES:bool -> bool ->(5)words$word -> word_width ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) aq rl rs1 width rd= (sail2_state_monad$bindS (haveAtomics () ) (\ (w__0 : bool) . if w__0 then sail2_state_monad$bindS (ext_data_get_addr rs1 ((zeros_implicit (( 64 : int):ii) : 64 words$word)) (Read Data) width) (\ (w__1 : unit Ext_DataAddr_Check) . (case w__1 of Ext_DataAddr_Error (e) => let (_ : unit) = (ext_handle_data_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_DataAddr_OK (vaddr) => let (aligned : bool) = ((case width of BYTE => T | HALF => (((subrange_vec_dec vaddr (( 0 : int):ii) (( 0 : int):ii) : 1 words$word)) = (0b0w : 1 words$word)) | WORD => (((subrange_vec_dec vaddr (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)) | DOUBLE => (((subrange_vec_dec vaddr (( 2 : int):ii) (( 0 : int):ii) : 3 words$word)) = (0b000w : 3 words$word)) )) in if ((~ aligned)) then sail2_state_monad$seqS (handle_mem_exception vaddr (E_Load_Addr_Align () )) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$bindS (translateAddr vaddr (Read Data) : ( (( 64 words$word), ExceptionType)TR_Result) M) (\ (w__2 : (( 64 words$word), ExceptionType) TR_Result) . (case w__2 of TR_Failure ((e, _)) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) | TR_Address ((addr, _)) => (case (width, (( 64 : int): ii)) of (BYTE, g__311) => sail2_state_monad$bindS (mem_read (Read Data) addr (( 1 : int): ii) aq (((aq /\ rl))) T : ( ( 8 words$word) MemoryOpResult) M) (\ (w__3 : ( 8 words$word) MemoryOpResult) . process_loadres rd vaddr w__3 F) | (HALF, g__312) => sail2_state_monad$bindS (mem_read (Read Data) addr (( 2 : int): ii) aq (((aq /\ rl))) T : ( ( 16 words$word) MemoryOpResult) M) (\ (w__5 : ( 16 words$word) MemoryOpResult) . process_loadres rd vaddr w__5 F) | (WORD, g__313) => sail2_state_monad$bindS (mem_read (Read Data) addr (( 4 : int): ii) aq (((aq /\ rl))) T : ( ( 32 words$word) MemoryOpResult) M) (\ (w__7 : ( 32 words$word) MemoryOpResult) . process_loadres rd vaddr w__7 F) | (DOUBLE, l__2) => if (((l__2 = (( 64 : int): ii)))) then sail2_state_monad$bindS (mem_read (Read Data) addr (( 8 : int): ii) aq (((aq /\ rl))) T : ( ( 64 words$word) MemoryOpResult) M) (\ (w__9 : ( 64 words$word) MemoryOpResult) . process_loadres rd vaddr w__9 F) else internal_error "Unexpected AMO width" ) )) )) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_LOAD : mword ty12 -> mword ty5 -> mword ty5 -> bool -> word_width -> bool -> bool -> M Retired*) val _ = Define ` ((execute_LOAD:(12)words$word ->(5)words$word ->(5)words$word -> bool -> word_width -> bool -> bool ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rs1 rd is_unsigned width aq rl= (let (offset : xlenbits) = ((EXTS (( 64 : int):ii) imm : 64 words$word)) in sail2_state_monad$bindS (ext_data_get_addr rs1 offset (Read Data) width) (\ (w__0 : unit Ext_DataAddr_Check) . (case w__0 of Ext_DataAddr_Error (e) => let (_ : unit) = (ext_handle_data_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_DataAddr_OK (vaddr) => if ((check_misaligned vaddr width)) then sail2_state_monad$seqS (handle_mem_exception vaddr (E_Load_Addr_Align () )) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$bindS (translateAddr vaddr (Read Data) : ( (( 64 words$word), ExceptionType)TR_Result) M) (\ (w__1 : (( 64 words$word), ExceptionType) TR_Result) . (case w__1 of TR_Failure ((e, _)) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) | TR_Address ((paddr, _)) => (case (width, (( 64 : int): ii)) of (BYTE, g__303) => sail2_state_monad$bindS (mem_read (Read Data) paddr (( 1 : int): ii) aq rl F : ( ( 8 words$word) MemoryOpResult) M) (\ (w__2 : ( 8 words$word) MemoryOpResult) . process_load rd vaddr w__2 is_unsigned) | (HALF, g__304) => sail2_state_monad$bindS (mem_read (Read Data) paddr (( 2 : int): ii) aq rl F : ( ( 16 words$word) MemoryOpResult) M) (\ (w__4 : ( 16 words$word) MemoryOpResult) . process_load rd vaddr w__4 is_unsigned) | (WORD, g__305) => sail2_state_monad$bindS (mem_read (Read Data) paddr (( 4 : int): ii) aq rl F : ( ( 32 words$word) MemoryOpResult) M) (\ (w__6 : ( 32 words$word) MemoryOpResult) . process_load rd vaddr w__6 is_unsigned) | (DOUBLE, l__0) => if (((l__0 = (( 64 : int): ii)))) then sail2_state_monad$bindS (mem_read (Read Data) paddr (( 8 : int): ii) aq rl F : ( ( 64 words$word) MemoryOpResult) M) (\ (w__8 : ( 64 words$word) MemoryOpResult) . process_load rd vaddr w__8 is_unsigned) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at model/riscv_insts_base.sail 329:10 - 338:11") (sail2_state_monad$exitS () ) ) )) ))))`; (*val execute_ITYPE : mword ty12 -> mword ty5 -> mword ty5 -> iop -> M Retired*) val _ = Define ` ((execute_ITYPE:(12)words$word ->(5)words$word ->(5)words$word -> iop ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rs1 rd op= (sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val . let (immext : xlenbits) = ((EXTS (( 64 : int):ii) imm : 64 words$word)) in let (result : xlenbits) = ((case op of RISCV_ADDI => (add_vec rs1_val immext : 64 words$word) | RISCV_SLTI => (EXTZ (( 64 : int):ii) ((bool_to_bits ((zopz0zI_s rs1_val immext)) : 1 words$word)) : 64 words$word) | RISCV_SLTIU => (EXTZ (( 64 : int):ii) ((bool_to_bits ((zopz0zI_u rs1_val immext)) : 1 words$word)) : 64 words$word) | RISCV_ANDI => (and_vec rs1_val immext : 64 words$word) | RISCV_ORI => (or_vec rs1_val immext : 64 words$word) | RISCV_XORI => (xor_vec rs1_val immext : 64 words$word) )) in sail2_state_monad$seqS (wX_bits rd result) (sail2_state_monad$returnS RETIRE_SUCCESS))))`; (*val execute_ILLEGAL : mword ty32 -> M Retired*) val _ = Define ` ((execute_ILLEGAL:(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= (sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL)))`; (*val execute_F_UN_TYPE_S : mword ty5 -> mword ty5 -> f_un_op_S -> M Retired*) val _ = Define ` ((execute_F_UN_TYPE_S:(5)words$word ->(5)words$word -> f_un_op_S ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg0 arg1 arg2= (let merge_var = (arg0, arg1, arg2) in (case merge_var of (rs1, rd, FCLASS_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in let (rd_val_10b : 10 bits) = (if ((f_is_neg_inf_S rs1_val_S)) then (0b0000000001w : 10 words$word) else if ((f_is_neg_norm_S rs1_val_S)) then (0b0000000010w : 10 words$word) else if ((f_is_neg_subnorm_S rs1_val_S)) then (0b0000000100w : 10 words$word) else if ((f_is_neg_zero_S rs1_val_S)) then (0b0000001000w : 10 words$word) else if ((f_is_pos_zero_S rs1_val_S)) then (0b0000010000w : 10 words$word) else if ((f_is_pos_subnorm_S rs1_val_S)) then (0b0000100000w : 10 words$word) else if ((f_is_pos_norm_S rs1_val_S)) then (0b0001000000w : 10 words$word) else if ((f_is_pos_inf_S rs1_val_S)) then (0b0010000000w : 10 words$word) else if ((f_is_SNaN_S rs1_val_S)) then (0b0100000000w : 10 words$word) else if ((f_is_QNaN_S rs1_val_S)) then (0b1000000000w : 10 words$word) else (zeros_implicit (( 10 : int):ii) : 10 words$word)) in sail2_state_monad$seqS (wX_bits rd ((EXTZ (( 64 : int):ii) rd_val_10b : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS)) | (rs1, rd, FMV_X_W) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((subrange_vec_dec w__0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in let (rd_val_X : xlenbits) = ((EXTS (( 64 : int):ii) rs1_val_S : 64 words$word)) in sail2_state_monad$seqS (wX_bits rd rd_val_X) (sail2_state_monad$returnS RETIRE_SUCCESS)) | (rs1, rd, FMV_W_X) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val_X . let rd_val_S = ((subrange_vec_dec rs1_val_X (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in sail2_state_monad$seqS (wF_bits rd ((nan_box rd_val_S : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS)) )))`; (*val execute_F_UN_TYPE_D : mword ty5 -> mword ty5 -> f_un_op_D -> M Retired*) val _ = Define ` ((execute_F_UN_TYPE_D:(5)words$word ->(5)words$word -> f_un_op_D ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg0 arg1 arg2= (let merge_var = (arg0, arg1, arg2) in (case merge_var of (rs1, rd, FCLASS_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . let (rd_val_10b : 10 bits) = (if ((f_is_neg_inf_D rs1_val_D)) then (0b0000000001w : 10 words$word) else if ((f_is_neg_norm_D rs1_val_D)) then (0b0000000010w : 10 words$word) else if ((f_is_neg_subnorm_D rs1_val_D)) then (0b0000000100w : 10 words$word) else if ((f_is_neg_zero_D rs1_val_D)) then (0b0000001000w : 10 words$word) else if ((f_is_pos_zero_D rs1_val_D)) then (0b0000010000w : 10 words$word) else if ((f_is_pos_subnorm_D rs1_val_D)) then (0b0000100000w : 10 words$word) else if ((f_is_pos_norm_D rs1_val_D)) then (0b0001000000w : 10 words$word) else if ((f_is_pos_inf_D rs1_val_D)) then (0b0010000000w : 10 words$word) else if ((f_is_SNaN_D rs1_val_D)) then (0b0100000000w : 10 words$word) else if ((f_is_QNaN_D rs1_val_D)) then (0b1000000000w : 10 words$word) else (zeros_implicit (( 10 : int):ii) : 10 words$word)) in sail2_state_monad$seqS (wX_bits rd ((EXTZ (( 64 : int):ii) rd_val_10b : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS)) | (rs1, rd, FMV_X_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . let rd_val_X = rs1_val_D in sail2_state_monad$seqS (wX_bits rd rd_val_X) (sail2_state_monad$returnS RETIRE_SUCCESS)) | (rs1, rd, FMV_D_X) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val_X . let rd_val_D = rs1_val_X in sail2_state_monad$seqS (wF_bits rd rd_val_D) (sail2_state_monad$returnS RETIRE_SUCCESS)) )))`; (*val execute_F_UN_RM_TYPE_S : mword ty5 -> rounding_mode -> mword ty5 -> f_un_rm_op_S -> M Retired*) val _ = Define ` ((execute_F_UN_RM_TYPE_S:(5)words$word -> rounding_mode ->(5)words$word -> f_un_rm_op_S ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg0 arg1 arg2 arg3= (let merge_var = (arg0, arg1, arg2, arg3) in (case merge_var of (rs1, rm, rd, FSQRT_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_f32Sqrt rm_3b rs1_val_S : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_S) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd ((nan_box rd_val_S : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_W_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_f32ToI32 rm_3b rs1_val_S : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_W) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd ((EXTS (( 64 : int):ii) rd_val_W : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_WU_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_f32ToUi32 rm_3b rs1_val_S : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_WU) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd ((EXTS (( 64 : int):ii) rd_val_WU : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_S_W) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_W = ((subrange_vec_dec w__0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_i32ToF32 rm_3b rs1_val_W : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_S) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd ((nan_box rd_val_S : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_S_WU) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_WU = ((subrange_vec_dec w__0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_ui32ToF32 rm_3b rs1_val_WU : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_S) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd ((nan_box rd_val_S : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_L_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_f32ToI64 rm_3b rs1_val_S : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_L) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd rd_val_L)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_LU_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_f32ToUi64 rm_3b rs1_val_S : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_LU) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd rd_val_LU)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_S_L) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val_L . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_i64ToF32 rm_3b rs1_val_L : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_S) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd ((nan_box rd_val_S : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_S_LU) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val_LU . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_ui64ToF32 rm_3b rs1_val_LU : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_S) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd ((nan_box rd_val_S : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) )))`; (*val execute_F_UN_RM_TYPE_D : mword ty5 -> rounding_mode -> mword ty5 -> f_un_rm_op_D -> M Retired*) val _ = Define ` ((execute_F_UN_RM_TYPE_D:(5)words$word -> rounding_mode ->(5)words$word -> f_un_rm_op_D ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg0 arg1 arg2 arg3= (let merge_var = (arg0, arg1, arg2, arg3) in (case merge_var of (rs1, rm, rd, FSQRT_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_f64Sqrt rm_3b rs1_val_D : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_D) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd rd_val_D)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_W_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_f64ToI32 rm_3b rs1_val_D : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_W) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd ((EXTS (( 64 : int):ii) rd_val_W : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_WU_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_f64ToUi32 rm_3b rs1_val_D : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_WU) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd ((EXTS (( 64 : int):ii) rd_val_WU : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_D_W) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_W = ((subrange_vec_dec w__0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_i32ToF64 rm_3b rs1_val_W : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_D) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd rd_val_D)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_D_WU) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_WU = ((subrange_vec_dec w__0 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_ui32ToF64 rm_3b rs1_val_WU : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_D) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd rd_val_D)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_S_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_f64ToF32 rm_3b rs1_val_D : (( 5 words$word # 32 words$word)) M) (\ varstup . let (fflags, rd_val_S) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd ((nan_box rd_val_S : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_D_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__1 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__1 : 3 words$word)) in sail2_state_monad$bindS (riscv_f32ToF64 rm_3b rs1_val_S : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_D) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd rd_val_D)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_L_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_f64ToI64 rm_3b rs1_val_D : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_L) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd rd_val_L)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_LU_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_f64ToUi64 rm_3b rs1_val_D : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_LU) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd rd_val_LU)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_D_L) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val_L . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_i64ToF64 rm_3b rs1_val_L : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_D) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd rd_val_D)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs1, rm, rd, FCVT_D_LU) => sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val_LU . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (riscv_ui64ToF64 rm_3b rs1_val_LU : (( 5 words$word # 64 words$word)) M) (\ varstup . let (fflags, rd_val_D) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd rd_val_D)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) )))`; (*val execute_F_MADD_TYPE_S : mword ty5 -> mword ty5 -> mword ty5 -> rounding_mode -> mword ty5 -> f_madd_op_S -> M Retired*) val _ = Define ` ((execute_F_MADD_TYPE_S:(5)words$word ->(5)words$word ->(5)words$word -> rounding_mode ->(5)words$word -> f_madd_op_S ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs3 rs2 rs1 rm rd op= (sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_32b = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_32b = ((nan_unbox w__1 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs3 : ( 64 words$word) M) (\ (w__2 : 64 words$word) . let rs3_val_32b = ((nan_unbox w__2 : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__3 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__3 : 3 words$word)) in sail2_state_monad$bindS (case op of FMADD_S => (riscv_f32MulAdd rm_3b rs1_val_32b rs2_val_32b rs3_val_32b : (( 5 words$word # 32 words$word)) M) | FMSUB_S => (riscv_f32MulAdd rm_3b rs1_val_32b rs2_val_32b ((negate_S rs3_val_32b : 32 words$word)) : (( 5 words$word # 32 words$word)) M) | FNMSUB_S => (riscv_f32MulAdd rm_3b ((negate_S rs1_val_32b : 32 words$word)) rs2_val_32b rs3_val_32b : (( 5 words$word # 32 words$word)) M) | FNMADD_S => (riscv_f32MulAdd rm_3b ((negate_S rs1_val_32b : 32 words$word)) rs2_val_32b ((negate_S rs3_val_32b : 32 words$word)) : (( 5 words$word # 32 words$word)) M) ) (\ varstup . let ((fflags : 5 bits), (rd_val_32b : 32 bits)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd ((nan_box rd_val_32b : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS))))))))`; (*val execute_F_MADD_TYPE_D : mword ty5 -> mword ty5 -> mword ty5 -> rounding_mode -> mword ty5 -> f_madd_op_D -> M Retired*) val _ = Define ` ((execute_F_MADD_TYPE_D:(5)words$word ->(5)words$word ->(5)words$word -> rounding_mode ->(5)words$word -> f_madd_op_D ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs3 rs2 rs1 rm rd op= (sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_64b . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_64b . sail2_state_monad$bindS (rF_bits rs3 : ( 64 words$word) M) (\ rs3_val_64b . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (case op of FMADD_D => (riscv_f64MulAdd rm_3b rs1_val_64b rs2_val_64b rs3_val_64b : (( 5 words$word # 64 words$word)) M) | FMSUB_D => (riscv_f64MulAdd rm_3b rs1_val_64b rs2_val_64b ((negate_D rs3_val_64b : 64 words$word)) : (( 5 words$word # 64 words$word)) M) | FNMSUB_D => (riscv_f64MulAdd rm_3b ((negate_D rs1_val_64b : 64 words$word)) rs2_val_64b rs3_val_64b : (( 5 words$word # 64 words$word)) M) | FNMADD_D => (riscv_f64MulAdd rm_3b ((negate_D rs1_val_64b : 64 words$word)) rs2_val_64b ((negate_D rs3_val_64b : 64 words$word)) : (( 5 words$word # 64 words$word)) M) ) (\ varstup . let ((fflags : 5 bits), (rd_val_64b : 64 bits)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd rd_val_64b)) (sail2_state_monad$returnS RETIRE_SUCCESS))))))))`; (*val execute_F_BIN_TYPE_S : mword ty5 -> mword ty5 -> mword ty5 -> f_bin_op_S -> M Retired*) val _ = Define ` ((execute_F_BIN_TYPE_S:(5)words$word ->(5)words$word ->(5)words$word -> f_bin_op_S ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg0 arg1 arg2 arg3= (let merge_var = (arg0, arg1, arg2, arg3) in (case merge_var of (rs2, rs1, rd, FSGNJ_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_S = ((nan_unbox w__1 : 32 words$word)) in let (s1, e1, m1) = ((fsplit_S rs1_val_S : ( 1 words$word # 8 words$word # 23 words$word))) in let (s2, e2, m2) = ((fsplit_S rs2_val_S : ( 1 words$word # 8 words$word # 23 words$word))) in let rd_val_S = ((fmake_S s2 e1 m1 : 32 words$word)) in sail2_state_monad$seqS (wF_bits rd ((nan_box rd_val_S : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FSGNJN_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_S = ((nan_unbox w__1 : 32 words$word)) in let (s1, e1, m1) = ((fsplit_S rs1_val_S : ( 1 words$word # 8 words$word # 23 words$word))) in let (s2, e2, m2) = ((fsplit_S rs2_val_S : ( 1 words$word # 8 words$word # 23 words$word))) in let rd_val_S = ((fmake_S ((xor_vec (0b1w : 1 words$word) s2 : 1 words$word)) e1 m1 : 32 words$word)) in sail2_state_monad$seqS (wF_bits rd ((nan_box rd_val_S : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FSGNJX_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_S = ((nan_unbox w__1 : 32 words$word)) in let (s1, e1, m1) = ((fsplit_S rs1_val_S : ( 1 words$word # 8 words$word # 23 words$word))) in let (s2, e2, m2) = ((fsplit_S rs2_val_S : ( 1 words$word # 8 words$word # 23 words$word))) in let rd_val_S = ((fmake_S ((xor_vec s1 s2 : 1 words$word)) e1 m1 : 32 words$word)) in sail2_state_monad$seqS (wF_bits rd ((nan_box rd_val_S : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FMIN_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_S = ((nan_unbox w__1 : 32 words$word)) in let is_quiet = T in let (rs1_lt_rs2, fflags) = ((fle_S rs1_val_S rs2_val_S is_quiet : (bool # 5 words$word))) in let rd_val_S = (if (((((f_is_NaN_S rs1_val_S)) /\ ((f_is_NaN_S rs2_val_S))))) then (canonical_NaN_S () : 32 words$word) else if ((f_is_NaN_S rs1_val_S)) then rs2_val_S else if ((f_is_NaN_S rs2_val_S)) then rs1_val_S else if (((((f_is_neg_zero_S rs1_val_S)) /\ ((f_is_pos_zero_S rs2_val_S))))) then rs1_val_S else if (((((f_is_neg_zero_S rs2_val_S)) /\ ((f_is_pos_zero_S rs1_val_S))))) then rs2_val_S else if rs1_lt_rs2 then rs1_val_S else rs2_val_S) in sail2_state_monad$seqS (sail2_state_monad$seqS (accrue_fflags fflags) (wF_bits rd ((nan_box rd_val_S : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FMAX_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_S = ((nan_unbox w__1 : 32 words$word)) in let is_quiet = T in let (rs2_lt_rs1, fflags) = ((fle_S rs2_val_S rs1_val_S is_quiet : (bool # 5 words$word))) in let rd_val_S = (if (((((f_is_NaN_S rs1_val_S)) /\ ((f_is_NaN_S rs2_val_S))))) then (canonical_NaN_S () : 32 words$word) else if ((f_is_NaN_S rs1_val_S)) then rs2_val_S else if ((f_is_NaN_S rs2_val_S)) then rs1_val_S else if (((((f_is_neg_zero_S rs1_val_S)) /\ ((f_is_pos_zero_S rs2_val_S))))) then rs2_val_S else if (((((f_is_neg_zero_S rs2_val_S)) /\ ((f_is_pos_zero_S rs1_val_S))))) then rs1_val_S else if rs2_lt_rs1 then rs1_val_S else rs2_val_S) in sail2_state_monad$seqS (sail2_state_monad$seqS (accrue_fflags fflags) (wF_bits rd ((nan_box rd_val_S : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FEQ_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_S = ((nan_unbox w__1 : 32 words$word)) in sail2_state_monad$bindS (riscv_f32Eq rs1_val_S rs2_val_S : (( 5 words$word # 32 words$word)) M) (\ varstup . let ((fflags : bits_fflags), (rd_val : bits_WU)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd ((EXTZ (( 64 : int):ii) rd_val : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs2, rs1, rd, FLT_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_S = ((nan_unbox w__1 : 32 words$word)) in sail2_state_monad$bindS (riscv_f32Lt rs1_val_S rs2_val_S : (( 5 words$word # 32 words$word)) M) (\ varstup . let ((fflags : bits_fflags), (rd_val : bits_WU)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd ((EXTZ (( 64 : int):ii) rd_val : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs2, rs1, rd, FLE_S) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_S = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_S = ((nan_unbox w__1 : 32 words$word)) in sail2_state_monad$bindS (riscv_f32Le rs1_val_S rs2_val_S : (( 5 words$word # 32 words$word)) M) (\ varstup . let ((fflags : bits_fflags), (rd_val : bits_WU)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd ((EXTZ (( 64 : int):ii) rd_val : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))) )))`; (*val execute_F_BIN_TYPE_D : mword ty5 -> mword ty5 -> mword ty5 -> f_bin_op_D -> M Retired*) val _ = Define ` ((execute_F_BIN_TYPE_D:(5)words$word ->(5)words$word ->(5)words$word -> f_bin_op_D ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg0 arg1 arg2 arg3= (let merge_var = (arg0, arg1, arg2, arg3) in (case merge_var of (rs2, rs1, rd, FSGNJ_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_D . let (s1, e1, m1) = ((fsplit_D rs1_val_D : ( 1 words$word # 11 words$word # 52 words$word))) in let (s2, e2, m2) = ((fsplit_D rs2_val_D : ( 1 words$word # 11 words$word # 52 words$word))) in let rd_val_D = ((fmake_D s2 e1 m1 : 64 words$word)) in sail2_state_monad$seqS (wF_bits rd rd_val_D) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FSGNJN_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_D . let (s1, e1, m1) = ((fsplit_D rs1_val_D : ( 1 words$word # 11 words$word # 52 words$word))) in let (s2, e2, m2) = ((fsplit_D rs2_val_D : ( 1 words$word # 11 words$word # 52 words$word))) in let rd_val_D = ((fmake_D ((xor_vec (0b1w : 1 words$word) s2 : 1 words$word)) e1 m1 : 64 words$word)) in sail2_state_monad$seqS (wF_bits rd rd_val_D) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FSGNJX_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_D . let (s1, e1, m1) = ((fsplit_D rs1_val_D : ( 1 words$word # 11 words$word # 52 words$word))) in let (s2, e2, m2) = ((fsplit_D rs2_val_D : ( 1 words$word # 11 words$word # 52 words$word))) in let rd_val_D = ((fmake_D ((xor_vec s1 s2 : 1 words$word)) e1 m1 : 64 words$word)) in sail2_state_monad$seqS (wF_bits rd rd_val_D) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FMIN_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_D . let is_quiet = T in let (rs1_lt_rs2, fflags) = ((fle_D rs1_val_D rs2_val_D is_quiet : (bool # 5 words$word))) in let rd_val_D = (if (((((f_is_NaN_D rs1_val_D)) /\ ((f_is_NaN_D rs2_val_D))))) then (canonical_NaN_D () : 64 words$word) else if ((f_is_NaN_D rs1_val_D)) then rs2_val_D else if ((f_is_NaN_D rs2_val_D)) then rs1_val_D else if (((((f_is_neg_zero_D rs1_val_D)) /\ ((f_is_pos_zero_D rs2_val_D))))) then rs1_val_D else if (((((f_is_neg_zero_D rs2_val_D)) /\ ((f_is_pos_zero_D rs1_val_D))))) then rs2_val_D else if rs1_lt_rs2 then rs1_val_D else rs2_val_D) in sail2_state_monad$seqS (sail2_state_monad$seqS (accrue_fflags fflags) (wF_bits rd rd_val_D)) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FMAX_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_D . let is_quiet = T in let (rs2_lt_rs1, fflags) = ((fle_D rs2_val_D rs1_val_D is_quiet : (bool # 5 words$word))) in let rd_val_D = (if (((((f_is_NaN_D rs1_val_D)) /\ ((f_is_NaN_D rs2_val_D))))) then (canonical_NaN_D () : 64 words$word) else if ((f_is_NaN_D rs1_val_D)) then rs2_val_D else if ((f_is_NaN_D rs2_val_D)) then rs1_val_D else if (((((f_is_neg_zero_D rs1_val_D)) /\ ((f_is_pos_zero_D rs2_val_D))))) then rs2_val_D else if (((((f_is_neg_zero_D rs2_val_D)) /\ ((f_is_pos_zero_D rs1_val_D))))) then rs1_val_D else if rs2_lt_rs1 then rs1_val_D else rs2_val_D) in sail2_state_monad$seqS (sail2_state_monad$seqS (accrue_fflags fflags) (wF_bits rd rd_val_D)) (sail2_state_monad$returnS RETIRE_SUCCESS))) | (rs2, rs1, rd, FEQ_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_D . sail2_state_monad$bindS (riscv_f64Eq rs1_val_D rs2_val_D : (( 5 words$word # 64 words$word)) M) (\ varstup . let ((fflags : bits_fflags), (rd_val : bits_LU)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd rd_val)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs2, rs1, rd, FLT_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_D . sail2_state_monad$bindS (riscv_f64Lt rs1_val_D rs2_val_D : (( 5 words$word # 64 words$word)) M) (\ varstup . let ((fflags : bits_fflags), (rd_val : bits_LU)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd rd_val)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) | (rs2, rs1, rd, FLE_D) => sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_D . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_D . sail2_state_monad$bindS (riscv_f64Le rs1_val_D rs2_val_D : (( 5 words$word # 64 words$word)) M) (\ varstup . let ((fflags : bits_fflags), (rd_val : bits_LU)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wX_bits rd rd_val)) (sail2_state_monad$returnS RETIRE_SUCCESS)))) )))`; (*val execute_F_BIN_RM_TYPE_S : mword ty5 -> mword ty5 -> rounding_mode -> mword ty5 -> f_bin_rm_op_S -> M Retired*) val _ = Define ` ((execute_F_BIN_RM_TYPE_S:(5)words$word ->(5)words$word -> rounding_mode ->(5)words$word -> f_bin_rm_op_S ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rm rd op= (sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let rs1_val_32b = ((nan_unbox w__0 : 32 words$word)) in sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs2_val_32b = ((nan_unbox w__1 : 32 words$word)) in sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__2 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__2 : 3 words$word)) in sail2_state_monad$bindS (case op of FADD_S => (riscv_f32Add rm_3b rs1_val_32b rs2_val_32b : (( 5 words$word # 32 words$word)) M) | FSUB_S => (riscv_f32Sub rm_3b rs1_val_32b rs2_val_32b : (( 5 words$word # 32 words$word)) M) | FMUL_S => (riscv_f32Mul rm_3b rs1_val_32b rs2_val_32b : (( 5 words$word # 32 words$word)) M) | FDIV_S => (riscv_f32Div rm_3b rs1_val_32b rs2_val_32b : (( 5 words$word # 32 words$word)) M) ) (\ varstup . let ((fflags : 5 bits), (rd_val_32b : 32 bits)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd ((nan_box rd_val_32b : 64 words$word)))) (sail2_state_monad$returnS RETIRE_SUCCESS)))))))`; (*val execute_F_BIN_RM_TYPE_D : mword ty5 -> mword ty5 -> rounding_mode -> mword ty5 -> f_bin_rm_op_D -> M Retired*) val _ = Define ` ((execute_F_BIN_RM_TYPE_D:(5)words$word ->(5)words$word -> rounding_mode ->(5)words$word -> f_bin_rm_op_D ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rm rd op= (sail2_state_monad$bindS (rF_bits rs1 : ( 64 words$word) M) (\ rs1_val_64b . sail2_state_monad$bindS (rF_bits rs2 : ( 64 words$word) M) (\ rs2_val_64b . sail2_state_monad$bindS (select_instr_or_fcsr_rm rm) (\ (w__0 : rounding_mode) . let rm_3b = ((encdec_rounding_mode_forwards w__0 : 3 words$word)) in sail2_state_monad$bindS (case op of FADD_D => (riscv_f64Add rm_3b rs1_val_64b rs2_val_64b : (( 5 words$word # 64 words$word)) M) | FSUB_D => (riscv_f64Sub rm_3b rs1_val_64b rs2_val_64b : (( 5 words$word # 64 words$word)) M) | FMUL_D => (riscv_f64Mul rm_3b rs1_val_64b rs2_val_64b : (( 5 words$word # 64 words$word)) M) | FDIV_D => (riscv_f64Div rm_3b rs1_val_64b rs2_val_64b : (( 5 words$word # 64 words$word)) M) ) (\ varstup . let ((fflags : 5 bits), (rd_val_64b : 64 bits)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (write_fflags fflags) (wF_bits rd rd_val_64b)) (sail2_state_monad$returnS RETIRE_SUCCESS)))))))`; (*val execute_FENCE_TSO : mword ty4 -> mword ty4 -> M Retired*) val _ = Define ` ((execute_FENCE_TSO:(4)words$word ->(4)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) pred succ= (sail2_state_monad$seqS (case (pred, succ) of (v__1434, v__1435) => if ((((((((subrange_vec_dec v__1434 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__1435 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word))))))) then barrier (Barrier_RISCV_tso () ) else sail2_state_monad$returnS (if ((((((((subrange_vec_dec v__1434 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__1435 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))) then () else let (_ : unit) = (print_endline "FIXME: unsupported fence") in () ) ) (sail2_state_monad$returnS RETIRE_SUCCESS)))`; (*val execute_FENCE_RESERVED : mword ty4 -> mword ty4 -> mword ty4 -> mword ty5 -> mword ty5 -> Retired*) val _ = Define ` ((execute_FENCE_RESERVED:(4)words$word ->(4)words$word ->(4)words$word ->(5)words$word ->(5)words$word -> Retired) fm pred succ rs rd= RETIRE_SUCCESS)`; (*val execute_FENCEI_RESERVED : mword ty12 -> mword ty5 -> mword ty5 -> Retired*) val _ = Define ` ((execute_FENCEI_RESERVED:(12)words$word ->(5)words$word ->(5)words$word -> Retired) imm rs rd= RETIRE_SUCCESS)`; (*val execute_FENCEI : unit -> Retired*) val _ = Define ` ((execute_FENCEI:unit -> Retired) () = RETIRE_SUCCESS)`; (*val execute_FENCE : mword ty4 -> mword ty4 -> M Retired*) val _ = Define ` ((execute_FENCE:(4)words$word ->(4)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) pred succ= (sail2_state_monad$seqS (case (pred, succ) of (v__1394, v__1395) => if ((((((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word))))))) then barrier (Barrier_RISCV_rw_rw () ) else if ((((((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word))))))) then barrier (Barrier_RISCV_r_rw () ) else if ((((((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))) then barrier (Barrier_RISCV_r_r () ) else if ((((((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then barrier (Barrier_RISCV_rw_w () ) else if ((((((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then barrier (Barrier_RISCV_w_w () ) else if ((((((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word))))))) then barrier (Barrier_RISCV_w_rw () ) else if ((((((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))) then barrier (Barrier_RISCV_rw_r () ) else if ((((((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then barrier (Barrier_RISCV_r_w () ) else if ((((((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))) then barrier (Barrier_RISCV_w_r () ) else sail2_state_monad$returnS (if (((((subrange_vec_dec v__1395 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) then () else if (((((subrange_vec_dec v__1394 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) then () else let (_ : unit) = (print_endline "FIXME: unsupported fence") in () ) ) (sail2_state_monad$returnS RETIRE_SUCCESS)))`; (*val execute_ECALL : unit -> M Retired*) val _ = Define ` ((execute_ECALL:unit ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__0 : Privilege) . let (t : sync_exception) = (<| sync_exception_trap := ((case w__0 of User => E_U_EnvCall () | Supervisor => E_S_EnvCall () | Machine => E_M_EnvCall () )); sync_exception_excinfo := NONE; sync_exception_ext := NONE |>) in sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__1 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . sail2_state_monad$bindS (exception_handler w__1 (CTL_TRAP t) w__2 : ( 64 words$word) M) (\ (w__3 : 64 words$word) . sail2_state_monad$seqS (set_next_pc w__3) (sail2_state_monad$returnS RETIRE_FAIL)))))))`; (*val execute_EBREAK : unit -> M Retired*) val _ = Define ` ((execute_EBREAK:unit ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$seqS (handle_mem_exception w__0 (E_Breakpoint () )) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_DIVW : mword ty5 -> mword ty5 -> mword ty5 -> bool -> M Retired*) val _ = Define ` ((execute_DIVW:(5)words$word ->(5)words$word ->(5)words$word -> bool ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rd s= (sail2_state_monad$bindS (haveMulDiv () ) (\ (w__0 : bool) . if w__0 then sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let rs1_val = ((subrange_vec_dec w__1 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__2 : 64 words$word) . let rs2_val = ((subrange_vec_dec w__2 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) in let (rs1_int : ii) = (if s then integer_word$w2i rs1_val else lem$w2ui rs1_val) in let (rs2_int : ii) = (if s then integer_word$w2i rs2_val else lem$w2ui rs2_val) in let (q : ii) = (if (((rs2_int = (( 0 : int):ii)))) then ((( 0 : int)-( 1 : int)):ii) else hardware_quot rs1_int rs2_int) in let (q' : ii) = (if (((s /\ ((q > ((((pow2 (( 31 : int):ii))) - (( 1 : int):ii)))))))) then (( 0 : int):ii) - ((pow0 (( 2 : int):ii) (( 31 : int):ii))) else q) in sail2_state_monad$seqS (wX_bits rd ((EXTS (( 64 : int):ii) ((to_bits (( 32 : int):ii) q' : 32 words$word)) : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_DIV : mword ty5 -> mword ty5 -> mword ty5 -> bool -> M Retired*) val _ = Define ` ((execute_DIV:(5)words$word ->(5)words$word ->(5)words$word -> bool ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) rs2 rs1 rd s= (sail2_state_monad$bindS (haveMulDiv () ) (\ (w__0 : bool) . if w__0 then sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val . sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ rs2_val . let (rs1_int : ii) = (if s then integer_word$w2i rs1_val else lem$w2ui rs1_val) in let (rs2_int : ii) = (if s then integer_word$w2i rs2_val else lem$w2ui rs2_val) in let (q : ii) = (if (((rs2_int = (( 0 : int):ii)))) then ((( 0 : int)-( 1 : int)):ii) else hardware_quot rs1_int rs2_int) in let (q' : ii) = (if (((s /\ ((q > xlen_max_signed))))) then xlen_min_signed else q) in sail2_state_monad$seqS (wX_bits rd ((to_bits (( 64 : int):ii) q' : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_C_SRLI_HINT : mword ty3 -> Retired*) val _ = Define ` ((execute_C_SRLI_HINT:(3)words$word -> Retired) rsd= RETIRE_SUCCESS)`; (*val execute_C_SRAI_HINT : mword ty3 -> Retired*) val _ = Define ` ((execute_C_SRAI_HINT:(3)words$word -> Retired) rsd= RETIRE_SUCCESS)`; (*val execute_C_SLLI_HINT : mword ty6 -> mword ty5 -> Retired*) val _ = Define ` ((execute_C_SLLI_HINT:(6)words$word ->(5)words$word -> Retired) shamt rsd= RETIRE_SUCCESS)`; (*val execute_C_NOP_HINT : mword ty6 -> Retired*) val _ = Define ` ((execute_C_NOP_HINT:(6)words$word -> Retired) imm= RETIRE_SUCCESS)`; (*val execute_C_NOP : unit -> Retired*) val _ = Define ` ((execute_C_NOP:unit -> Retired) () = RETIRE_SUCCESS)`; (*val execute_C_MV_HINT : mword ty5 -> Retired*) val _ = Define ` ((execute_C_MV_HINT:(5)words$word -> Retired) rs2= RETIRE_SUCCESS)`; (*val execute_C_LUI_HINT : mword ty6 -> Retired*) val _ = Define ` ((execute_C_LUI_HINT:(6)words$word -> Retired) imm= RETIRE_SUCCESS)`; (*val execute_C_LI_HINT : mword ty6 -> Retired*) val _ = Define ` ((execute_C_LI_HINT:(6)words$word -> Retired) imm= RETIRE_SUCCESS)`; (*val execute_C_ILLEGAL : mword ty16 -> M Retired*) val _ = Define ` ((execute_C_ILLEGAL:(16)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) s= (sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL)))`; (*val execute_C_ADD_HINT : mword ty5 -> Retired*) val _ = Define ` ((execute_C_ADD_HINT:(5)words$word -> Retired) rs2= RETIRE_SUCCESS)`; (*val execute_C_ADDI_HINT : mword ty5 -> Retired*) val _ = Define ` ((execute_C_ADDI_HINT:(5)words$word -> Retired) rsd= RETIRE_SUCCESS)`; (*val execute_CSR : mword ty12 -> mword ty5 -> mword ty5 -> bool -> csrop -> M Retired*) val _ = Define ` ((execute_CSR:(12)words$word ->(5)words$word ->(5)words$word -> bool -> csrop ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) csr rs1 rd is_imm op= (sail2_state_monad$bindS (if is_imm then sail2_state_monad$returnS ((EXTZ (( 64 : int):ii) rs1 : 64 words$word)) else (rX_bits rs1 : ( 64 words$word) M)) (\ (rs1_val : xlenbits) . let (isWrite : bool) = ((case op of CSRRW => T | _ => if is_imm then (((lem$w2ui rs1_val)) <> (( 0 : int):ii)) else (((lem$w2ui rs1)) <> (( 0 : int):ii)) )) in sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__1 : Privilege) . sail2_state_monad$bindS (check_CSR csr w__1 isWrite) (\ (w__2 : bool) . if ((~ w__2)) then sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__3 : Privilege) . if ((~ ((ext_check_CSR csr w__3 isWrite)))) then let (_ : unit) = (ext_check_CSR_fail () ) in sail2_state_monad$returnS RETIRE_FAIL else sail2_state_monad$bindS (readCSR csr : ( 64 words$word) M) (\ csr_val . sail2_state_monad$seqS (sail2_state_monad$seqS (if isWrite then let (new_val : xlenbits) = ((case op of CSRRW => rs1_val | CSRRS => (or_vec csr_val rs1_val : 64 words$word) | CSRRC => (and_vec csr_val ((not_vec rs1_val : 64 words$word)) : 64 words$word) )) in writeCSR csr new_val else sail2_state_monad$returnS () ) (wX_bits rd csr_val)) (sail2_state_monad$returnS RETIRE_SUCCESS))))))))`; (*val execute_BTYPE : mword ty13 -> mword ty5 -> mword ty5 -> bop -> M Retired*) val _ = Define ` ((execute_BTYPE:(13)words$word ->(5)words$word ->(5)words$word -> bop ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rs2 rs1 op= (sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ rs1_val . sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ rs2_val . let (taken : bool) = ((case op of RISCV_BEQ => (rs1_val = rs2_val) | RISCV_BNE => (rs1_val <> rs2_val) | RISCV_BLT => zopz0zI_s rs1_val rs2_val | RISCV_BGE => zopz0zKzJ_s rs1_val rs2_val | RISCV_BLTU => zopz0zI_u rs1_val rs2_val | RISCV_BGEU => zopz0zKzJ_u rs1_val rs2_val )) in sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let (t : xlenbits) = ((add_vec w__0 ((EXTS (( 64 : int):ii) imm : 64 words$word)) : 64 words$word)) in if taken then (case ((ext_control_check_pc t)) of Ext_ControlAddr_Error (e) => let (_ : unit) = (ext_handle_control_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_ControlAddr_OK (target) => sail2_state_monad$bindS (sail2_state$and_boolS (sail2_state_monad$returnS ((bit_to_bool ((access_vec_dec target (( 1 : int):ii)))))) ( sail2_state_monad$bindS(haveRVC () ) (\ (w__1 : bool) . sail2_state_monad$returnS ((~ w__1))))) (\ (w__2 : bool) . if w__2 then sail2_state_monad$seqS (handle_mem_exception target (E_Fetch_Addr_Align () )) (sail2_state_monad$returnS RETIRE_FAIL) else sail2_state_monad$seqS (set_next_pc target) (sail2_state_monad$returnS RETIRE_SUCCESS)) ) else sail2_state_monad$returnS RETIRE_SUCCESS)))))`; (*val execute_AMO : amoop -> bool -> bool -> mword ty5 -> mword ty5 -> word_width -> mword ty5 -> M Retired*) val _ = Define ` ((execute_AMO:amoop -> bool -> bool ->(5)words$word ->(5)words$word -> word_width ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) op aq rl rs2 rs1 width rd= (sail2_state_monad$bindS (haveAtomics () ) (\ (w__0 : bool) . if w__0 then sail2_state_monad$bindS (ext_data_get_addr rs1 ((zeros_implicit (( 64 : int):ii) : 64 words$word)) (ReadWrite (Data, Data)) width) (\ (w__1 : unit Ext_DataAddr_Check) . (case w__1 of Ext_DataAddr_Error (e) => let (_ : unit) = (ext_handle_data_check_error e) in sail2_state_monad$returnS RETIRE_FAIL | Ext_DataAddr_OK (vaddr) => sail2_state_monad$bindS (translateAddr vaddr (ReadWrite (Data, Data)) : ( (( 64 words$word), ExceptionType)TR_Result) M) (\ (w__2 : (( 64 words$word), ExceptionType) TR_Result) . (case w__2 of TR_Failure ((e, _)) => sail2_state_monad$seqS (handle_mem_exception vaddr e) (sail2_state_monad$returnS RETIRE_FAIL) | TR_Address ((addr, _)) => sail2_state_monad$bindS (case (width, (( 64 : int): ii)) of (BYTE, g__326) => mem_write_ea addr (( 1 : int): ii) (((aq /\ rl))) rl T | (HALF, g__327) => mem_write_ea addr (( 2 : int): ii) (((aq /\ rl))) rl T | (WORD, g__328) => mem_write_ea addr (( 4 : int): ii) (((aq /\ rl))) rl T | (DOUBLE, l__7) => if (((l__7 = (( 64 : int): ii)))) then mem_write_ea addr (( 8 : int): ii) (((aq /\ rl))) rl T else internal_error "Unexpected AMO width" ) (\ (eares : unit MemoryOpResult) . let (is_unsigned : bool) = ((case op of AMOMINU => T | AMOMAXU => T | _ => F )) in sail2_state_monad$bindS (case width of BYTE => if is_unsigned then sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__10 : 64 words$word) . sail2_state_monad$returnS ((EXTZ (( 64 : int):ii) ((subrange_vec_dec w__10 (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word))) else sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__11 : 64 words$word) . sail2_state_monad$returnS ((EXTS (( 64 : int):ii) ((subrange_vec_dec w__11 (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word))) | HALF => if is_unsigned then sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__13 : 64 words$word) . sail2_state_monad$returnS ((EXTZ (( 64 : int):ii) ((subrange_vec_dec w__13 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word)) : 64 words$word))) else sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__14 : 64 words$word) . sail2_state_monad$returnS ((EXTS (( 64 : int):ii) ((subrange_vec_dec w__14 (( 15 : int):ii) (( 0 : int):ii) : 16 words$word)) : 64 words$word))) | WORD => if is_unsigned then sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__16 : 64 words$word) . sail2_state_monad$returnS ((EXTZ (( 64 : int):ii) ((subrange_vec_dec w__16 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 64 words$word))) else sail2_state_monad$bindS (rX_bits rs2 : ( 64 words$word) M) (\ (w__17 : 64 words$word) . sail2_state_monad$returnS ((EXTS (( 64 : int):ii) ((subrange_vec_dec w__17 (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 64 words$word))) | DOUBLE => (rX_bits rs2 : ( 64 words$word) M) ) (\ (rs2_val : xlenbits) . (case eares of MemException (e) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS RETIRE_FAIL) | MemValue (_) => sail2_state_monad$bindS (case (width, (( 64 : int): ii)) of (BYTE, g__323) => sail2_state_monad$bindS (mem_read (ReadWrite (Data, Data)) addr (( 1 : int): ii) aq (((aq /\ rl))) T : ( ( 8 words$word) MemoryOpResult) M) (\ (w__20 : ( 8 words$word) MemoryOpResult) . sail2_state_monad$returnS ((extend_value is_unsigned w__20 : ( 64 words$word) MemoryOpResult))) | (HALF, g__324) => sail2_state_monad$bindS (mem_read (ReadWrite (Data, Data)) addr (( 2 : int): ii) aq (((aq /\ rl))) T : ( ( 16 words$word) MemoryOpResult) M) (\ (w__21 : ( 16 words$word) MemoryOpResult) . sail2_state_monad$returnS ((extend_value is_unsigned w__21 : ( 64 words$word) MemoryOpResult))) | (WORD, g__325) => sail2_state_monad$bindS (mem_read (ReadWrite (Data, Data)) addr (( 4 : int): ii) aq (((aq /\ rl))) T : ( ( 32 words$word) MemoryOpResult) M) (\ (w__22 : ( 32 words$word) MemoryOpResult) . sail2_state_monad$returnS ((extend_value is_unsigned w__22 : ( 64 words$word) MemoryOpResult))) | (DOUBLE, l__6) => if (((l__6 = (( 64 : int): ii)))) then sail2_state_monad$bindS (mem_read (ReadWrite (Data, Data)) addr (( 8 : int): ii) aq (((aq /\ rl))) T : ( ( 64 words$word) MemoryOpResult) M) (\ (w__23 : ( 64 words$word) MemoryOpResult) . sail2_state_monad$returnS ((extend_value is_unsigned w__23 : ( 64 words$word) MemoryOpResult))) else (internal_error "Unexpected AMO width" : ( ( 64 words$word) MemoryOpResult) M) ) (\ (mval : xlenbits MemoryOpResult) . (case mval of MemException (e) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS RETIRE_FAIL) | MemValue (loaded) => let (result : xlenbits) = ((case op of AMOSWAP => rs2_val | AMOADD => (add_vec rs2_val loaded : 64 words$word) | AMOXOR => (xor_vec rs2_val loaded : 64 words$word) | AMOAND => (and_vec rs2_val loaded : 64 words$word) | AMOOR => (or_vec rs2_val loaded : 64 words$word) | AMOMIN => (to_bits (( 64 : int):ii) ((int_min ((integer_word$w2i rs2_val)) ((integer_word$w2i loaded)))) : 64 words$word) | AMOMAX => (to_bits (( 64 : int):ii) ((int_max ((integer_word$w2i rs2_val)) ((integer_word$w2i loaded)))) : 64 words$word) | AMOMINU => (to_bits (( 64 : int):ii) ((int_min ((lem$w2ui rs2_val)) ((lem$w2ui loaded)))) : 64 words$word) | AMOMAXU => (to_bits (( 64 : int):ii) ((int_max ((lem$w2ui rs2_val)) ((lem$w2ui loaded)))) : 64 words$word) )) in let (rval : xlenbits) = ((case width of BYTE => (EXTS (( 64 : int):ii) ((subrange_vec_dec loaded (( 7 : int):ii) (( 0 : int):ii) : 8 words$word)) : 64 words$word) | HALF => (EXTS (( 64 : int):ii) ((subrange_vec_dec loaded (( 15 : int):ii) (( 0 : int):ii) : 16 words$word)) : 64 words$word) | WORD => (EXTS (( 64 : int):ii) ((subrange_vec_dec loaded (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 64 words$word) | DOUBLE => loaded )) in sail2_state_monad$bindS (case (width, (( 64 : int): ii)) of (BYTE, g__320) => mem_write_value addr (( 1 : int): ii) ((subrange_vec_dec result (( 7 : int): ii) (( 0 : int): ii) : 8 words$word)) (((aq /\ rl))) rl T | (HALF, g__321) => mem_write_value addr (( 2 : int): ii) ((subrange_vec_dec result (( 15 : int): ii) (( 0 : int): ii) : 16 words$word)) (((aq /\ rl))) rl T | (WORD, g__322) => mem_write_value addr (( 4 : int): ii) ((subrange_vec_dec result (( 31 : int): ii) (( 0 : int): ii) : 32 words$word)) (((aq /\ rl))) rl T | (DOUBLE, l__5) => if (((l__5 = (( 64 : int): ii)))) then mem_write_value addr (( 8 : int): ii) result (((aq /\ rl))) rl T else internal_error "Unexpected AMO width" ) (\ (wval : bool MemoryOpResult) . (case wval of MemValue (T) => sail2_state_monad$seqS (wX_bits rd rval) (sail2_state_monad$returnS RETIRE_SUCCESS) | MemValue (F) => internal_error "AMO got false from mem_write_value" | MemException (e) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS RETIRE_FAIL) )) )) ))) )) )) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS RETIRE_FAIL))))`; (*val execute_ADDIW : mword ty12 -> mword ty5 -> mword ty5 -> M Retired*) val _ = Define ` ((execute_ADDIW:(12)words$word ->(5)words$word ->(5)words$word ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) imm rs1 rd= (sail2_state_monad$bindS (rX_bits rs1 : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let (result : xlenbits) = ((add_vec ((EXTS (( 64 : int):ii) imm : 64 words$word)) w__0 : 64 words$word)) in sail2_state_monad$seqS (wX_bits rd ((EXTS (( 64 : int):ii) ((subrange_vec_dec result (( 31 : int):ii) (( 0 : int):ii) : 32 words$word)) : 64 words$word))) (sail2_state_monad$returnS RETIRE_SUCCESS))))`; val execute_defn = Hol_defn "execute" ` ((execute:ast ->(regstate)sail2_state_monad$sequential_state ->(((Retired),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) merge_var= ((case merge_var of C_ADDI4SPN ((rdc, nzimm)) => let (imm : 12 bits) = ((concat_vec (0b00w : 2 words$word) ((concat_vec nzimm (0b00w : 2 words$word) : 10 words$word)) : 12 words$word)) in let rd = ((creg2reg_idx rdc : 5 words$word)) in execute (ITYPE (imm, sp, rd, RISCV_ADDI)) | C_LW ((uimm, rsc, rdc)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b00w : 2 words$word) : 7 words$word)) : 12 words$word)) in let rd = ((creg2reg_idx rdc : 5 words$word)) in let rs = ((creg2reg_idx rsc : 5 words$word)) in execute (LOAD (imm, rs, rd, F, WORD, F, F)) | C_LD ((uimm, rsc, rdc)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b000w : 3 words$word) : 8 words$word)) : 12 words$word)) in let rd = ((creg2reg_idx rdc : 5 words$word)) in let rs = ((creg2reg_idx rsc : 5 words$word)) in execute (LOAD (imm, rs, rd, F, DOUBLE, F, F)) | C_SW ((uimm, rsc1, rsc2)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b00w : 2 words$word) : 7 words$word)) : 12 words$word)) in let rs1 = ((creg2reg_idx rsc1 : 5 words$word)) in let rs2 = ((creg2reg_idx rsc2 : 5 words$word)) in execute (STORE (imm, rs2, rs1, WORD, F, F)) | C_SD ((uimm, rsc1, rsc2)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b000w : 3 words$word) : 8 words$word)) : 12 words$word)) in let rs1 = ((creg2reg_idx rsc1 : 5 words$word)) in let rs2 = ((creg2reg_idx rsc2 : 5 words$word)) in execute (STORE (imm, rs2, rs1, DOUBLE, F, F)) | C_ADDI ((nzi, rsd)) => let (imm : 12 bits) = ((EXTS (( 12 : int):ii) nzi : 12 words$word)) in execute (ITYPE (imm, rsd, rsd, RISCV_ADDI)) | C_JAL (imm) => execute (RISCV_JAL ((EXTS (( 21 : int):ii) ((concat_vec imm (0b0w : 1 words$word) : 12 words$word)) : 21 words$word), ra)) | C_ADDIW ((imm, rsd)) => execute (ADDIW ((EXTS (( 12 : int):ii) imm : 12 words$word), rsd, rsd)) | C_LI ((imm, rd)) => let (imm : 12 bits) = ((EXTS (( 12 : int):ii) imm : 12 words$word)) in execute (ITYPE (imm, zreg, rd, RISCV_ADDI)) | C_ADDI16SP (imm) => let (imm : 12 bits) = ((EXTS (( 12 : int):ii) ((concat_vec imm (0x0w : 4 words$word) : 10 words$word)) : 12 words$word)) in execute (ITYPE (imm, sp, sp, RISCV_ADDI)) | C_LUI ((imm, rd)) => let (res : 20 bits) = ((EXTS (( 20 : int):ii) imm : 20 words$word)) in execute (UTYPE (res, rd, RISCV_LUI)) | C_SRLI ((shamt, rsd)) => let rsd = ((creg2reg_idx rsd : 5 words$word)) in execute (SHIFTIOP (shamt, rsd, rsd, RISCV_SRLI)) | C_SRAI ((shamt, rsd)) => let rsd = ((creg2reg_idx rsd : 5 words$word)) in execute (SHIFTIOP (shamt, rsd, rsd, RISCV_SRAI)) | C_ANDI ((imm, rsd)) => let rsd = ((creg2reg_idx rsd : 5 words$word)) in execute (ITYPE ((EXTS (( 12 : int):ii) imm : 12 words$word), rsd, rsd, RISCV_ANDI)) | C_SUB ((rsd, rs2)) => let rsd = ((creg2reg_idx rsd : 5 words$word)) in let rs2 = ((creg2reg_idx rs2 : 5 words$word)) in execute (RTYPE (rs2, rsd, rsd, RISCV_SUB)) | C_XOR ((rsd, rs2)) => let rsd = ((creg2reg_idx rsd : 5 words$word)) in let rs2 = ((creg2reg_idx rs2 : 5 words$word)) in execute (RTYPE (rs2, rsd, rsd, RISCV_XOR)) | C_OR ((rsd, rs2)) => let rsd = ((creg2reg_idx rsd : 5 words$word)) in let rs2 = ((creg2reg_idx rs2 : 5 words$word)) in execute (RTYPE (rs2, rsd, rsd, RISCV_OR)) | C_AND ((rsd, rs2)) => let rsd = ((creg2reg_idx rsd : 5 words$word)) in let rs2 = ((creg2reg_idx rs2 : 5 words$word)) in execute (RTYPE (rs2, rsd, rsd, RISCV_AND)) | C_SUBW ((rsd, rs2)) => let rsd = ((creg2reg_idx rsd : 5 words$word)) in let rs2 = ((creg2reg_idx rs2 : 5 words$word)) in execute (RTYPEW (rs2, rsd, rsd, RISCV_SUBW)) | C_ADDW ((rsd, rs2)) => let rsd = ((creg2reg_idx rsd : 5 words$word)) in let rs2 = ((creg2reg_idx rs2 : 5 words$word)) in execute (RTYPEW (rs2, rsd, rsd, RISCV_ADDW)) | C_J (imm) => execute (RISCV_JAL ((EXTS (( 21 : int):ii) ((concat_vec imm (0b0w : 1 words$word) : 12 words$word)) : 21 words$word), zreg)) | C_BEQZ ((imm, rs)) => execute (BTYPE ((EXTS (( 13 : int):ii) ((concat_vec imm (0b0w : 1 words$word) : 9 words$word)) : 13 words$word), zreg, (creg2reg_idx rs : 5 words$word), RISCV_BEQ)) | C_BNEZ ((imm, rs)) => execute (BTYPE ((EXTS (( 13 : int):ii) ((concat_vec imm (0b0w : 1 words$word) : 9 words$word)) : 13 words$word), zreg, (creg2reg_idx rs : 5 words$word), RISCV_BNE)) | C_SLLI ((shamt, rsd)) => execute (SHIFTIOP (shamt, rsd, rsd, RISCV_SLLI)) | C_LWSP ((uimm, rd)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b00w : 2 words$word) : 8 words$word)) : 12 words$word)) in execute (LOAD (imm, sp, rd, F, WORD, F, F)) | C_LDSP ((uimm, rd)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b000w : 3 words$word) : 9 words$word)) : 12 words$word)) in execute (LOAD (imm, sp, rd, F, DOUBLE, F, F)) | C_SWSP ((uimm, rs2)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b00w : 2 words$word) : 8 words$word)) : 12 words$word)) in execute (STORE (imm, rs2, sp, WORD, F, F)) | C_SDSP ((uimm, rs2)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b000w : 3 words$word) : 9 words$word)) : 12 words$word)) in execute (STORE (imm, rs2, sp, DOUBLE, F, F)) | C_JR (rs1) => execute (RISCV_JALR ((EXTZ (( 12 : int):ii) (0b0w : 1 words$word) : 12 words$word), rs1, zreg)) | C_JALR (rs1) => execute (RISCV_JALR ((EXTZ (( 12 : int):ii) (0b0w : 1 words$word) : 12 words$word), rs1, ra)) | C_MV ((rd, rs2)) => execute (RTYPE (rs2, zreg, rd, RISCV_ADD)) | C_EBREAK (() ) => execute (EBREAK () ) | C_ADD ((rsd, rs2)) => execute (RTYPE (rs2, rsd, rsd, RISCV_ADD)) | C_FLWSP ((imm, rd)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec imm (0b00w : 2 words$word) : 8 words$word)) : 12 words$word)) in execute (LOAD_FP (imm, sp, rd, WORD)) | C_FSWSP ((uimm, rs2)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b00w : 2 words$word) : 8 words$word)) : 12 words$word)) in execute (STORE_FP (imm, rs2, sp, WORD)) | C_FLW ((uimm, rsc, rdc)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b00w : 2 words$word) : 7 words$word)) : 12 words$word)) in let rd = ((creg2reg_idx rdc : 5 words$word)) in let rs = ((creg2reg_idx rsc : 5 words$word)) in execute (LOAD_FP (imm, rs, rd, WORD)) | C_FSW ((uimm, rsc1, rsc2)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b00w : 2 words$word) : 7 words$word)) : 12 words$word)) in let rs1 = ((creg2reg_idx rsc1 : 5 words$word)) in let rs2 = ((creg2reg_idx rsc2 : 5 words$word)) in execute (STORE_FP (imm, rs2, rs1, WORD)) | C_FLDSP ((uimm, rd)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b000w : 3 words$word) : 9 words$word)) : 12 words$word)) in execute (LOAD_FP (imm, sp, rd, DOUBLE)) | C_FSDSP ((uimm, rs2)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b000w : 3 words$word) : 9 words$word)) : 12 words$word)) in execute (STORE_FP (imm, rs2, sp, DOUBLE)) | C_FLD ((uimm, rsc, rdc)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b000w : 3 words$word) : 8 words$word)) : 12 words$word)) in let rd = ((creg2reg_idx rdc : 5 words$word)) in let rs = ((creg2reg_idx rsc : 5 words$word)) in execute (LOAD_FP (imm, rs, rd, DOUBLE)) | C_FSD ((uimm, rsc1, rsc2)) => let (imm : 12 bits) = ((EXTZ (( 12 : int):ii) ((concat_vec uimm (0b000w : 3 words$word) : 8 words$word)) : 12 words$word)) in let rs1 = ((creg2reg_idx rsc1 : 5 words$word)) in let rs2 = ((creg2reg_idx rsc2 : 5 words$word)) in execute (STORE_FP (imm, rs2, rs1, DOUBLE)) | UTYPE ((imm, rd, op)) => execute_UTYPE imm rd op | RISCV_JAL ((imm, rd)) => execute_RISCV_JAL imm rd | BTYPE ((imm, rs2, rs1, op)) => execute_BTYPE imm rs2 rs1 op | ITYPE ((imm, rs1, rd, op)) => execute_ITYPE imm rs1 rd op | SHIFTIOP ((shamt, rs1, rd, op)) => execute_SHIFTIOP shamt rs1 rd op | RTYPE ((rs2, rs1, rd, op)) => execute_RTYPE rs2 rs1 rd op | LOAD ((imm, rs1, rd, is_unsigned, width, aq, rl)) => execute_LOAD imm rs1 rd is_unsigned width aq rl | STORE ((imm, rs2, rs1, width, aq, rl)) => execute_STORE imm rs2 rs1 width aq rl | ADDIW ((imm, rs1, rd)) => execute_ADDIW imm rs1 rd | SHIFTW ((shamt, rs1, rd, op)) => execute_SHIFTW shamt rs1 rd op | RTYPEW ((rs2, rs1, rd, op)) => execute_RTYPEW rs2 rs1 rd op | SHIFTIWOP ((shamt, rs1, rd, op)) => execute_SHIFTIWOP shamt rs1 rd op | FENCE ((pred, succ)) => execute_FENCE pred succ | FENCE_TSO ((pred, succ)) => execute_FENCE_TSO pred succ | FENCEI (arg0) => sail2_state_monad$returnS ((execute_FENCEI arg0)) | ECALL (arg0) => execute_ECALL arg0 | MRET (arg0) => execute_MRET arg0 | SRET (arg0) => execute_SRET arg0 | EBREAK (arg0) => execute_EBREAK arg0 | WFI (arg0) => execute_WFI arg0 | SFENCE_VMA ((rs1, rs2)) => execute_SFENCE_VMA rs1 rs2 | LOADRES ((aq, rl, rs1, width, rd)) => execute_LOADRES aq rl rs1 width rd | STORECON ((aq, rl, rs2, rs1, width, rd)) => execute_STORECON aq rl rs2 rs1 width rd | AMO ((op, aq, rl, rs2, rs1, width, rd)) => execute_AMO op aq rl rs2 rs1 width rd | C_NOP (arg0) => sail2_state_monad$returnS ((execute_C_NOP arg0)) | MUL ((rs2, rs1, rd, high, signed1, signed2)) => execute_MUL rs2 rs1 rd high signed1 signed2 | DIV0 ((rs2, rs1, rd, s)) => execute_DIV rs2 rs1 rd s | REM ((rs2, rs1, rd, s)) => execute_REM rs2 rs1 rd s | MULW ((rs2, rs1, rd)) => execute_MULW rs2 rs1 rd | DIVW ((rs2, rs1, rd, s)) => execute_DIVW rs2 rs1 rd s | REMW ((rs2, rs1, rd, s)) => execute_REMW rs2 rs1 rd s | CSR ((csr, rs1, rd, is_imm, op)) => execute_CSR csr rs1 rd is_imm op | URET (arg0) => execute_URET arg0 | C_NOP_HINT (imm) => sail2_state_monad$returnS ((execute_C_NOP_HINT imm)) | C_ADDI_HINT (rsd) => sail2_state_monad$returnS ((execute_C_ADDI_HINT rsd)) | C_LI_HINT (imm) => sail2_state_monad$returnS ((execute_C_LI_HINT imm)) | C_LUI_HINT (imm) => sail2_state_monad$returnS ((execute_C_LUI_HINT imm)) | C_MV_HINT (rs2) => sail2_state_monad$returnS ((execute_C_MV_HINT rs2)) | C_ADD_HINT (rs2) => sail2_state_monad$returnS ((execute_C_ADD_HINT rs2)) | C_SLLI_HINT ((shamt, rsd)) => sail2_state_monad$returnS ((execute_C_SLLI_HINT shamt rsd)) | C_SRLI_HINT (rsd) => sail2_state_monad$returnS ((execute_C_SRLI_HINT rsd)) | C_SRAI_HINT (rsd) => sail2_state_monad$returnS ((execute_C_SRAI_HINT rsd)) | FENCE_RESERVED ((fm, pred, succ, rs, rd)) => sail2_state_monad$returnS ((execute_FENCE_RESERVED fm pred succ rs rd)) | FENCEI_RESERVED ((imm, rs, rd)) => sail2_state_monad$returnS ((execute_FENCEI_RESERVED imm rs rd)) | LOAD_FP ((imm, rs1, rd, width)) => execute_LOAD_FP imm rs1 rd width | STORE_FP ((imm, rs2, rs1, width)) => execute_STORE_FP imm rs2 rs1 width | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, op)) => execute_F_MADD_TYPE_S rs3 rs2 rs1 rm rd op | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, op)) => execute_F_BIN_RM_TYPE_S rs2 rs1 rm rd op | F_UN_RM_TYPE_S ((rs1, rm, rd, arg3)) => execute_F_UN_RM_TYPE_S rs1 rm rd arg3 | F_BIN_TYPE_S ((rs2, rs1, rd, arg3)) => execute_F_BIN_TYPE_S rs2 rs1 rd arg3 | F_UN_TYPE_S ((rs1, rd, arg2)) => execute_F_UN_TYPE_S rs1 rd arg2 | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, op)) => execute_F_MADD_TYPE_D rs3 rs2 rs1 rm rd op | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, op)) => execute_F_BIN_RM_TYPE_D rs2 rs1 rm rd op | F_UN_RM_TYPE_D ((rs1, rm, rd, arg3)) => execute_F_UN_RM_TYPE_D rs1 rm rd arg3 | F_BIN_TYPE_D ((rs2, rs1, rd, arg3)) => execute_F_BIN_TYPE_D rs2 rs1 rd arg3 | F_UN_TYPE_D ((rs1, rd, arg2)) => execute_F_UN_TYPE_D rs1 rd arg2 | RISCV_JALR ((imm, rs1, rd)) => execute_RISCV_JALR imm rs1 rd | ILLEGAL (s) => execute_ILLEGAL s | C_ILLEGAL (s) => execute_C_ILLEGAL s )))`; val _ = Lib.with_flag (computeLib.auto_import_definitions, false) Defn.save_defn execute_defn; val _ = Define ` ((assembly_forwards:ast ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= ((case arg_ of UTYPE ((imm, rd, op)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__0 : string) . sail2_state_monad$returnS ((string_append ((utype_mnemonic_forwards op)) ((string_append ((spc_forwards () )) ((string_append w__0 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) ""))))))))))) | RISCV_JAL ((imm, rd)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__1 : string) . sail2_state_monad$returnS ((string_append "jal" ((string_append ((spc_forwards () )) ((string_append w__1 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) ""))))))))))) | RISCV_JALR ((imm, rs1, rd)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__2 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__3 : string) . sail2_state_monad$returnS (( string_append "jalr" ( ( string_append ( ( spc_forwards () )) ( ( string_append w__2 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__3 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits imm)) "")))))))))))))))) | BTYPE ((imm, rs2, rs1, op)) => sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__4 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__5 : string) . sail2_state_monad$returnS (( string_append ( ( btype_mnemonic_forwards op)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__4 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__5 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits imm)) "")))))))))))))))) | ITYPE ((imm, rs1, rd, op)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__6 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__7 : string) . sail2_state_monad$returnS ((string_append ( ( itype_mnemonic_forwards op)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__6 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__7 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits imm)) "")))))))))))))))) | SHIFTIOP ((shamt, rs1, rd, op)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__8 : string) . sail2_state_monad$bindS ( reg_name_forwards rs1) ( \ (w__9 : string) . sail2_state_monad$returnS ( ( string_append ( ( shiftiop_mnemonic_forwards op)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__8 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__9 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits shamt)) "")))))))))))))))) | RTYPE ((rs2, rs1, rd, op)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__10 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__11 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__12 : string) . sail2_state_monad$returnS ( ( string_append ( ( rtype_mnemonic_forwards op)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__10 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__11 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__12 ""))))))))))))))))) | LOAD ((imm, rs1, rd, is_unsigned, size1, aq, rl)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__13 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__14 : string) . sail2_state_monad$returnS ( ( string_append "l" ( ( string_append ( ( size_mnemonic_forwards size1)) ( ( string_append ( ( maybe_u_forwards is_unsigned)) ( ( string_append ( ( maybe_aq_forwards aq)) ( ( string_append ( ( maybe_rl_forwards rl)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__13 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits imm)) ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append "(" ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append w__14 ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append ")" "")))))))))))))))))))))))))))))))) | STORE ((imm, rs2, rs1, size1, aq, rl)) => sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__15 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__16 : string) . sail2_state_monad$returnS ((string_append "s" ((string_append ((size_mnemonic_forwards size1)) ((string_append ( ( maybe_aq_forwards aq)) ( ( string_append ( ( maybe_rl_forwards rl)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__15 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits imm)) ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append "(" ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append w__16 ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append ")" "")))))))))))))))))))))))))))))) | ADDIW ((imm, rs1, rd)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__17 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__18 : string) . sail2_state_monad$returnS ((string_append "addiw" ((string_append ((spc_forwards () )) ((string_append w__17 ((string_append ((sep_forwards () )) ((string_append w__18 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) "")))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | SHIFTW ((shamt, rs1, rd, op)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__21 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__22 : string) . sail2_state_monad$returnS ((string_append ((shiftw_mnemonic_forwards op)) ((string_append ((spc_forwards () )) ((string_append w__21 ((string_append ((sep_forwards () )) ((string_append w__22 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits shamt)) "")))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | RTYPEW ((rs2, rs1, rd, op)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__25 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__26 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__27 : string) . sail2_state_monad$returnS ((string_append ((rtypew_mnemonic_forwards op)) ((string_append ( ( spc_forwards () )) ( ( string_append w__25 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__26 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__27 ""))))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | SHIFTIWOP ((shamt, rs1, rd, op)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__30 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__31 : string) . sail2_state_monad$returnS ((string_append ((shiftiwop_mnemonic_forwards op)) ((string_append ((spc_forwards () )) ((string_append w__30 ((string_append ((sep_forwards () )) ((string_append w__31 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits shamt)) "")))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | FENCE ((pred, succ)) => sail2_state_monad$bindS (fence_bits_forwards pred) (\ (w__34 : string) . sail2_state_monad$bindS (fence_bits_forwards succ) (\ (w__35 : string) . sail2_state_monad$returnS ((string_append "fence" ((string_append ( ( spc_forwards () )) ( ( string_append w__34 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__35 "")))))))))))) | FENCE_TSO ((pred, succ)) => sail2_state_monad$bindS (fence_bits_forwards pred) (\ (w__36 : string) . sail2_state_monad$bindS (fence_bits_forwards succ) (\ (w__37 : string) . sail2_state_monad$returnS ((string_append "fence.tso" ( ( string_append ( ( spc_forwards () )) ( ( string_append w__36 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__37 "")))))))))))) | FENCEI (() ) => sail2_state_monad$returnS "fence.i" | ECALL (() ) => sail2_state_monad$returnS "ecall" | MRET (() ) => sail2_state_monad$returnS "mret" | SRET (() ) => sail2_state_monad$returnS "sret" | EBREAK (() ) => sail2_state_monad$returnS "ebreak" | WFI (() ) => sail2_state_monad$returnS "wfi" | SFENCE_VMA ((rs1, rs2)) => sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__38 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__39 : string) . sail2_state_monad$returnS ((string_append "sfence.vma" ( ( string_append ( ( spc_forwards () )) ( ( string_append w__38 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__39 "")))))))))))) | LOADRES ((aq, rl, rs1, size1, rd)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__40 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__41 : string) . sail2_state_monad$returnS ((string_append "lr." ((string_append ((size_mnemonic_forwards size1)) ((string_append ((maybe_aq_forwards aq)) ((string_append ( ( maybe_rl_forwards rl)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__40 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__41 "")))))))))))))))))) | STORECON ((aq, rl, rs2, rs1, size1, rd)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__42 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__43 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__44 : string) . sail2_state_monad$returnS ((string_append "sc." ((string_append ( ( size_mnemonic_forwards size1)) ( ( string_append ( ( maybe_aq_forwards aq)) ( ( string_append ( ( maybe_rl_forwards rl)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__42 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__43 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__44 ""))))))))))))))))))))))) | AMO ((op, aq, rl, rs2, rs1, width, rd)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__45 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__46 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__47 : string) . sail2_state_monad$returnS ((string_append ((amo_mnemonic_forwards op)) ((string_append "." ( ( string_append ( ( size_mnemonic_forwards width)) ( ( string_append ( ( maybe_aq_forwards aq)) ( ( string_append ( ( maybe_rl_forwards rl)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__45 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__46 ( ( string_append ( ( sep_forwards () )) ( ( string_append "(" ( ( string_append w__47 ( ( string_append ")" ""))))))))))))))))))))))))))))) | C_NOP (() ) => sail2_state_monad$returnS "c.nop" | C_ADDI4SPN ((rdc, nzimm)) => if (((nzimm <> (0x00w : 8 words$word)))) then sail2_state_monad$bindS (creg_name_forwards rdc) (\ (w__48 : string) . sail2_state_monad$returnS ((string_append "c.addi4spn" ((string_append ((spc_forwards () )) ((string_append w__48 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits ((concat_vec nzimm (0b00w : 2 words$word) : 10 words$word)))) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LW ((uimm, rsc, rdc)) => sail2_state_monad$bindS (creg_name_forwards rdc) (\ (w__51 : string) . sail2_state_monad$bindS (creg_name_forwards rsc) (\ (w__52 : string) . sail2_state_monad$returnS ((string_append "c.lw" ( ( string_append ( ( spc_forwards () )) ( ( string_append w__51 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__52 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits ( ( concat_vec uimm ( 0b00w : 2 words$word) : 7 words$word)))) "")))))))))))))))) | C_LD ((uimm, rsc, rdc)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (creg_name_forwards rdc) (\ (w__53 : string) . sail2_state_monad$bindS (creg_name_forwards rsc) (\ (w__54 : string) . sail2_state_monad$returnS ((string_append "c.ld" ((string_append ((spc_forwards () )) ((string_append w__53 ((string_append ((sep_forwards () )) ((string_append w__54 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits (( concat_vec uimm ( 0b000w : 3 words$word) : 8 words$word)))) "")))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SW ((uimm, rsc1, rsc2)) => sail2_state_monad$bindS (creg_name_forwards rsc1) (\ (w__57 : string) . sail2_state_monad$bindS (creg_name_forwards rsc2) (\ (w__58 : string) . sail2_state_monad$returnS ((string_append "c.sw" ( ( string_append ( ( spc_forwards () )) ( ( string_append w__57 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__58 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits ( ( concat_vec uimm ( 0b00w : 2 words$word) : 7 words$word)))) "")))))))))))))))) | C_SD ((uimm, rsc1, rsc2)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (creg_name_forwards rsc1) (\ (w__59 : string) . sail2_state_monad$bindS (creg_name_forwards rsc2) (\ (w__60 : string) . sail2_state_monad$returnS ((string_append "c.sd" ((string_append ((spc_forwards () )) ((string_append w__59 ((string_append ((sep_forwards () )) ((string_append w__60 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits (( concat_vec uimm ( 0b000w : 3 words$word) : 8 words$word)))) "")))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADDI ((nzi, rsd)) => if ((((((nzi <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))))) then sail2_state_monad$bindS (reg_name_forwards rsd) (\ (w__63 : string) . sail2_state_monad$returnS ((string_append "c.addi" ((string_append ((spc_forwards () )) ((string_append w__63 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits nzi)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_JAL (imm) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then sail2_state_monad$returnS ((string_append "c.jal" ((string_append ((spc_forwards () )) ((string_append ((decimal_string_of_bits ((concat_vec imm (0b0w : 1 words$word) : 12 words$word)))) "")))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADDIW ((imm, rsd)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rsd) (\ (w__68 : string) . sail2_state_monad$returnS ((string_append "c.addiw" ((string_append ((spc_forwards () )) ((string_append w__68 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LI ((imm, rd)) => if (((rd <> zreg))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__71 : string) . sail2_state_monad$returnS ((string_append "c.li" ((string_append ((spc_forwards () )) ((string_append w__71 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADDI16SP (imm) => if (((imm <> (0b000000w : 6 words$word)))) then sail2_state_monad$returnS ((string_append "c.addi16sp" ((string_append ((spc_forwards () )) ((string_append ((decimal_string_of_bits imm)) "")))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LUI ((imm, rd)) => if ((((((rd <> zreg))) /\ ((((((rd <> sp))) /\ (((imm <> (0b000000w : 6 words$word)))))))))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__76 : string) . sail2_state_monad$returnS ((string_append "c.lui" ((string_append ((spc_forwards () )) ((string_append w__76 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SRLI ((shamt, rsd)) => if (((shamt <> (0b000000w : 6 words$word)))) then sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__79 : string) . sail2_state_monad$returnS ((string_append "c.srli" ((string_append ((spc_forwards () )) ((string_append w__79 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits shamt)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SRAI ((shamt, rsd)) => if (((shamt <> (0b000000w : 6 words$word)))) then sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__82 : string) . sail2_state_monad$returnS ((string_append "c.srai" ((string_append ((spc_forwards () )) ((string_append w__82 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits shamt)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ANDI ((imm, rsd)) => sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__85 : string) . sail2_state_monad$returnS ((string_append "c.andi" ((string_append ((spc_forwards () )) ((string_append w__85 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) ""))))))))))) | C_SUB ((rsd, rs2)) => sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__86 : string) . sail2_state_monad$bindS (creg_name_forwards rs2) (\ (w__87 : string) . sail2_state_monad$returnS ((string_append "c.sub" ((string_append (( spc_forwards () )) (( string_append w__86 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__87 "")))))))))))) | C_XOR ((rsd, rs2)) => sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__88 : string) . sail2_state_monad$bindS (creg_name_forwards rs2) (\ (w__89 : string) . sail2_state_monad$returnS ((string_append "c.xor" ((string_append (( spc_forwards () )) (( string_append w__88 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__89 "")))))))))))) | C_OR ((rsd, rs2)) => sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__90 : string) . sail2_state_monad$bindS (creg_name_forwards rs2) (\ (w__91 : string) . sail2_state_monad$returnS ((string_append "c.or" ((string_append ((spc_forwards () )) ((string_append w__90 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__91 "")))))))))))) | C_AND ((rsd, rs2)) => sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__92 : string) . sail2_state_monad$bindS (creg_name_forwards rs2) (\ (w__93 : string) . sail2_state_monad$returnS ((string_append "c.and" ((string_append (( spc_forwards () )) (( string_append w__92 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__93 "")))))))))))) | C_SUBW ((rsd, rs2)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__94 : string) . sail2_state_monad$bindS (creg_name_forwards rs2) (\ (w__95 : string) . sail2_state_monad$returnS ((string_append "c.subw" ((string_append ((spc_forwards () )) ((string_append w__94 ((string_append ((sep_forwards () )) ((string_append w__95 "")))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADDW ((rsd, rs2)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__98 : string) . sail2_state_monad$bindS (creg_name_forwards rs2) (\ (w__99 : string) . sail2_state_monad$returnS ((string_append "c.addw" ((string_append ((spc_forwards () )) ((string_append w__98 ((string_append ((sep_forwards () )) ((string_append w__99 "")))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_J (imm) => sail2_state_monad$returnS ((string_append "c.j" ((string_append ((spc_forwards () )) ((string_append ((decimal_string_of_bits imm)) "")))))) | C_BEQZ ((imm, rs)) => sail2_state_monad$bindS (creg_name_forwards rs) (\ (w__102 : string) . sail2_state_monad$returnS ((string_append "c.beqz" ((string_append ((spc_forwards () )) ((string_append w__102 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) ""))))))))))) | C_BNEZ ((imm, rs)) => sail2_state_monad$bindS (creg_name_forwards rs) (\ (w__103 : string) . sail2_state_monad$returnS ((string_append "c.bnez" ((string_append ((spc_forwards () )) ((string_append w__103 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) ""))))))))))) | C_SLLI ((shamt, rsd)) => if ((((((shamt <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))))) then sail2_state_monad$bindS (reg_name_forwards rsd) (\ (w__104 : string) . sail2_state_monad$returnS ((string_append "c.slli" ((string_append ((spc_forwards () )) ((string_append w__104 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits shamt)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LWSP ((uimm, rd)) => if (((rd <> zreg))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__107 : string) . sail2_state_monad$returnS ((string_append "c.lwsp" ((string_append ((spc_forwards () )) ((string_append w__107 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits uimm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LDSP ((uimm, rd)) => if ((((((rd <> zreg))) /\ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__110 : string) . sail2_state_monad$returnS ((string_append "c.ldsp" ((string_append ((spc_forwards () )) ((string_append w__110 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits uimm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SWSP ((uimm, rd)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__113 : string) . sail2_state_monad$returnS ((string_append "c.swsp" ((string_append ((spc_forwards () )) ((string_append w__113 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits uimm)) ""))))))))))) | C_SDSP ((uimm, rs2)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__114 : string) . sail2_state_monad$returnS ((string_append "c.sdsp" ((string_append ((spc_forwards () )) ((string_append w__114 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits uimm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_JR (rs1) => if (((rs1 <> zreg))) then sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__117 : string) . sail2_state_monad$returnS ((string_append "c.jr" ((string_append ((spc_forwards () )) ((string_append w__117 ""))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_JALR (rs1) => if (((rs1 <> zreg))) then sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__120 : string) . sail2_state_monad$returnS ((string_append "c.jalr" ((string_append ((spc_forwards () )) ((string_append w__120 ""))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_MV ((rd, rs2)) => if ((((((rd <> zreg))) /\ (((rs2 <> zreg)))))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__123 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__124 : string) . sail2_state_monad$returnS ((string_append "c.mv" ((string_append ((spc_forwards () )) ((string_append w__123 ((string_append ((sep_forwards () )) ((string_append w__124 "")))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_EBREAK (() ) => sail2_state_monad$returnS "c.ebreak" | C_ADD ((rsd, rs2)) => if ((((((rsd <> zreg))) /\ (((rs2 <> zreg)))))) then sail2_state_monad$bindS (reg_name_forwards rsd) (\ (w__127 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__128 : string) . sail2_state_monad$returnS ((string_append "c.add" ((string_append ((spc_forwards () )) ((string_append w__127 ((string_append ((sep_forwards () )) ((string_append w__128 "")))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | MUL ((rs2, rs1, rd, high, signed1, signed2)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__131 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__132 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__133 : string) . sail2_state_monad$returnS ((string_append ( ( mul_mnemonic_forwards (high, signed1, signed2))) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__131 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__132 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__133 ""))))))))))))))))) | DIV0 ((rs2, rs1, rd, s)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__134 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__135 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__136 : string) . sail2_state_monad$returnS ( ( string_append "div" ( ( string_append ( ( maybe_not_u_forwards s)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__134 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__135 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__136 ""))))))))))))))))))) | REM ((rs2, rs1, rd, s)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__137 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__138 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__139 : string) . sail2_state_monad$returnS ( ( string_append "rem" ( ( string_append ( ( maybe_not_u_forwards s)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__137 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__138 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__139 ""))))))))))))))))))) | MULW ((rs2, rs1, rd)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__140 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__141 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__142 : string) . sail2_state_monad$returnS ((string_append "mulw" ((string_append ( ( spc_forwards () )) ( ( string_append w__140 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__141 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__142 ""))))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | DIVW ((rs2, rs1, rd, s)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__145 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__146 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__147 : string) . sail2_state_monad$returnS ((string_append "div" ((string_append ( ( maybe_not_u_forwards s)) ( ( string_append "w" ( ( string_append ( ( spc_forwards () )) ( ( string_append w__145 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__146 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__147 ""))))))))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | REMW ((rs2, rs1, rd, s)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__150 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__151 : string) . sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__152 : string) . sail2_state_monad$returnS ((string_append "rem" ((string_append ( ( maybe_not_u_forwards s)) ( ( string_append "w" ( ( string_append ( ( spc_forwards () )) ( ( string_append w__150 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__151 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__152 ""))))))))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | CSR ((csr, rs1, rd, T, op)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__155 : string) . sail2_state_monad$returnS ((string_append ((csr_mnemonic_forwards op)) ((string_append "i" ((string_append ((spc_forwards () )) ((string_append w__155 ((string_append ((sep_forwards () )) ((string_append (( csr_name_map_forwards csr)) (( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits rs1)) ""))))))))))))))))) | CSR ((csr, rs1, rd, F, op)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__156 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__157 : string) . sail2_state_monad$returnS ( ( string_append ( ( csr_mnemonic_forwards op)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__156 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( csr_name_map_forwards csr)) ( ( string_append ( ( sep_forwards () )) ( ( string_append w__157 "")))))))))))))))) | URET (() ) => sail2_state_monad$returnS "uret" | C_NOP_HINT (imm) => sail2_state_monad$returnS ((string_append "c.nop.hint." ((string_append ((decimal_string_of_bits imm)) "")))) | C_ADDI_HINT (rsd) => if (((rsd <> zreg))) then sail2_state_monad$bindS (reg_name_forwards rsd) (\ (w__158 : string) . sail2_state_monad$returnS ((string_append "c.addi.hint." ((string_append w__158 ""))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_LI_HINT (imm) => sail2_state_monad$returnS ((string_append "c.li.hint." ((string_append ((decimal_string_of_bits imm)) "")))) | C_LUI_HINT (imm) => if (((imm <> (0b000000w : 6 words$word)))) then sail2_state_monad$returnS ((string_append "c.lui.hint." ((string_append ((decimal_string_of_bits imm)) "")))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_MV_HINT (rs2) => if (((rs2 <> zreg))) then sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__163 : string) . sail2_state_monad$returnS ((string_append "c.mv.hint." ((string_append w__163 ""))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_ADD_HINT (rs2) => if (((rs2 <> zreg))) then sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__166 : string) . sail2_state_monad$returnS ((string_append "c.add.hint." ((string_append w__166 ""))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SLLI_HINT ((shamt, rsd)) => if ((((((shamt = (0b000000w : 6 words$word)))) \/ (((rsd = zreg)))))) then sail2_state_monad$bindS (reg_name_forwards rsd) (\ (w__169 : string) . sail2_state_monad$returnS ((string_append "c.slli.hint." ((string_append w__169 ((string_append "." ((string_append ((decimal_string_of_bits shamt)) ""))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_SRLI_HINT (rsd) => sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__172 : string) . sail2_state_monad$returnS ((string_append "c.srli.hint." ((string_append w__172 ""))))) | C_SRAI_HINT (rsd) => sail2_state_monad$bindS (creg_name_forwards rsd) (\ (w__173 : string) . sail2_state_monad$returnS ((string_append "c.srai.hint." ((string_append w__173 ""))))) | FENCE_RESERVED ((fm, pred, succ, rs, rd)) => if (((((((((fm <> (0x0w : 4 words$word)))) /\ (((fm <> (0x8w : 4 words$word))))))) \/ ((((((rs <> (0b00000w : 5 words$word)))) \/ (((rd <> (0b00000w : 5 words$word)))))))))) then sail2_state_monad$bindS (fence_bits_forwards pred) (\ (w__174 : string) . sail2_state_monad$bindS (fence_bits_forwards succ) (\ (w__175 : string) . sail2_state_monad$bindS (reg_name_forwards rs) (\ (w__176 : string) . sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__177 : string) . sail2_state_monad$returnS ((string_append "fence.reserved." ( ( string_append w__174 ( ( string_append "." ( ( string_append w__175 ( ( string_append "." ( ( string_append w__176 ( ( string_append "." ( ( string_append w__177 ( ( string_append "." ( ( string_append ( ( decimal_string_of_bits fm)) "")))))))))))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | FENCEI_RESERVED ((imm, rs, rd)) => if ((((((imm <> (0x000w : 12 words$word)))) \/ ((((((rs <> zreg))) \/ (((rd <> zreg))))))))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__180 : string) . sail2_state_monad$bindS (reg_name_forwards rs) (\ (w__181 : string) . sail2_state_monad$returnS ((string_append "fence.i.reserved." ((string_append w__180 ((string_append "." ((string_append w__181 ((string_append "." ((string_append ((decimal_string_of_bits imm)) "")))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | LOAD_FP ((imm, rs1, rd, width)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__184 : string) . sail2_state_monad$bindS ( reg_name_forwards rs1) ( \ (w__185 : string) . sail2_state_monad$returnS ( ( string_append "fl" ( ( string_append ( ( size_mnemonic_forwards width)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__184 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits imm)) ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append "(" ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append w__185 ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append ")" "")))))))))))))))))))))))))) | STORE_FP ((imm, rs2, rs1, width)) => sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__186 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__187 : string) . sail2_state_monad$returnS ((string_append "fs" ((string_append ((size_mnemonic_forwards width)) ((string_append ((spc_forwards () )) ((string_append w__186 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( decimal_string_of_bits imm)) ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append "(" ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append w__187 ( ( string_append ( ( opt_spc_forwards () )) ( ( string_append ")" "")))))))))))))))))))))))))) | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, op)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__188 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__189 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__190 : string) . sail2_state_monad$bindS (freg_name_forwards rs3) (\ (w__191 : string) . sail2_state_monad$returnS ( ( string_append ( ( f_madd_type_mnemonic_S_forwards op)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__188 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__189 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__190 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__191 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))))))))))))) | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, op)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__192 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__193 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__194 : string) . sail2_state_monad$returnS ((string_append ((f_bin_rm_type_mnemonic_S_forwards op)) ((string_append ( ( spc_forwards () )) ( ( string_append w__192 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__193 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__194 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) ""))))))))))))))))))))) | F_UN_RM_TYPE_S ((rs1, rm, rd, FSQRT_S)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__195 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__196 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_S_forwards FSQRT_S)) ((string_append ((spc_forwards () )) ((string_append w__195 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__196 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_W_S)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__197 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__198 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_S_forwards FCVT_W_S)) ((string_append (( spc_forwards () )) (( string_append w__197 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__198 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_WU_S)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__199 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__200 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_S_forwards FCVT_WU_S)) ((string_append ( ( spc_forwards () )) ( ( string_append w__199 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__200 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_W)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__201 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__202 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_S_forwards FCVT_S_W)) ((string_append (( spc_forwards () )) (( string_append w__201 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__202 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_WU)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__203 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__204 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_S_forwards FCVT_S_WU)) ((string_append ( ( spc_forwards () )) ( ( string_append w__203 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__204 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_L_S)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__205 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__206 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_S_forwards FCVT_L_S)) ((string_append (( spc_forwards () )) (( string_append w__205 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__206 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_LU_S)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__207 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__208 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_S_forwards FCVT_LU_S)) ((string_append ( ( spc_forwards () )) ( ( string_append w__207 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__208 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_L)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__209 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__210 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_S_forwards FCVT_S_L)) ((string_append (( spc_forwards () )) (( string_append w__209 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__210 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_LU)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__211 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__212 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_S_forwards FCVT_S_LU)) ((string_append ( ( spc_forwards () )) ( ( string_append w__211 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__212 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJ_S)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__213 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__214 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__215 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_S_forwards FSGNJ_S)) ((string_append ( ( spc_forwards () )) ( ( string_append w__213 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__214 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__215 ""))))))))))))))))) | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJN_S)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__216 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__217 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__218 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_S_forwards FSGNJN_S)) ((string_append ( ( spc_forwards () )) ( ( string_append w__216 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__217 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__218 ""))))))))))))))))) | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJX_S)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__219 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__220 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__221 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_S_forwards FSGNJX_S)) ((string_append ( ( spc_forwards () )) ( ( string_append w__219 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__220 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__221 ""))))))))))))))))) | F_BIN_TYPE_S ((rs2, rs1, rd, FMIN_S)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__222 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__223 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__224 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_S_forwards FMIN_S)) ((string_append (( spc_forwards () )) (( string_append w__222 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__223 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__224 ""))))))))))))))))) | F_BIN_TYPE_S ((rs2, rs1, rd, FMAX_S)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__225 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__226 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__227 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_S_forwards FMAX_S)) ((string_append (( spc_forwards () )) (( string_append w__225 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__226 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__227 ""))))))))))))))))) | F_BIN_TYPE_S ((rs2, rs1, rd, FEQ_S)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__228 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__229 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__230 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_S_forwards FEQ_S)) ((string_append ((spc_forwards () )) ((string_append w__228 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__229 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__230 ""))))))))))))))))) | F_BIN_TYPE_S ((rs2, rs1, rd, FLT_S)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__231 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__232 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__233 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_S_forwards FLT_S)) ((string_append ((spc_forwards () )) ((string_append w__231 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__232 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__233 ""))))))))))))))))) | F_BIN_TYPE_S ((rs2, rs1, rd, FLE_S)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__234 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__235 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__236 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_S_forwards FLE_S)) ((string_append ((spc_forwards () )) ((string_append w__234 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__235 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__236 ""))))))))))))))))) | F_UN_TYPE_S ((rs1, rd, FMV_X_W)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__237 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__238 : string) . sail2_state_monad$returnS ((string_append ((f_un_type_mnemonic_S_forwards FMV_X_W)) ((string_append ((spc_forwards () )) ((string_append w__237 ((string_append (( sep_forwards () )) (( string_append w__238 "")))))))))))) | F_UN_TYPE_S ((rs1, rd, FMV_W_X)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__239 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__240 : string) . sail2_state_monad$returnS ((string_append ((f_un_type_mnemonic_S_forwards FMV_W_X)) ((string_append ((spc_forwards () )) ((string_append w__239 ((string_append (( sep_forwards () )) (( string_append w__240 "")))))))))))) | F_UN_TYPE_S ((rs1, rd, FCLASS_S)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__241 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__242 : string) . sail2_state_monad$returnS ((string_append ((f_un_type_mnemonic_S_forwards FCLASS_S)) ((string_append ((spc_forwards () )) ((string_append w__241 ((string_append ( ( sep_forwards () )) ( ( string_append w__242 "")))))))))))) | C_FLWSP ((imm, rd)) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__243 : string) . sail2_state_monad$returnS ((string_append "c.flwsp" ((string_append ((spc_forwards () )) ((string_append w__243 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits imm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_FSWSP ((uimm, rd)) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__246 : string) . sail2_state_monad$returnS ((string_append "c.fswsp" ((string_append ((spc_forwards () )) ((string_append w__246 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits uimm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_FLW ((uimm, rsc, rdc)) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then sail2_state_monad$bindS (creg_name_forwards rdc) (\ (w__249 : string) . sail2_state_monad$bindS (creg_name_forwards rsc) (\ (w__250 : string) . sail2_state_monad$returnS ((string_append "c.flw" ((string_append ((spc_forwards () )) ((string_append w__249 ((string_append ((sep_forwards () )) ((string_append w__250 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits ( ( concat_vec uimm ( 0b00w : 2 words$word) : 7 words$word)))) "")))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_FSW ((uimm, rsc1, rsc2)) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then sail2_state_monad$bindS (creg_name_forwards rsc1) (\ (w__253 : string) . sail2_state_monad$bindS (creg_name_forwards rsc2) (\ (w__254 : string) . sail2_state_monad$returnS ((string_append "c.fsw" ((string_append ((spc_forwards () )) ((string_append w__253 ((string_append ((sep_forwards () )) ((string_append w__254 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits ( ( concat_vec uimm ( 0b00w : 2 words$word) : 7 words$word)))) "")))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, op)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__257 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__258 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__259 : string) . sail2_state_monad$bindS (freg_name_forwards rs3) (\ (w__260 : string) . sail2_state_monad$returnS ( ( string_append ( ( f_madd_type_mnemonic_D_forwards op)) ( ( string_append ( ( spc_forwards () )) ( ( string_append w__257 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__258 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__259 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__260 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))))))))))))) | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, op)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__261 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__262 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__263 : string) . sail2_state_monad$returnS ((string_append ((f_bin_rm_type_mnemonic_D_forwards op)) ((string_append ( ( spc_forwards () )) ( ( string_append w__261 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__262 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__263 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) ""))))))))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FSQRT_D)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__264 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__265 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FSQRT_D)) ((string_append ((spc_forwards () )) ((string_append w__264 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__265 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_W_D)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__266 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__267 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_W_D)) ((string_append (( spc_forwards () )) (( string_append w__266 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__267 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_WU_D)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__268 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__269 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_WU_D)) ((string_append ( ( spc_forwards () )) ( ( string_append w__268 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__269 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_W)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__270 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__271 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_D_W)) ((string_append (( spc_forwards () )) (( string_append w__270 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__271 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_WU)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__272 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__273 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_D_WU)) ((string_append ( ( spc_forwards () )) ( ( string_append w__272 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__273 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_L_D)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__274 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__275 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_L_D)) ((string_append (( spc_forwards () )) (( string_append w__274 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__275 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_LU_D)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__276 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__277 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_LU_D)) ((string_append ( ( spc_forwards () )) ( ( string_append w__276 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__277 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_L)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__278 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__279 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_D_L)) ((string_append (( spc_forwards () )) (( string_append w__278 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__279 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_LU)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__280 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__281 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_D_LU)) ((string_append ( ( spc_forwards () )) ( ( string_append w__280 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__281 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_S_D)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__282 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__283 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_S_D)) ((string_append (( spc_forwards () )) (( string_append w__282 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__283 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_S)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__284 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__285 : string) . sail2_state_monad$returnS ((string_append ((f_un_rm_type_mnemonic_D_forwards FCVT_D_S)) ((string_append (( spc_forwards () )) (( string_append w__284 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__285 ( ( string_append ( ( sep_forwards () )) ( ( string_append ( ( frm_mnemonic_forwards rm)) "")))))))))))))))) | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJ_D)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__286 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__287 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__288 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_D_forwards FSGNJ_D)) ((string_append ( ( spc_forwards () )) ( ( string_append w__286 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__287 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__288 ""))))))))))))))))) | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJN_D)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__289 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__290 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__291 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_D_forwards FSGNJN_D)) ((string_append ( ( spc_forwards () )) ( ( string_append w__289 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__290 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__291 ""))))))))))))))))) | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJX_D)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__292 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__293 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__294 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_D_forwards FSGNJX_D)) ((string_append ( ( spc_forwards () )) ( ( string_append w__292 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__293 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__294 ""))))))))))))))))) | F_BIN_TYPE_D ((rs2, rs1, rd, FMIN_D)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__295 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__296 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__297 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_D_forwards FMIN_D)) ((string_append (( spc_forwards () )) (( string_append w__295 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__296 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__297 ""))))))))))))))))) | F_BIN_TYPE_D ((rs2, rs1, rd, FMAX_D)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__298 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__299 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__300 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_D_forwards FMAX_D)) ((string_append (( spc_forwards () )) (( string_append w__298 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__299 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__300 ""))))))))))))))))) | F_BIN_TYPE_D ((rs2, rs1, rd, FEQ_D)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__301 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__302 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__303 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_D_forwards FEQ_D)) ((string_append ((spc_forwards () )) ((string_append w__301 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__302 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__303 ""))))))))))))))))) | F_BIN_TYPE_D ((rs2, rs1, rd, FLT_D)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__304 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__305 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__306 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_D_forwards FLT_D)) ((string_append ((spc_forwards () )) ((string_append w__304 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__305 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__306 ""))))))))))))))))) | F_BIN_TYPE_D ((rs2, rs1, rd, FLE_D)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__307 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__308 : string) . sail2_state_monad$bindS (freg_name_forwards rs2) (\ (w__309 : string) . sail2_state_monad$returnS ((string_append ((f_bin_type_mnemonic_D_forwards FLE_D)) ((string_append ((spc_forwards () )) ((string_append w__307 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__308 ( ( string_append ( ( sep_forwards () )) ( ( string_append w__309 ""))))))))))))))))) | F_UN_TYPE_D ((rs1, rd, FMV_X_D)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__310 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__311 : string) . sail2_state_monad$returnS ((string_append ((f_un_type_mnemonic_D_forwards FMV_X_D)) ((string_append ((spc_forwards () )) ((string_append w__310 ((string_append (( sep_forwards () )) (( string_append w__311 "")))))))))))) | F_UN_TYPE_D ((rs1, rd, FMV_D_X)) => sail2_state_monad$bindS (freg_name_forwards rd) (\ (w__312 : string) . sail2_state_monad$bindS (reg_name_forwards rs1) (\ (w__313 : string) . sail2_state_monad$returnS ((string_append ((f_un_type_mnemonic_D_forwards FMV_D_X)) ((string_append ((spc_forwards () )) ((string_append w__312 ((string_append (( sep_forwards () )) (( string_append w__313 "")))))))))))) | F_UN_TYPE_D ((rs1, rd, FCLASS_D)) => sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__314 : string) . sail2_state_monad$bindS (freg_name_forwards rs1) (\ (w__315 : string) . sail2_state_monad$returnS ((string_append ((f_un_type_mnemonic_D_forwards FCLASS_D)) ((string_append ((spc_forwards () )) ((string_append w__314 ((string_append ( ( sep_forwards () )) ( ( string_append w__315 "")))))))))))) | C_FLDSP ((uimm, rd)) => if (((((((( 64 : int): ii) = (( 32 : int): ii)))) \/ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then sail2_state_monad$bindS (reg_name_forwards rd) (\ (w__316 : string) . sail2_state_monad$returnS ((string_append "c.fldsp" ((string_append ((spc_forwards () )) ((string_append w__316 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits uimm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_FSDSP ((uimm, rs2)) => if (((((((( 64 : int): ii) = (( 32 : int): ii)))) \/ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then sail2_state_monad$bindS (reg_name_forwards rs2) (\ (w__319 : string) . sail2_state_monad$returnS ((string_append "c.fsdsp" ((string_append ((spc_forwards () )) ((string_append w__319 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits uimm)) ""))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_FLD ((uimm, rsc, rdc)) => if (((((((( 64 : int): ii) = (( 32 : int): ii)))) \/ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then sail2_state_monad$bindS (creg_name_forwards rdc) (\ (w__322 : string) . sail2_state_monad$bindS (creg_name_forwards rsc) (\ (w__323 : string) . sail2_state_monad$returnS ((string_append "c.fld" ((string_append ((spc_forwards () )) ((string_append w__322 ((string_append ((sep_forwards () )) ((string_append w__323 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits ( ( concat_vec uimm ( 0b000w : 3 words$word) : 8 words$word)))) "")))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | C_FSD ((uimm, rsc1, rsc2)) => if (((((((( 64 : int): ii) = (( 32 : int): ii)))) \/ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then sail2_state_monad$bindS (creg_name_forwards rsc1) (\ (w__326 : string) . sail2_state_monad$bindS (creg_name_forwards rsc2) (\ (w__327 : string) . sail2_state_monad$returnS ((string_append "c.fsd" ((string_append ((spc_forwards () )) ((string_append w__326 ((string_append ((sep_forwards () )) ((string_append w__327 ((string_append ((sep_forwards () )) ((string_append ((decimal_string_of_bits ( ( concat_vec uimm ( 0b000w : 3 words$word) : 8 words$word)))) "")))))))))))))))) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () ) | ILLEGAL (s) => sail2_state_monad$returnS ((string_append "illegal" ((string_append ((spc_forwards () )) ((string_append ((decimal_string_of_bits s)) "")))))) | C_ILLEGAL (s) => sail2_state_monad$returnS ((string_append "c.illegal" ((string_append ((spc_forwards () )) ((string_append ((decimal_string_of_bits s)) "")))))) )))`; (*val _s3229_ : string -> maybe (mword ty16)*) val _ = Define ` ((s3229_:string ->((16)words$word)option) s3230_0= (let s3231_0 = s3230_0 in if ((string_startswith s3231_0 "c.illegal")) then (case ((string_drop s3231_0 ((string_length "c.illegal")))) of s3232_0 => (case ((spc_matches_prefix0 s3232_0)) of SOME ((() , s3233_0)) => (case ((string_drop s3232_0 s3233_0)) of s3234_0 => (case ((hex_bits_16_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3234_0 : (( 16 words$word # ii)) option)) of SOME ((s, s3235_0)) => let p0_ = (string_drop s3234_0 s3235_0) in if (((p0_ = ""))) then SOME s else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3221_ : string -> maybe (mword ty32)*) val _ = Define ` ((s3221_:string ->((32)words$word)option) s3222_0= (let s3223_0 = s3222_0 in if ((string_startswith s3223_0 "illegal")) then (case ((string_drop s3223_0 ((string_length "illegal")))) of s3224_0 => (case ((spc_matches_prefix0 s3224_0)) of SOME ((() , s3225_0)) => (case ((string_drop s3224_0 s3225_0)) of s3226_0 => (case ((hex_bits_32_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3226_0 : (( 32 words$word # ii)) option)) of SOME ((s, s3227_0)) => let p0_ = (string_drop s3226_0 s3227_0) in if (((p0_ = ""))) then SOME s else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3205_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s3205_:string ->((3)words$word#(3)words$word#(5)words$word)option) s3206_0= (let s3207_0 = s3206_0 in if ((string_startswith s3207_0 "c.fsd")) then (case ((string_drop s3207_0 ((string_length "c.fsd")))) of s3208_0 => (case ((spc_matches_prefix0 s3208_0)) of SOME ((() , s3209_0)) => (case ((string_drop s3208_0 s3209_0)) of s3210_0 => (case ((creg_name_matches_prefix s3210_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s3211_0)) => (case ((string_drop s3210_0 s3211_0)) of s3212_0 => (case ((sep_matches_prefix s3212_0)) of SOME ((() , s3213_0)) => (case ((string_drop s3212_0 s3213_0)) of s3214_0 => (case ((creg_name_matches_prefix s3214_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s3215_0)) => (case ((string_drop s3214_0 s3215_0)) of s3216_0 => (case ((sep_matches_prefix s3216_0)) of SOME ((() , s3217_0)) => (case ((string_drop s3216_0 s3217_0)) of s3218_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3218_0 : (( 8 words$word # ii)) option)) of SOME ((v__1442, s3219_0)) => if (((((subrange_vec_dec v__1442 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1442 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1442 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let p0_ = (string_drop s3218_0 s3219_0) in if (((p0_ = ""))) then SOME (rsc1, rsc2, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3189_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s3189_:string ->((3)words$word#(3)words$word#(5)words$word)option) s3190_0= (let s3191_0 = s3190_0 in if ((string_startswith s3191_0 "c.fld")) then (case ((string_drop s3191_0 ((string_length "c.fld")))) of s3192_0 => (case ((spc_matches_prefix0 s3192_0)) of SOME ((() , s3193_0)) => (case ((string_drop s3192_0 s3193_0)) of s3194_0 => (case ((creg_name_matches_prefix s3194_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s3195_0)) => (case ((string_drop s3194_0 s3195_0)) of s3196_0 => (case ((sep_matches_prefix s3196_0)) of SOME ((() , s3197_0)) => (case ((string_drop s3196_0 s3197_0)) of s3198_0 => (case ((creg_name_matches_prefix s3198_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s3199_0)) => (case ((string_drop s3198_0 s3199_0)) of s3200_0 => (case ((sep_matches_prefix s3200_0)) of SOME ((() , s3201_0)) => (case ((string_drop s3200_0 s3201_0)) of s3202_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3202_0 : (( 8 words$word # ii)) option)) of SOME ((v__1444, s3203_0)) => if (((((subrange_vec_dec v__1444 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1444 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1444 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let p0_ = (string_drop s3202_0 s3203_0) in if (((p0_ = ""))) then SOME (rdc, rsc, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3177_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3177_:string ->((5)words$word#(6)words$word)option) s3178_0= (let s3179_0 = s3178_0 in if ((string_startswith s3179_0 "c.fsdsp")) then (case ((string_drop s3179_0 ((string_length "c.fsdsp")))) of s3180_0 => (case ((spc_matches_prefix0 s3180_0)) of SOME ((() , s3181_0)) => (case ((string_drop s3180_0 s3181_0)) of s3182_0 => (case ((reg_name_matches_prefix s3182_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3183_0)) => (case ((string_drop s3182_0 s3183_0)) of s3184_0 => (case ((sep_matches_prefix s3184_0)) of SOME ((() , s3185_0)) => (case ((string_drop s3184_0 s3185_0)) of s3186_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3186_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s3187_0)) => let p0_ = (string_drop s3186_0 s3187_0) in if (((p0_ = ""))) then SOME (rs2, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3165_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3165_:string ->((5)words$word#(6)words$word)option) s3166_0= (let s3167_0 = s3166_0 in if ((string_startswith s3167_0 "c.fldsp")) then (case ((string_drop s3167_0 ((string_length "c.fldsp")))) of s3168_0 => (case ((spc_matches_prefix0 s3168_0)) of SOME ((() , s3169_0)) => (case ((string_drop s3168_0 s3169_0)) of s3170_0 => (case ((reg_name_matches_prefix s3170_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3171_0)) => (case ((string_drop s3170_0 s3171_0)) of s3172_0 => (case ((sep_matches_prefix s3172_0)) of SOME ((() , s3173_0)) => (case ((string_drop s3172_0 s3173_0)) of s3174_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3174_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s3175_0)) => let p0_ = (string_drop s3174_0 s3175_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3152_ : string -> maybe ((f_un_op_D * mword ty5 * mword ty5))*) val _ = Define ` ((s3152_:string ->(f_un_op_D#(5)words$word#(5)words$word)option) s3153_0= ((case s3153_0 of s3154_0 => (case ((f_un_type_mnemonic_D_matches_prefix s3154_0)) of SOME ((FCLASS_D, s3155_0)) => (case ((string_drop s3154_0 s3155_0)) of s3156_0 => (case ((spc_matches_prefix0 s3156_0)) of SOME ((() , s3157_0)) => (case ((string_drop s3156_0 s3157_0)) of s3158_0 => (case ((reg_name_matches_prefix s3158_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3159_0)) => (case ((string_drop s3158_0 s3159_0)) of s3160_0 => (case ((sep_matches_prefix s3160_0)) of SOME ((() , s3161_0)) => (case ((string_drop s3160_0 s3161_0)) of s3162_0 => (case ((freg_name_matches_prefix s3162_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3163_0)) => let p0_ = (string_drop s3162_0 s3163_0) in if (((p0_ = ""))) then SOME (FCLASS_D, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3139_ : string -> maybe ((f_un_op_D * mword ty5 * mword ty5))*) val _ = Define ` ((s3139_:string ->(f_un_op_D#(5)words$word#(5)words$word)option) s3140_0= ((case s3140_0 of s3141_0 => (case ((f_un_type_mnemonic_D_matches_prefix s3141_0)) of SOME ((FMV_D_X, s3142_0)) => (case ((string_drop s3141_0 s3142_0)) of s3143_0 => (case ((spc_matches_prefix0 s3143_0)) of SOME ((() , s3144_0)) => (case ((string_drop s3143_0 s3144_0)) of s3145_0 => (case ((freg_name_matches_prefix s3145_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3146_0)) => (case ((string_drop s3145_0 s3146_0)) of s3147_0 => (case ((sep_matches_prefix s3147_0)) of SOME ((() , s3148_0)) => (case ((string_drop s3147_0 s3148_0)) of s3149_0 => (case ((reg_name_matches_prefix s3149_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3150_0)) => let p0_ = (string_drop s3149_0 s3150_0) in if (((p0_ = ""))) then SOME (FMV_D_X, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3126_ : string -> maybe ((f_un_op_D * mword ty5 * mword ty5))*) val _ = Define ` ((s3126_:string ->(f_un_op_D#(5)words$word#(5)words$word)option) s3127_0= ((case s3127_0 of s3128_0 => (case ((f_un_type_mnemonic_D_matches_prefix s3128_0)) of SOME ((FMV_X_D, s3129_0)) => (case ((string_drop s3128_0 s3129_0)) of s3130_0 => (case ((spc_matches_prefix0 s3130_0)) of SOME ((() , s3131_0)) => (case ((string_drop s3130_0 s3131_0)) of s3132_0 => (case ((reg_name_matches_prefix s3132_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3133_0)) => (case ((string_drop s3132_0 s3133_0)) of s3134_0 => (case ((sep_matches_prefix s3134_0)) of SOME ((() , s3135_0)) => (case ((string_drop s3134_0 s3135_0)) of s3136_0 => (case ((freg_name_matches_prefix s3136_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3137_0)) => let p0_ = (string_drop s3136_0 s3137_0) in if (((p0_ = ""))) then SOME (FMV_X_D, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3109_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3109_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s3110_0= ((case s3110_0 of s3111_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s3111_0)) of SOME ((FLE_D, s3112_0)) => (case ((string_drop s3111_0 s3112_0)) of s3113_0 => (case ((spc_matches_prefix0 s3113_0)) of SOME ((() , s3114_0)) => (case ((string_drop s3113_0 s3114_0)) of s3115_0 => (case ((reg_name_matches_prefix s3115_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3116_0)) => (case ((string_drop s3115_0 s3116_0)) of s3117_0 => (case ((sep_matches_prefix s3117_0)) of SOME ((() , s3118_0)) => (case ((string_drop s3117_0 s3118_0)) of s3119_0 => (case ((freg_name_matches_prefix s3119_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3120_0)) => (case ((string_drop s3119_0 s3120_0)) of s3121_0 => (case ((sep_matches_prefix s3121_0)) of SOME ((() , s3122_0)) => (case ((string_drop s3121_0 s3122_0)) of s3123_0 => (case ((freg_name_matches_prefix s3123_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3124_0)) => let p0_ = (string_drop s3123_0 s3124_0) in if (((p0_ = ""))) then SOME (FLE_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3092_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3092_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s3093_0= ((case s3093_0 of s3094_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s3094_0)) of SOME ((FLT_D, s3095_0)) => (case ((string_drop s3094_0 s3095_0)) of s3096_0 => (case ((spc_matches_prefix0 s3096_0)) of SOME ((() , s3097_0)) => (case ((string_drop s3096_0 s3097_0)) of s3098_0 => (case ((reg_name_matches_prefix s3098_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3099_0)) => (case ((string_drop s3098_0 s3099_0)) of s3100_0 => (case ((sep_matches_prefix s3100_0)) of SOME ((() , s3101_0)) => (case ((string_drop s3100_0 s3101_0)) of s3102_0 => (case ((freg_name_matches_prefix s3102_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3103_0)) => (case ((string_drop s3102_0 s3103_0)) of s3104_0 => (case ((sep_matches_prefix s3104_0)) of SOME ((() , s3105_0)) => (case ((string_drop s3104_0 s3105_0)) of s3106_0 => (case ((freg_name_matches_prefix s3106_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3107_0)) => let p0_ = (string_drop s3106_0 s3107_0) in if (((p0_ = ""))) then SOME (FLT_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3075_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3075_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s3076_0= ((case s3076_0 of s3077_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s3077_0)) of SOME ((FEQ_D, s3078_0)) => (case ((string_drop s3077_0 s3078_0)) of s3079_0 => (case ((spc_matches_prefix0 s3079_0)) of SOME ((() , s3080_0)) => (case ((string_drop s3079_0 s3080_0)) of s3081_0 => (case ((reg_name_matches_prefix s3081_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3082_0)) => (case ((string_drop s3081_0 s3082_0)) of s3083_0 => (case ((sep_matches_prefix s3083_0)) of SOME ((() , s3084_0)) => (case ((string_drop s3083_0 s3084_0)) of s3085_0 => (case ((freg_name_matches_prefix s3085_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3086_0)) => (case ((string_drop s3085_0 s3086_0)) of s3087_0 => (case ((sep_matches_prefix s3087_0)) of SOME ((() , s3088_0)) => (case ((string_drop s3087_0 s3088_0)) of s3089_0 => (case ((freg_name_matches_prefix s3089_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3090_0)) => let p0_ = (string_drop s3089_0 s3090_0) in if (((p0_ = ""))) then SOME (FEQ_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3058_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3058_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s3059_0= ((case s3059_0 of s3060_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s3060_0)) of SOME ((FMAX_D, s3061_0)) => (case ((string_drop s3060_0 s3061_0)) of s3062_0 => (case ((spc_matches_prefix0 s3062_0)) of SOME ((() , s3063_0)) => (case ((string_drop s3062_0 s3063_0)) of s3064_0 => (case ((freg_name_matches_prefix s3064_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3065_0)) => (case ((string_drop s3064_0 s3065_0)) of s3066_0 => (case ((sep_matches_prefix s3066_0)) of SOME ((() , s3067_0)) => (case ((string_drop s3066_0 s3067_0)) of s3068_0 => (case ((freg_name_matches_prefix s3068_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3069_0)) => (case ((string_drop s3068_0 s3069_0)) of s3070_0 => (case ((sep_matches_prefix s3070_0)) of SOME ((() , s3071_0)) => (case ((string_drop s3070_0 s3071_0)) of s3072_0 => (case ((freg_name_matches_prefix s3072_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3073_0)) => let p0_ = (string_drop s3072_0 s3073_0) in if (((p0_ = ""))) then SOME (FMAX_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3041_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3041_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s3042_0= ((case s3042_0 of s3043_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s3043_0)) of SOME ((FMIN_D, s3044_0)) => (case ((string_drop s3043_0 s3044_0)) of s3045_0 => (case ((spc_matches_prefix0 s3045_0)) of SOME ((() , s3046_0)) => (case ((string_drop s3045_0 s3046_0)) of s3047_0 => (case ((freg_name_matches_prefix s3047_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3048_0)) => (case ((string_drop s3047_0 s3048_0)) of s3049_0 => (case ((sep_matches_prefix s3049_0)) of SOME ((() , s3050_0)) => (case ((string_drop s3049_0 s3050_0)) of s3051_0 => (case ((freg_name_matches_prefix s3051_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3052_0)) => (case ((string_drop s3051_0 s3052_0)) of s3053_0 => (case ((sep_matches_prefix s3053_0)) of SOME ((() , s3054_0)) => (case ((string_drop s3053_0 s3054_0)) of s3055_0 => (case ((freg_name_matches_prefix s3055_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3056_0)) => let p0_ = (string_drop s3055_0 s3056_0) in if (((p0_ = ""))) then SOME (FMIN_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3024_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3024_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s3025_0= ((case s3025_0 of s3026_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s3026_0)) of SOME ((FSGNJX_D, s3027_0)) => (case ((string_drop s3026_0 s3027_0)) of s3028_0 => (case ((spc_matches_prefix0 s3028_0)) of SOME ((() , s3029_0)) => (case ((string_drop s3028_0 s3029_0)) of s3030_0 => (case ((freg_name_matches_prefix s3030_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3031_0)) => (case ((string_drop s3030_0 s3031_0)) of s3032_0 => (case ((sep_matches_prefix s3032_0)) of SOME ((() , s3033_0)) => (case ((string_drop s3032_0 s3033_0)) of s3034_0 => (case ((freg_name_matches_prefix s3034_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3035_0)) => (case ((string_drop s3034_0 s3035_0)) of s3036_0 => (case ((sep_matches_prefix s3036_0)) of SOME ((() , s3037_0)) => (case ((string_drop s3036_0 s3037_0)) of s3038_0 => (case ((freg_name_matches_prefix s3038_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3039_0)) => let p0_ = (string_drop s3038_0 s3039_0) in if (((p0_ = ""))) then SOME (FSGNJX_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3007_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3007_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s3008_0= ((case s3008_0 of s3009_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s3009_0)) of SOME ((FSGNJN_D, s3010_0)) => (case ((string_drop s3009_0 s3010_0)) of s3011_0 => (case ((spc_matches_prefix0 s3011_0)) of SOME ((() , s3012_0)) => (case ((string_drop s3011_0 s3012_0)) of s3013_0 => (case ((freg_name_matches_prefix s3013_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3014_0)) => (case ((string_drop s3013_0 s3014_0)) of s3015_0 => (case ((sep_matches_prefix s3015_0)) of SOME ((() , s3016_0)) => (case ((string_drop s3015_0 s3016_0)) of s3017_0 => (case ((freg_name_matches_prefix s3017_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3018_0)) => (case ((string_drop s3017_0 s3018_0)) of s3019_0 => (case ((sep_matches_prefix s3019_0)) of SOME ((() , s3020_0)) => (case ((string_drop s3019_0 s3020_0)) of s3021_0 => (case ((freg_name_matches_prefix s3021_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3022_0)) => let p0_ = (string_drop s3021_0 s3022_0) in if (((p0_ = ""))) then SOME (FSGNJN_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2990_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2990_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s2991_0= ((case s2991_0 of s2992_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s2992_0)) of SOME ((FSGNJ_D, s2993_0)) => (case ((string_drop s2992_0 s2993_0)) of s2994_0 => (case ((spc_matches_prefix0 s2994_0)) of SOME ((() , s2995_0)) => (case ((string_drop s2994_0 s2995_0)) of s2996_0 => (case ((freg_name_matches_prefix s2996_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2997_0)) => (case ((string_drop s2996_0 s2997_0)) of s2998_0 => (case ((sep_matches_prefix s2998_0)) of SOME ((() , s2999_0)) => (case ((string_drop s2998_0 s2999_0)) of s3000_0 => (case ((freg_name_matches_prefix s3000_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3001_0)) => (case ((string_drop s3000_0 s3001_0)) of s3002_0 => (case ((sep_matches_prefix s3002_0)) of SOME ((() , s3003_0)) => (case ((string_drop s3002_0 s3003_0)) of s3004_0 => (case ((freg_name_matches_prefix s3004_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3005_0)) => let p0_ = (string_drop s3004_0 s3005_0) in if (((p0_ = ""))) then SOME (FSGNJ_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2973_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2973_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2974_0= ((case s2974_0 of s2975_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2975_0)) of SOME ((FCVT_D_S, s2976_0)) => (case ((string_drop s2975_0 s2976_0)) of s2977_0 => (case ((spc_matches_prefix0 s2977_0)) of SOME ((() , s2978_0)) => (case ((string_drop s2977_0 s2978_0)) of s2979_0 => (case ((freg_name_matches_prefix s2979_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2980_0)) => (case ((string_drop s2979_0 s2980_0)) of s2981_0 => (case ((sep_matches_prefix s2981_0)) of SOME ((() , s2982_0)) => (case ((string_drop s2981_0 s2982_0)) of s2983_0 => (case ((freg_name_matches_prefix s2983_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2984_0)) => (case ((string_drop s2983_0 s2984_0)) of s2985_0 => (case ((sep_matches_prefix s2985_0)) of SOME ((() , s2986_0)) => (case ((string_drop s2985_0 s2986_0)) of s2987_0 => (case ((frm_mnemonic_matches_prefix s2987_0)) of SOME ((rm, s2988_0)) => let p0_ = (string_drop s2987_0 s2988_0) in if (((p0_ = ""))) then SOME (FCVT_D_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2956_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2956_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2957_0= ((case s2957_0 of s2958_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2958_0)) of SOME ((FCVT_S_D, s2959_0)) => (case ((string_drop s2958_0 s2959_0)) of s2960_0 => (case ((spc_matches_prefix0 s2960_0)) of SOME ((() , s2961_0)) => (case ((string_drop s2960_0 s2961_0)) of s2962_0 => (case ((freg_name_matches_prefix s2962_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2963_0)) => (case ((string_drop s2962_0 s2963_0)) of s2964_0 => (case ((sep_matches_prefix s2964_0)) of SOME ((() , s2965_0)) => (case ((string_drop s2964_0 s2965_0)) of s2966_0 => (case ((freg_name_matches_prefix s2966_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2967_0)) => (case ((string_drop s2966_0 s2967_0)) of s2968_0 => (case ((sep_matches_prefix s2968_0)) of SOME ((() , s2969_0)) => (case ((string_drop s2968_0 s2969_0)) of s2970_0 => (case ((frm_mnemonic_matches_prefix s2970_0)) of SOME ((rm, s2971_0)) => let p0_ = (string_drop s2970_0 s2971_0) in if (((p0_ = ""))) then SOME (FCVT_S_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2939_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2939_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2940_0= ((case s2940_0 of s2941_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2941_0)) of SOME ((FCVT_D_LU, s2942_0)) => (case ((string_drop s2941_0 s2942_0)) of s2943_0 => (case ((spc_matches_prefix0 s2943_0)) of SOME ((() , s2944_0)) => (case ((string_drop s2943_0 s2944_0)) of s2945_0 => (case ((freg_name_matches_prefix s2945_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2946_0)) => (case ((string_drop s2945_0 s2946_0)) of s2947_0 => (case ((sep_matches_prefix s2947_0)) of SOME ((() , s2948_0)) => (case ((string_drop s2947_0 s2948_0)) of s2949_0 => (case ((reg_name_matches_prefix s2949_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2950_0)) => (case ((string_drop s2949_0 s2950_0)) of s2951_0 => (case ((sep_matches_prefix s2951_0)) of SOME ((() , s2952_0)) => (case ((string_drop s2951_0 s2952_0)) of s2953_0 => (case ((frm_mnemonic_matches_prefix s2953_0)) of SOME ((rm, s2954_0)) => let p0_ = (string_drop s2953_0 s2954_0) in if (((p0_ = ""))) then SOME (FCVT_D_LU, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2922_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2922_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2923_0= ((case s2923_0 of s2924_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2924_0)) of SOME ((FCVT_D_L, s2925_0)) => (case ((string_drop s2924_0 s2925_0)) of s2926_0 => (case ((spc_matches_prefix0 s2926_0)) of SOME ((() , s2927_0)) => (case ((string_drop s2926_0 s2927_0)) of s2928_0 => (case ((freg_name_matches_prefix s2928_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2929_0)) => (case ((string_drop s2928_0 s2929_0)) of s2930_0 => (case ((sep_matches_prefix s2930_0)) of SOME ((() , s2931_0)) => (case ((string_drop s2930_0 s2931_0)) of s2932_0 => (case ((reg_name_matches_prefix s2932_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2933_0)) => (case ((string_drop s2932_0 s2933_0)) of s2934_0 => (case ((sep_matches_prefix s2934_0)) of SOME ((() , s2935_0)) => (case ((string_drop s2934_0 s2935_0)) of s2936_0 => (case ((frm_mnemonic_matches_prefix s2936_0)) of SOME ((rm, s2937_0)) => let p0_ = (string_drop s2936_0 s2937_0) in if (((p0_ = ""))) then SOME (FCVT_D_L, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2905_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2905_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2906_0= ((case s2906_0 of s2907_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2907_0)) of SOME ((FCVT_LU_D, s2908_0)) => (case ((string_drop s2907_0 s2908_0)) of s2909_0 => (case ((spc_matches_prefix0 s2909_0)) of SOME ((() , s2910_0)) => (case ((string_drop s2909_0 s2910_0)) of s2911_0 => (case ((reg_name_matches_prefix s2911_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2912_0)) => (case ((string_drop s2911_0 s2912_0)) of s2913_0 => (case ((sep_matches_prefix s2913_0)) of SOME ((() , s2914_0)) => (case ((string_drop s2913_0 s2914_0)) of s2915_0 => (case ((freg_name_matches_prefix s2915_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2916_0)) => (case ((string_drop s2915_0 s2916_0)) of s2917_0 => (case ((sep_matches_prefix s2917_0)) of SOME ((() , s2918_0)) => (case ((string_drop s2917_0 s2918_0)) of s2919_0 => (case ((frm_mnemonic_matches_prefix s2919_0)) of SOME ((rm, s2920_0)) => let p0_ = (string_drop s2919_0 s2920_0) in if (((p0_ = ""))) then SOME (FCVT_LU_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2888_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2888_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2889_0= ((case s2889_0 of s2890_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2890_0)) of SOME ((FCVT_L_D, s2891_0)) => (case ((string_drop s2890_0 s2891_0)) of s2892_0 => (case ((spc_matches_prefix0 s2892_0)) of SOME ((() , s2893_0)) => (case ((string_drop s2892_0 s2893_0)) of s2894_0 => (case ((reg_name_matches_prefix s2894_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2895_0)) => (case ((string_drop s2894_0 s2895_0)) of s2896_0 => (case ((sep_matches_prefix s2896_0)) of SOME ((() , s2897_0)) => (case ((string_drop s2896_0 s2897_0)) of s2898_0 => (case ((freg_name_matches_prefix s2898_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2899_0)) => (case ((string_drop s2898_0 s2899_0)) of s2900_0 => (case ((sep_matches_prefix s2900_0)) of SOME ((() , s2901_0)) => (case ((string_drop s2900_0 s2901_0)) of s2902_0 => (case ((frm_mnemonic_matches_prefix s2902_0)) of SOME ((rm, s2903_0)) => let p0_ = (string_drop s2902_0 s2903_0) in if (((p0_ = ""))) then SOME (FCVT_L_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2871_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2871_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2872_0= ((case s2872_0 of s2873_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2873_0)) of SOME ((FCVT_D_WU, s2874_0)) => (case ((string_drop s2873_0 s2874_0)) of s2875_0 => (case ((spc_matches_prefix0 s2875_0)) of SOME ((() , s2876_0)) => (case ((string_drop s2875_0 s2876_0)) of s2877_0 => (case ((freg_name_matches_prefix s2877_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2878_0)) => (case ((string_drop s2877_0 s2878_0)) of s2879_0 => (case ((sep_matches_prefix s2879_0)) of SOME ((() , s2880_0)) => (case ((string_drop s2879_0 s2880_0)) of s2881_0 => (case ((reg_name_matches_prefix s2881_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2882_0)) => (case ((string_drop s2881_0 s2882_0)) of s2883_0 => (case ((sep_matches_prefix s2883_0)) of SOME ((() , s2884_0)) => (case ((string_drop s2883_0 s2884_0)) of s2885_0 => (case ((frm_mnemonic_matches_prefix s2885_0)) of SOME ((rm, s2886_0)) => let p0_ = (string_drop s2885_0 s2886_0) in if (((p0_ = ""))) then SOME (FCVT_D_WU, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2854_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2854_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2855_0= ((case s2855_0 of s2856_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2856_0)) of SOME ((FCVT_D_W, s2857_0)) => (case ((string_drop s2856_0 s2857_0)) of s2858_0 => (case ((spc_matches_prefix0 s2858_0)) of SOME ((() , s2859_0)) => (case ((string_drop s2858_0 s2859_0)) of s2860_0 => (case ((freg_name_matches_prefix s2860_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2861_0)) => (case ((string_drop s2860_0 s2861_0)) of s2862_0 => (case ((sep_matches_prefix s2862_0)) of SOME ((() , s2863_0)) => (case ((string_drop s2862_0 s2863_0)) of s2864_0 => (case ((reg_name_matches_prefix s2864_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2865_0)) => (case ((string_drop s2864_0 s2865_0)) of s2866_0 => (case ((sep_matches_prefix s2866_0)) of SOME ((() , s2867_0)) => (case ((string_drop s2866_0 s2867_0)) of s2868_0 => (case ((frm_mnemonic_matches_prefix s2868_0)) of SOME ((rm, s2869_0)) => let p0_ = (string_drop s2868_0 s2869_0) in if (((p0_ = ""))) then SOME (FCVT_D_W, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2837_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2837_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2838_0= ((case s2838_0 of s2839_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2839_0)) of SOME ((FCVT_WU_D, s2840_0)) => (case ((string_drop s2839_0 s2840_0)) of s2841_0 => (case ((spc_matches_prefix0 s2841_0)) of SOME ((() , s2842_0)) => (case ((string_drop s2841_0 s2842_0)) of s2843_0 => (case ((reg_name_matches_prefix s2843_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2844_0)) => (case ((string_drop s2843_0 s2844_0)) of s2845_0 => (case ((sep_matches_prefix s2845_0)) of SOME ((() , s2846_0)) => (case ((string_drop s2845_0 s2846_0)) of s2847_0 => (case ((freg_name_matches_prefix s2847_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2848_0)) => (case ((string_drop s2847_0 s2848_0)) of s2849_0 => (case ((sep_matches_prefix s2849_0)) of SOME ((() , s2850_0)) => (case ((string_drop s2849_0 s2850_0)) of s2851_0 => (case ((frm_mnemonic_matches_prefix s2851_0)) of SOME ((rm, s2852_0)) => let p0_ = (string_drop s2851_0 s2852_0) in if (((p0_ = ""))) then SOME (FCVT_WU_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2820_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2820_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2821_0= ((case s2821_0 of s2822_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2822_0)) of SOME ((FCVT_W_D, s2823_0)) => (case ((string_drop s2822_0 s2823_0)) of s2824_0 => (case ((spc_matches_prefix0 s2824_0)) of SOME ((() , s2825_0)) => (case ((string_drop s2824_0 s2825_0)) of s2826_0 => (case ((reg_name_matches_prefix s2826_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2827_0)) => (case ((string_drop s2826_0 s2827_0)) of s2828_0 => (case ((sep_matches_prefix s2828_0)) of SOME ((() , s2829_0)) => (case ((string_drop s2828_0 s2829_0)) of s2830_0 => (case ((freg_name_matches_prefix s2830_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2831_0)) => (case ((string_drop s2830_0 s2831_0)) of s2832_0 => (case ((sep_matches_prefix s2832_0)) of SOME ((() , s2833_0)) => (case ((string_drop s2832_0 s2833_0)) of s2834_0 => (case ((frm_mnemonic_matches_prefix s2834_0)) of SOME ((rm, s2835_0)) => let p0_ = (string_drop s2834_0 s2835_0) in if (((p0_ = ""))) then SOME (FCVT_W_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2803_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2803_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s2804_0= ((case s2804_0 of s2805_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s2805_0)) of SOME ((FSQRT_D, s2806_0)) => (case ((string_drop s2805_0 s2806_0)) of s2807_0 => (case ((spc_matches_prefix0 s2807_0)) of SOME ((() , s2808_0)) => (case ((string_drop s2807_0 s2808_0)) of s2809_0 => (case ((freg_name_matches_prefix s2809_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2810_0)) => (case ((string_drop s2809_0 s2810_0)) of s2811_0 => (case ((sep_matches_prefix s2811_0)) of SOME ((() , s2812_0)) => (case ((string_drop s2811_0 s2812_0)) of s2813_0 => (case ((freg_name_matches_prefix s2813_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2814_0)) => (case ((string_drop s2813_0 s2814_0)) of s2815_0 => (case ((sep_matches_prefix s2815_0)) of SOME ((() , s2816_0)) => (case ((string_drop s2815_0 s2816_0)) of s2817_0 => (case ((frm_mnemonic_matches_prefix s2817_0)) of SOME ((rm, s2818_0)) => let p0_ = (string_drop s2817_0 s2818_0) in if (((p0_ = ""))) then SOME (FSQRT_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2782_ : string -> maybe ((f_bin_rm_op_D * mword ty5 * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2782_:string ->(f_bin_rm_op_D#(5)words$word#(5)words$word#(5)words$word#rounding_mode)option) s2783_0= ((case s2783_0 of s2784_0 => (case ((f_bin_rm_type_mnemonic_D_matches_prefix s2784_0)) of SOME ((op, s2785_0)) => (case ((string_drop s2784_0 s2785_0)) of s2786_0 => (case ((spc_matches_prefix0 s2786_0)) of SOME ((() , s2787_0)) => (case ((string_drop s2786_0 s2787_0)) of s2788_0 => (case ((freg_name_matches_prefix s2788_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2789_0)) => (case ((string_drop s2788_0 s2789_0)) of s2790_0 => (case ((sep_matches_prefix s2790_0)) of SOME ((() , s2791_0)) => (case ((string_drop s2790_0 s2791_0)) of s2792_0 => (case ((freg_name_matches_prefix s2792_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2793_0)) => (case ((string_drop s2792_0 s2793_0)) of s2794_0 => (case ((sep_matches_prefix s2794_0)) of SOME ((() , s2795_0)) => (case ((string_drop s2794_0 s2795_0)) of s2796_0 => (case ((freg_name_matches_prefix s2796_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2797_0)) => (case ((string_drop s2796_0 s2797_0)) of s2798_0 => (case ((sep_matches_prefix s2798_0)) of SOME ((() , s2799_0)) => (case ((string_drop s2798_0 s2799_0)) of s2800_0 => (case ((frm_mnemonic_matches_prefix s2800_0)) of SOME ((rm, s2801_0)) => let p0_ = (string_drop s2800_0 s2801_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2757_ : string -> maybe ((f_madd_op_D * mword ty5 * mword ty5 * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2757_:string ->(f_madd_op_D#(5)words$word#(5)words$word#(5)words$word#(5)words$word#rounding_mode)option) s2758_0= ((case s2758_0 of s2759_0 => (case ((f_madd_type_mnemonic_D_matches_prefix s2759_0)) of SOME ((op, s2760_0)) => (case ((string_drop s2759_0 s2760_0)) of s2761_0 => (case ((spc_matches_prefix0 s2761_0)) of SOME ((() , s2762_0)) => (case ((string_drop s2761_0 s2762_0)) of s2763_0 => (case ((freg_name_matches_prefix s2763_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2764_0)) => (case ((string_drop s2763_0 s2764_0)) of s2765_0 => (case ((sep_matches_prefix s2765_0)) of SOME ((() , s2766_0)) => (case ((string_drop s2765_0 s2766_0)) of s2767_0 => (case ((freg_name_matches_prefix s2767_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2768_0)) => (case ((string_drop s2767_0 s2768_0)) of s2769_0 => (case ((sep_matches_prefix s2769_0)) of SOME ((() , s2770_0)) => (case ((string_drop s2769_0 s2770_0)) of s2771_0 => (case ((freg_name_matches_prefix s2771_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2772_0)) => (case ((string_drop s2771_0 s2772_0)) of s2773_0 => (case ((sep_matches_prefix s2773_0)) of SOME ((() , s2774_0)) => (case ((string_drop s2773_0 s2774_0)) of s2775_0 => (case ((freg_name_matches_prefix s2775_0 : (( 5 words$word # ii)) option)) of SOME ((rs3, s2776_0)) => (case ((string_drop s2775_0 s2776_0)) of s2777_0 => (case ((sep_matches_prefix s2777_0)) of SOME ((() , s2778_0)) => (case ((string_drop s2777_0 s2778_0)) of s2779_0 => (case ((frm_mnemonic_matches_prefix s2779_0)) of SOME ((rm, s2780_0)) => let p0_ = (string_drop s2779_0 s2780_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2, rs3, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2741_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s2741_:string ->((3)words$word#(3)words$word#(5)words$word)option) s2742_0= (let s2743_0 = s2742_0 in if ((string_startswith s2743_0 "c.fsw")) then (case ((string_drop s2743_0 ((string_length "c.fsw")))) of s2744_0 => (case ((spc_matches_prefix0 s2744_0)) of SOME ((() , s2745_0)) => (case ((string_drop s2744_0 s2745_0)) of s2746_0 => (case ((creg_name_matches_prefix s2746_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s2747_0)) => (case ((string_drop s2746_0 s2747_0)) of s2748_0 => (case ((sep_matches_prefix s2748_0)) of SOME ((() , s2749_0)) => (case ((string_drop s2748_0 s2749_0)) of s2750_0 => (case ((creg_name_matches_prefix s2750_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s2751_0)) => (case ((string_drop s2750_0 s2751_0)) of s2752_0 => (case ((sep_matches_prefix s2752_0)) of SOME ((() , s2753_0)) => (case ((string_drop s2752_0 s2753_0)) of s2754_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2754_0 : (( 7 words$word # ii)) option)) of SOME ((v__1446, s2755_0)) => if (((((subrange_vec_dec v__1446 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1446 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1446 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let p0_ = (string_drop s2754_0 s2755_0) in if (((p0_ = ""))) then SOME (rsc1, rsc2, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2725_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s2725_:string ->((3)words$word#(3)words$word#(5)words$word)option) s2726_0= (let s2727_0 = s2726_0 in if ((string_startswith s2727_0 "c.flw")) then (case ((string_drop s2727_0 ((string_length "c.flw")))) of s2728_0 => (case ((spc_matches_prefix0 s2728_0)) of SOME ((() , s2729_0)) => (case ((string_drop s2728_0 s2729_0)) of s2730_0 => (case ((creg_name_matches_prefix s2730_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s2731_0)) => (case ((string_drop s2730_0 s2731_0)) of s2732_0 => (case ((sep_matches_prefix s2732_0)) of SOME ((() , s2733_0)) => (case ((string_drop s2732_0 s2733_0)) of s2734_0 => (case ((creg_name_matches_prefix s2734_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s2735_0)) => (case ((string_drop s2734_0 s2735_0)) of s2736_0 => (case ((sep_matches_prefix s2736_0)) of SOME ((() , s2737_0)) => (case ((string_drop s2736_0 s2737_0)) of s2738_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2738_0 : (( 7 words$word # ii)) option)) of SOME ((v__1448, s2739_0)) => if (((((subrange_vec_dec v__1448 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1448 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1448 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let p0_ = (string_drop s2738_0 s2739_0) in if (((p0_ = ""))) then SOME (rdc, rsc, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2713_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s2713_:string ->((5)words$word#(6)words$word)option) s2714_0= (let s2715_0 = s2714_0 in if ((string_startswith s2715_0 "c.fswsp")) then (case ((string_drop s2715_0 ((string_length "c.fswsp")))) of s2716_0 => (case ((spc_matches_prefix0 s2716_0)) of SOME ((() , s2717_0)) => (case ((string_drop s2716_0 s2717_0)) of s2718_0 => (case ((reg_name_matches_prefix s2718_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2719_0)) => (case ((string_drop s2718_0 s2719_0)) of s2720_0 => (case ((sep_matches_prefix s2720_0)) of SOME ((() , s2721_0)) => (case ((string_drop s2720_0 s2721_0)) of s2722_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2722_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s2723_0)) => let p0_ = (string_drop s2722_0 s2723_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2701_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s2701_:string ->((5)words$word#(6)words$word)option) s2702_0= (let s2703_0 = s2702_0 in if ((string_startswith s2703_0 "c.flwsp")) then (case ((string_drop s2703_0 ((string_length "c.flwsp")))) of s2704_0 => (case ((spc_matches_prefix0 s2704_0)) of SOME ((() , s2705_0)) => (case ((string_drop s2704_0 s2705_0)) of s2706_0 => (case ((reg_name_matches_prefix s2706_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2707_0)) => (case ((string_drop s2706_0 s2707_0)) of s2708_0 => (case ((sep_matches_prefix s2708_0)) of SOME ((() , s2709_0)) => (case ((string_drop s2708_0 s2709_0)) of s2710_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2710_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s2711_0)) => let p0_ = (string_drop s2710_0 s2711_0) in if (((p0_ = ""))) then SOME (rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2688_ : string -> maybe ((f_un_op_S * mword ty5 * mword ty5))*) val _ = Define ` ((s2688_:string ->(f_un_op_S#(5)words$word#(5)words$word)option) s2689_0= ((case s2689_0 of s2690_0 => (case ((f_un_type_mnemonic_S_matches_prefix s2690_0)) of SOME ((FCLASS_S, s2691_0)) => (case ((string_drop s2690_0 s2691_0)) of s2692_0 => (case ((spc_matches_prefix0 s2692_0)) of SOME ((() , s2693_0)) => (case ((string_drop s2692_0 s2693_0)) of s2694_0 => (case ((reg_name_matches_prefix s2694_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2695_0)) => (case ((string_drop s2694_0 s2695_0)) of s2696_0 => (case ((sep_matches_prefix s2696_0)) of SOME ((() , s2697_0)) => (case ((string_drop s2696_0 s2697_0)) of s2698_0 => (case ((freg_name_matches_prefix s2698_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2699_0)) => let p0_ = (string_drop s2698_0 s2699_0) in if (((p0_ = ""))) then SOME (FCLASS_S, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2675_ : string -> maybe ((f_un_op_S * mword ty5 * mword ty5))*) val _ = Define ` ((s2675_:string ->(f_un_op_S#(5)words$word#(5)words$word)option) s2676_0= ((case s2676_0 of s2677_0 => (case ((f_un_type_mnemonic_S_matches_prefix s2677_0)) of SOME ((FMV_W_X, s2678_0)) => (case ((string_drop s2677_0 s2678_0)) of s2679_0 => (case ((spc_matches_prefix0 s2679_0)) of SOME ((() , s2680_0)) => (case ((string_drop s2679_0 s2680_0)) of s2681_0 => (case ((freg_name_matches_prefix s2681_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2682_0)) => (case ((string_drop s2681_0 s2682_0)) of s2683_0 => (case ((sep_matches_prefix s2683_0)) of SOME ((() , s2684_0)) => (case ((string_drop s2683_0 s2684_0)) of s2685_0 => (case ((reg_name_matches_prefix s2685_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2686_0)) => let p0_ = (string_drop s2685_0 s2686_0) in if (((p0_ = ""))) then SOME (FMV_W_X, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2662_ : string -> maybe ((f_un_op_S * mword ty5 * mword ty5))*) val _ = Define ` ((s2662_:string ->(f_un_op_S#(5)words$word#(5)words$word)option) s2663_0= ((case s2663_0 of s2664_0 => (case ((f_un_type_mnemonic_S_matches_prefix s2664_0)) of SOME ((FMV_X_W, s2665_0)) => (case ((string_drop s2664_0 s2665_0)) of s2666_0 => (case ((spc_matches_prefix0 s2666_0)) of SOME ((() , s2667_0)) => (case ((string_drop s2666_0 s2667_0)) of s2668_0 => (case ((reg_name_matches_prefix s2668_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2669_0)) => (case ((string_drop s2668_0 s2669_0)) of s2670_0 => (case ((sep_matches_prefix s2670_0)) of SOME ((() , s2671_0)) => (case ((string_drop s2670_0 s2671_0)) of s2672_0 => (case ((freg_name_matches_prefix s2672_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2673_0)) => let p0_ = (string_drop s2672_0 s2673_0) in if (((p0_ = ""))) then SOME (FMV_X_W, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2645_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2645_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s2646_0= ((case s2646_0 of s2647_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s2647_0)) of SOME ((FLE_S, s2648_0)) => (case ((string_drop s2647_0 s2648_0)) of s2649_0 => (case ((spc_matches_prefix0 s2649_0)) of SOME ((() , s2650_0)) => (case ((string_drop s2649_0 s2650_0)) of s2651_0 => (case ((reg_name_matches_prefix s2651_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2652_0)) => (case ((string_drop s2651_0 s2652_0)) of s2653_0 => (case ((sep_matches_prefix s2653_0)) of SOME ((() , s2654_0)) => (case ((string_drop s2653_0 s2654_0)) of s2655_0 => (case ((freg_name_matches_prefix s2655_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2656_0)) => (case ((string_drop s2655_0 s2656_0)) of s2657_0 => (case ((sep_matches_prefix s2657_0)) of SOME ((() , s2658_0)) => (case ((string_drop s2657_0 s2658_0)) of s2659_0 => (case ((freg_name_matches_prefix s2659_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2660_0)) => let p0_ = (string_drop s2659_0 s2660_0) in if (((p0_ = ""))) then SOME (FLE_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2628_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2628_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s2629_0= ((case s2629_0 of s2630_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s2630_0)) of SOME ((FLT_S, s2631_0)) => (case ((string_drop s2630_0 s2631_0)) of s2632_0 => (case ((spc_matches_prefix0 s2632_0)) of SOME ((() , s2633_0)) => (case ((string_drop s2632_0 s2633_0)) of s2634_0 => (case ((reg_name_matches_prefix s2634_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2635_0)) => (case ((string_drop s2634_0 s2635_0)) of s2636_0 => (case ((sep_matches_prefix s2636_0)) of SOME ((() , s2637_0)) => (case ((string_drop s2636_0 s2637_0)) of s2638_0 => (case ((freg_name_matches_prefix s2638_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2639_0)) => (case ((string_drop s2638_0 s2639_0)) of s2640_0 => (case ((sep_matches_prefix s2640_0)) of SOME ((() , s2641_0)) => (case ((string_drop s2640_0 s2641_0)) of s2642_0 => (case ((freg_name_matches_prefix s2642_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2643_0)) => let p0_ = (string_drop s2642_0 s2643_0) in if (((p0_ = ""))) then SOME (FLT_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2611_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2611_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s2612_0= ((case s2612_0 of s2613_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s2613_0)) of SOME ((FEQ_S, s2614_0)) => (case ((string_drop s2613_0 s2614_0)) of s2615_0 => (case ((spc_matches_prefix0 s2615_0)) of SOME ((() , s2616_0)) => (case ((string_drop s2615_0 s2616_0)) of s2617_0 => (case ((reg_name_matches_prefix s2617_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2618_0)) => (case ((string_drop s2617_0 s2618_0)) of s2619_0 => (case ((sep_matches_prefix s2619_0)) of SOME ((() , s2620_0)) => (case ((string_drop s2619_0 s2620_0)) of s2621_0 => (case ((freg_name_matches_prefix s2621_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2622_0)) => (case ((string_drop s2621_0 s2622_0)) of s2623_0 => (case ((sep_matches_prefix s2623_0)) of SOME ((() , s2624_0)) => (case ((string_drop s2623_0 s2624_0)) of s2625_0 => (case ((freg_name_matches_prefix s2625_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2626_0)) => let p0_ = (string_drop s2625_0 s2626_0) in if (((p0_ = ""))) then SOME (FEQ_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2594_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2594_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s2595_0= ((case s2595_0 of s2596_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s2596_0)) of SOME ((FMAX_S, s2597_0)) => (case ((string_drop s2596_0 s2597_0)) of s2598_0 => (case ((spc_matches_prefix0 s2598_0)) of SOME ((() , s2599_0)) => (case ((string_drop s2598_0 s2599_0)) of s2600_0 => (case ((freg_name_matches_prefix s2600_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2601_0)) => (case ((string_drop s2600_0 s2601_0)) of s2602_0 => (case ((sep_matches_prefix s2602_0)) of SOME ((() , s2603_0)) => (case ((string_drop s2602_0 s2603_0)) of s2604_0 => (case ((freg_name_matches_prefix s2604_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2605_0)) => (case ((string_drop s2604_0 s2605_0)) of s2606_0 => (case ((sep_matches_prefix s2606_0)) of SOME ((() , s2607_0)) => (case ((string_drop s2606_0 s2607_0)) of s2608_0 => (case ((freg_name_matches_prefix s2608_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2609_0)) => let p0_ = (string_drop s2608_0 s2609_0) in if (((p0_ = ""))) then SOME (FMAX_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2577_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2577_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s2578_0= ((case s2578_0 of s2579_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s2579_0)) of SOME ((FMIN_S, s2580_0)) => (case ((string_drop s2579_0 s2580_0)) of s2581_0 => (case ((spc_matches_prefix0 s2581_0)) of SOME ((() , s2582_0)) => (case ((string_drop s2581_0 s2582_0)) of s2583_0 => (case ((freg_name_matches_prefix s2583_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2584_0)) => (case ((string_drop s2583_0 s2584_0)) of s2585_0 => (case ((sep_matches_prefix s2585_0)) of SOME ((() , s2586_0)) => (case ((string_drop s2585_0 s2586_0)) of s2587_0 => (case ((freg_name_matches_prefix s2587_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2588_0)) => (case ((string_drop s2587_0 s2588_0)) of s2589_0 => (case ((sep_matches_prefix s2589_0)) of SOME ((() , s2590_0)) => (case ((string_drop s2589_0 s2590_0)) of s2591_0 => (case ((freg_name_matches_prefix s2591_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2592_0)) => let p0_ = (string_drop s2591_0 s2592_0) in if (((p0_ = ""))) then SOME (FMIN_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2560_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2560_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s2561_0= ((case s2561_0 of s2562_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s2562_0)) of SOME ((FSGNJX_S, s2563_0)) => (case ((string_drop s2562_0 s2563_0)) of s2564_0 => (case ((spc_matches_prefix0 s2564_0)) of SOME ((() , s2565_0)) => (case ((string_drop s2564_0 s2565_0)) of s2566_0 => (case ((freg_name_matches_prefix s2566_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2567_0)) => (case ((string_drop s2566_0 s2567_0)) of s2568_0 => (case ((sep_matches_prefix s2568_0)) of SOME ((() , s2569_0)) => (case ((string_drop s2568_0 s2569_0)) of s2570_0 => (case ((freg_name_matches_prefix s2570_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2571_0)) => (case ((string_drop s2570_0 s2571_0)) of s2572_0 => (case ((sep_matches_prefix s2572_0)) of SOME ((() , s2573_0)) => (case ((string_drop s2572_0 s2573_0)) of s2574_0 => (case ((freg_name_matches_prefix s2574_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2575_0)) => let p0_ = (string_drop s2574_0 s2575_0) in if (((p0_ = ""))) then SOME (FSGNJX_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2543_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2543_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s2544_0= ((case s2544_0 of s2545_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s2545_0)) of SOME ((FSGNJN_S, s2546_0)) => (case ((string_drop s2545_0 s2546_0)) of s2547_0 => (case ((spc_matches_prefix0 s2547_0)) of SOME ((() , s2548_0)) => (case ((string_drop s2547_0 s2548_0)) of s2549_0 => (case ((freg_name_matches_prefix s2549_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2550_0)) => (case ((string_drop s2549_0 s2550_0)) of s2551_0 => (case ((sep_matches_prefix s2551_0)) of SOME ((() , s2552_0)) => (case ((string_drop s2551_0 s2552_0)) of s2553_0 => (case ((freg_name_matches_prefix s2553_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2554_0)) => (case ((string_drop s2553_0 s2554_0)) of s2555_0 => (case ((sep_matches_prefix s2555_0)) of SOME ((() , s2556_0)) => (case ((string_drop s2555_0 s2556_0)) of s2557_0 => (case ((freg_name_matches_prefix s2557_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2558_0)) => let p0_ = (string_drop s2557_0 s2558_0) in if (((p0_ = ""))) then SOME (FSGNJN_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2526_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2526_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s2527_0= ((case s2527_0 of s2528_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s2528_0)) of SOME ((FSGNJ_S, s2529_0)) => (case ((string_drop s2528_0 s2529_0)) of s2530_0 => (case ((spc_matches_prefix0 s2530_0)) of SOME ((() , s2531_0)) => (case ((string_drop s2530_0 s2531_0)) of s2532_0 => (case ((freg_name_matches_prefix s2532_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2533_0)) => (case ((string_drop s2532_0 s2533_0)) of s2534_0 => (case ((sep_matches_prefix s2534_0)) of SOME ((() , s2535_0)) => (case ((string_drop s2534_0 s2535_0)) of s2536_0 => (case ((freg_name_matches_prefix s2536_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2537_0)) => (case ((string_drop s2536_0 s2537_0)) of s2538_0 => (case ((sep_matches_prefix s2538_0)) of SOME ((() , s2539_0)) => (case ((string_drop s2538_0 s2539_0)) of s2540_0 => (case ((freg_name_matches_prefix s2540_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2541_0)) => let p0_ = (string_drop s2540_0 s2541_0) in if (((p0_ = ""))) then SOME (FSGNJ_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2509_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2509_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s2510_0= ((case s2510_0 of s2511_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s2511_0)) of SOME ((FCVT_S_LU, s2512_0)) => (case ((string_drop s2511_0 s2512_0)) of s2513_0 => (case ((spc_matches_prefix0 s2513_0)) of SOME ((() , s2514_0)) => (case ((string_drop s2513_0 s2514_0)) of s2515_0 => (case ((freg_name_matches_prefix s2515_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2516_0)) => (case ((string_drop s2515_0 s2516_0)) of s2517_0 => (case ((sep_matches_prefix s2517_0)) of SOME ((() , s2518_0)) => (case ((string_drop s2517_0 s2518_0)) of s2519_0 => (case ((reg_name_matches_prefix s2519_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2520_0)) => (case ((string_drop s2519_0 s2520_0)) of s2521_0 => (case ((sep_matches_prefix s2521_0)) of SOME ((() , s2522_0)) => (case ((string_drop s2521_0 s2522_0)) of s2523_0 => (case ((frm_mnemonic_matches_prefix s2523_0)) of SOME ((rm, s2524_0)) => let p0_ = (string_drop s2523_0 s2524_0) in if (((p0_ = ""))) then SOME (FCVT_S_LU, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2492_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2492_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s2493_0= ((case s2493_0 of s2494_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s2494_0)) of SOME ((FCVT_S_L, s2495_0)) => (case ((string_drop s2494_0 s2495_0)) of s2496_0 => (case ((spc_matches_prefix0 s2496_0)) of SOME ((() , s2497_0)) => (case ((string_drop s2496_0 s2497_0)) of s2498_0 => (case ((freg_name_matches_prefix s2498_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2499_0)) => (case ((string_drop s2498_0 s2499_0)) of s2500_0 => (case ((sep_matches_prefix s2500_0)) of SOME ((() , s2501_0)) => (case ((string_drop s2500_0 s2501_0)) of s2502_0 => (case ((reg_name_matches_prefix s2502_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2503_0)) => (case ((string_drop s2502_0 s2503_0)) of s2504_0 => (case ((sep_matches_prefix s2504_0)) of SOME ((() , s2505_0)) => (case ((string_drop s2504_0 s2505_0)) of s2506_0 => (case ((frm_mnemonic_matches_prefix s2506_0)) of SOME ((rm, s2507_0)) => let p0_ = (string_drop s2506_0 s2507_0) in if (((p0_ = ""))) then SOME (FCVT_S_L, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2475_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2475_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s2476_0= ((case s2476_0 of s2477_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s2477_0)) of SOME ((FCVT_LU_S, s2478_0)) => (case ((string_drop s2477_0 s2478_0)) of s2479_0 => (case ((spc_matches_prefix0 s2479_0)) of SOME ((() , s2480_0)) => (case ((string_drop s2479_0 s2480_0)) of s2481_0 => (case ((reg_name_matches_prefix s2481_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2482_0)) => (case ((string_drop s2481_0 s2482_0)) of s2483_0 => (case ((sep_matches_prefix s2483_0)) of SOME ((() , s2484_0)) => (case ((string_drop s2483_0 s2484_0)) of s2485_0 => (case ((freg_name_matches_prefix s2485_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2486_0)) => (case ((string_drop s2485_0 s2486_0)) of s2487_0 => (case ((sep_matches_prefix s2487_0)) of SOME ((() , s2488_0)) => (case ((string_drop s2487_0 s2488_0)) of s2489_0 => (case ((frm_mnemonic_matches_prefix s2489_0)) of SOME ((rm, s2490_0)) => let p0_ = (string_drop s2489_0 s2490_0) in if (((p0_ = ""))) then SOME (FCVT_LU_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2458_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2458_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s2459_0= ((case s2459_0 of s2460_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s2460_0)) of SOME ((FCVT_L_S, s2461_0)) => (case ((string_drop s2460_0 s2461_0)) of s2462_0 => (case ((spc_matches_prefix0 s2462_0)) of SOME ((() , s2463_0)) => (case ((string_drop s2462_0 s2463_0)) of s2464_0 => (case ((reg_name_matches_prefix s2464_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2465_0)) => (case ((string_drop s2464_0 s2465_0)) of s2466_0 => (case ((sep_matches_prefix s2466_0)) of SOME ((() , s2467_0)) => (case ((string_drop s2466_0 s2467_0)) of s2468_0 => (case ((freg_name_matches_prefix s2468_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2469_0)) => (case ((string_drop s2468_0 s2469_0)) of s2470_0 => (case ((sep_matches_prefix s2470_0)) of SOME ((() , s2471_0)) => (case ((string_drop s2470_0 s2471_0)) of s2472_0 => (case ((frm_mnemonic_matches_prefix s2472_0)) of SOME ((rm, s2473_0)) => let p0_ = (string_drop s2472_0 s2473_0) in if (((p0_ = ""))) then SOME (FCVT_L_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2441_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2441_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s2442_0= ((case s2442_0 of s2443_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s2443_0)) of SOME ((FCVT_S_WU, s2444_0)) => (case ((string_drop s2443_0 s2444_0)) of s2445_0 => (case ((spc_matches_prefix0 s2445_0)) of SOME ((() , s2446_0)) => (case ((string_drop s2445_0 s2446_0)) of s2447_0 => (case ((freg_name_matches_prefix s2447_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2448_0)) => (case ((string_drop s2447_0 s2448_0)) of s2449_0 => (case ((sep_matches_prefix s2449_0)) of SOME ((() , s2450_0)) => (case ((string_drop s2449_0 s2450_0)) of s2451_0 => (case ((reg_name_matches_prefix s2451_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2452_0)) => (case ((string_drop s2451_0 s2452_0)) of s2453_0 => (case ((sep_matches_prefix s2453_0)) of SOME ((() , s2454_0)) => (case ((string_drop s2453_0 s2454_0)) of s2455_0 => (case ((frm_mnemonic_matches_prefix s2455_0)) of SOME ((rm, s2456_0)) => let p0_ = (string_drop s2455_0 s2456_0) in if (((p0_ = ""))) then SOME (FCVT_S_WU, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2424_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2424_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s2425_0= ((case s2425_0 of s2426_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s2426_0)) of SOME ((FCVT_S_W, s2427_0)) => (case ((string_drop s2426_0 s2427_0)) of s2428_0 => (case ((spc_matches_prefix0 s2428_0)) of SOME ((() , s2429_0)) => (case ((string_drop s2428_0 s2429_0)) of s2430_0 => (case ((freg_name_matches_prefix s2430_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2431_0)) => (case ((string_drop s2430_0 s2431_0)) of s2432_0 => (case ((sep_matches_prefix s2432_0)) of SOME ((() , s2433_0)) => (case ((string_drop s2432_0 s2433_0)) of s2434_0 => (case ((reg_name_matches_prefix s2434_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2435_0)) => (case ((string_drop s2434_0 s2435_0)) of s2436_0 => (case ((sep_matches_prefix s2436_0)) of SOME ((() , s2437_0)) => (case ((string_drop s2436_0 s2437_0)) of s2438_0 => (case ((frm_mnemonic_matches_prefix s2438_0)) of SOME ((rm, s2439_0)) => let p0_ = (string_drop s2438_0 s2439_0) in if (((p0_ = ""))) then SOME (FCVT_S_W, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2407_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2407_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s2408_0= ((case s2408_0 of s2409_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s2409_0)) of SOME ((FCVT_WU_S, s2410_0)) => (case ((string_drop s2409_0 s2410_0)) of s2411_0 => (case ((spc_matches_prefix0 s2411_0)) of SOME ((() , s2412_0)) => (case ((string_drop s2411_0 s2412_0)) of s2413_0 => (case ((reg_name_matches_prefix s2413_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2414_0)) => (case ((string_drop s2413_0 s2414_0)) of s2415_0 => (case ((sep_matches_prefix s2415_0)) of SOME ((() , s2416_0)) => (case ((string_drop s2415_0 s2416_0)) of s2417_0 => (case ((freg_name_matches_prefix s2417_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2418_0)) => (case ((string_drop s2417_0 s2418_0)) of s2419_0 => (case ((sep_matches_prefix s2419_0)) of SOME ((() , s2420_0)) => (case ((string_drop s2419_0 s2420_0)) of s2421_0 => (case ((frm_mnemonic_matches_prefix s2421_0)) of SOME ((rm, s2422_0)) => let p0_ = (string_drop s2421_0 s2422_0) in if (((p0_ = ""))) then SOME (FCVT_WU_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2390_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2390_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s2391_0= ((case s2391_0 of s2392_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s2392_0)) of SOME ((FCVT_W_S, s2393_0)) => (case ((string_drop s2392_0 s2393_0)) of s2394_0 => (case ((spc_matches_prefix0 s2394_0)) of SOME ((() , s2395_0)) => (case ((string_drop s2394_0 s2395_0)) of s2396_0 => (case ((reg_name_matches_prefix s2396_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2397_0)) => (case ((string_drop s2396_0 s2397_0)) of s2398_0 => (case ((sep_matches_prefix s2398_0)) of SOME ((() , s2399_0)) => (case ((string_drop s2398_0 s2399_0)) of s2400_0 => (case ((freg_name_matches_prefix s2400_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2401_0)) => (case ((string_drop s2400_0 s2401_0)) of s2402_0 => (case ((sep_matches_prefix s2402_0)) of SOME ((() , s2403_0)) => (case ((string_drop s2402_0 s2403_0)) of s2404_0 => (case ((frm_mnemonic_matches_prefix s2404_0)) of SOME ((rm, s2405_0)) => let p0_ = (string_drop s2404_0 s2405_0) in if (((p0_ = ""))) then SOME (FCVT_W_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2373_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2373_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s2374_0= ((case s2374_0 of s2375_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s2375_0)) of SOME ((FSQRT_S, s2376_0)) => (case ((string_drop s2375_0 s2376_0)) of s2377_0 => (case ((spc_matches_prefix0 s2377_0)) of SOME ((() , s2378_0)) => (case ((string_drop s2377_0 s2378_0)) of s2379_0 => (case ((freg_name_matches_prefix s2379_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2380_0)) => (case ((string_drop s2379_0 s2380_0)) of s2381_0 => (case ((sep_matches_prefix s2381_0)) of SOME ((() , s2382_0)) => (case ((string_drop s2381_0 s2382_0)) of s2383_0 => (case ((freg_name_matches_prefix s2383_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2384_0)) => (case ((string_drop s2383_0 s2384_0)) of s2385_0 => (case ((sep_matches_prefix s2385_0)) of SOME ((() , s2386_0)) => (case ((string_drop s2385_0 s2386_0)) of s2387_0 => (case ((frm_mnemonic_matches_prefix s2387_0)) of SOME ((rm, s2388_0)) => let p0_ = (string_drop s2387_0 s2388_0) in if (((p0_ = ""))) then SOME (FSQRT_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2352_ : string -> maybe ((f_bin_rm_op_S * mword ty5 * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2352_:string ->(f_bin_rm_op_S#(5)words$word#(5)words$word#(5)words$word#rounding_mode)option) s2353_0= ((case s2353_0 of s2354_0 => (case ((f_bin_rm_type_mnemonic_S_matches_prefix s2354_0)) of SOME ((op, s2355_0)) => (case ((string_drop s2354_0 s2355_0)) of s2356_0 => (case ((spc_matches_prefix0 s2356_0)) of SOME ((() , s2357_0)) => (case ((string_drop s2356_0 s2357_0)) of s2358_0 => (case ((freg_name_matches_prefix s2358_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2359_0)) => (case ((string_drop s2358_0 s2359_0)) of s2360_0 => (case ((sep_matches_prefix s2360_0)) of SOME ((() , s2361_0)) => (case ((string_drop s2360_0 s2361_0)) of s2362_0 => (case ((freg_name_matches_prefix s2362_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2363_0)) => (case ((string_drop s2362_0 s2363_0)) of s2364_0 => (case ((sep_matches_prefix s2364_0)) of SOME ((() , s2365_0)) => (case ((string_drop s2364_0 s2365_0)) of s2366_0 => (case ((freg_name_matches_prefix s2366_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2367_0)) => (case ((string_drop s2366_0 s2367_0)) of s2368_0 => (case ((sep_matches_prefix s2368_0)) of SOME ((() , s2369_0)) => (case ((string_drop s2368_0 s2369_0)) of s2370_0 => (case ((frm_mnemonic_matches_prefix s2370_0)) of SOME ((rm, s2371_0)) => let p0_ = (string_drop s2370_0 s2371_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2327_ : string -> maybe ((f_madd_op_S * mword ty5 * mword ty5 * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s2327_:string ->(f_madd_op_S#(5)words$word#(5)words$word#(5)words$word#(5)words$word#rounding_mode)option) s2328_0= ((case s2328_0 of s2329_0 => (case ((f_madd_type_mnemonic_S_matches_prefix s2329_0)) of SOME ((op, s2330_0)) => (case ((string_drop s2329_0 s2330_0)) of s2331_0 => (case ((spc_matches_prefix0 s2331_0)) of SOME ((() , s2332_0)) => (case ((string_drop s2331_0 s2332_0)) of s2333_0 => (case ((freg_name_matches_prefix s2333_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2334_0)) => (case ((string_drop s2333_0 s2334_0)) of s2335_0 => (case ((sep_matches_prefix s2335_0)) of SOME ((() , s2336_0)) => (case ((string_drop s2335_0 s2336_0)) of s2337_0 => (case ((freg_name_matches_prefix s2337_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2338_0)) => (case ((string_drop s2337_0 s2338_0)) of s2339_0 => (case ((sep_matches_prefix s2339_0)) of SOME ((() , s2340_0)) => (case ((string_drop s2339_0 s2340_0)) of s2341_0 => (case ((freg_name_matches_prefix s2341_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2342_0)) => (case ((string_drop s2341_0 s2342_0)) of s2343_0 => (case ((sep_matches_prefix s2343_0)) of SOME ((() , s2344_0)) => (case ((string_drop s2343_0 s2344_0)) of s2345_0 => (case ((freg_name_matches_prefix s2345_0 : (( 5 words$word # ii)) option)) of SOME ((rs3, s2346_0)) => (case ((string_drop s2345_0 s2346_0)) of s2347_0 => (case ((sep_matches_prefix s2347_0)) of SOME ((() , s2348_0)) => (case ((string_drop s2347_0 s2348_0)) of s2349_0 => (case ((frm_mnemonic_matches_prefix s2349_0)) of SOME ((rm, s2350_0)) => let p0_ = (string_drop s2349_0 s2350_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2, rs3, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2303_ : string -> maybe ((word_width * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s2303_:string ->(word_width#(5)words$word#(12)words$word#(5)words$word)option) s2304_0= (let s2305_0 = s2304_0 in if ((string_startswith s2305_0 "fs")) then (case ((string_drop s2305_0 ((string_length "fs")))) of s2306_0 => (case ((size_mnemonic_matches_prefix s2306_0)) of SOME ((width, s2307_0)) => (case ((string_drop s2306_0 s2307_0)) of s2308_0 => (case ((spc_matches_prefix0 s2308_0)) of SOME ((() , s2309_0)) => (case ((string_drop s2308_0 s2309_0)) of s2310_0 => (case ((freg_name_matches_prefix s2310_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2311_0)) => (case ((string_drop s2310_0 s2311_0)) of s2312_0 => (case ((sep_matches_prefix s2312_0)) of SOME ((() , s2313_0)) => (case ((string_drop s2312_0 s2313_0)) of s2314_0 => (case ((hex_bits_12_matches_prefix0 s2314_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s2315_0)) => (case ((string_drop s2314_0 s2315_0)) of s2316_0 => (case ((opt_spc_matches_prefix0 s2316_0)) of SOME ((() , s2317_0)) => let s2318_0 = (string_drop s2316_0 s2317_0) in if ((string_startswith s2318_0 "(")) then (case ((string_drop s2318_0 ((string_length "(")))) of s2319_0 => (case ((opt_spc_matches_prefix0 s2319_0)) of SOME ((() , s2320_0)) => (case ((string_drop s2319_0 s2320_0)) of s2321_0 => (case ((reg_name_matches_prefix s2321_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2322_0)) => (case ((string_drop s2321_0 s2322_0)) of s2323_0 => (case ((opt_spc_matches_prefix0 s2323_0)) of SOME ((() , s2324_0)) => let s2325_0 = (string_drop s2323_0 s2324_0) in if ((string_startswith s2325_0 ")")) then let p0_ = (string_drop s2325_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (width, rs2, imm, rs1) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2279_ : string -> maybe ((word_width * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s2279_:string ->(word_width#(5)words$word#(12)words$word#(5)words$word)option) s2280_0= (let s2281_0 = s2280_0 in if ((string_startswith s2281_0 "fl")) then (case ((string_drop s2281_0 ((string_length "fl")))) of s2282_0 => (case ((size_mnemonic_matches_prefix s2282_0)) of SOME ((width, s2283_0)) => (case ((string_drop s2282_0 s2283_0)) of s2284_0 => (case ((spc_matches_prefix0 s2284_0)) of SOME ((() , s2285_0)) => (case ((string_drop s2284_0 s2285_0)) of s2286_0 => (case ((freg_name_matches_prefix s2286_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2287_0)) => (case ((string_drop s2286_0 s2287_0)) of s2288_0 => (case ((sep_matches_prefix s2288_0)) of SOME ((() , s2289_0)) => (case ((string_drop s2288_0 s2289_0)) of s2290_0 => (case ((hex_bits_12_matches_prefix0 s2290_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s2291_0)) => (case ((string_drop s2290_0 s2291_0)) of s2292_0 => (case ((opt_spc_matches_prefix0 s2292_0)) of SOME ((() , s2293_0)) => let s2294_0 = (string_drop s2292_0 s2293_0) in if ((string_startswith s2294_0 "(")) then (case ((string_drop s2294_0 ((string_length "(")))) of s2295_0 => (case ((opt_spc_matches_prefix0 s2295_0)) of SOME ((() , s2296_0)) => (case ((string_drop s2295_0 s2296_0)) of s2297_0 => (case ((reg_name_matches_prefix s2297_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2298_0)) => (case ((string_drop s2297_0 s2298_0)) of s2299_0 => (case ((opt_spc_matches_prefix0 s2299_0)) of SOME ((() , s2300_0)) => let s2301_0 = (string_drop s2299_0 s2300_0) in if ((string_startswith s2301_0 ")")) then let p0_ = (string_drop s2301_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (width, rd, imm, rs1) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2267_ : string -> maybe ((mword ty5 * mword ty5 * mword ty12))*) val _ = Define ` ((s2267_:string ->((5)words$word#(5)words$word#(12)words$word)option) s2268_0= (let s2269_0 = s2268_0 in if ((string_startswith s2269_0 "fence.i.reserved.")) then (case ((string_drop s2269_0 ((string_length "fence.i.reserved.")))) of s2270_0 => (case ((reg_name_matches_prefix s2270_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2271_0)) => let s2272_0 = (string_drop s2270_0 s2271_0) in if ((string_startswith s2272_0 ".")) then (case ((string_drop s2272_0 ((string_length ".")))) of s2273_0 => (case ((reg_name_matches_prefix s2273_0 : (( 5 words$word # ii)) option)) of SOME ((rs, s2274_0)) => let s2275_0 = (string_drop s2273_0 s2274_0) in if ((string_startswith s2275_0 ".")) then (case ((string_drop s2275_0 ((string_length ".")))) of s2276_0 => (case ((hex_bits_12_matches_prefix0 s2276_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s2277_0)) => let p0_ = (string_drop s2276_0 s2277_0) in if (((p0_ = ""))) then SOME (rd, rs, imm) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s2249_ : string -> maybe ((mword ty4 * mword ty4 * mword ty5 * mword ty5 * mword ty4))*) val _ = Define ` ((s2249_:string ->((4)words$word#(4)words$word#(5)words$word#(5)words$word#(4)words$word)option) s2250_0= (let s2251_0 = s2250_0 in if ((string_startswith s2251_0 "fence.reserved.")) then (case ((string_drop s2251_0 ((string_length "fence.reserved.")))) of s2252_0 => (case ((fence_bits_matches_prefix s2252_0 : (( 4 words$word # ii)) option)) of SOME ((pred, s2253_0)) => let s2254_0 = (string_drop s2252_0 s2253_0) in if ((string_startswith s2254_0 ".")) then (case ((string_drop s2254_0 ((string_length ".")))) of s2255_0 => (case ((fence_bits_matches_prefix s2255_0 : (( 4 words$word # ii)) option)) of SOME ((succ, s2256_0)) => let s2257_0 = (string_drop s2255_0 s2256_0) in if ((string_startswith s2257_0 ".")) then (case ((string_drop s2257_0 ((string_length ".")))) of s2258_0 => (case ((reg_name_matches_prefix s2258_0 : (( 5 words$word # ii)) option)) of SOME ((rs, s2259_0)) => let s2260_0 = (string_drop s2258_0 s2259_0) in if ((string_startswith s2260_0 ".")) then (case ((string_drop s2260_0 ((string_length ".")))) of s2261_0 => (case ((reg_name_matches_prefix s2261_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2262_0)) => let s2263_0 = (string_drop s2261_0 s2262_0) in if ((string_startswith s2263_0 ".")) then (case ((string_drop s2263_0 ((string_length ".")))) of s2264_0 => (case ((hex_bits_4_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2264_0 : (( 4 words$word # ii)) option)) of SOME ((fm, s2265_0)) => let p0_ = (string_drop s2264_0 s2265_0) in if (((p0_ = ""))) then SOME (pred, succ, rs, rd, fm) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s2243_ : string -> maybe (mword ty3)*) val _ = Define ` ((s2243_:string ->((3)words$word)option) s2244_0= (let s2245_0 = s2244_0 in if ((string_startswith s2245_0 "c.srai.hint.")) then (case ((string_drop s2245_0 ((string_length "c.srai.hint.")))) of s2246_0 => (case ((creg_name_matches_prefix s2246_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s2247_0)) => let p0_ = (string_drop s2246_0 s2247_0) in if (((p0_ = ""))) then SOME rsd else NONE | _ => NONE ) ) else NONE))`; (*val _s2237_ : string -> maybe (mword ty3)*) val _ = Define ` ((s2237_:string ->((3)words$word)option) s2238_0= (let s2239_0 = s2238_0 in if ((string_startswith s2239_0 "c.srli.hint.")) then (case ((string_drop s2239_0 ((string_length "c.srli.hint.")))) of s2240_0 => (case ((creg_name_matches_prefix s2240_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s2241_0)) => let p0_ = (string_drop s2240_0 s2241_0) in if (((p0_ = ""))) then SOME rsd else NONE | _ => NONE ) ) else NONE))`; (*val _s2228_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s2228_:string ->((5)words$word#(6)words$word)option) s2229_0= (let s2230_0 = s2229_0 in if ((string_startswith s2230_0 "c.slli.hint.")) then (case ((string_drop s2230_0 ((string_length "c.slli.hint.")))) of s2231_0 => (case ((reg_name_matches_prefix s2231_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s2232_0)) => let s2233_0 = (string_drop s2231_0 s2232_0) in if ((string_startswith s2233_0 ".")) then (case ((string_drop s2233_0 ((string_length ".")))) of s2234_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2234_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s2235_0)) => let p0_ = (string_drop s2234_0 s2235_0) in if (((p0_ = ""))) then SOME (rsd, shamt) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s2222_ : string -> maybe (mword ty5)*) val _ = Define ` ((s2222_:string ->((5)words$word)option) s2223_0= (let s2224_0 = s2223_0 in if ((string_startswith s2224_0 "c.add.hint.")) then (case ((string_drop s2224_0 ((string_length "c.add.hint.")))) of s2225_0 => (case ((reg_name_matches_prefix s2225_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2226_0)) => let p0_ = (string_drop s2225_0 s2226_0) in if (((p0_ = ""))) then SOME rs2 else NONE | _ => NONE ) ) else NONE))`; (*val _s2216_ : string -> maybe (mword ty5)*) val _ = Define ` ((s2216_:string ->((5)words$word)option) s2217_0= (let s2218_0 = s2217_0 in if ((string_startswith s2218_0 "c.mv.hint.")) then (case ((string_drop s2218_0 ((string_length "c.mv.hint.")))) of s2219_0 => (case ((reg_name_matches_prefix s2219_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2220_0)) => let p0_ = (string_drop s2219_0 s2220_0) in if (((p0_ = ""))) then SOME rs2 else NONE | _ => NONE ) ) else NONE))`; (*val _s2210_ : string -> maybe (mword ty6)*) val _ = Define ` ((s2210_:string ->((6)words$word)option) s2211_0= (let s2212_0 = s2211_0 in if ((string_startswith s2212_0 "c.lui.hint.")) then (case ((string_drop s2212_0 ((string_length "c.lui.hint.")))) of s2213_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2213_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s2214_0)) => let p0_ = (string_drop s2213_0 s2214_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) else NONE))`; (*val _s2204_ : string -> maybe (mword ty6)*) val _ = Define ` ((s2204_:string ->((6)words$word)option) s2205_0= (let s2206_0 = s2205_0 in if ((string_startswith s2206_0 "c.li.hint.")) then (case ((string_drop s2206_0 ((string_length "c.li.hint.")))) of s2207_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2207_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s2208_0)) => let p0_ = (string_drop s2207_0 s2208_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) else NONE))`; (*val _s2198_ : string -> maybe (mword ty5)*) val _ = Define ` ((s2198_:string ->((5)words$word)option) s2199_0= (let s2200_0 = s2199_0 in if ((string_startswith s2200_0 "c.addi.hint.")) then (case ((string_drop s2200_0 ((string_length "c.addi.hint.")))) of s2201_0 => (case ((reg_name_matches_prefix s2201_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s2202_0)) => let p0_ = (string_drop s2201_0 s2202_0) in if (((p0_ = ""))) then SOME rsd else NONE | _ => NONE ) ) else NONE))`; (*val _s2192_ : string -> maybe (mword ty6)*) val _ = Define ` ((s2192_:string ->((6)words$word)option) s2193_0= (let s2194_0 = s2193_0 in if ((string_startswith s2194_0 "c.nop.hint.")) then (case ((string_drop s2194_0 ((string_length "c.nop.hint.")))) of s2195_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2195_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s2196_0)) => let p0_ = (string_drop s2195_0 s2196_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) else NONE))`; (*val _s2175_ : string -> maybe ((csrop * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s2175_:string ->(csrop#(5)words$word#(12)words$word#(5)words$word)option) s2176_0= ((case s2176_0 of s2177_0 => (case ((csr_mnemonic_matches_prefix s2177_0)) of SOME ((op, s2178_0)) => (case ((string_drop s2177_0 s2178_0)) of s2179_0 => (case ((spc_matches_prefix0 s2179_0)) of SOME ((() , s2180_0)) => (case ((string_drop s2179_0 s2180_0)) of s2181_0 => (case ((reg_name_matches_prefix s2181_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2182_0)) => (case ((string_drop s2181_0 s2182_0)) of s2183_0 => (case ((sep_matches_prefix s2183_0)) of SOME ((() , s2184_0)) => (case ((string_drop s2183_0 s2184_0)) of s2185_0 => (case ((csr_name_map_matches_prefix s2185_0 : (( 12 words$word # ii)) option)) of SOME ((csr, s2186_0)) => (case ((string_drop s2185_0 s2186_0)) of s2187_0 => (case ((sep_matches_prefix s2187_0)) of SOME ((() , s2188_0)) => (case ((string_drop s2187_0 s2188_0)) of s2189_0 => (case ((reg_name_matches_prefix s2189_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2190_0)) => let p0_ = (string_drop s2189_0 s2190_0) in if (((p0_ = ""))) then SOME (op, rd, csr, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2157_ : string -> maybe ((csrop * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s2157_:string ->(csrop#(5)words$word#(12)words$word#(5)words$word)option) s2158_0= ((case s2158_0 of s2159_0 => (case ((csr_mnemonic_matches_prefix s2159_0)) of SOME ((op, s2160_0)) => let s2161_0 = (string_drop s2159_0 s2160_0) in if ((string_startswith s2161_0 "i")) then (case ((string_drop s2161_0 ((string_length "i")))) of s2162_0 => (case ((spc_matches_prefix0 s2162_0)) of SOME ((() , s2163_0)) => (case ((string_drop s2162_0 s2163_0)) of s2164_0 => (case ((reg_name_matches_prefix s2164_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2165_0)) => (case ((string_drop s2164_0 s2165_0)) of s2166_0 => (case ((sep_matches_prefix s2166_0)) of SOME ((() , s2167_0)) => (case ((string_drop s2166_0 s2167_0)) of s2168_0 => (case ((csr_name_map_matches_prefix s2168_0 : (( 12 words$word # ii)) option)) of SOME ((csr, s2169_0)) => (case ((string_drop s2168_0 s2169_0)) of s2170_0 => (case ((sep_matches_prefix s2170_0)) of SOME ((() , s2171_0)) => (case ((string_drop s2170_0 s2171_0)) of s2172_0 => (case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2172_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2173_0)) => let p0_ = (string_drop s2172_0 s2173_0) in if (((p0_ = ""))) then SOME (op, rd, csr, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) )))`; (*val _s2138_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2138_:string ->(bool#(5)words$word#(5)words$word#(5)words$word)option) s2139_0= (let s2140_0 = s2139_0 in if ((string_startswith s2140_0 "rem")) then (case ((string_drop s2140_0 ((string_length "rem")))) of s2141_0 => (case ((maybe_not_u_matches_prefix s2141_0)) of SOME ((s, s2142_0)) => let s2143_0 = (string_drop s2141_0 s2142_0) in if ((string_startswith s2143_0 "w")) then (case ((string_drop s2143_0 ((string_length "w")))) of s2144_0 => (case ((spc_matches_prefix0 s2144_0)) of SOME ((() , s2145_0)) => (case ((string_drop s2144_0 s2145_0)) of s2146_0 => (case ((reg_name_matches_prefix s2146_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2147_0)) => (case ((string_drop s2146_0 s2147_0)) of s2148_0 => (case ((sep_matches_prefix s2148_0)) of SOME ((() , s2149_0)) => (case ((string_drop s2148_0 s2149_0)) of s2150_0 => (case ((reg_name_matches_prefix s2150_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2151_0)) => (case ((string_drop s2150_0 s2151_0)) of s2152_0 => (case ((sep_matches_prefix s2152_0)) of SOME ((() , s2153_0)) => (case ((string_drop s2152_0 s2153_0)) of s2154_0 => (case ((reg_name_matches_prefix s2154_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2155_0)) => let p0_ = (string_drop s2154_0 s2155_0) in if (((p0_ = ""))) then SOME (s, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s2119_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2119_:string ->(bool#(5)words$word#(5)words$word#(5)words$word)option) s2120_0= (let s2121_0 = s2120_0 in if ((string_startswith s2121_0 "div")) then (case ((string_drop s2121_0 ((string_length "div")))) of s2122_0 => (case ((maybe_not_u_matches_prefix s2122_0)) of SOME ((s, s2123_0)) => let s2124_0 = (string_drop s2122_0 s2123_0) in if ((string_startswith s2124_0 "w")) then (case ((string_drop s2124_0 ((string_length "w")))) of s2125_0 => (case ((spc_matches_prefix0 s2125_0)) of SOME ((() , s2126_0)) => (case ((string_drop s2125_0 s2126_0)) of s2127_0 => (case ((reg_name_matches_prefix s2127_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2128_0)) => (case ((string_drop s2127_0 s2128_0)) of s2129_0 => (case ((sep_matches_prefix s2129_0)) of SOME ((() , s2130_0)) => (case ((string_drop s2129_0 s2130_0)) of s2131_0 => (case ((reg_name_matches_prefix s2131_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2132_0)) => (case ((string_drop s2131_0 s2132_0)) of s2133_0 => (case ((sep_matches_prefix s2133_0)) of SOME ((() , s2134_0)) => (case ((string_drop s2133_0 s2134_0)) of s2135_0 => (case ((reg_name_matches_prefix s2135_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2136_0)) => let p0_ = (string_drop s2135_0 s2136_0) in if (((p0_ = ""))) then SOME (s, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s2103_ : string -> maybe ((mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2103_:string ->((5)words$word#(5)words$word#(5)words$word)option) s2104_0= (let s2105_0 = s2104_0 in if ((string_startswith s2105_0 "mulw")) then (case ((string_drop s2105_0 ((string_length "mulw")))) of s2106_0 => (case ((spc_matches_prefix0 s2106_0)) of SOME ((() , s2107_0)) => (case ((string_drop s2106_0 s2107_0)) of s2108_0 => (case ((reg_name_matches_prefix s2108_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2109_0)) => (case ((string_drop s2108_0 s2109_0)) of s2110_0 => (case ((sep_matches_prefix s2110_0)) of SOME ((() , s2111_0)) => (case ((string_drop s2110_0 s2111_0)) of s2112_0 => (case ((reg_name_matches_prefix s2112_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2113_0)) => (case ((string_drop s2112_0 s2113_0)) of s2114_0 => (case ((sep_matches_prefix s2114_0)) of SOME ((() , s2115_0)) => (case ((string_drop s2114_0 s2115_0)) of s2116_0 => (case ((reg_name_matches_prefix s2116_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2117_0)) => let p0_ = (string_drop s2116_0 s2117_0) in if (((p0_ = ""))) then SOME (rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2085_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2085_:string ->(bool#(5)words$word#(5)words$word#(5)words$word)option) s2086_0= (let s2087_0 = s2086_0 in if ((string_startswith s2087_0 "rem")) then (case ((string_drop s2087_0 ((string_length "rem")))) of s2088_0 => (case ((maybe_not_u_matches_prefix s2088_0)) of SOME ((s, s2089_0)) => (case ((string_drop s2088_0 s2089_0)) of s2090_0 => (case ((spc_matches_prefix0 s2090_0)) of SOME ((() , s2091_0)) => (case ((string_drop s2090_0 s2091_0)) of s2092_0 => (case ((reg_name_matches_prefix s2092_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2093_0)) => (case ((string_drop s2092_0 s2093_0)) of s2094_0 => (case ((sep_matches_prefix s2094_0)) of SOME ((() , s2095_0)) => (case ((string_drop s2094_0 s2095_0)) of s2096_0 => (case ((reg_name_matches_prefix s2096_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2097_0)) => (case ((string_drop s2096_0 s2097_0)) of s2098_0 => (case ((sep_matches_prefix s2098_0)) of SOME ((() , s2099_0)) => (case ((string_drop s2098_0 s2099_0)) of s2100_0 => (case ((reg_name_matches_prefix s2100_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2101_0)) => let p0_ = (string_drop s2100_0 s2101_0) in if (((p0_ = ""))) then SOME (s, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2067_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2067_:string ->(bool#(5)words$word#(5)words$word#(5)words$word)option) s2068_0= (let s2069_0 = s2068_0 in if ((string_startswith s2069_0 "div")) then (case ((string_drop s2069_0 ((string_length "div")))) of s2070_0 => (case ((maybe_not_u_matches_prefix s2070_0)) of SOME ((s, s2071_0)) => (case ((string_drop s2070_0 s2071_0)) of s2072_0 => (case ((spc_matches_prefix0 s2072_0)) of SOME ((() , s2073_0)) => (case ((string_drop s2072_0 s2073_0)) of s2074_0 => (case ((reg_name_matches_prefix s2074_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2075_0)) => (case ((string_drop s2074_0 s2075_0)) of s2076_0 => (case ((sep_matches_prefix s2076_0)) of SOME ((() , s2077_0)) => (case ((string_drop s2076_0 s2077_0)) of s2078_0 => (case ((reg_name_matches_prefix s2078_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2079_0)) => (case ((string_drop s2078_0 s2079_0)) of s2080_0 => (case ((sep_matches_prefix s2080_0)) of SOME ((() , s2081_0)) => (case ((string_drop s2080_0 s2081_0)) of s2082_0 => (case ((reg_name_matches_prefix s2082_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2083_0)) => let p0_ = (string_drop s2082_0 s2083_0) in if (((p0_ = ""))) then SOME (s, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2050_ : string -> maybe ((bool * bool * bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s2050_:string ->(bool#bool#bool#(5)words$word#(5)words$word#(5)words$word)option) s2051_0= ((case s2051_0 of s2052_0 => (case ((mul_mnemonic_matches_prefix s2052_0)) of SOME (((high, signed1, signed2), s2053_0)) => (case ((string_drop s2052_0 s2053_0)) of s2054_0 => (case ((spc_matches_prefix0 s2054_0)) of SOME ((() , s2055_0)) => (case ((string_drop s2054_0 s2055_0)) of s2056_0 => (case ((reg_name_matches_prefix s2056_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2057_0)) => (case ((string_drop s2056_0 s2057_0)) of s2058_0 => (case ((sep_matches_prefix s2058_0)) of SOME ((() , s2059_0)) => (case ((string_drop s2058_0 s2059_0)) of s2060_0 => (case ((reg_name_matches_prefix s2060_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2061_0)) => (case ((string_drop s2060_0 s2061_0)) of s2062_0 => (case ((sep_matches_prefix s2062_0)) of SOME ((() , s2063_0)) => (case ((string_drop s2062_0 s2063_0)) of s2064_0 => (case ((reg_name_matches_prefix s2064_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2065_0)) => let p0_ = (string_drop s2064_0 s2065_0) in if (((p0_ = ""))) then SOME (high, signed1, signed2, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s2038_ : string -> maybe ((mword ty5 * mword ty5))*) val _ = Define ` ((s2038_:string ->((5)words$word#(5)words$word)option) s2039_0= (let s2040_0 = s2039_0 in if ((string_startswith s2040_0 "c.add")) then (case ((string_drop s2040_0 ((string_length "c.add")))) of s2041_0 => (case ((spc_matches_prefix0 s2041_0)) of SOME ((() , s2042_0)) => (case ((string_drop s2041_0 s2042_0)) of s2043_0 => (case ((reg_name_matches_prefix s2043_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s2044_0)) => (case ((string_drop s2043_0 s2044_0)) of s2045_0 => (case ((sep_matches_prefix s2045_0)) of SOME ((() , s2046_0)) => (case ((string_drop s2045_0 s2046_0)) of s2047_0 => (case ((reg_name_matches_prefix s2047_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2048_0)) => let p0_ = (string_drop s2047_0 s2048_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2026_ : string -> maybe ((mword ty5 * mword ty5))*) val _ = Define ` ((s2026_:string ->((5)words$word#(5)words$word)option) s2027_0= (let s2028_0 = s2027_0 in if ((string_startswith s2028_0 "c.mv")) then (case ((string_drop s2028_0 ((string_length "c.mv")))) of s2029_0 => (case ((spc_matches_prefix0 s2029_0)) of SOME ((() , s2030_0)) => (case ((string_drop s2029_0 s2030_0)) of s2031_0 => (case ((reg_name_matches_prefix s2031_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s2032_0)) => (case ((string_drop s2031_0 s2032_0)) of s2033_0 => (case ((sep_matches_prefix s2033_0)) of SOME ((() , s2034_0)) => (case ((string_drop s2033_0 s2034_0)) of s2035_0 => (case ((reg_name_matches_prefix s2035_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2036_0)) => let p0_ = (string_drop s2035_0 s2036_0) in if (((p0_ = ""))) then SOME (rd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2018_ : string -> maybe (mword ty5)*) val _ = Define ` ((s2018_:string ->((5)words$word)option) s2019_0= (let s2020_0 = s2019_0 in if ((string_startswith s2020_0 "c.jalr")) then (case ((string_drop s2020_0 ((string_length "c.jalr")))) of s2021_0 => (case ((spc_matches_prefix0 s2021_0)) of SOME ((() , s2022_0)) => (case ((string_drop s2021_0 s2022_0)) of s2023_0 => (case ((reg_name_matches_prefix s2023_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2024_0)) => let p0_ = (string_drop s2023_0 s2024_0) in if (((p0_ = ""))) then SOME rs1 else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s2010_ : string -> maybe (mword ty5)*) val _ = Define ` ((s2010_:string ->((5)words$word)option) s2011_0= (let s2012_0 = s2011_0 in if ((string_startswith s2012_0 "c.jr")) then (case ((string_drop s2012_0 ((string_length "c.jr")))) of s2013_0 => (case ((spc_matches_prefix0 s2013_0)) of SOME ((() , s2014_0)) => (case ((string_drop s2013_0 s2014_0)) of s2015_0 => (case ((reg_name_matches_prefix s2015_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s2016_0)) => let p0_ = (string_drop s2015_0 s2016_0) in if (((p0_ = ""))) then SOME rs1 else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1998_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s1998_:string ->((5)words$word#(6)words$word)option) s1999_0= (let s2000_0 = s1999_0 in if ((string_startswith s2000_0 "c.sdsp")) then (case ((string_drop s2000_0 ((string_length "c.sdsp")))) of s2001_0 => (case ((spc_matches_prefix0 s2001_0)) of SOME ((() , s2002_0)) => (case ((string_drop s2001_0 s2002_0)) of s2003_0 => (case ((reg_name_matches_prefix s2003_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s2004_0)) => (case ((string_drop s2003_0 s2004_0)) of s2005_0 => (case ((sep_matches_prefix s2005_0)) of SOME ((() , s2006_0)) => (case ((string_drop s2005_0 s2006_0)) of s2007_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s2007_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s2008_0)) => let p0_ = (string_drop s2007_0 s2008_0) in if (((p0_ = ""))) then SOME (rs2, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1986_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s1986_:string ->((5)words$word#(6)words$word)option) s1987_0= (let s1988_0 = s1987_0 in if ((string_startswith s1988_0 "c.swsp")) then (case ((string_drop s1988_0 ((string_length "c.swsp")))) of s1989_0 => (case ((spc_matches_prefix0 s1989_0)) of SOME ((() , s1990_0)) => (case ((string_drop s1989_0 s1990_0)) of s1991_0 => (case ((reg_name_matches_prefix s1991_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1992_0)) => (case ((string_drop s1991_0 s1992_0)) of s1993_0 => (case ((sep_matches_prefix s1993_0)) of SOME ((() , s1994_0)) => (case ((string_drop s1993_0 s1994_0)) of s1995_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1995_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s1996_0)) => let p0_ = (string_drop s1995_0 s1996_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1974_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s1974_:string ->((5)words$word#(6)words$word)option) s1975_0= (let s1976_0 = s1975_0 in if ((string_startswith s1976_0 "c.ldsp")) then (case ((string_drop s1976_0 ((string_length "c.ldsp")))) of s1977_0 => (case ((spc_matches_prefix0 s1977_0)) of SOME ((() , s1978_0)) => (case ((string_drop s1977_0 s1978_0)) of s1979_0 => (case ((reg_name_matches_prefix s1979_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1980_0)) => (case ((string_drop s1979_0 s1980_0)) of s1981_0 => (case ((sep_matches_prefix s1981_0)) of SOME ((() , s1982_0)) => (case ((string_drop s1981_0 s1982_0)) of s1983_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1983_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s1984_0)) => let p0_ = (string_drop s1983_0 s1984_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1962_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s1962_:string ->((5)words$word#(6)words$word)option) s1963_0= (let s1964_0 = s1963_0 in if ((string_startswith s1964_0 "c.lwsp")) then (case ((string_drop s1964_0 ((string_length "c.lwsp")))) of s1965_0 => (case ((spc_matches_prefix0 s1965_0)) of SOME ((() , s1966_0)) => (case ((string_drop s1965_0 s1966_0)) of s1967_0 => (case ((reg_name_matches_prefix s1967_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1968_0)) => (case ((string_drop s1967_0 s1968_0)) of s1969_0 => (case ((sep_matches_prefix s1969_0)) of SOME ((() , s1970_0)) => (case ((string_drop s1969_0 s1970_0)) of s1971_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1971_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s1972_0)) => let p0_ = (string_drop s1971_0 s1972_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1950_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s1950_:string ->((5)words$word#(6)words$word)option) s1951_0= (let s1952_0 = s1951_0 in if ((string_startswith s1952_0 "c.slli")) then (case ((string_drop s1952_0 ((string_length "c.slli")))) of s1953_0 => (case ((spc_matches_prefix0 s1953_0)) of SOME ((() , s1954_0)) => (case ((string_drop s1953_0 s1954_0)) of s1955_0 => (case ((reg_name_matches_prefix s1955_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s1956_0)) => (case ((string_drop s1955_0 s1956_0)) of s1957_0 => (case ((sep_matches_prefix s1957_0)) of SOME ((() , s1958_0)) => (case ((string_drop s1957_0 s1958_0)) of s1959_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1959_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s1960_0)) => let p0_ = (string_drop s1959_0 s1960_0) in if (((p0_ = ""))) then SOME (rsd, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1938_ : string -> maybe ((mword ty3 * mword ty8))*) val _ = Define ` ((s1938_:string ->((3)words$word#(8)words$word)option) s1939_0= (let s1940_0 = s1939_0 in if ((string_startswith s1940_0 "c.bnez")) then (case ((string_drop s1940_0 ((string_length "c.bnez")))) of s1941_0 => (case ((spc_matches_prefix0 s1941_0)) of SOME ((() , s1942_0)) => (case ((string_drop s1941_0 s1942_0)) of s1943_0 => (case ((creg_name_matches_prefix s1943_0 : (( 3 words$word # ii)) option)) of SOME ((rs, s1944_0)) => (case ((string_drop s1943_0 s1944_0)) of s1945_0 => (case ((sep_matches_prefix s1945_0)) of SOME ((() , s1946_0)) => (case ((string_drop s1945_0 s1946_0)) of s1947_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1947_0 : (( 8 words$word # ii)) option)) of SOME ((imm, s1948_0)) => let p0_ = (string_drop s1947_0 s1948_0) in if (((p0_ = ""))) then SOME (rs, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1926_ : string -> maybe ((mword ty3 * mword ty8))*) val _ = Define ` ((s1926_:string ->((3)words$word#(8)words$word)option) s1927_0= (let s1928_0 = s1927_0 in if ((string_startswith s1928_0 "c.beqz")) then (case ((string_drop s1928_0 ((string_length "c.beqz")))) of s1929_0 => (case ((spc_matches_prefix0 s1929_0)) of SOME ((() , s1930_0)) => (case ((string_drop s1929_0 s1930_0)) of s1931_0 => (case ((creg_name_matches_prefix s1931_0 : (( 3 words$word # ii)) option)) of SOME ((rs, s1932_0)) => (case ((string_drop s1931_0 s1932_0)) of s1933_0 => (case ((sep_matches_prefix s1933_0)) of SOME ((() , s1934_0)) => (case ((string_drop s1933_0 s1934_0)) of s1935_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1935_0 : (( 8 words$word # ii)) option)) of SOME ((imm, s1936_0)) => let p0_ = (string_drop s1935_0 s1936_0) in if (((p0_ = ""))) then SOME (rs, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1918_ : string -> maybe (mword ty11)*) val _ = Define ` ((s1918_:string ->((11)words$word)option) s1919_0= (let s1920_0 = s1919_0 in if ((string_startswith s1920_0 "c.j")) then (case ((string_drop s1920_0 ((string_length "c.j")))) of s1921_0 => (case ((spc_matches_prefix0 s1921_0)) of SOME ((() , s1922_0)) => (case ((string_drop s1921_0 s1922_0)) of s1923_0 => (case ((hex_bits_11_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1923_0 : (( 11 words$word # ii)) option)) of SOME ((imm, s1924_0)) => let p0_ = (string_drop s1923_0 s1924_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1906_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s1906_:string ->((3)words$word#(3)words$word)option) s1907_0= (let s1908_0 = s1907_0 in if ((string_startswith s1908_0 "c.addw")) then (case ((string_drop s1908_0 ((string_length "c.addw")))) of s1909_0 => (case ((spc_matches_prefix0 s1909_0)) of SOME ((() , s1910_0)) => (case ((string_drop s1909_0 s1910_0)) of s1911_0 => (case ((creg_name_matches_prefix s1911_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s1912_0)) => (case ((string_drop s1911_0 s1912_0)) of s1913_0 => (case ((sep_matches_prefix s1913_0)) of SOME ((() , s1914_0)) => (case ((string_drop s1913_0 s1914_0)) of s1915_0 => (case ((creg_name_matches_prefix s1915_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s1916_0)) => let p0_ = (string_drop s1915_0 s1916_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1894_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s1894_:string ->((3)words$word#(3)words$word)option) s1895_0= (let s1896_0 = s1895_0 in if ((string_startswith s1896_0 "c.subw")) then (case ((string_drop s1896_0 ((string_length "c.subw")))) of s1897_0 => (case ((spc_matches_prefix0 s1897_0)) of SOME ((() , s1898_0)) => (case ((string_drop s1897_0 s1898_0)) of s1899_0 => (case ((creg_name_matches_prefix s1899_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s1900_0)) => (case ((string_drop s1899_0 s1900_0)) of s1901_0 => (case ((sep_matches_prefix s1901_0)) of SOME ((() , s1902_0)) => (case ((string_drop s1901_0 s1902_0)) of s1903_0 => (case ((creg_name_matches_prefix s1903_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s1904_0)) => let p0_ = (string_drop s1903_0 s1904_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1882_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s1882_:string ->((3)words$word#(3)words$word)option) s1883_0= (let s1884_0 = s1883_0 in if ((string_startswith s1884_0 "c.and")) then (case ((string_drop s1884_0 ((string_length "c.and")))) of s1885_0 => (case ((spc_matches_prefix0 s1885_0)) of SOME ((() , s1886_0)) => (case ((string_drop s1885_0 s1886_0)) of s1887_0 => (case ((creg_name_matches_prefix s1887_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s1888_0)) => (case ((string_drop s1887_0 s1888_0)) of s1889_0 => (case ((sep_matches_prefix s1889_0)) of SOME ((() , s1890_0)) => (case ((string_drop s1889_0 s1890_0)) of s1891_0 => (case ((creg_name_matches_prefix s1891_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s1892_0)) => let p0_ = (string_drop s1891_0 s1892_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1870_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s1870_:string ->((3)words$word#(3)words$word)option) s1871_0= (let s1872_0 = s1871_0 in if ((string_startswith s1872_0 "c.or")) then (case ((string_drop s1872_0 ((string_length "c.or")))) of s1873_0 => (case ((spc_matches_prefix0 s1873_0)) of SOME ((() , s1874_0)) => (case ((string_drop s1873_0 s1874_0)) of s1875_0 => (case ((creg_name_matches_prefix s1875_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s1876_0)) => (case ((string_drop s1875_0 s1876_0)) of s1877_0 => (case ((sep_matches_prefix s1877_0)) of SOME ((() , s1878_0)) => (case ((string_drop s1877_0 s1878_0)) of s1879_0 => (case ((creg_name_matches_prefix s1879_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s1880_0)) => let p0_ = (string_drop s1879_0 s1880_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1858_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s1858_:string ->((3)words$word#(3)words$word)option) s1859_0= (let s1860_0 = s1859_0 in if ((string_startswith s1860_0 "c.xor")) then (case ((string_drop s1860_0 ((string_length "c.xor")))) of s1861_0 => (case ((spc_matches_prefix0 s1861_0)) of SOME ((() , s1862_0)) => (case ((string_drop s1861_0 s1862_0)) of s1863_0 => (case ((creg_name_matches_prefix s1863_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s1864_0)) => (case ((string_drop s1863_0 s1864_0)) of s1865_0 => (case ((sep_matches_prefix s1865_0)) of SOME ((() , s1866_0)) => (case ((string_drop s1865_0 s1866_0)) of s1867_0 => (case ((creg_name_matches_prefix s1867_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s1868_0)) => let p0_ = (string_drop s1867_0 s1868_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1846_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s1846_:string ->((3)words$word#(3)words$word)option) s1847_0= (let s1848_0 = s1847_0 in if ((string_startswith s1848_0 "c.sub")) then (case ((string_drop s1848_0 ((string_length "c.sub")))) of s1849_0 => (case ((spc_matches_prefix0 s1849_0)) of SOME ((() , s1850_0)) => (case ((string_drop s1849_0 s1850_0)) of s1851_0 => (case ((creg_name_matches_prefix s1851_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s1852_0)) => (case ((string_drop s1851_0 s1852_0)) of s1853_0 => (case ((sep_matches_prefix s1853_0)) of SOME ((() , s1854_0)) => (case ((string_drop s1853_0 s1854_0)) of s1855_0 => (case ((creg_name_matches_prefix s1855_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s1856_0)) => let p0_ = (string_drop s1855_0 s1856_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1834_ : string -> maybe ((mword ty3 * mword ty6))*) val _ = Define ` ((s1834_:string ->((3)words$word#(6)words$word)option) s1835_0= (let s1836_0 = s1835_0 in if ((string_startswith s1836_0 "c.andi")) then (case ((string_drop s1836_0 ((string_length "c.andi")))) of s1837_0 => (case ((spc_matches_prefix0 s1837_0)) of SOME ((() , s1838_0)) => (case ((string_drop s1837_0 s1838_0)) of s1839_0 => (case ((creg_name_matches_prefix s1839_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s1840_0)) => (case ((string_drop s1839_0 s1840_0)) of s1841_0 => (case ((sep_matches_prefix s1841_0)) of SOME ((() , s1842_0)) => (case ((string_drop s1841_0 s1842_0)) of s1843_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1843_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s1844_0)) => let p0_ = (string_drop s1843_0 s1844_0) in if (((p0_ = ""))) then SOME (rsd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1822_ : string -> maybe ((mword ty3 * mword ty6))*) val _ = Define ` ((s1822_:string ->((3)words$word#(6)words$word)option) s1823_0= (let s1824_0 = s1823_0 in if ((string_startswith s1824_0 "c.srai")) then (case ((string_drop s1824_0 ((string_length "c.srai")))) of s1825_0 => (case ((spc_matches_prefix0 s1825_0)) of SOME ((() , s1826_0)) => (case ((string_drop s1825_0 s1826_0)) of s1827_0 => (case ((creg_name_matches_prefix s1827_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s1828_0)) => (case ((string_drop s1827_0 s1828_0)) of s1829_0 => (case ((sep_matches_prefix s1829_0)) of SOME ((() , s1830_0)) => (case ((string_drop s1829_0 s1830_0)) of s1831_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1831_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s1832_0)) => let p0_ = (string_drop s1831_0 s1832_0) in if (((p0_ = ""))) then SOME (rsd, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1810_ : string -> maybe ((mword ty3 * mword ty6))*) val _ = Define ` ((s1810_:string ->((3)words$word#(6)words$word)option) s1811_0= (let s1812_0 = s1811_0 in if ((string_startswith s1812_0 "c.srli")) then (case ((string_drop s1812_0 ((string_length "c.srli")))) of s1813_0 => (case ((spc_matches_prefix0 s1813_0)) of SOME ((() , s1814_0)) => (case ((string_drop s1813_0 s1814_0)) of s1815_0 => (case ((creg_name_matches_prefix s1815_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s1816_0)) => (case ((string_drop s1815_0 s1816_0)) of s1817_0 => (case ((sep_matches_prefix s1817_0)) of SOME ((() , s1818_0)) => (case ((string_drop s1817_0 s1818_0)) of s1819_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1819_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s1820_0)) => let p0_ = (string_drop s1819_0 s1820_0) in if (((p0_ = ""))) then SOME (rsd, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1798_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s1798_:string ->((5)words$word#(6)words$word)option) s1799_0= (let s1800_0 = s1799_0 in if ((string_startswith s1800_0 "c.lui")) then (case ((string_drop s1800_0 ((string_length "c.lui")))) of s1801_0 => (case ((spc_matches_prefix0 s1801_0)) of SOME ((() , s1802_0)) => (case ((string_drop s1801_0 s1802_0)) of s1803_0 => (case ((reg_name_matches_prefix s1803_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1804_0)) => (case ((string_drop s1803_0 s1804_0)) of s1805_0 => (case ((sep_matches_prefix s1805_0)) of SOME ((() , s1806_0)) => (case ((string_drop s1805_0 s1806_0)) of s1807_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1807_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s1808_0)) => let p0_ = (string_drop s1807_0 s1808_0) in if (((p0_ = ""))) then SOME (rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1790_ : string -> maybe (mword ty6)*) val _ = Define ` ((s1790_:string ->((6)words$word)option) s1791_0= (let s1792_0 = s1791_0 in if ((string_startswith s1792_0 "c.addi16sp")) then (case ((string_drop s1792_0 ((string_length "c.addi16sp")))) of s1793_0 => (case ((spc_matches_prefix0 s1793_0)) of SOME ((() , s1794_0)) => (case ((string_drop s1793_0 s1794_0)) of s1795_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1795_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s1796_0)) => let p0_ = (string_drop s1795_0 s1796_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1778_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s1778_:string ->((5)words$word#(6)words$word)option) s1779_0= (let s1780_0 = s1779_0 in if ((string_startswith s1780_0 "c.li")) then (case ((string_drop s1780_0 ((string_length "c.li")))) of s1781_0 => (case ((spc_matches_prefix0 s1781_0)) of SOME ((() , s1782_0)) => (case ((string_drop s1781_0 s1782_0)) of s1783_0 => (case ((reg_name_matches_prefix s1783_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1784_0)) => (case ((string_drop s1783_0 s1784_0)) of s1785_0 => (case ((sep_matches_prefix s1785_0)) of SOME ((() , s1786_0)) => (case ((string_drop s1785_0 s1786_0)) of s1787_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1787_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s1788_0)) => let p0_ = (string_drop s1787_0 s1788_0) in if (((p0_ = ""))) then SOME (rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1766_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s1766_:string ->((5)words$word#(6)words$word)option) s1767_0= (let s1768_0 = s1767_0 in if ((string_startswith s1768_0 "c.addiw")) then (case ((string_drop s1768_0 ((string_length "c.addiw")))) of s1769_0 => (case ((spc_matches_prefix0 s1769_0)) of SOME ((() , s1770_0)) => (case ((string_drop s1769_0 s1770_0)) of s1771_0 => (case ((reg_name_matches_prefix s1771_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s1772_0)) => (case ((string_drop s1771_0 s1772_0)) of s1773_0 => (case ((sep_matches_prefix s1773_0)) of SOME ((() , s1774_0)) => (case ((string_drop s1773_0 s1774_0)) of s1775_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1775_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s1776_0)) => let p0_ = (string_drop s1775_0 s1776_0) in if (((p0_ = ""))) then SOME (rsd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1758_ : string -> maybe (mword ty11)*) val _ = Define ` ((s1758_:string ->((11)words$word)option) s1759_0= (let s1760_0 = s1759_0 in if ((string_startswith s1760_0 "c.jal")) then (case ((string_drop s1760_0 ((string_length "c.jal")))) of s1761_0 => (case ((spc_matches_prefix0 s1761_0)) of SOME ((() , s1762_0)) => (case ((string_drop s1761_0 s1762_0)) of s1763_0 => (case ((hex_bits_12_matches_prefix0 s1763_0 : (( 12 words$word # ii)) option)) of SOME ((v__1450, s1764_0)) => if (((((subrange_vec_dec v__1450 (( 0 : int): ii) (( 0 : int): ii) : 1 words$word)) = (0b0w : 1 words$word)))) then let (imm : 11 words$word) = ((subrange_vec_dec v__1450 (( 11 : int): ii) (( 1 : int): ii) : 11 words$word)) in let (imm : 11 words$word) = ((subrange_vec_dec v__1450 (( 11 : int): ii) (( 1 : int): ii) : 11 words$word)) in let p0_ = (string_drop s1763_0 s1764_0) in if (((p0_ = ""))) then SOME imm else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1746_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s1746_:string ->((5)words$word#(6)words$word)option) s1747_0= (let s1748_0 = s1747_0 in if ((string_startswith s1748_0 "c.addi")) then (case ((string_drop s1748_0 ((string_length "c.addi")))) of s1749_0 => (case ((spc_matches_prefix0 s1749_0)) of SOME ((() , s1750_0)) => (case ((string_drop s1749_0 s1750_0)) of s1751_0 => (case ((reg_name_matches_prefix s1751_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s1752_0)) => (case ((string_drop s1751_0 s1752_0)) of s1753_0 => (case ((sep_matches_prefix s1753_0)) of SOME ((() , s1754_0)) => (case ((string_drop s1753_0 s1754_0)) of s1755_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1755_0 : (( 6 words$word # ii)) option)) of SOME ((nzi, s1756_0)) => let p0_ = (string_drop s1755_0 s1756_0) in if (((p0_ = ""))) then SOME (rsd, nzi) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1730_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s1730_:string ->((3)words$word#(3)words$word#(5)words$word)option) s1731_0= (let s1732_0 = s1731_0 in if ((string_startswith s1732_0 "c.sd")) then (case ((string_drop s1732_0 ((string_length "c.sd")))) of s1733_0 => (case ((spc_matches_prefix0 s1733_0)) of SOME ((() , s1734_0)) => (case ((string_drop s1733_0 s1734_0)) of s1735_0 => (case ((creg_name_matches_prefix s1735_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s1736_0)) => (case ((string_drop s1735_0 s1736_0)) of s1737_0 => (case ((sep_matches_prefix s1737_0)) of SOME ((() , s1738_0)) => (case ((string_drop s1737_0 s1738_0)) of s1739_0 => (case ((creg_name_matches_prefix s1739_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s1740_0)) => (case ((string_drop s1739_0 s1740_0)) of s1741_0 => (case ((sep_matches_prefix s1741_0)) of SOME ((() , s1742_0)) => (case ((string_drop s1741_0 s1742_0)) of s1743_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1743_0 : (( 8 words$word # ii)) option)) of SOME ((v__1452, s1744_0)) => if (((((subrange_vec_dec v__1452 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1452 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1452 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let p0_ = (string_drop s1743_0 s1744_0) in if (((p0_ = ""))) then SOME (rsc1, rsc2, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1714_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s1714_:string ->((3)words$word#(3)words$word#(5)words$word)option) s1715_0= (let s1716_0 = s1715_0 in if ((string_startswith s1716_0 "c.sw")) then (case ((string_drop s1716_0 ((string_length "c.sw")))) of s1717_0 => (case ((spc_matches_prefix0 s1717_0)) of SOME ((() , s1718_0)) => (case ((string_drop s1717_0 s1718_0)) of s1719_0 => (case ((creg_name_matches_prefix s1719_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s1720_0)) => (case ((string_drop s1719_0 s1720_0)) of s1721_0 => (case ((sep_matches_prefix s1721_0)) of SOME ((() , s1722_0)) => (case ((string_drop s1721_0 s1722_0)) of s1723_0 => (case ((creg_name_matches_prefix s1723_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s1724_0)) => (case ((string_drop s1723_0 s1724_0)) of s1725_0 => (case ((sep_matches_prefix s1725_0)) of SOME ((() , s1726_0)) => (case ((string_drop s1725_0 s1726_0)) of s1727_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1727_0 : (( 7 words$word # ii)) option)) of SOME ((v__1454, s1728_0)) => if (((((subrange_vec_dec v__1454 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1454 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1454 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let p0_ = (string_drop s1727_0 s1728_0) in if (((p0_ = ""))) then SOME (rsc1, rsc2, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1698_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s1698_:string ->((3)words$word#(3)words$word#(5)words$word)option) s1699_0= (let s1700_0 = s1699_0 in if ((string_startswith s1700_0 "c.ld")) then (case ((string_drop s1700_0 ((string_length "c.ld")))) of s1701_0 => (case ((spc_matches_prefix0 s1701_0)) of SOME ((() , s1702_0)) => (case ((string_drop s1701_0 s1702_0)) of s1703_0 => (case ((creg_name_matches_prefix s1703_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s1704_0)) => (case ((string_drop s1703_0 s1704_0)) of s1705_0 => (case ((sep_matches_prefix s1705_0)) of SOME ((() , s1706_0)) => (case ((string_drop s1705_0 s1706_0)) of s1707_0 => (case ((creg_name_matches_prefix s1707_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s1708_0)) => (case ((string_drop s1707_0 s1708_0)) of s1709_0 => (case ((sep_matches_prefix s1709_0)) of SOME ((() , s1710_0)) => (case ((string_drop s1709_0 s1710_0)) of s1711_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1711_0 : (( 8 words$word # ii)) option)) of SOME ((v__1456, s1712_0)) => if (((((subrange_vec_dec v__1456 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1456 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1456 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let p0_ = (string_drop s1711_0 s1712_0) in if (((p0_ = ""))) then SOME (rdc, rsc, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1682_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s1682_:string ->((3)words$word#(3)words$word#(5)words$word)option) s1683_0= (let s1684_0 = s1683_0 in if ((string_startswith s1684_0 "c.lw")) then (case ((string_drop s1684_0 ((string_length "c.lw")))) of s1685_0 => (case ((spc_matches_prefix0 s1685_0)) of SOME ((() , s1686_0)) => (case ((string_drop s1685_0 s1686_0)) of s1687_0 => (case ((creg_name_matches_prefix s1687_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s1688_0)) => (case ((string_drop s1687_0 s1688_0)) of s1689_0 => (case ((sep_matches_prefix s1689_0)) of SOME ((() , s1690_0)) => (case ((string_drop s1689_0 s1690_0)) of s1691_0 => (case ((creg_name_matches_prefix s1691_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s1692_0)) => (case ((string_drop s1691_0 s1692_0)) of s1693_0 => (case ((sep_matches_prefix s1693_0)) of SOME ((() , s1694_0)) => (case ((string_drop s1693_0 s1694_0)) of s1695_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1695_0 : (( 7 words$word # ii)) option)) of SOME ((v__1458, s1696_0)) => if (((((subrange_vec_dec v__1458 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1458 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1458 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let p0_ = (string_drop s1695_0 s1696_0) in if (((p0_ = ""))) then SOME (rdc, rsc, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1670_ : string -> maybe ((mword ty3 * mword ty8))*) val _ = Define ` ((s1670_:string ->((3)words$word#(8)words$word)option) s1671_0= (let s1672_0 = s1671_0 in if ((string_startswith s1672_0 "c.addi4spn")) then (case ((string_drop s1672_0 ((string_length "c.addi4spn")))) of s1673_0 => (case ((spc_matches_prefix0 s1673_0)) of SOME ((() , s1674_0)) => (case ((string_drop s1673_0 s1674_0)) of s1675_0 => (case ((creg_name_matches_prefix s1675_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s1676_0)) => (case ((string_drop s1675_0 s1676_0)) of s1677_0 => (case ((sep_matches_prefix s1677_0)) of SOME ((() , s1678_0)) => (case ((string_drop s1677_0 s1678_0)) of s1679_0 => (case ((hex_bits_10_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1679_0 : (( 10 words$word # ii)) option)) of SOME ((v__1460, s1680_0)) => if (((((subrange_vec_dec v__1460 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (nzimm : 8 words$word) = ((subrange_vec_dec v__1460 (( 9 : int): ii) (( 2 : int): ii) : 8 words$word)) in let (nzimm : 8 words$word) = ((subrange_vec_dec v__1460 (( 9 : int): ii) (( 2 : int): ii) : 8 words$word)) in let p0_ = (string_drop s1679_0 s1680_0) in if (((p0_ = ""))) then SOME (rdc, nzimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1644_ : string -> maybe ((amoop * word_width * bool * bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s1644_:string ->(amoop#word_width#bool#bool#(5)words$word#(5)words$word#(5)words$word)option) s1645_0= ((case s1645_0 of s1646_0 => (case ((amo_mnemonic_matches_prefix s1646_0)) of SOME ((op, s1647_0)) => let s1648_0 = (string_drop s1646_0 s1647_0) in if ((string_startswith s1648_0 ".")) then (case ((string_drop s1648_0 ((string_length ".")))) of s1649_0 => (case ((size_mnemonic_matches_prefix s1649_0)) of SOME ((width, s1650_0)) => (case ((string_drop s1649_0 s1650_0)) of s1651_0 => (case ((maybe_aq_matches_prefix s1651_0)) of SOME ((aq, s1652_0)) => (case ((string_drop s1651_0 s1652_0)) of s1653_0 => (case ((maybe_rl_matches_prefix s1653_0)) of SOME ((rl, s1654_0)) => (case ((string_drop s1653_0 s1654_0)) of s1655_0 => (case ((spc_matches_prefix0 s1655_0)) of SOME ((() , s1656_0)) => (case ((string_drop s1655_0 s1656_0)) of s1657_0 => (case ((reg_name_matches_prefix s1657_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1658_0)) => (case ((string_drop s1657_0 s1658_0)) of s1659_0 => (case ((sep_matches_prefix s1659_0)) of SOME ((() , s1660_0)) => (case ((string_drop s1659_0 s1660_0)) of s1661_0 => (case ((reg_name_matches_prefix s1661_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s1662_0)) => (case ((string_drop s1661_0 s1662_0)) of s1663_0 => (case ((sep_matches_prefix s1663_0)) of SOME ((() , s1664_0)) => let s1665_0 = (string_drop s1663_0 s1664_0) in if ((string_startswith s1665_0 "(")) then (case ((string_drop s1665_0 ((string_length "(")))) of s1666_0 => (case ((reg_name_matches_prefix s1666_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1667_0)) => let s1668_0 = (string_drop s1666_0 s1667_0) in if ((string_startswith s1668_0 ")")) then let p0_ = (string_drop s1668_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (op, width, aq, rl, rd, rs2, rs1) else NONE else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) )))`; (*val _s1622_ : string -> maybe ((word_width * bool * bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s1622_:string ->(word_width#bool#bool#(5)words$word#(5)words$word#(5)words$word)option) s1623_0= (let s1624_0 = s1623_0 in if ((string_startswith s1624_0 "sc.")) then (case ((string_drop s1624_0 ((string_length "sc.")))) of s1625_0 => (case ((size_mnemonic_matches_prefix s1625_0)) of SOME ((size1, s1626_0)) => (case ((string_drop s1625_0 s1626_0)) of s1627_0 => (case ((maybe_aq_matches_prefix s1627_0)) of SOME ((aq, s1628_0)) => (case ((string_drop s1627_0 s1628_0)) of s1629_0 => (case ((maybe_rl_matches_prefix s1629_0)) of SOME ((rl, s1630_0)) => (case ((string_drop s1629_0 s1630_0)) of s1631_0 => (case ((spc_matches_prefix0 s1631_0)) of SOME ((() , s1632_0)) => (case ((string_drop s1631_0 s1632_0)) of s1633_0 => (case ((reg_name_matches_prefix s1633_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1634_0)) => (case ((string_drop s1633_0 s1634_0)) of s1635_0 => (case ((sep_matches_prefix s1635_0)) of SOME ((() , s1636_0)) => (case ((string_drop s1635_0 s1636_0)) of s1637_0 => (case ((reg_name_matches_prefix s1637_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1638_0)) => (case ((string_drop s1637_0 s1638_0)) of s1639_0 => (case ((sep_matches_prefix s1639_0)) of SOME ((() , s1640_0)) => (case ((string_drop s1639_0 s1640_0)) of s1641_0 => (case ((reg_name_matches_prefix s1641_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s1642_0)) => let p0_ = (string_drop s1641_0 s1642_0) in if (((p0_ = ""))) then SOME (size1, aq, rl, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1604_ : string -> maybe ((word_width * bool * bool * mword ty5 * mword ty5))*) val _ = Define ` ((s1604_:string ->(word_width#bool#bool#(5)words$word#(5)words$word)option) s1605_0= (let s1606_0 = s1605_0 in if ((string_startswith s1606_0 "lr.")) then (case ((string_drop s1606_0 ((string_length "lr.")))) of s1607_0 => (case ((size_mnemonic_matches_prefix s1607_0)) of SOME ((size1, s1608_0)) => (case ((string_drop s1607_0 s1608_0)) of s1609_0 => (case ((maybe_aq_matches_prefix s1609_0)) of SOME ((aq, s1610_0)) => (case ((string_drop s1609_0 s1610_0)) of s1611_0 => (case ((maybe_rl_matches_prefix s1611_0)) of SOME ((rl, s1612_0)) => (case ((string_drop s1611_0 s1612_0)) of s1613_0 => (case ((spc_matches_prefix0 s1613_0)) of SOME ((() , s1614_0)) => (case ((string_drop s1613_0 s1614_0)) of s1615_0 => (case ((reg_name_matches_prefix s1615_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1616_0)) => (case ((string_drop s1615_0 s1616_0)) of s1617_0 => (case ((sep_matches_prefix s1617_0)) of SOME ((() , s1618_0)) => (case ((string_drop s1617_0 s1618_0)) of s1619_0 => (case ((reg_name_matches_prefix s1619_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1620_0)) => let p0_ = (string_drop s1619_0 s1620_0) in if (((p0_ = ""))) then SOME (size1, aq, rl, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1592_ : string -> maybe ((mword ty5 * mword ty5))*) val _ = Define ` ((s1592_:string ->((5)words$word#(5)words$word)option) s1593_0= (let s1594_0 = s1593_0 in if ((string_startswith s1594_0 "sfence.vma")) then (case ((string_drop s1594_0 ((string_length "sfence.vma")))) of s1595_0 => (case ((spc_matches_prefix0 s1595_0)) of SOME ((() , s1596_0)) => (case ((string_drop s1595_0 s1596_0)) of s1597_0 => (case ((reg_name_matches_prefix s1597_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1598_0)) => (case ((string_drop s1597_0 s1598_0)) of s1599_0 => (case ((sep_matches_prefix s1599_0)) of SOME ((() , s1600_0)) => (case ((string_drop s1599_0 s1600_0)) of s1601_0 => (case ((reg_name_matches_prefix s1601_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s1602_0)) => let p0_ = (string_drop s1601_0 s1602_0) in if (((p0_ = ""))) then SOME (rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1580_ : string -> maybe ((mword ty4 * mword ty4))*) val _ = Define ` ((s1580_:string ->((4)words$word#(4)words$word)option) s1581_0= (let s1582_0 = s1581_0 in if ((string_startswith s1582_0 "fence.tso")) then (case ((string_drop s1582_0 ((string_length "fence.tso")))) of s1583_0 => (case ((spc_matches_prefix0 s1583_0)) of SOME ((() , s1584_0)) => (case ((string_drop s1583_0 s1584_0)) of s1585_0 => (case ((fence_bits_matches_prefix s1585_0 : (( 4 words$word # ii)) option)) of SOME ((pred, s1586_0)) => (case ((string_drop s1585_0 s1586_0)) of s1587_0 => (case ((sep_matches_prefix s1587_0)) of SOME ((() , s1588_0)) => (case ((string_drop s1587_0 s1588_0)) of s1589_0 => (case ((fence_bits_matches_prefix s1589_0 : (( 4 words$word # ii)) option)) of SOME ((succ, s1590_0)) => let p0_ = (string_drop s1589_0 s1590_0) in if (((p0_ = ""))) then SOME (pred, succ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1568_ : string -> maybe ((mword ty4 * mword ty4))*) val _ = Define ` ((s1568_:string ->((4)words$word#(4)words$word)option) s1569_0= (let s1570_0 = s1569_0 in if ((string_startswith s1570_0 "fence")) then (case ((string_drop s1570_0 ((string_length "fence")))) of s1571_0 => (case ((spc_matches_prefix0 s1571_0)) of SOME ((() , s1572_0)) => (case ((string_drop s1571_0 s1572_0)) of s1573_0 => (case ((fence_bits_matches_prefix s1573_0 : (( 4 words$word # ii)) option)) of SOME ((pred, s1574_0)) => (case ((string_drop s1573_0 s1574_0)) of s1575_0 => (case ((sep_matches_prefix s1575_0)) of SOME ((() , s1576_0)) => (case ((string_drop s1575_0 s1576_0)) of s1577_0 => (case ((fence_bits_matches_prefix s1577_0 : (( 4 words$word # ii)) option)) of SOME ((succ, s1578_0)) => let p0_ = (string_drop s1577_0 s1578_0) in if (((p0_ = ""))) then SOME (pred, succ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1551_ : string -> maybe ((sopw * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s1551_:string ->(sopw#(5)words$word#(5)words$word#(5)words$word)option) s1552_0= ((case s1552_0 of s1553_0 => (case ((shiftiwop_mnemonic_matches_prefix s1553_0)) of SOME ((op, s1554_0)) => (case ((string_drop s1553_0 s1554_0)) of s1555_0 => (case ((spc_matches_prefix0 s1555_0)) of SOME ((() , s1556_0)) => (case ((string_drop s1555_0 s1556_0)) of s1557_0 => (case ((reg_name_matches_prefix s1557_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1558_0)) => (case ((string_drop s1557_0 s1558_0)) of s1559_0 => (case ((sep_matches_prefix s1559_0)) of SOME ((() , s1560_0)) => (case ((string_drop s1559_0 s1560_0)) of s1561_0 => (case ((reg_name_matches_prefix s1561_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1562_0)) => (case ((string_drop s1561_0 s1562_0)) of s1563_0 => (case ((sep_matches_prefix s1563_0)) of SOME ((() , s1564_0)) => (case ((string_drop s1563_0 s1564_0)) of s1565_0 => (case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1565_0 : (( 5 words$word # ii)) option)) of SOME ((shamt, s1566_0)) => let p0_ = (string_drop s1565_0 s1566_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s1534_ : string -> maybe ((ropw * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s1534_:string ->(ropw#(5)words$word#(5)words$word#(5)words$word)option) s1535_0= ((case s1535_0 of s1536_0 => (case ((rtypew_mnemonic_matches_prefix s1536_0)) of SOME ((op, s1537_0)) => (case ((string_drop s1536_0 s1537_0)) of s1538_0 => (case ((spc_matches_prefix0 s1538_0)) of SOME ((() , s1539_0)) => (case ((string_drop s1538_0 s1539_0)) of s1540_0 => (case ((reg_name_matches_prefix s1540_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1541_0)) => (case ((string_drop s1540_0 s1541_0)) of s1542_0 => (case ((sep_matches_prefix s1542_0)) of SOME ((() , s1543_0)) => (case ((string_drop s1542_0 s1543_0)) of s1544_0 => (case ((reg_name_matches_prefix s1544_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1545_0)) => (case ((string_drop s1544_0 s1545_0)) of s1546_0 => (case ((sep_matches_prefix s1546_0)) of SOME ((() , s1547_0)) => (case ((string_drop s1546_0 s1547_0)) of s1548_0 => (case ((reg_name_matches_prefix s1548_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s1549_0)) => let p0_ = (string_drop s1548_0 s1549_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s1517_ : string -> maybe ((sop * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s1517_:string ->(sop#(5)words$word#(5)words$word#(5)words$word)option) s1518_0= ((case s1518_0 of s1519_0 => (case ((shiftw_mnemonic_matches_prefix s1519_0)) of SOME ((op, s1520_0)) => (case ((string_drop s1519_0 s1520_0)) of s1521_0 => (case ((spc_matches_prefix0 s1521_0)) of SOME ((() , s1522_0)) => (case ((string_drop s1521_0 s1522_0)) of s1523_0 => (case ((reg_name_matches_prefix s1523_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1524_0)) => (case ((string_drop s1523_0 s1524_0)) of s1525_0 => (case ((sep_matches_prefix s1525_0)) of SOME ((() , s1526_0)) => (case ((string_drop s1525_0 s1526_0)) of s1527_0 => (case ((reg_name_matches_prefix s1527_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1528_0)) => (case ((string_drop s1527_0 s1528_0)) of s1529_0 => (case ((sep_matches_prefix s1529_0)) of SOME ((() , s1530_0)) => (case ((string_drop s1529_0 s1530_0)) of s1531_0 => (case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1531_0 : (( 5 words$word # ii)) option)) of SOME ((shamt, s1532_0)) => let p0_ = (string_drop s1531_0 s1532_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s1501_ : string -> maybe ((mword ty5 * mword ty5 * mword ty12))*) val _ = Define ` ((s1501_:string ->((5)words$word#(5)words$word#(12)words$word)option) s1502_0= (let s1503_0 = s1502_0 in if ((string_startswith s1503_0 "addiw")) then (case ((string_drop s1503_0 ((string_length "addiw")))) of s1504_0 => (case ((spc_matches_prefix0 s1504_0)) of SOME ((() , s1505_0)) => (case ((string_drop s1504_0 s1505_0)) of s1506_0 => (case ((reg_name_matches_prefix s1506_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1507_0)) => (case ((string_drop s1506_0 s1507_0)) of s1508_0 => (case ((sep_matches_prefix s1508_0)) of SOME ((() , s1509_0)) => (case ((string_drop s1508_0 s1509_0)) of s1510_0 => (case ((reg_name_matches_prefix s1510_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1511_0)) => (case ((string_drop s1510_0 s1511_0)) of s1512_0 => (case ((sep_matches_prefix s1512_0)) of SOME ((() , s1513_0)) => (case ((string_drop s1512_0 s1513_0)) of s1514_0 => (case ((hex_bits_12_matches_prefix0 s1514_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s1515_0)) => let p0_ = (string_drop s1514_0 s1515_0) in if (((p0_ = ""))) then SOME (rd, rs1, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1473_ : string -> maybe ((word_width * bool * bool * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s1473_:string ->(word_width#bool#bool#(5)words$word#(12)words$word#(5)words$word)option) s1474_0= (let s1475_0 = s1474_0 in if ((string_startswith s1475_0 "s")) then (case ((string_drop s1475_0 ((string_length "s")))) of s1476_0 => (case ((size_mnemonic_matches_prefix s1476_0)) of SOME ((size1, s1477_0)) => (case ((string_drop s1476_0 s1477_0)) of s1478_0 => (case ((maybe_aq_matches_prefix s1478_0)) of SOME ((aq, s1479_0)) => (case ((string_drop s1478_0 s1479_0)) of s1480_0 => (case ((maybe_rl_matches_prefix s1480_0)) of SOME ((rl, s1481_0)) => (case ((string_drop s1480_0 s1481_0)) of s1482_0 => (case ((spc_matches_prefix0 s1482_0)) of SOME ((() , s1483_0)) => (case ((string_drop s1482_0 s1483_0)) of s1484_0 => (case ((reg_name_matches_prefix s1484_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s1485_0)) => (case ((string_drop s1484_0 s1485_0)) of s1486_0 => (case ((sep_matches_prefix s1486_0)) of SOME ((() , s1487_0)) => (case ((string_drop s1486_0 s1487_0)) of s1488_0 => (case ((hex_bits_12_matches_prefix0 s1488_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s1489_0)) => (case ((string_drop s1488_0 s1489_0)) of s1490_0 => (case ((opt_spc_matches_prefix0 s1490_0)) of SOME ((() , s1491_0)) => let s1492_0 = (string_drop s1490_0 s1491_0) in if ((string_startswith s1492_0 "(")) then (case ((string_drop s1492_0 ((string_length "(")))) of s1493_0 => (case ((opt_spc_matches_prefix0 s1493_0)) of SOME ((() , s1494_0)) => (case ((string_drop s1493_0 s1494_0)) of s1495_0 => (case ((reg_name_matches_prefix s1495_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1496_0)) => (case ((string_drop s1495_0 s1496_0)) of s1497_0 => (case ((opt_spc_matches_prefix0 s1497_0)) of SOME ((() , s1498_0)) => let s1499_0 = (string_drop s1497_0 s1498_0) in if ((string_startswith s1499_0 ")")) then let p0_ = (string_drop s1499_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (size1, aq, rl, rs2, imm, rs1) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1443_ : string -> maybe ((word_width * bool * bool * bool * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s1443_:string ->(word_width#bool#bool#bool#(5)words$word#(12)words$word#(5)words$word)option) s1444_0= (let s1445_0 = s1444_0 in if ((string_startswith s1445_0 "l")) then (case ((string_drop s1445_0 ((string_length "l")))) of s1446_0 => (case ((size_mnemonic_matches_prefix s1446_0)) of SOME ((size1, s1447_0)) => (case ((string_drop s1446_0 s1447_0)) of s1448_0 => (case ((maybe_u_matches_prefix s1448_0)) of SOME ((is_unsigned, s1449_0)) => (case ((string_drop s1448_0 s1449_0)) of s1450_0 => (case ((maybe_aq_matches_prefix s1450_0)) of SOME ((aq, s1451_0)) => (case ((string_drop s1450_0 s1451_0)) of s1452_0 => (case ((maybe_rl_matches_prefix s1452_0)) of SOME ((rl, s1453_0)) => (case ((string_drop s1452_0 s1453_0)) of s1454_0 => (case ((spc_matches_prefix0 s1454_0)) of SOME ((() , s1455_0)) => (case ((string_drop s1454_0 s1455_0)) of s1456_0 => (case ((reg_name_matches_prefix s1456_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1457_0)) => (case ((string_drop s1456_0 s1457_0)) of s1458_0 => (case ((sep_matches_prefix s1458_0)) of SOME ((() , s1459_0)) => (case ((string_drop s1458_0 s1459_0)) of s1460_0 => (case ((hex_bits_12_matches_prefix0 s1460_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s1461_0)) => (case ((string_drop s1460_0 s1461_0)) of s1462_0 => (case ((opt_spc_matches_prefix0 s1462_0)) of SOME ((() , s1463_0)) => let s1464_0 = (string_drop s1462_0 s1463_0) in if ((string_startswith s1464_0 "(")) then (case ((string_drop s1464_0 ((string_length "(")))) of s1465_0 => (case ((opt_spc_matches_prefix0 s1465_0)) of SOME ((() , s1466_0)) => (case ((string_drop s1465_0 s1466_0)) of s1467_0 => (case ((reg_name_matches_prefix s1467_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1468_0)) => (case ((string_drop s1467_0 s1468_0)) of s1469_0 => (case ((opt_spc_matches_prefix0 s1469_0)) of SOME ((() , s1470_0)) => let s1471_0 = (string_drop s1469_0 s1470_0) in if ((string_startswith s1471_0 ")")) then let p0_ = (string_drop s1471_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (size1, is_unsigned, aq, rl, rd, imm, rs1) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1426_ : string -> maybe ((rop * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s1426_:string ->(rop#(5)words$word#(5)words$word#(5)words$word)option) s1427_0= ((case s1427_0 of s1428_0 => (case ((rtype_mnemonic_matches_prefix s1428_0)) of SOME ((op, s1429_0)) => (case ((string_drop s1428_0 s1429_0)) of s1430_0 => (case ((spc_matches_prefix0 s1430_0)) of SOME ((() , s1431_0)) => (case ((string_drop s1430_0 s1431_0)) of s1432_0 => (case ((reg_name_matches_prefix s1432_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1433_0)) => (case ((string_drop s1432_0 s1433_0)) of s1434_0 => (case ((sep_matches_prefix s1434_0)) of SOME ((() , s1435_0)) => (case ((string_drop s1434_0 s1435_0)) of s1436_0 => (case ((reg_name_matches_prefix s1436_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1437_0)) => (case ((string_drop s1436_0 s1437_0)) of s1438_0 => (case ((sep_matches_prefix s1438_0)) of SOME ((() , s1439_0)) => (case ((string_drop s1438_0 s1439_0)) of s1440_0 => (case ((reg_name_matches_prefix s1440_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s1441_0)) => let p0_ = (string_drop s1440_0 s1441_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s1409_ : string -> maybe ((sop * mword ty5 * mword ty5 * mword ty6))*) val _ = Define ` ((s1409_:string ->(sop#(5)words$word#(5)words$word#(6)words$word)option) s1410_0= ((case s1410_0 of s1411_0 => (case ((shiftiop_mnemonic_matches_prefix s1411_0)) of SOME ((op, s1412_0)) => (case ((string_drop s1411_0 s1412_0)) of s1413_0 => (case ((spc_matches_prefix0 s1413_0)) of SOME ((() , s1414_0)) => (case ((string_drop s1413_0 s1414_0)) of s1415_0 => (case ((reg_name_matches_prefix s1415_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1416_0)) => (case ((string_drop s1415_0 s1416_0)) of s1417_0 => (case ((sep_matches_prefix s1417_0)) of SOME ((() , s1418_0)) => (case ((string_drop s1417_0 s1418_0)) of s1419_0 => (case ((reg_name_matches_prefix s1419_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1420_0)) => (case ((string_drop s1419_0 s1420_0)) of s1421_0 => (case ((sep_matches_prefix s1421_0)) of SOME ((() , s1422_0)) => (case ((string_drop s1421_0 s1422_0)) of s1423_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1423_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s1424_0)) => let p0_ = (string_drop s1423_0 s1424_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s1392_ : string -> maybe ((iop * mword ty5 * mword ty5 * mword ty12))*) val _ = Define ` ((s1392_:string ->(iop#(5)words$word#(5)words$word#(12)words$word)option) s1393_0= ((case s1393_0 of s1394_0 => (case ((itype_mnemonic_matches_prefix s1394_0)) of SOME ((op, s1395_0)) => (case ((string_drop s1394_0 s1395_0)) of s1396_0 => (case ((spc_matches_prefix0 s1396_0)) of SOME ((() , s1397_0)) => (case ((string_drop s1396_0 s1397_0)) of s1398_0 => (case ((reg_name_matches_prefix s1398_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1399_0)) => (case ((string_drop s1398_0 s1399_0)) of s1400_0 => (case ((sep_matches_prefix s1400_0)) of SOME ((() , s1401_0)) => (case ((string_drop s1400_0 s1401_0)) of s1402_0 => (case ((reg_name_matches_prefix s1402_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1403_0)) => (case ((string_drop s1402_0 s1403_0)) of s1404_0 => (case ((sep_matches_prefix s1404_0)) of SOME ((() , s1405_0)) => (case ((string_drop s1404_0 s1405_0)) of s1406_0 => (case ((hex_bits_12_matches_prefix0 s1406_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s1407_0)) => let p0_ = (string_drop s1406_0 s1407_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s1375_ : string -> maybe ((bop * mword ty5 * mword ty5 * mword ty13))*) val _ = Define ` ((s1375_:string ->(bop#(5)words$word#(5)words$word#(13)words$word)option) s1376_0= ((case s1376_0 of s1377_0 => (case ((btype_mnemonic_matches_prefix s1377_0)) of SOME ((op, s1378_0)) => (case ((string_drop s1377_0 s1378_0)) of s1379_0 => (case ((spc_matches_prefix0 s1379_0)) of SOME ((() , s1380_0)) => (case ((string_drop s1379_0 s1380_0)) of s1381_0 => (case ((reg_name_matches_prefix s1381_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1382_0)) => (case ((string_drop s1381_0 s1382_0)) of s1383_0 => (case ((sep_matches_prefix s1383_0)) of SOME ((() , s1384_0)) => (case ((string_drop s1383_0 s1384_0)) of s1385_0 => (case ((reg_name_matches_prefix s1385_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s1386_0)) => (case ((string_drop s1385_0 s1386_0)) of s1387_0 => (case ((sep_matches_prefix s1387_0)) of SOME ((() , s1388_0)) => (case ((string_drop s1387_0 s1388_0)) of s1389_0 => (case ((hex_bits_13_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1389_0 : (( 13 words$word # ii)) option)) of SOME ((imm, s1390_0)) => let p0_ = (string_drop s1389_0 s1390_0) in if (((p0_ = ""))) then SOME (op, rs1, rs2, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s1359_ : string -> maybe ((mword ty5 * mword ty5 * mword ty12))*) val _ = Define ` ((s1359_:string ->((5)words$word#(5)words$word#(12)words$word)option) s1360_0= (let s1361_0 = s1360_0 in if ((string_startswith s1361_0 "jalr")) then (case ((string_drop s1361_0 ((string_length "jalr")))) of s1362_0 => (case ((spc_matches_prefix0 s1362_0)) of SOME ((() , s1363_0)) => (case ((string_drop s1362_0 s1363_0)) of s1364_0 => (case ((reg_name_matches_prefix s1364_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1365_0)) => (case ((string_drop s1364_0 s1365_0)) of s1366_0 => (case ((sep_matches_prefix s1366_0)) of SOME ((() , s1367_0)) => (case ((string_drop s1366_0 s1367_0)) of s1368_0 => (case ((reg_name_matches_prefix s1368_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s1369_0)) => (case ((string_drop s1368_0 s1369_0)) of s1370_0 => (case ((sep_matches_prefix s1370_0)) of SOME ((() , s1371_0)) => (case ((string_drop s1370_0 s1371_0)) of s1372_0 => (case ((hex_bits_12_matches_prefix0 s1372_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s1373_0)) => let p0_ = (string_drop s1372_0 s1373_0) in if (((p0_ = ""))) then SOME (rd, rs1, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1347_ : string -> maybe ((mword ty5 * mword ty21))*) val _ = Define ` ((s1347_:string ->((5)words$word#(21)words$word)option) s1348_0= (let s1349_0 = s1348_0 in if ((string_startswith s1349_0 "jal")) then (case ((string_drop s1349_0 ((string_length "jal")))) of s1350_0 => (case ((spc_matches_prefix0 s1350_0)) of SOME ((() , s1351_0)) => (case ((string_drop s1350_0 s1351_0)) of s1352_0 => (case ((reg_name_matches_prefix s1352_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1353_0)) => (case ((string_drop s1352_0 s1353_0)) of s1354_0 => (case ((sep_matches_prefix s1354_0)) of SOME ((() , s1355_0)) => (case ((string_drop s1354_0 s1355_0)) of s1356_0 => (case ((hex_bits_21_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1356_0 : (( 21 words$word # ii)) option)) of SOME ((imm, s1357_0)) => let p0_ = (string_drop s1356_0 s1357_0) in if (((p0_ = ""))) then SOME (rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s1334_ : string -> maybe ((uop * mword ty5 * mword ty20))*) val _ = Define ` ((s1334_:string ->(uop#(5)words$word#(20)words$word)option) s1335_0= ((case s1335_0 of s1336_0 => (case ((utype_mnemonic_matches_prefix s1336_0)) of SOME ((op, s1337_0)) => (case ((string_drop s1336_0 s1337_0)) of s1338_0 => (case ((spc_matches_prefix0 s1338_0)) of SOME ((() , s1339_0)) => (case ((string_drop s1338_0 s1339_0)) of s1340_0 => (case ((reg_name_matches_prefix s1340_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s1341_0)) => (case ((string_drop s1340_0 s1341_0)) of s1342_0 => (case ((sep_matches_prefix s1342_0)) of SOME ((() , s1343_0)) => (case ((string_drop s1342_0 s1343_0)) of s1344_0 => (case ((hex_bits_20_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s1344_0 : (( 20 words$word # ii)) option)) of SOME ((imm, s1345_0)) => let p0_ = (string_drop s1344_0 s1345_0) in if (((p0_ = ""))) then SOME (op, rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; val _ = Define ` ((assembly_backwards:string ->(regstate)sail2_state_monad$sequential_state ->(((ast),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) arg_= (let s1346_0 = arg_ in if ((case ((s1334_ s1346_0 : ((uop # 5 words$word # 20 words$word))option)) of SOME ((op, rd, imm)) => T | _ => F )) then (case (s1334_ s1346_0 : (( uop # 5 words$word # 20 words$word)) option) of (SOME ((op, rd, imm))) => sail2_state_monad$returnS (UTYPE (imm, rd, op)) ) else if ((case ((s1347_ s1346_0 : (( 5 words$word # 21 words$word))option)) of SOME ((rd, imm)) => T | _ => F )) then (case (s1347_ s1346_0 : (( 5 words$word # 21 words$word)) option) of (SOME ((rd, imm))) => sail2_state_monad$returnS (RISCV_JAL (imm, rd)) ) else if ((case ((s1359_ s1346_0 : (( 5 words$word # 5 words$word # 12 words$word))option)) of SOME ((rd, rs1, imm)) => T | _ => F )) then (case (s1359_ s1346_0 : (( 5 words$word # 5 words$word # 12 words$word)) option) of (SOME ((rd, rs1, imm))) => sail2_state_monad$returnS (RISCV_JALR (imm, rs1, rd)) ) else if ((case ((s1375_ s1346_0 : ((bop # 5 words$word # 5 words$word # 13 words$word))option)) of SOME ((op, rs1, rs2, imm)) => T | _ => F )) then (case (s1375_ s1346_0 : (( bop # 5 words$word # 5 words$word # 13 words$word)) option) of (SOME ((op, rs1, rs2, imm))) => sail2_state_monad$returnS (BTYPE (imm, rs2, rs1, op)) ) else if ((case ((s1392_ s1346_0 : ((iop # 5 words$word # 5 words$word # 12 words$word))option)) of SOME ((op, rd, rs1, imm)) => T | _ => F )) then (case (s1392_ s1346_0 : (( iop # 5 words$word # 5 words$word # 12 words$word)) option) of (SOME ((op, rd, rs1, imm))) => sail2_state_monad$returnS (ITYPE (imm, rs1, rd, op)) ) else if ((case ((s1409_ s1346_0 : ((sop # 5 words$word # 5 words$word # 6 words$word))option)) of SOME ((op, rd, rs1, shamt)) => T | _ => F )) then (case (s1409_ s1346_0 : (( sop # 5 words$word # 5 words$word # 6 words$word)) option) of (SOME ((op, rd, rs1, shamt))) => sail2_state_monad$returnS (SHIFTIOP (shamt, rs1, rd, op)) ) else if ((case ((s1426_ s1346_0 : ((rop # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, rd, rs1, rs2)) => T | _ => F )) then (case (s1426_ s1346_0 : (( rop # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, rd, rs1, rs2))) => sail2_state_monad$returnS (RTYPE (rs2, rs1, rd, op)) ) else if ((case ((s1443_ s1346_0 : ((word_width # bool # bool # bool # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((size1, is_unsigned, aq, rl, rd, imm, rs1)) => T | _ => F )) then (case (s1443_ s1346_0 : (( word_width # bool # bool # bool # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((size1, is_unsigned, aq, rl, rd, imm, rs1))) => sail2_state_monad$returnS (LOAD (imm, rs1, rd, is_unsigned, size1, aq, rl)) ) else if ((case ((s1473_ s1346_0 : ((word_width # bool # bool # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((size1, aq, rl, rs2, imm, rs1)) => T | _ => F )) then (case (s1473_ s1346_0 : (( word_width # bool # bool # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((size1, aq, rl, rs2, imm, rs1))) => sail2_state_monad$returnS (STORE (imm, rs2, rs1, size1, aq, rl)) ) else if ((case ((s1501_ s1346_0 : (( 5 words$word # 5 words$word # 12 words$word))option)) of SOME ((rd, rs1, imm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1501_ s1346_0 : (( 5 words$word # 5 words$word # 12 words$word)) option) of (SOME ((rd, rs1, imm))) => sail2_state_monad$returnS (ADDIW (imm, rs1, rd)) ) else if ((case ((s1517_ s1346_0 : ((sop # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, rd, rs1, shamt)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1517_ s1346_0 : (( sop # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, rd, rs1, shamt))) => sail2_state_monad$returnS (SHIFTW (shamt, rs1, rd, op)) ) else if ((case ((s1534_ s1346_0 : ((ropw # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, rd, rs1, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1534_ s1346_0 : (( ropw # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, rd, rs1, rs2))) => sail2_state_monad$returnS (RTYPEW (rs2, rs1, rd, op)) ) else if ((case ((s1551_ s1346_0 : ((sopw # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, rd, rs1, shamt)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1551_ s1346_0 : (( sopw # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, rd, rs1, shamt))) => sail2_state_monad$returnS (SHIFTIWOP (shamt, rs1, rd, op)) ) else if ((case ((s1568_ s1346_0 : (( 4 words$word # 4 words$word))option)) of SOME ((pred, succ)) => T | _ => F )) then (case (s1568_ s1346_0 : (( 4 words$word # 4 words$word)) option) of (SOME ((pred, succ))) => sail2_state_monad$returnS (FENCE (pred, succ)) ) else if ((case ((s1580_ s1346_0 : (( 4 words$word # 4 words$word))option)) of SOME ((pred, succ)) => T | _ => F )) then (case (s1580_ s1346_0 : (( 4 words$word # 4 words$word)) option) of (SOME ((pred, succ))) => sail2_state_monad$returnS (FENCE_TSO (pred, succ)) ) else if (((s1346_0 = "fence.i"))) then sail2_state_monad$returnS (FENCEI () ) else if (((s1346_0 = "ecall"))) then sail2_state_monad$returnS (ECALL () ) else if (((s1346_0 = "mret"))) then sail2_state_monad$returnS (MRET () ) else if (((s1346_0 = "sret"))) then sail2_state_monad$returnS (SRET () ) else if (((s1346_0 = "ebreak"))) then sail2_state_monad$returnS (EBREAK () ) else if (((s1346_0 = "wfi"))) then sail2_state_monad$returnS (WFI () ) else if ((case ((s1592_ s1346_0 : (( 5 words$word # 5 words$word))option)) of SOME ((rs1, rs2)) => T | _ => F )) then (case (s1592_ s1346_0 : (( 5 words$word # 5 words$word)) option) of (SOME ((rs1, rs2))) => sail2_state_monad$returnS (SFENCE_VMA (rs1, rs2)) ) else if ((case ((s1604_ s1346_0 : ((word_width # bool # bool # 5 words$word # 5 words$word))option)) of SOME ((size1, aq, rl, rd, rs1)) => T | _ => F )) then (case (s1604_ s1346_0 : (( word_width # bool # bool # 5 words$word # 5 words$word)) option) of (SOME ((size1, aq, rl, rd, rs1))) => sail2_state_monad$returnS (LOADRES (aq, rl, rs1, size1, rd)) ) else if ((case ((s1622_ s1346_0 : ((word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((size1, aq, rl, rd, rs1, rs2)) => T | _ => F )) then (case (s1622_ s1346_0 : (( word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((size1, aq, rl, rd, rs1, rs2))) => sail2_state_monad$returnS (STORECON (aq, rl, rs2, rs1, size1, rd)) ) else if ((case ((s1644_ s1346_0 : ((amoop # word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, width, aq, rl, rd, rs2, rs1)) => T | _ => F )) then (case (s1644_ s1346_0 : (( amoop # word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, width, aq, rl, rd, rs2, rs1))) => sail2_state_monad$returnS (AMO (op, aq, rl, rs2, rs1, width, rd)) ) else if (((s1346_0 = "c.nop"))) then sail2_state_monad$returnS (C_NOP () ) else if ((case ((s1670_ s1346_0 : (( 3 words$word # 8 words$word))option)) of SOME ((rdc, nzimm)) => (nzimm <> (0x00w : 8 words$word)) | _ => F )) then (case (s1670_ s1346_0 : (( 3 words$word # 8 words$word)) option) of (SOME ((rdc, nzimm))) => sail2_state_monad$returnS (C_ADDI4SPN (rdc, nzimm)) ) else if ((case ((s1682_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rdc, rsc, uimm)) => T | _ => F )) then (case (s1682_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rdc, rsc, uimm))) => sail2_state_monad$returnS (C_LW (uimm, rsc, rdc)) ) else if ((case ((s1698_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rdc, rsc, uimm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1698_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rdc, rsc, uimm))) => sail2_state_monad$returnS (C_LD (uimm, rsc, rdc)) ) else if ((case ((s1714_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rsc1, rsc2, uimm)) => T | _ => F )) then (case (s1714_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rsc1, rsc2, uimm))) => sail2_state_monad$returnS (C_SW (uimm, rsc1, rsc2)) ) else if ((case ((s1730_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rsc1, rsc2, uimm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1730_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rsc1, rsc2, uimm))) => sail2_state_monad$returnS (C_SD (uimm, rsc1, rsc2)) ) else if ((case ((s1746_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rsd, nzi)) => ((((nzi <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))) | _ => F )) then (case (s1746_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rsd, nzi))) => sail2_state_monad$returnS (C_ADDI (nzi, rsd)) ) else if ((case ((s1758_ s1346_0 : ( 11 words$word)option)) of SOME (imm) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s1758_ s1346_0 : ( 11 words$word) option) of (SOME (imm)) => sail2_state_monad$returnS (C_JAL imm) ) else if ((case ((s1766_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rsd, imm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1766_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rsd, imm))) => sail2_state_monad$returnS (C_ADDIW (imm, rsd)) ) else if ((case ((s1778_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, imm)) => (rd <> zreg) | _ => F )) then (case (s1778_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, imm))) => sail2_state_monad$returnS (C_LI (imm, rd)) ) else if ((case ((s1790_ s1346_0 : ( 6 words$word)option)) of SOME (imm) => (imm <> (0b000000w : 6 words$word)) | _ => F )) then (case (s1790_ s1346_0 : ( 6 words$word) option) of (SOME (imm)) => sail2_state_monad$returnS (C_ADDI16SP imm) ) else if ((case ((s1798_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, imm)) => ((((rd <> zreg))) /\ ((((((rd <> sp))) /\ (((imm <> (0b000000w : 6 words$word)))))))) | _ => F )) then (case (s1798_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, imm))) => sail2_state_monad$returnS (C_LUI (imm, rd)) ) else if ((case ((s1810_ s1346_0 : (( 3 words$word # 6 words$word))option)) of SOME ((rsd, shamt)) => (shamt <> (0b000000w : 6 words$word)) | _ => F )) then (case (s1810_ s1346_0 : (( 3 words$word # 6 words$word)) option) of (SOME ((rsd, shamt))) => sail2_state_monad$returnS (C_SRLI (shamt, rsd)) ) else if ((case ((s1822_ s1346_0 : (( 3 words$word # 6 words$word))option)) of SOME ((rsd, shamt)) => (shamt <> (0b000000w : 6 words$word)) | _ => F )) then (case (s1822_ s1346_0 : (( 3 words$word # 6 words$word)) option) of (SOME ((rsd, shamt))) => sail2_state_monad$returnS (C_SRAI (shamt, rsd)) ) else if ((case ((s1834_ s1346_0 : (( 3 words$word # 6 words$word))option)) of SOME ((rsd, imm)) => T | _ => F )) then (case (s1834_ s1346_0 : (( 3 words$word # 6 words$word)) option) of (SOME ((rsd, imm))) => sail2_state_monad$returnS (C_ANDI (imm, rsd)) ) else if ((case ((s1846_ s1346_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => T | _ => F )) then (case (s1846_ s1346_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => sail2_state_monad$returnS (C_SUB (rsd, rs2)) ) else if ((case ((s1858_ s1346_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => T | _ => F )) then (case (s1858_ s1346_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => sail2_state_monad$returnS (C_XOR (rsd, rs2)) ) else if ((case ((s1870_ s1346_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => T | _ => F )) then (case (s1870_ s1346_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => sail2_state_monad$returnS (C_OR (rsd, rs2)) ) else if ((case ((s1882_ s1346_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => T | _ => F )) then (case (s1882_ s1346_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => sail2_state_monad$returnS (C_AND (rsd, rs2)) ) else if ((case ((s1894_ s1346_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1894_ s1346_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => sail2_state_monad$returnS (C_SUBW (rsd, rs2)) ) else if ((case ((s1906_ s1346_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1906_ s1346_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => sail2_state_monad$returnS (C_ADDW (rsd, rs2)) ) else if ((case ((s1918_ s1346_0 : ( 11 words$word)option)) of SOME (imm) => T | _ => F )) then (case (s1918_ s1346_0 : ( 11 words$word) option) of (SOME (imm)) => sail2_state_monad$returnS (C_J imm) ) else if ((case ((s1926_ s1346_0 : (( 3 words$word # 8 words$word))option)) of SOME ((rs, imm)) => T | _ => F )) then (case (s1926_ s1346_0 : (( 3 words$word # 8 words$word)) option) of (SOME ((rs, imm))) => sail2_state_monad$returnS (C_BEQZ (imm, rs)) ) else if ((case ((s1938_ s1346_0 : (( 3 words$word # 8 words$word))option)) of SOME ((rs, imm)) => T | _ => F )) then (case (s1938_ s1346_0 : (( 3 words$word # 8 words$word)) option) of (SOME ((rs, imm))) => sail2_state_monad$returnS (C_BNEZ (imm, rs)) ) else if ((case ((s1950_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rsd, shamt)) => ((((shamt <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))) | _ => F )) then (case (s1950_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rsd, shamt))) => sail2_state_monad$returnS (C_SLLI (shamt, rsd)) ) else if ((case ((s1962_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => (rd <> zreg) | _ => F )) then (case (s1962_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => sail2_state_monad$returnS (C_LWSP (uimm, rd)) ) else if ((case ((s1974_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => ((((rd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s1974_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => sail2_state_monad$returnS (C_LDSP (uimm, rd)) ) else if ((case ((s1986_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => T | _ => F )) then (case (s1986_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => sail2_state_monad$returnS (C_SWSP (uimm, rd)) ) else if ((case ((s1998_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rs2, uimm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s1998_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rs2, uimm))) => sail2_state_monad$returnS (C_SDSP (uimm, rs2)) ) else if ((case ((s2010_ s1346_0 : ( 5 words$word)option)) of SOME (rs1) => (rs1 <> zreg) | _ => F )) then (case (s2010_ s1346_0 : ( 5 words$word) option) of (SOME (rs1)) => sail2_state_monad$returnS (C_JR rs1) ) else if ((case ((s2018_ s1346_0 : ( 5 words$word)option)) of SOME (rs1) => (rs1 <> zreg) | _ => F )) then (case (s2018_ s1346_0 : ( 5 words$word) option) of (SOME (rs1)) => sail2_state_monad$returnS (C_JALR rs1) ) else if ((case ((s2026_ s1346_0 : (( 5 words$word # 5 words$word))option)) of SOME ((rd, rs2)) => ((((rd <> zreg))) /\ (((rs2 <> zreg)))) | _ => F )) then (case (s2026_ s1346_0 : (( 5 words$word # 5 words$word)) option) of (SOME ((rd, rs2))) => sail2_state_monad$returnS (C_MV (rd, rs2)) ) else if (((s1346_0 = "c.ebreak"))) then sail2_state_monad$returnS (C_EBREAK () ) else if ((case ((s2038_ s1346_0 : (( 5 words$word # 5 words$word))option)) of SOME ((rsd, rs2)) => ((((rsd <> zreg))) /\ (((rs2 <> zreg)))) | _ => F )) then (case (s2038_ s1346_0 : (( 5 words$word # 5 words$word)) option) of (SOME ((rsd, rs2))) => sail2_state_monad$returnS (C_ADD (rsd, rs2)) ) else if ((case ((s2050_ s1346_0 : ((bool # bool # bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((high, signed1, signed2, rd, rs1, rs2)) => T | _ => F )) then (case (s2050_ s1346_0 : (( bool # bool # bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((high, signed1, signed2, rd, rs1, rs2))) => sail2_state_monad$returnS (MUL (rs2, rs1, rd, high, signed1, signed2)) ) else if ((case ((s2067_ s1346_0 : ((bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((s, rd, rs1, rs2)) => T | _ => F )) then (case (s2067_ s1346_0 : (( bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((s, rd, rs1, rs2))) => sail2_state_monad$returnS (DIV0 (rs2, rs1, rd, s)) ) else if ((case ((s2085_ s1346_0 : ((bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((s, rd, rs1, rs2)) => T | _ => F )) then (case (s2085_ s1346_0 : (( bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((s, rd, rs1, rs2))) => sail2_state_monad$returnS (REM (rs2, rs1, rd, s)) ) else if ((case ((s2103_ s1346_0 : (( 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((rd, rs1, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s2103_ s1346_0 : (( 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((rd, rs1, rs2))) => sail2_state_monad$returnS (MULW (rs2, rs1, rd)) ) else if ((case ((s2119_ s1346_0 : ((bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((s, rd, rs1, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s2119_ s1346_0 : (( bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((s, rd, rs1, rs2))) => sail2_state_monad$returnS (DIVW (rs2, rs1, rd, s)) ) else if ((case ((s2138_ s1346_0 : ((bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((s, rd, rs1, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s2138_ s1346_0 : (( bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((s, rd, rs1, rs2))) => sail2_state_monad$returnS (REMW (rs2, rs1, rd, s)) ) else if ((case ((s2157_ s1346_0 : ((csrop # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((op, rd, csr, rs1)) => T | _ => F )) then (case (s2157_ s1346_0 : (( csrop # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((op, rd, csr, rs1))) => sail2_state_monad$returnS (CSR (csr, rs1, rd, T, op)) ) else if ((case ((s2175_ s1346_0 : ((csrop # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((op, rd, csr, rs1)) => T | _ => F )) then (case (s2175_ s1346_0 : (( csrop # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((op, rd, csr, rs1))) => sail2_state_monad$returnS (CSR (csr, rs1, rd, F, op)) ) else if (((s1346_0 = "uret"))) then sail2_state_monad$returnS (URET () ) else if ((case ((s2192_ s1346_0 : ( 6 words$word)option)) of SOME (imm) => T | _ => F )) then (case (s2192_ s1346_0 : ( 6 words$word) option) of (SOME (imm)) => sail2_state_monad$returnS (C_NOP_HINT imm) ) else if ((case ((s2198_ s1346_0 : ( 5 words$word)option)) of SOME (rsd) => (rsd <> zreg) | _ => F )) then (case (s2198_ s1346_0 : ( 5 words$word) option) of (SOME (rsd)) => sail2_state_monad$returnS (C_ADDI_HINT rsd) ) else if ((case ((s2204_ s1346_0 : ( 6 words$word)option)) of SOME (imm) => T | _ => F )) then (case (s2204_ s1346_0 : ( 6 words$word) option) of (SOME (imm)) => sail2_state_monad$returnS (C_LI_HINT imm) ) else if ((case ((s2210_ s1346_0 : ( 6 words$word)option)) of SOME (imm) => (imm <> (0b000000w : 6 words$word)) | _ => F )) then (case (s2210_ s1346_0 : ( 6 words$word) option) of (SOME (imm)) => sail2_state_monad$returnS (C_LUI_HINT imm) ) else if ((case ((s2216_ s1346_0 : ( 5 words$word)option)) of SOME (rs2) => (rs2 <> zreg) | _ => F )) then (case (s2216_ s1346_0 : ( 5 words$word) option) of (SOME (rs2)) => sail2_state_monad$returnS (C_MV_HINT rs2) ) else if ((case ((s2222_ s1346_0 : ( 5 words$word)option)) of SOME (rs2) => (rs2 <> zreg) | _ => F )) then (case (s2222_ s1346_0 : ( 5 words$word) option) of (SOME (rs2)) => sail2_state_monad$returnS (C_ADD_HINT rs2) ) else if ((case ((s2228_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rsd, shamt)) => ((((shamt = (0b000000w : 6 words$word)))) \/ (((rsd = zreg)))) | _ => F )) then (case (s2228_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rsd, shamt))) => sail2_state_monad$returnS (C_SLLI_HINT (shamt, rsd)) ) else if ((case ((s2237_ s1346_0 : ( 3 words$word)option)) of SOME (rsd) => T | _ => F )) then (case (s2237_ s1346_0 : ( 3 words$word) option) of (SOME (rsd)) => sail2_state_monad$returnS (C_SRLI_HINT rsd) ) else if ((case ((s2243_ s1346_0 : ( 3 words$word)option)) of SOME (rsd) => T | _ => F )) then (case (s2243_ s1346_0 : ( 3 words$word) option) of (SOME (rsd)) => sail2_state_monad$returnS (C_SRAI_HINT rsd) ) else if ((case ((s2249_ s1346_0 : (( 4 words$word # 4 words$word # 5 words$word # 5 words$word # 4 words$word))option)) of SOME ((pred, succ, rs, rd, fm)) => (((((((fm <> (0x0w : 4 words$word)))) /\ (((fm <> (0x8w : 4 words$word))))))) \/ ((((((rs <> (0b00000w : 5 words$word)))) \/ (((rd <> (0b00000w : 5 words$word)))))))) | _ => F )) then (case (s2249_ s1346_0 : (( 4 words$word # 4 words$word # 5 words$word # 5 words$word # 4 words$word)) option) of (SOME ((pred, succ, rs, rd, fm))) => sail2_state_monad$returnS (FENCE_RESERVED (fm, pred, succ, rs, rd)) ) else if ((case ((s2267_ s1346_0 : (( 5 words$word # 5 words$word # 12 words$word))option)) of SOME ((rd, rs, imm)) => ((((imm <> (0x000w : 12 words$word)))) \/ ((((((rs <> zreg))) \/ (((rd <> zreg))))))) | _ => F )) then (case (s2267_ s1346_0 : (( 5 words$word # 5 words$word # 12 words$word)) option) of (SOME ((rd, rs, imm))) => sail2_state_monad$returnS (FENCEI_RESERVED (imm, rs, rd)) ) else if ((case ((s2279_ s1346_0 : ((word_width # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((width, rd, imm, rs1)) => T | _ => F )) then (case (s2279_ s1346_0 : (( word_width # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((width, rd, imm, rs1))) => sail2_state_monad$returnS (LOAD_FP (imm, rs1, rd, width)) ) else if ((case ((s2303_ s1346_0 : ((word_width # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((width, rs2, imm, rs1)) => T | _ => F )) then (case (s2303_ s1346_0 : (( word_width # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((width, rs2, imm, rs1))) => sail2_state_monad$returnS (STORE_FP (imm, rs2, rs1, width)) ) else if ((case ((s2327_ s1346_0 : ((f_madd_op_S # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((op, rd, rs1, rs2, rs3, rm)) => T | _ => F )) then (case (s2327_ s1346_0 : (( f_madd_op_S # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((op, rd, rs1, rs2, rs3, rm))) => sail2_state_monad$returnS (F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, op)) ) else if ((case ((s2352_ s1346_0 : ((f_bin_rm_op_S # 5 words$word # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((op, rd, rs1, rs2, rm)) => T | _ => F )) then (case (s2352_ s1346_0 : (( f_bin_rm_op_S # 5 words$word # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((op, rd, rs1, rs2, rm))) => sail2_state_monad$returnS (F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, op)) ) else if ((case ((s2373_ s1346_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FSQRT_S, rd, rs1, rm)) => T | _ => F )) then (case (s2373_ s1346_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FSQRT_S, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FSQRT_S)) ) else if ((case ((s2390_ s1346_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_W_S, rd, rs1, rm)) => T | _ => F )) then (case (s2390_ s1346_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_W_S, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_W_S)) ) else if ((case ((s2407_ s1346_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_WU_S, rd, rs1, rm)) => T | _ => F )) then (case (s2407_ s1346_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_WU_S, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_WU_S)) ) else if ((case ((s2424_ s1346_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_W, rd, rs1, rm)) => T | _ => F )) then (case (s2424_ s1346_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_W, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_W)) ) else if ((case ((s2441_ s1346_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_WU, rd, rs1, rm)) => T | _ => F )) then (case (s2441_ s1346_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_WU, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_WU)) ) else if ((case ((s2458_ s1346_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_L_S, rd, rs1, rm)) => T | _ => F )) then (case (s2458_ s1346_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_L_S, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_L_S)) ) else if ((case ((s2475_ s1346_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_LU_S, rd, rs1, rm)) => T | _ => F )) then (case (s2475_ s1346_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_LU_S, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_LU_S)) ) else if ((case ((s2492_ s1346_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_L, rd, rs1, rm)) => T | _ => F )) then (case (s2492_ s1346_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_L, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_L)) ) else if ((case ((s2509_ s1346_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_LU, rd, rs1, rm)) => T | _ => F )) then (case (s2509_ s1346_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_LU, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_LU)) ) else if ((case ((s2526_ s1346_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJ_S, rd, rs1, rs2)) => T | _ => F )) then (case (s2526_ s1346_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJ_S, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FSGNJ_S)) ) else if ((case ((s2543_ s1346_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJN_S, rd, rs1, rs2)) => T | _ => F )) then (case (s2543_ s1346_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJN_S, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FSGNJN_S)) ) else if ((case ((s2560_ s1346_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJX_S, rd, rs1, rs2)) => T | _ => F )) then (case (s2560_ s1346_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJX_S, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FSGNJX_S)) ) else if ((case ((s2577_ s1346_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FMIN_S, rd, rs1, rs2)) => T | _ => F )) then (case (s2577_ s1346_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FMIN_S, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FMIN_S)) ) else if ((case ((s2594_ s1346_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FMAX_S, rd, rs1, rs2)) => T | _ => F )) then (case (s2594_ s1346_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FMAX_S, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FMAX_S)) ) else if ((case ((s2611_ s1346_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FEQ_S, rd, rs1, rs2)) => T | _ => F )) then (case (s2611_ s1346_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FEQ_S, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FEQ_S)) ) else if ((case ((s2628_ s1346_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FLT_S, rd, rs1, rs2)) => T | _ => F )) then (case (s2628_ s1346_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FLT_S, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FLT_S)) ) else if ((case ((s2645_ s1346_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FLE_S, rd, rs1, rs2)) => T | _ => F )) then (case (s2645_ s1346_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FLE_S, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_S (rs2, rs1, rd, FLE_S)) ) else if ((case ((s2662_ s1346_0 : ((f_un_op_S # 5 words$word # 5 words$word))option)) of SOME ((FMV_X_W, rd, rs1)) => T | _ => F )) then (case (s2662_ s1346_0 : (( f_un_op_S # 5 words$word # 5 words$word)) option) of (SOME ((FMV_X_W, rd, rs1))) => sail2_state_monad$returnS (F_UN_TYPE_S (rs1, rd, FMV_X_W)) ) else if ((case ((s2675_ s1346_0 : ((f_un_op_S # 5 words$word # 5 words$word))option)) of SOME ((FMV_W_X, rd, rs1)) => T | _ => F )) then (case (s2675_ s1346_0 : (( f_un_op_S # 5 words$word # 5 words$word)) option) of (SOME ((FMV_W_X, rd, rs1))) => sail2_state_monad$returnS (F_UN_TYPE_S (rs1, rd, FMV_W_X)) ) else if ((case ((s2688_ s1346_0 : ((f_un_op_S # 5 words$word # 5 words$word))option)) of SOME ((FCLASS_S, rd, rs1)) => T | _ => F )) then (case (s2688_ s1346_0 : (( f_un_op_S # 5 words$word # 5 words$word)) option) of (SOME ((FCLASS_S, rd, rs1))) => sail2_state_monad$returnS (F_UN_TYPE_S (rs1, rd, FCLASS_S)) ) else if ((case ((s2701_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, imm)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s2701_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, imm))) => sail2_state_monad$returnS (C_FLWSP (imm, rd)) ) else if ((case ((s2713_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s2713_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => sail2_state_monad$returnS (C_FSWSP (uimm, rd)) ) else if ((case ((s2725_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rdc, rsc, uimm)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s2725_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rdc, rsc, uimm))) => sail2_state_monad$returnS (C_FLW (uimm, rsc, rdc)) ) else if ((case ((s2741_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rsc1, rsc2, uimm)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s2741_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rsc1, rsc2, uimm))) => sail2_state_monad$returnS (C_FSW (uimm, rsc1, rsc2)) ) else if ((case ((s2757_ s1346_0 : ((f_madd_op_D # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((op, rd, rs1, rs2, rs3, rm)) => T | _ => F )) then (case (s2757_ s1346_0 : (( f_madd_op_D # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((op, rd, rs1, rs2, rs3, rm))) => sail2_state_monad$returnS (F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, op)) ) else if ((case ((s2782_ s1346_0 : ((f_bin_rm_op_D # 5 words$word # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((op, rd, rs1, rs2, rm)) => T | _ => F )) then (case (s2782_ s1346_0 : (( f_bin_rm_op_D # 5 words$word # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((op, rd, rs1, rs2, rm))) => sail2_state_monad$returnS (F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, op)) ) else if ((case ((s2803_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FSQRT_D, rd, rs1, rm)) => T | _ => F )) then (case (s2803_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FSQRT_D, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FSQRT_D)) ) else if ((case ((s2820_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_W_D, rd, rs1, rm)) => T | _ => F )) then (case (s2820_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_W_D, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_W_D)) ) else if ((case ((s2837_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_WU_D, rd, rs1, rm)) => T | _ => F )) then (case (s2837_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_WU_D, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_WU_D)) ) else if ((case ((s2854_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_W, rd, rs1, rm)) => T | _ => F )) then (case (s2854_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_W, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_W)) ) else if ((case ((s2871_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_WU, rd, rs1, rm)) => T | _ => F )) then (case (s2871_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_WU, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_WU)) ) else if ((case ((s2888_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_L_D, rd, rs1, rm)) => T | _ => F )) then (case (s2888_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_L_D, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_L_D)) ) else if ((case ((s2905_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_LU_D, rd, rs1, rm)) => T | _ => F )) then (case (s2905_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_LU_D, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_LU_D)) ) else if ((case ((s2922_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_L, rd, rs1, rm)) => T | _ => F )) then (case (s2922_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_L, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_L)) ) else if ((case ((s2939_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_LU, rd, rs1, rm)) => T | _ => F )) then (case (s2939_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_LU, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_LU)) ) else if ((case ((s2956_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_D, rd, rs1, rm)) => T | _ => F )) then (case (s2956_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_D, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_S_D)) ) else if ((case ((s2973_ s1346_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_S, rd, rs1, rm)) => T | _ => F )) then (case (s2973_ s1346_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_S, rd, rs1, rm))) => sail2_state_monad$returnS (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_S)) ) else if ((case ((s2990_ s1346_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJ_D, rd, rs1, rs2)) => T | _ => F )) then (case (s2990_ s1346_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJ_D, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FSGNJ_D)) ) else if ((case ((s3007_ s1346_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJN_D, rd, rs1, rs2)) => T | _ => F )) then (case (s3007_ s1346_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJN_D, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FSGNJN_D)) ) else if ((case ((s3024_ s1346_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJX_D, rd, rs1, rs2)) => T | _ => F )) then (case (s3024_ s1346_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJX_D, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FSGNJX_D)) ) else if ((case ((s3041_ s1346_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FMIN_D, rd, rs1, rs2)) => T | _ => F )) then (case (s3041_ s1346_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FMIN_D, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FMIN_D)) ) else if ((case ((s3058_ s1346_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FMAX_D, rd, rs1, rs2)) => T | _ => F )) then (case (s3058_ s1346_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FMAX_D, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FMAX_D)) ) else if ((case ((s3075_ s1346_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FEQ_D, rd, rs1, rs2)) => T | _ => F )) then (case (s3075_ s1346_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FEQ_D, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FEQ_D)) ) else if ((case ((s3092_ s1346_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FLT_D, rd, rs1, rs2)) => T | _ => F )) then (case (s3092_ s1346_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FLT_D, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FLT_D)) ) else if ((case ((s3109_ s1346_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FLE_D, rd, rs1, rs2)) => T | _ => F )) then (case (s3109_ s1346_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FLE_D, rd, rs1, rs2))) => sail2_state_monad$returnS (F_BIN_TYPE_D (rs2, rs1, rd, FLE_D)) ) else if ((case ((s3126_ s1346_0 : ((f_un_op_D # 5 words$word # 5 words$word))option)) of SOME ((FMV_X_D, rd, rs1)) => T | _ => F )) then (case (s3126_ s1346_0 : (( f_un_op_D # 5 words$word # 5 words$word)) option) of (SOME ((FMV_X_D, rd, rs1))) => sail2_state_monad$returnS (F_UN_TYPE_D (rs1, rd, FMV_X_D)) ) else if ((case ((s3139_ s1346_0 : ((f_un_op_D # 5 words$word # 5 words$word))option)) of SOME ((FMV_D_X, rd, rs1)) => T | _ => F )) then (case (s3139_ s1346_0 : (( f_un_op_D # 5 words$word # 5 words$word)) option) of (SOME ((FMV_D_X, rd, rs1))) => sail2_state_monad$returnS (F_UN_TYPE_D (rs1, rd, FMV_D_X)) ) else if ((case ((s3152_ s1346_0 : ((f_un_op_D # 5 words$word # 5 words$word))option)) of SOME ((FCLASS_D, rd, rs1)) => T | _ => F )) then (case (s3152_ s1346_0 : (( f_un_op_D # 5 words$word # 5 words$word)) option) of (SOME ((FCLASS_D, rd, rs1))) => sail2_state_monad$returnS (F_UN_TYPE_D (rs1, rd, FCLASS_D)) ) else if ((case ((s3165_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s3165_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => sail2_state_monad$returnS (C_FLDSP (uimm, rd)) ) else if ((case ((s3177_ s1346_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rs2, uimm)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s3177_ s1346_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rs2, uimm))) => sail2_state_monad$returnS (C_FSDSP (uimm, rs2)) ) else if ((case ((s3189_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rdc, rsc, uimm)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s3189_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rdc, rsc, uimm))) => sail2_state_monad$returnS (C_FLD (uimm, rsc, rdc)) ) else if ((case ((s3205_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rsc1, rsc2, uimm)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s3205_ s1346_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rsc1, rsc2, uimm))) => sail2_state_monad$returnS (C_FSD (uimm, rsc1, rsc2)) ) else if ((case ((s3221_ s1346_0 : ( 32 words$word)option)) of SOME (s) => T | _ => F )) then (case (s3221_ s1346_0 : ( 32 words$word) option) of (SOME (s)) => sail2_state_monad$returnS (ILLEGAL s) ) else if ((case ((s3229_ s1346_0 : ( 16 words$word)option)) of SOME (s) => T | _ => F )) then (case (s3229_ s1346_0 : ( 16 words$word) option) of (SOME (s)) => sail2_state_monad$returnS (C_ILLEGAL s) ) else sail2_state_monad$seqS (sail2_state_monad$assert_expS F "Pattern match failure at unknown location") (sail2_state_monad$exitS () )))`; val _ = Define ` ((assembly_forwards_matches:ast -> bool) arg_= ((case arg_ of UTYPE ((imm, rd, op)) => T | RISCV_JAL ((imm, rd)) => T | RISCV_JALR ((imm, rs1, rd)) => T | BTYPE ((imm, rs2, rs1, op)) => T | ITYPE ((imm, rs1, rd, op)) => T | SHIFTIOP ((shamt, rs1, rd, op)) => T | RTYPE ((rs2, rs1, rd, op)) => T | LOAD ((imm, rs1, rd, is_unsigned, size1, aq, rl)) => T | STORE ((imm, rs2, rs1, size1, aq, rl)) => T | ADDIW ((imm, rs1, rd)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | SHIFTW ((shamt, rs1, rd, op)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | RTYPEW ((rs2, rs1, rd, op)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | SHIFTIWOP ((shamt, rs1, rd, op)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | FENCE ((pred, succ)) => T | FENCE_TSO ((pred, succ)) => T | FENCEI (() ) => T | ECALL (() ) => T | MRET (() ) => T | SRET (() ) => T | EBREAK (() ) => T | WFI (() ) => T | SFENCE_VMA ((rs1, rs2)) => T | LOADRES ((aq, rl, rs1, size1, rd)) => T | STORECON ((aq, rl, rs2, rs1, size1, rd)) => T | AMO ((op, aq, rl, rs2, rs1, width, rd)) => T | C_NOP (() ) => T | C_ADDI4SPN ((rdc, nzimm)) => if (((nzimm <> (0x00w : 8 words$word)))) then T else F | C_LW ((uimm, rsc, rdc)) => T | C_LD ((uimm, rsc, rdc)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | C_SW ((uimm, rsc1, rsc2)) => T | C_SD ((uimm, rsc1, rsc2)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | C_ADDI ((nzi, rsd)) => if ((((((nzi <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))))) then T else F | C_JAL (imm) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then T else F | C_ADDIW ((imm, rsd)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | C_LI ((imm, rd)) => if (((rd <> zreg))) then T else F | C_ADDI16SP (imm) => if (((imm <> (0b000000w : 6 words$word)))) then T else F | C_LUI ((imm, rd)) => if ((((((rd <> zreg))) /\ ((((((rd <> sp))) /\ (((imm <> (0b000000w : 6 words$word)))))))))) then T else F | C_SRLI ((shamt, rsd)) => if (((shamt <> (0b000000w : 6 words$word)))) then T else F | C_SRAI ((shamt, rsd)) => if (((shamt <> (0b000000w : 6 words$word)))) then T else F | C_ANDI ((imm, rsd)) => T | C_SUB ((rsd, rs2)) => T | C_XOR ((rsd, rs2)) => T | C_OR ((rsd, rs2)) => T | C_AND ((rsd, rs2)) => T | C_SUBW ((rsd, rs2)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | C_ADDW ((rsd, rs2)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | C_J (imm) => T | C_BEQZ ((imm, rs)) => T | C_BNEZ ((imm, rs)) => T | C_SLLI ((shamt, rsd)) => if ((((((shamt <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))))) then T else F | C_LWSP ((uimm, rd)) => if (((rd <> zreg))) then T else F | C_LDSP ((uimm, rd)) => if ((((((rd <> zreg))) /\ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then T else F | C_SWSP ((uimm, rd)) => T | C_SDSP ((uimm, rs2)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | C_JR (rs1) => if (((rs1 <> zreg))) then T else F | C_JALR (rs1) => if (((rs1 <> zreg))) then T else F | C_MV ((rd, rs2)) => if ((((((rd <> zreg))) /\ (((rs2 <> zreg)))))) then T else F | C_EBREAK (() ) => T | C_ADD ((rsd, rs2)) => if ((((((rsd <> zreg))) /\ (((rs2 <> zreg)))))) then T else F | MUL ((rs2, rs1, rd, high, signed1, signed2)) => T | DIV0 ((rs2, rs1, rd, s)) => T | REM ((rs2, rs1, rd, s)) => T | MULW ((rs2, rs1, rd)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | DIVW ((rs2, rs1, rd, s)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | REMW ((rs2, rs1, rd, s)) => if ((((( 64 : int): ii) = (( 64 : int): ii)))) then T else F | CSR ((csr, rs1, rd, T, op)) => T | CSR ((csr, rs1, rd, F, op)) => T | URET (() ) => T | C_NOP_HINT (imm) => T | C_ADDI_HINT (rsd) => if (((rsd <> zreg))) then T else F | C_LI_HINT (imm) => T | C_LUI_HINT (imm) => if (((imm <> (0b000000w : 6 words$word)))) then T else F | C_MV_HINT (rs2) => if (((rs2 <> zreg))) then T else F | C_ADD_HINT (rs2) => if (((rs2 <> zreg))) then T else F | C_SLLI_HINT ((shamt, rsd)) => if ((((((shamt = (0b000000w : 6 words$word)))) \/ (((rsd = zreg)))))) then T else F | C_SRLI_HINT (rsd) => T | C_SRAI_HINT (rsd) => T | FENCE_RESERVED ((fm, pred, succ, rs, rd)) => if (((((((((fm <> (0x0w : 4 words$word)))) /\ (((fm <> (0x8w : 4 words$word))))))) \/ ((((((rs <> (0b00000w : 5 words$word)))) \/ (((rd <> (0b00000w : 5 words$word)))))))))) then T else F | FENCEI_RESERVED ((imm, rs, rd)) => if ((((((imm <> (0x000w : 12 words$word)))) \/ ((((((rs <> zreg))) \/ (((rd <> zreg))))))))) then T else F | LOAD_FP ((imm, rs1, rd, width)) => T | STORE_FP ((imm, rs2, rs1, width)) => T | F_MADD_TYPE_S ((rs3, rs2, rs1, rm, rd, op)) => T | F_BIN_RM_TYPE_S ((rs2, rs1, rm, rd, op)) => T | F_UN_RM_TYPE_S ((rs1, rm, rd, FSQRT_S)) => T | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_W_S)) => T | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_WU_S)) => T | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_W)) => T | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_WU)) => T | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_L_S)) => T | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_LU_S)) => T | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_L)) => T | F_UN_RM_TYPE_S ((rs1, rm, rd, FCVT_S_LU)) => T | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJ_S)) => T | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJN_S)) => T | F_BIN_TYPE_S ((rs2, rs1, rd, FSGNJX_S)) => T | F_BIN_TYPE_S ((rs2, rs1, rd, FMIN_S)) => T | F_BIN_TYPE_S ((rs2, rs1, rd, FMAX_S)) => T | F_BIN_TYPE_S ((rs2, rs1, rd, FEQ_S)) => T | F_BIN_TYPE_S ((rs2, rs1, rd, FLT_S)) => T | F_BIN_TYPE_S ((rs2, rs1, rd, FLE_S)) => T | F_UN_TYPE_S ((rs1, rd, FMV_X_W)) => T | F_UN_TYPE_S ((rs1, rd, FMV_W_X)) => T | F_UN_TYPE_S ((rs1, rd, FCLASS_S)) => T | C_FLWSP ((imm, rd)) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then T else F | C_FSWSP ((uimm, rd)) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then T else F | C_FLW ((uimm, rsc, rdc)) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then T else F | C_FSW ((uimm, rsc1, rsc2)) => if ((((( 64 : int): ii) = (( 32 : int): ii)))) then T else F | F_MADD_TYPE_D ((rs3, rs2, rs1, rm, rd, op)) => T | F_BIN_RM_TYPE_D ((rs2, rs1, rm, rd, op)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FSQRT_D)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_W_D)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_WU_D)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_W)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_WU)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_L_D)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_LU_D)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_L)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_LU)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_S_D)) => T | F_UN_RM_TYPE_D ((rs1, rm, rd, FCVT_D_S)) => T | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJ_D)) => T | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJN_D)) => T | F_BIN_TYPE_D ((rs2, rs1, rd, FSGNJX_D)) => T | F_BIN_TYPE_D ((rs2, rs1, rd, FMIN_D)) => T | F_BIN_TYPE_D ((rs2, rs1, rd, FMAX_D)) => T | F_BIN_TYPE_D ((rs2, rs1, rd, FEQ_D)) => T | F_BIN_TYPE_D ((rs2, rs1, rd, FLT_D)) => T | F_BIN_TYPE_D ((rs2, rs1, rd, FLE_D)) => T | F_UN_TYPE_D ((rs1, rd, FMV_X_D)) => T | F_UN_TYPE_D ((rs1, rd, FMV_D_X)) => T | F_UN_TYPE_D ((rs1, rd, FCLASS_D)) => T | C_FLDSP ((uimm, rd)) => if (((((((( 64 : int): ii) = (( 32 : int): ii)))) \/ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then T else F | C_FSDSP ((uimm, rs2)) => if (((((((( 64 : int): ii) = (( 32 : int): ii)))) \/ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then T else F | C_FLD ((uimm, rsc, rdc)) => if (((((((( 64 : int): ii) = (( 32 : int): ii)))) \/ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then T else F | C_FSD ((uimm, rsc1, rsc2)) => if (((((((( 64 : int): ii) = (( 32 : int): ii)))) \/ ((((( 64 : int): ii) = (( 64 : int): ii))))))) then T else F | ILLEGAL (s) => T | C_ILLEGAL (s) => T )))`; (*val _s5132_ : string -> maybe (mword ty16)*) val _ = Define ` ((s5132_:string ->((16)words$word)option) s5133_0= (let s5134_0 = s5133_0 in if ((string_startswith s5134_0 "c.illegal")) then (case ((string_drop s5134_0 ((string_length "c.illegal")))) of s5135_0 => (case ((spc_matches_prefix0 s5135_0)) of SOME ((() , s5136_0)) => (case ((string_drop s5135_0 s5136_0)) of s5137_0 => (case ((hex_bits_16_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5137_0 : (( 16 words$word # ii)) option)) of SOME ((s, s5138_0)) => let p0_ = (string_drop s5137_0 s5138_0) in if (((p0_ = ""))) then SOME s else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5124_ : string -> maybe (mword ty32)*) val _ = Define ` ((s5124_:string ->((32)words$word)option) s5125_0= (let s5126_0 = s5125_0 in if ((string_startswith s5126_0 "illegal")) then (case ((string_drop s5126_0 ((string_length "illegal")))) of s5127_0 => (case ((spc_matches_prefix0 s5127_0)) of SOME ((() , s5128_0)) => (case ((string_drop s5127_0 s5128_0)) of s5129_0 => (case ((hex_bits_32_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5129_0 : (( 32 words$word # ii)) option)) of SOME ((s, s5130_0)) => let p0_ = (string_drop s5129_0 s5130_0) in if (((p0_ = ""))) then SOME s else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5108_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s5108_:string ->((3)words$word#(3)words$word#(5)words$word)option) s5109_0= (let s5110_0 = s5109_0 in if ((string_startswith s5110_0 "c.fsd")) then (case ((string_drop s5110_0 ((string_length "c.fsd")))) of s5111_0 => (case ((spc_matches_prefix0 s5111_0)) of SOME ((() , s5112_0)) => (case ((string_drop s5111_0 s5112_0)) of s5113_0 => (case ((creg_name_matches_prefix s5113_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s5114_0)) => (case ((string_drop s5113_0 s5114_0)) of s5115_0 => (case ((sep_matches_prefix s5115_0)) of SOME ((() , s5116_0)) => (case ((string_drop s5115_0 s5116_0)) of s5117_0 => (case ((creg_name_matches_prefix s5117_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s5118_0)) => (case ((string_drop s5117_0 s5118_0)) of s5119_0 => (case ((sep_matches_prefix s5119_0)) of SOME ((() , s5120_0)) => (case ((string_drop s5119_0 s5120_0)) of s5121_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5121_0 : (( 8 words$word # ii)) option)) of SOME ((v__1462, s5122_0)) => if (((((subrange_vec_dec v__1462 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1462 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1462 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let p0_ = (string_drop s5121_0 s5122_0) in if (((p0_ = ""))) then SOME (rsc1, rsc2, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5092_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s5092_:string ->((3)words$word#(3)words$word#(5)words$word)option) s5093_0= (let s5094_0 = s5093_0 in if ((string_startswith s5094_0 "c.fld")) then (case ((string_drop s5094_0 ((string_length "c.fld")))) of s5095_0 => (case ((spc_matches_prefix0 s5095_0)) of SOME ((() , s5096_0)) => (case ((string_drop s5095_0 s5096_0)) of s5097_0 => (case ((creg_name_matches_prefix s5097_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s5098_0)) => (case ((string_drop s5097_0 s5098_0)) of s5099_0 => (case ((sep_matches_prefix s5099_0)) of SOME ((() , s5100_0)) => (case ((string_drop s5099_0 s5100_0)) of s5101_0 => (case ((creg_name_matches_prefix s5101_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s5102_0)) => (case ((string_drop s5101_0 s5102_0)) of s5103_0 => (case ((sep_matches_prefix s5103_0)) of SOME ((() , s5104_0)) => (case ((string_drop s5103_0 s5104_0)) of s5105_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5105_0 : (( 8 words$word # ii)) option)) of SOME ((v__1464, s5106_0)) => if (((((subrange_vec_dec v__1464 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1464 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1464 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let p0_ = (string_drop s5105_0 s5106_0) in if (((p0_ = ""))) then SOME (rdc, rsc, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5080_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s5080_:string ->((5)words$word#(6)words$word)option) s5081_0= (let s5082_0 = s5081_0 in if ((string_startswith s5082_0 "c.fsdsp")) then (case ((string_drop s5082_0 ((string_length "c.fsdsp")))) of s5083_0 => (case ((spc_matches_prefix0 s5083_0)) of SOME ((() , s5084_0)) => (case ((string_drop s5083_0 s5084_0)) of s5085_0 => (case ((reg_name_matches_prefix s5085_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5086_0)) => (case ((string_drop s5085_0 s5086_0)) of s5087_0 => (case ((sep_matches_prefix s5087_0)) of SOME ((() , s5088_0)) => (case ((string_drop s5087_0 s5088_0)) of s5089_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5089_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s5090_0)) => let p0_ = (string_drop s5089_0 s5090_0) in if (((p0_ = ""))) then SOME (rs2, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5068_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s5068_:string ->((5)words$word#(6)words$word)option) s5069_0= (let s5070_0 = s5069_0 in if ((string_startswith s5070_0 "c.fldsp")) then (case ((string_drop s5070_0 ((string_length "c.fldsp")))) of s5071_0 => (case ((spc_matches_prefix0 s5071_0)) of SOME ((() , s5072_0)) => (case ((string_drop s5071_0 s5072_0)) of s5073_0 => (case ((reg_name_matches_prefix s5073_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5074_0)) => (case ((string_drop s5073_0 s5074_0)) of s5075_0 => (case ((sep_matches_prefix s5075_0)) of SOME ((() , s5076_0)) => (case ((string_drop s5075_0 s5076_0)) of s5077_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5077_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s5078_0)) => let p0_ = (string_drop s5077_0 s5078_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5055_ : string -> maybe ((f_un_op_D * mword ty5 * mword ty5))*) val _ = Define ` ((s5055_:string ->(f_un_op_D#(5)words$word#(5)words$word)option) s5056_0= ((case s5056_0 of s5057_0 => (case ((f_un_type_mnemonic_D_matches_prefix s5057_0)) of SOME ((FCLASS_D, s5058_0)) => (case ((string_drop s5057_0 s5058_0)) of s5059_0 => (case ((spc_matches_prefix0 s5059_0)) of SOME ((() , s5060_0)) => (case ((string_drop s5059_0 s5060_0)) of s5061_0 => (case ((reg_name_matches_prefix s5061_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5062_0)) => (case ((string_drop s5061_0 s5062_0)) of s5063_0 => (case ((sep_matches_prefix s5063_0)) of SOME ((() , s5064_0)) => (case ((string_drop s5063_0 s5064_0)) of s5065_0 => (case ((freg_name_matches_prefix s5065_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5066_0)) => let p0_ = (string_drop s5065_0 s5066_0) in if (((p0_ = ""))) then SOME (FCLASS_D, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5042_ : string -> maybe ((f_un_op_D * mword ty5 * mword ty5))*) val _ = Define ` ((s5042_:string ->(f_un_op_D#(5)words$word#(5)words$word)option) s5043_0= ((case s5043_0 of s5044_0 => (case ((f_un_type_mnemonic_D_matches_prefix s5044_0)) of SOME ((FMV_D_X, s5045_0)) => (case ((string_drop s5044_0 s5045_0)) of s5046_0 => (case ((spc_matches_prefix0 s5046_0)) of SOME ((() , s5047_0)) => (case ((string_drop s5046_0 s5047_0)) of s5048_0 => (case ((freg_name_matches_prefix s5048_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5049_0)) => (case ((string_drop s5048_0 s5049_0)) of s5050_0 => (case ((sep_matches_prefix s5050_0)) of SOME ((() , s5051_0)) => (case ((string_drop s5050_0 s5051_0)) of s5052_0 => (case ((reg_name_matches_prefix s5052_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5053_0)) => let p0_ = (string_drop s5052_0 s5053_0) in if (((p0_ = ""))) then SOME (FMV_D_X, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5029_ : string -> maybe ((f_un_op_D * mword ty5 * mword ty5))*) val _ = Define ` ((s5029_:string ->(f_un_op_D#(5)words$word#(5)words$word)option) s5030_0= ((case s5030_0 of s5031_0 => (case ((f_un_type_mnemonic_D_matches_prefix s5031_0)) of SOME ((FMV_X_D, s5032_0)) => (case ((string_drop s5031_0 s5032_0)) of s5033_0 => (case ((spc_matches_prefix0 s5033_0)) of SOME ((() , s5034_0)) => (case ((string_drop s5033_0 s5034_0)) of s5035_0 => (case ((reg_name_matches_prefix s5035_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5036_0)) => (case ((string_drop s5035_0 s5036_0)) of s5037_0 => (case ((sep_matches_prefix s5037_0)) of SOME ((() , s5038_0)) => (case ((string_drop s5037_0 s5038_0)) of s5039_0 => (case ((freg_name_matches_prefix s5039_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5040_0)) => let p0_ = (string_drop s5039_0 s5040_0) in if (((p0_ = ""))) then SOME (FMV_X_D, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5012_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s5012_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s5013_0= ((case s5013_0 of s5014_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s5014_0)) of SOME ((FLE_D, s5015_0)) => (case ((string_drop s5014_0 s5015_0)) of s5016_0 => (case ((spc_matches_prefix0 s5016_0)) of SOME ((() , s5017_0)) => (case ((string_drop s5016_0 s5017_0)) of s5018_0 => (case ((reg_name_matches_prefix s5018_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5019_0)) => (case ((string_drop s5018_0 s5019_0)) of s5020_0 => (case ((sep_matches_prefix s5020_0)) of SOME ((() , s5021_0)) => (case ((string_drop s5020_0 s5021_0)) of s5022_0 => (case ((freg_name_matches_prefix s5022_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5023_0)) => (case ((string_drop s5022_0 s5023_0)) of s5024_0 => (case ((sep_matches_prefix s5024_0)) of SOME ((() , s5025_0)) => (case ((string_drop s5024_0 s5025_0)) of s5026_0 => (case ((freg_name_matches_prefix s5026_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5027_0)) => let p0_ = (string_drop s5026_0 s5027_0) in if (((p0_ = ""))) then SOME (FLE_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4995_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4995_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s4996_0= ((case s4996_0 of s4997_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s4997_0)) of SOME ((FLT_D, s4998_0)) => (case ((string_drop s4997_0 s4998_0)) of s4999_0 => (case ((spc_matches_prefix0 s4999_0)) of SOME ((() , s5000_0)) => (case ((string_drop s4999_0 s5000_0)) of s5001_0 => (case ((reg_name_matches_prefix s5001_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5002_0)) => (case ((string_drop s5001_0 s5002_0)) of s5003_0 => (case ((sep_matches_prefix s5003_0)) of SOME ((() , s5004_0)) => (case ((string_drop s5003_0 s5004_0)) of s5005_0 => (case ((freg_name_matches_prefix s5005_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5006_0)) => (case ((string_drop s5005_0 s5006_0)) of s5007_0 => (case ((sep_matches_prefix s5007_0)) of SOME ((() , s5008_0)) => (case ((string_drop s5007_0 s5008_0)) of s5009_0 => (case ((freg_name_matches_prefix s5009_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5010_0)) => let p0_ = (string_drop s5009_0 s5010_0) in if (((p0_ = ""))) then SOME (FLT_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4978_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4978_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s4979_0= ((case s4979_0 of s4980_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s4980_0)) of SOME ((FEQ_D, s4981_0)) => (case ((string_drop s4980_0 s4981_0)) of s4982_0 => (case ((spc_matches_prefix0 s4982_0)) of SOME ((() , s4983_0)) => (case ((string_drop s4982_0 s4983_0)) of s4984_0 => (case ((reg_name_matches_prefix s4984_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4985_0)) => (case ((string_drop s4984_0 s4985_0)) of s4986_0 => (case ((sep_matches_prefix s4986_0)) of SOME ((() , s4987_0)) => (case ((string_drop s4986_0 s4987_0)) of s4988_0 => (case ((freg_name_matches_prefix s4988_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4989_0)) => (case ((string_drop s4988_0 s4989_0)) of s4990_0 => (case ((sep_matches_prefix s4990_0)) of SOME ((() , s4991_0)) => (case ((string_drop s4990_0 s4991_0)) of s4992_0 => (case ((freg_name_matches_prefix s4992_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4993_0)) => let p0_ = (string_drop s4992_0 s4993_0) in if (((p0_ = ""))) then SOME (FEQ_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4961_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4961_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s4962_0= ((case s4962_0 of s4963_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s4963_0)) of SOME ((FMAX_D, s4964_0)) => (case ((string_drop s4963_0 s4964_0)) of s4965_0 => (case ((spc_matches_prefix0 s4965_0)) of SOME ((() , s4966_0)) => (case ((string_drop s4965_0 s4966_0)) of s4967_0 => (case ((freg_name_matches_prefix s4967_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4968_0)) => (case ((string_drop s4967_0 s4968_0)) of s4969_0 => (case ((sep_matches_prefix s4969_0)) of SOME ((() , s4970_0)) => (case ((string_drop s4969_0 s4970_0)) of s4971_0 => (case ((freg_name_matches_prefix s4971_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4972_0)) => (case ((string_drop s4971_0 s4972_0)) of s4973_0 => (case ((sep_matches_prefix s4973_0)) of SOME ((() , s4974_0)) => (case ((string_drop s4973_0 s4974_0)) of s4975_0 => (case ((freg_name_matches_prefix s4975_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4976_0)) => let p0_ = (string_drop s4975_0 s4976_0) in if (((p0_ = ""))) then SOME (FMAX_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4944_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4944_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s4945_0= ((case s4945_0 of s4946_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s4946_0)) of SOME ((FMIN_D, s4947_0)) => (case ((string_drop s4946_0 s4947_0)) of s4948_0 => (case ((spc_matches_prefix0 s4948_0)) of SOME ((() , s4949_0)) => (case ((string_drop s4948_0 s4949_0)) of s4950_0 => (case ((freg_name_matches_prefix s4950_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4951_0)) => (case ((string_drop s4950_0 s4951_0)) of s4952_0 => (case ((sep_matches_prefix s4952_0)) of SOME ((() , s4953_0)) => (case ((string_drop s4952_0 s4953_0)) of s4954_0 => (case ((freg_name_matches_prefix s4954_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4955_0)) => (case ((string_drop s4954_0 s4955_0)) of s4956_0 => (case ((sep_matches_prefix s4956_0)) of SOME ((() , s4957_0)) => (case ((string_drop s4956_0 s4957_0)) of s4958_0 => (case ((freg_name_matches_prefix s4958_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4959_0)) => let p0_ = (string_drop s4958_0 s4959_0) in if (((p0_ = ""))) then SOME (FMIN_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4927_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4927_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s4928_0= ((case s4928_0 of s4929_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s4929_0)) of SOME ((FSGNJX_D, s4930_0)) => (case ((string_drop s4929_0 s4930_0)) of s4931_0 => (case ((spc_matches_prefix0 s4931_0)) of SOME ((() , s4932_0)) => (case ((string_drop s4931_0 s4932_0)) of s4933_0 => (case ((freg_name_matches_prefix s4933_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4934_0)) => (case ((string_drop s4933_0 s4934_0)) of s4935_0 => (case ((sep_matches_prefix s4935_0)) of SOME ((() , s4936_0)) => (case ((string_drop s4935_0 s4936_0)) of s4937_0 => (case ((freg_name_matches_prefix s4937_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4938_0)) => (case ((string_drop s4937_0 s4938_0)) of s4939_0 => (case ((sep_matches_prefix s4939_0)) of SOME ((() , s4940_0)) => (case ((string_drop s4939_0 s4940_0)) of s4941_0 => (case ((freg_name_matches_prefix s4941_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4942_0)) => let p0_ = (string_drop s4941_0 s4942_0) in if (((p0_ = ""))) then SOME (FSGNJX_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4910_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4910_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s4911_0= ((case s4911_0 of s4912_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s4912_0)) of SOME ((FSGNJN_D, s4913_0)) => (case ((string_drop s4912_0 s4913_0)) of s4914_0 => (case ((spc_matches_prefix0 s4914_0)) of SOME ((() , s4915_0)) => (case ((string_drop s4914_0 s4915_0)) of s4916_0 => (case ((freg_name_matches_prefix s4916_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4917_0)) => (case ((string_drop s4916_0 s4917_0)) of s4918_0 => (case ((sep_matches_prefix s4918_0)) of SOME ((() , s4919_0)) => (case ((string_drop s4918_0 s4919_0)) of s4920_0 => (case ((freg_name_matches_prefix s4920_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4921_0)) => (case ((string_drop s4920_0 s4921_0)) of s4922_0 => (case ((sep_matches_prefix s4922_0)) of SOME ((() , s4923_0)) => (case ((string_drop s4922_0 s4923_0)) of s4924_0 => (case ((freg_name_matches_prefix s4924_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4925_0)) => let p0_ = (string_drop s4924_0 s4925_0) in if (((p0_ = ""))) then SOME (FSGNJN_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4893_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4893_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word)option) s4894_0= ((case s4894_0 of s4895_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s4895_0)) of SOME ((FSGNJ_D, s4896_0)) => (case ((string_drop s4895_0 s4896_0)) of s4897_0 => (case ((spc_matches_prefix0 s4897_0)) of SOME ((() , s4898_0)) => (case ((string_drop s4897_0 s4898_0)) of s4899_0 => (case ((freg_name_matches_prefix s4899_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4900_0)) => (case ((string_drop s4899_0 s4900_0)) of s4901_0 => (case ((sep_matches_prefix s4901_0)) of SOME ((() , s4902_0)) => (case ((string_drop s4901_0 s4902_0)) of s4903_0 => (case ((freg_name_matches_prefix s4903_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4904_0)) => (case ((string_drop s4903_0 s4904_0)) of s4905_0 => (case ((sep_matches_prefix s4905_0)) of SOME ((() , s4906_0)) => (case ((string_drop s4905_0 s4906_0)) of s4907_0 => (case ((freg_name_matches_prefix s4907_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4908_0)) => let p0_ = (string_drop s4907_0 s4908_0) in if (((p0_ = ""))) then SOME (FSGNJ_D, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4876_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4876_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4877_0= ((case s4877_0 of s4878_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4878_0)) of SOME ((FCVT_D_S, s4879_0)) => (case ((string_drop s4878_0 s4879_0)) of s4880_0 => (case ((spc_matches_prefix0 s4880_0)) of SOME ((() , s4881_0)) => (case ((string_drop s4880_0 s4881_0)) of s4882_0 => (case ((freg_name_matches_prefix s4882_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4883_0)) => (case ((string_drop s4882_0 s4883_0)) of s4884_0 => (case ((sep_matches_prefix s4884_0)) of SOME ((() , s4885_0)) => (case ((string_drop s4884_0 s4885_0)) of s4886_0 => (case ((freg_name_matches_prefix s4886_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4887_0)) => (case ((string_drop s4886_0 s4887_0)) of s4888_0 => (case ((sep_matches_prefix s4888_0)) of SOME ((() , s4889_0)) => (case ((string_drop s4888_0 s4889_0)) of s4890_0 => (case ((frm_mnemonic_matches_prefix s4890_0)) of SOME ((rm, s4891_0)) => let p0_ = (string_drop s4890_0 s4891_0) in if (((p0_ = ""))) then SOME (FCVT_D_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4859_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4859_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4860_0= ((case s4860_0 of s4861_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4861_0)) of SOME ((FCVT_S_D, s4862_0)) => (case ((string_drop s4861_0 s4862_0)) of s4863_0 => (case ((spc_matches_prefix0 s4863_0)) of SOME ((() , s4864_0)) => (case ((string_drop s4863_0 s4864_0)) of s4865_0 => (case ((freg_name_matches_prefix s4865_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4866_0)) => (case ((string_drop s4865_0 s4866_0)) of s4867_0 => (case ((sep_matches_prefix s4867_0)) of SOME ((() , s4868_0)) => (case ((string_drop s4867_0 s4868_0)) of s4869_0 => (case ((freg_name_matches_prefix s4869_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4870_0)) => (case ((string_drop s4869_0 s4870_0)) of s4871_0 => (case ((sep_matches_prefix s4871_0)) of SOME ((() , s4872_0)) => (case ((string_drop s4871_0 s4872_0)) of s4873_0 => (case ((frm_mnemonic_matches_prefix s4873_0)) of SOME ((rm, s4874_0)) => let p0_ = (string_drop s4873_0 s4874_0) in if (((p0_ = ""))) then SOME (FCVT_S_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4842_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4842_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4843_0= ((case s4843_0 of s4844_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4844_0)) of SOME ((FCVT_D_LU, s4845_0)) => (case ((string_drop s4844_0 s4845_0)) of s4846_0 => (case ((spc_matches_prefix0 s4846_0)) of SOME ((() , s4847_0)) => (case ((string_drop s4846_0 s4847_0)) of s4848_0 => (case ((freg_name_matches_prefix s4848_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4849_0)) => (case ((string_drop s4848_0 s4849_0)) of s4850_0 => (case ((sep_matches_prefix s4850_0)) of SOME ((() , s4851_0)) => (case ((string_drop s4850_0 s4851_0)) of s4852_0 => (case ((reg_name_matches_prefix s4852_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4853_0)) => (case ((string_drop s4852_0 s4853_0)) of s4854_0 => (case ((sep_matches_prefix s4854_0)) of SOME ((() , s4855_0)) => (case ((string_drop s4854_0 s4855_0)) of s4856_0 => (case ((frm_mnemonic_matches_prefix s4856_0)) of SOME ((rm, s4857_0)) => let p0_ = (string_drop s4856_0 s4857_0) in if (((p0_ = ""))) then SOME (FCVT_D_LU, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4825_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4825_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4826_0= ((case s4826_0 of s4827_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4827_0)) of SOME ((FCVT_D_L, s4828_0)) => (case ((string_drop s4827_0 s4828_0)) of s4829_0 => (case ((spc_matches_prefix0 s4829_0)) of SOME ((() , s4830_0)) => (case ((string_drop s4829_0 s4830_0)) of s4831_0 => (case ((freg_name_matches_prefix s4831_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4832_0)) => (case ((string_drop s4831_0 s4832_0)) of s4833_0 => (case ((sep_matches_prefix s4833_0)) of SOME ((() , s4834_0)) => (case ((string_drop s4833_0 s4834_0)) of s4835_0 => (case ((reg_name_matches_prefix s4835_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4836_0)) => (case ((string_drop s4835_0 s4836_0)) of s4837_0 => (case ((sep_matches_prefix s4837_0)) of SOME ((() , s4838_0)) => (case ((string_drop s4837_0 s4838_0)) of s4839_0 => (case ((frm_mnemonic_matches_prefix s4839_0)) of SOME ((rm, s4840_0)) => let p0_ = (string_drop s4839_0 s4840_0) in if (((p0_ = ""))) then SOME (FCVT_D_L, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4808_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4808_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4809_0= ((case s4809_0 of s4810_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4810_0)) of SOME ((FCVT_LU_D, s4811_0)) => (case ((string_drop s4810_0 s4811_0)) of s4812_0 => (case ((spc_matches_prefix0 s4812_0)) of SOME ((() , s4813_0)) => (case ((string_drop s4812_0 s4813_0)) of s4814_0 => (case ((reg_name_matches_prefix s4814_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4815_0)) => (case ((string_drop s4814_0 s4815_0)) of s4816_0 => (case ((sep_matches_prefix s4816_0)) of SOME ((() , s4817_0)) => (case ((string_drop s4816_0 s4817_0)) of s4818_0 => (case ((freg_name_matches_prefix s4818_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4819_0)) => (case ((string_drop s4818_0 s4819_0)) of s4820_0 => (case ((sep_matches_prefix s4820_0)) of SOME ((() , s4821_0)) => (case ((string_drop s4820_0 s4821_0)) of s4822_0 => (case ((frm_mnemonic_matches_prefix s4822_0)) of SOME ((rm, s4823_0)) => let p0_ = (string_drop s4822_0 s4823_0) in if (((p0_ = ""))) then SOME (FCVT_LU_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4791_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4791_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4792_0= ((case s4792_0 of s4793_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4793_0)) of SOME ((FCVT_L_D, s4794_0)) => (case ((string_drop s4793_0 s4794_0)) of s4795_0 => (case ((spc_matches_prefix0 s4795_0)) of SOME ((() , s4796_0)) => (case ((string_drop s4795_0 s4796_0)) of s4797_0 => (case ((reg_name_matches_prefix s4797_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4798_0)) => (case ((string_drop s4797_0 s4798_0)) of s4799_0 => (case ((sep_matches_prefix s4799_0)) of SOME ((() , s4800_0)) => (case ((string_drop s4799_0 s4800_0)) of s4801_0 => (case ((freg_name_matches_prefix s4801_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4802_0)) => (case ((string_drop s4801_0 s4802_0)) of s4803_0 => (case ((sep_matches_prefix s4803_0)) of SOME ((() , s4804_0)) => (case ((string_drop s4803_0 s4804_0)) of s4805_0 => (case ((frm_mnemonic_matches_prefix s4805_0)) of SOME ((rm, s4806_0)) => let p0_ = (string_drop s4805_0 s4806_0) in if (((p0_ = ""))) then SOME (FCVT_L_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4774_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4774_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4775_0= ((case s4775_0 of s4776_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4776_0)) of SOME ((FCVT_D_WU, s4777_0)) => (case ((string_drop s4776_0 s4777_0)) of s4778_0 => (case ((spc_matches_prefix0 s4778_0)) of SOME ((() , s4779_0)) => (case ((string_drop s4778_0 s4779_0)) of s4780_0 => (case ((freg_name_matches_prefix s4780_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4781_0)) => (case ((string_drop s4780_0 s4781_0)) of s4782_0 => (case ((sep_matches_prefix s4782_0)) of SOME ((() , s4783_0)) => (case ((string_drop s4782_0 s4783_0)) of s4784_0 => (case ((reg_name_matches_prefix s4784_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4785_0)) => (case ((string_drop s4784_0 s4785_0)) of s4786_0 => (case ((sep_matches_prefix s4786_0)) of SOME ((() , s4787_0)) => (case ((string_drop s4786_0 s4787_0)) of s4788_0 => (case ((frm_mnemonic_matches_prefix s4788_0)) of SOME ((rm, s4789_0)) => let p0_ = (string_drop s4788_0 s4789_0) in if (((p0_ = ""))) then SOME (FCVT_D_WU, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4757_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4757_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4758_0= ((case s4758_0 of s4759_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4759_0)) of SOME ((FCVT_D_W, s4760_0)) => (case ((string_drop s4759_0 s4760_0)) of s4761_0 => (case ((spc_matches_prefix0 s4761_0)) of SOME ((() , s4762_0)) => (case ((string_drop s4761_0 s4762_0)) of s4763_0 => (case ((freg_name_matches_prefix s4763_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4764_0)) => (case ((string_drop s4763_0 s4764_0)) of s4765_0 => (case ((sep_matches_prefix s4765_0)) of SOME ((() , s4766_0)) => (case ((string_drop s4765_0 s4766_0)) of s4767_0 => (case ((reg_name_matches_prefix s4767_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4768_0)) => (case ((string_drop s4767_0 s4768_0)) of s4769_0 => (case ((sep_matches_prefix s4769_0)) of SOME ((() , s4770_0)) => (case ((string_drop s4769_0 s4770_0)) of s4771_0 => (case ((frm_mnemonic_matches_prefix s4771_0)) of SOME ((rm, s4772_0)) => let p0_ = (string_drop s4771_0 s4772_0) in if (((p0_ = ""))) then SOME (FCVT_D_W, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4740_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4740_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4741_0= ((case s4741_0 of s4742_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4742_0)) of SOME ((FCVT_WU_D, s4743_0)) => (case ((string_drop s4742_0 s4743_0)) of s4744_0 => (case ((spc_matches_prefix0 s4744_0)) of SOME ((() , s4745_0)) => (case ((string_drop s4744_0 s4745_0)) of s4746_0 => (case ((reg_name_matches_prefix s4746_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4747_0)) => (case ((string_drop s4746_0 s4747_0)) of s4748_0 => (case ((sep_matches_prefix s4748_0)) of SOME ((() , s4749_0)) => (case ((string_drop s4748_0 s4749_0)) of s4750_0 => (case ((freg_name_matches_prefix s4750_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4751_0)) => (case ((string_drop s4750_0 s4751_0)) of s4752_0 => (case ((sep_matches_prefix s4752_0)) of SOME ((() , s4753_0)) => (case ((string_drop s4752_0 s4753_0)) of s4754_0 => (case ((frm_mnemonic_matches_prefix s4754_0)) of SOME ((rm, s4755_0)) => let p0_ = (string_drop s4754_0 s4755_0) in if (((p0_ = ""))) then SOME (FCVT_WU_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4723_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4723_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4724_0= ((case s4724_0 of s4725_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4725_0)) of SOME ((FCVT_W_D, s4726_0)) => (case ((string_drop s4725_0 s4726_0)) of s4727_0 => (case ((spc_matches_prefix0 s4727_0)) of SOME ((() , s4728_0)) => (case ((string_drop s4727_0 s4728_0)) of s4729_0 => (case ((reg_name_matches_prefix s4729_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4730_0)) => (case ((string_drop s4729_0 s4730_0)) of s4731_0 => (case ((sep_matches_prefix s4731_0)) of SOME ((() , s4732_0)) => (case ((string_drop s4731_0 s4732_0)) of s4733_0 => (case ((freg_name_matches_prefix s4733_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4734_0)) => (case ((string_drop s4733_0 s4734_0)) of s4735_0 => (case ((sep_matches_prefix s4735_0)) of SOME ((() , s4736_0)) => (case ((string_drop s4735_0 s4736_0)) of s4737_0 => (case ((frm_mnemonic_matches_prefix s4737_0)) of SOME ((rm, s4738_0)) => let p0_ = (string_drop s4737_0 s4738_0) in if (((p0_ = ""))) then SOME (FCVT_W_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4706_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4706_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode)option) s4707_0= ((case s4707_0 of s4708_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s4708_0)) of SOME ((FSQRT_D, s4709_0)) => (case ((string_drop s4708_0 s4709_0)) of s4710_0 => (case ((spc_matches_prefix0 s4710_0)) of SOME ((() , s4711_0)) => (case ((string_drop s4710_0 s4711_0)) of s4712_0 => (case ((freg_name_matches_prefix s4712_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4713_0)) => (case ((string_drop s4712_0 s4713_0)) of s4714_0 => (case ((sep_matches_prefix s4714_0)) of SOME ((() , s4715_0)) => (case ((string_drop s4714_0 s4715_0)) of s4716_0 => (case ((freg_name_matches_prefix s4716_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4717_0)) => (case ((string_drop s4716_0 s4717_0)) of s4718_0 => (case ((sep_matches_prefix s4718_0)) of SOME ((() , s4719_0)) => (case ((string_drop s4718_0 s4719_0)) of s4720_0 => (case ((frm_mnemonic_matches_prefix s4720_0)) of SOME ((rm, s4721_0)) => let p0_ = (string_drop s4720_0 s4721_0) in if (((p0_ = ""))) then SOME (FSQRT_D, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4685_ : string -> maybe ((f_bin_rm_op_D * mword ty5 * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4685_:string ->(f_bin_rm_op_D#(5)words$word#(5)words$word#(5)words$word#rounding_mode)option) s4686_0= ((case s4686_0 of s4687_0 => (case ((f_bin_rm_type_mnemonic_D_matches_prefix s4687_0)) of SOME ((op, s4688_0)) => (case ((string_drop s4687_0 s4688_0)) of s4689_0 => (case ((spc_matches_prefix0 s4689_0)) of SOME ((() , s4690_0)) => (case ((string_drop s4689_0 s4690_0)) of s4691_0 => (case ((freg_name_matches_prefix s4691_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4692_0)) => (case ((string_drop s4691_0 s4692_0)) of s4693_0 => (case ((sep_matches_prefix s4693_0)) of SOME ((() , s4694_0)) => (case ((string_drop s4693_0 s4694_0)) of s4695_0 => (case ((freg_name_matches_prefix s4695_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4696_0)) => (case ((string_drop s4695_0 s4696_0)) of s4697_0 => (case ((sep_matches_prefix s4697_0)) of SOME ((() , s4698_0)) => (case ((string_drop s4697_0 s4698_0)) of s4699_0 => (case ((freg_name_matches_prefix s4699_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4700_0)) => (case ((string_drop s4699_0 s4700_0)) of s4701_0 => (case ((sep_matches_prefix s4701_0)) of SOME ((() , s4702_0)) => (case ((string_drop s4701_0 s4702_0)) of s4703_0 => (case ((frm_mnemonic_matches_prefix s4703_0)) of SOME ((rm, s4704_0)) => let p0_ = (string_drop s4703_0 s4704_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4660_ : string -> maybe ((f_madd_op_D * mword ty5 * mword ty5 * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4660_:string ->(f_madd_op_D#(5)words$word#(5)words$word#(5)words$word#(5)words$word#rounding_mode)option) s4661_0= ((case s4661_0 of s4662_0 => (case ((f_madd_type_mnemonic_D_matches_prefix s4662_0)) of SOME ((op, s4663_0)) => (case ((string_drop s4662_0 s4663_0)) of s4664_0 => (case ((spc_matches_prefix0 s4664_0)) of SOME ((() , s4665_0)) => (case ((string_drop s4664_0 s4665_0)) of s4666_0 => (case ((freg_name_matches_prefix s4666_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4667_0)) => (case ((string_drop s4666_0 s4667_0)) of s4668_0 => (case ((sep_matches_prefix s4668_0)) of SOME ((() , s4669_0)) => (case ((string_drop s4668_0 s4669_0)) of s4670_0 => (case ((freg_name_matches_prefix s4670_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4671_0)) => (case ((string_drop s4670_0 s4671_0)) of s4672_0 => (case ((sep_matches_prefix s4672_0)) of SOME ((() , s4673_0)) => (case ((string_drop s4672_0 s4673_0)) of s4674_0 => (case ((freg_name_matches_prefix s4674_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4675_0)) => (case ((string_drop s4674_0 s4675_0)) of s4676_0 => (case ((sep_matches_prefix s4676_0)) of SOME ((() , s4677_0)) => (case ((string_drop s4676_0 s4677_0)) of s4678_0 => (case ((freg_name_matches_prefix s4678_0 : (( 5 words$word # ii)) option)) of SOME ((rs3, s4679_0)) => (case ((string_drop s4678_0 s4679_0)) of s4680_0 => (case ((sep_matches_prefix s4680_0)) of SOME ((() , s4681_0)) => (case ((string_drop s4680_0 s4681_0)) of s4682_0 => (case ((frm_mnemonic_matches_prefix s4682_0)) of SOME ((rm, s4683_0)) => let p0_ = (string_drop s4682_0 s4683_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2, rs3, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4644_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s4644_:string ->((3)words$word#(3)words$word#(5)words$word)option) s4645_0= (let s4646_0 = s4645_0 in if ((string_startswith s4646_0 "c.fsw")) then (case ((string_drop s4646_0 ((string_length "c.fsw")))) of s4647_0 => (case ((spc_matches_prefix0 s4647_0)) of SOME ((() , s4648_0)) => (case ((string_drop s4647_0 s4648_0)) of s4649_0 => (case ((creg_name_matches_prefix s4649_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s4650_0)) => (case ((string_drop s4649_0 s4650_0)) of s4651_0 => (case ((sep_matches_prefix s4651_0)) of SOME ((() , s4652_0)) => (case ((string_drop s4651_0 s4652_0)) of s4653_0 => (case ((creg_name_matches_prefix s4653_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s4654_0)) => (case ((string_drop s4653_0 s4654_0)) of s4655_0 => (case ((sep_matches_prefix s4655_0)) of SOME ((() , s4656_0)) => (case ((string_drop s4655_0 s4656_0)) of s4657_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4657_0 : (( 7 words$word # ii)) option)) of SOME ((v__1466, s4658_0)) => if (((((subrange_vec_dec v__1466 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1466 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1466 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let p0_ = (string_drop s4657_0 s4658_0) in if (((p0_ = ""))) then SOME (rsc1, rsc2, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s4628_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s4628_:string ->((3)words$word#(3)words$word#(5)words$word)option) s4629_0= (let s4630_0 = s4629_0 in if ((string_startswith s4630_0 "c.flw")) then (case ((string_drop s4630_0 ((string_length "c.flw")))) of s4631_0 => (case ((spc_matches_prefix0 s4631_0)) of SOME ((() , s4632_0)) => (case ((string_drop s4631_0 s4632_0)) of s4633_0 => (case ((creg_name_matches_prefix s4633_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s4634_0)) => (case ((string_drop s4633_0 s4634_0)) of s4635_0 => (case ((sep_matches_prefix s4635_0)) of SOME ((() , s4636_0)) => (case ((string_drop s4635_0 s4636_0)) of s4637_0 => (case ((creg_name_matches_prefix s4637_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s4638_0)) => (case ((string_drop s4637_0 s4638_0)) of s4639_0 => (case ((sep_matches_prefix s4639_0)) of SOME ((() , s4640_0)) => (case ((string_drop s4639_0 s4640_0)) of s4641_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4641_0 : (( 7 words$word # ii)) option)) of SOME ((v__1468, s4642_0)) => if (((((subrange_vec_dec v__1468 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1468 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1468 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let p0_ = (string_drop s4641_0 s4642_0) in if (((p0_ = ""))) then SOME (rdc, rsc, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s4616_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s4616_:string ->((5)words$word#(6)words$word)option) s4617_0= (let s4618_0 = s4617_0 in if ((string_startswith s4618_0 "c.fswsp")) then (case ((string_drop s4618_0 ((string_length "c.fswsp")))) of s4619_0 => (case ((spc_matches_prefix0 s4619_0)) of SOME ((() , s4620_0)) => (case ((string_drop s4619_0 s4620_0)) of s4621_0 => (case ((reg_name_matches_prefix s4621_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4622_0)) => (case ((string_drop s4621_0 s4622_0)) of s4623_0 => (case ((sep_matches_prefix s4623_0)) of SOME ((() , s4624_0)) => (case ((string_drop s4623_0 s4624_0)) of s4625_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4625_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s4626_0)) => let p0_ = (string_drop s4625_0 s4626_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s4604_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s4604_:string ->((5)words$word#(6)words$word)option) s4605_0= (let s4606_0 = s4605_0 in if ((string_startswith s4606_0 "c.flwsp")) then (case ((string_drop s4606_0 ((string_length "c.flwsp")))) of s4607_0 => (case ((spc_matches_prefix0 s4607_0)) of SOME ((() , s4608_0)) => (case ((string_drop s4607_0 s4608_0)) of s4609_0 => (case ((reg_name_matches_prefix s4609_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4610_0)) => (case ((string_drop s4609_0 s4610_0)) of s4611_0 => (case ((sep_matches_prefix s4611_0)) of SOME ((() , s4612_0)) => (case ((string_drop s4611_0 s4612_0)) of s4613_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4613_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s4614_0)) => let p0_ = (string_drop s4613_0 s4614_0) in if (((p0_ = ""))) then SOME (rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s4591_ : string -> maybe ((f_un_op_S * mword ty5 * mword ty5))*) val _ = Define ` ((s4591_:string ->(f_un_op_S#(5)words$word#(5)words$word)option) s4592_0= ((case s4592_0 of s4593_0 => (case ((f_un_type_mnemonic_S_matches_prefix s4593_0)) of SOME ((FCLASS_S, s4594_0)) => (case ((string_drop s4593_0 s4594_0)) of s4595_0 => (case ((spc_matches_prefix0 s4595_0)) of SOME ((() , s4596_0)) => (case ((string_drop s4595_0 s4596_0)) of s4597_0 => (case ((reg_name_matches_prefix s4597_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4598_0)) => (case ((string_drop s4597_0 s4598_0)) of s4599_0 => (case ((sep_matches_prefix s4599_0)) of SOME ((() , s4600_0)) => (case ((string_drop s4599_0 s4600_0)) of s4601_0 => (case ((freg_name_matches_prefix s4601_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4602_0)) => let p0_ = (string_drop s4601_0 s4602_0) in if (((p0_ = ""))) then SOME (FCLASS_S, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4578_ : string -> maybe ((f_un_op_S * mword ty5 * mword ty5))*) val _ = Define ` ((s4578_:string ->(f_un_op_S#(5)words$word#(5)words$word)option) s4579_0= ((case s4579_0 of s4580_0 => (case ((f_un_type_mnemonic_S_matches_prefix s4580_0)) of SOME ((FMV_W_X, s4581_0)) => (case ((string_drop s4580_0 s4581_0)) of s4582_0 => (case ((spc_matches_prefix0 s4582_0)) of SOME ((() , s4583_0)) => (case ((string_drop s4582_0 s4583_0)) of s4584_0 => (case ((freg_name_matches_prefix s4584_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4585_0)) => (case ((string_drop s4584_0 s4585_0)) of s4586_0 => (case ((sep_matches_prefix s4586_0)) of SOME ((() , s4587_0)) => (case ((string_drop s4586_0 s4587_0)) of s4588_0 => (case ((reg_name_matches_prefix s4588_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4589_0)) => let p0_ = (string_drop s4588_0 s4589_0) in if (((p0_ = ""))) then SOME (FMV_W_X, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4565_ : string -> maybe ((f_un_op_S * mword ty5 * mword ty5))*) val _ = Define ` ((s4565_:string ->(f_un_op_S#(5)words$word#(5)words$word)option) s4566_0= ((case s4566_0 of s4567_0 => (case ((f_un_type_mnemonic_S_matches_prefix s4567_0)) of SOME ((FMV_X_W, s4568_0)) => (case ((string_drop s4567_0 s4568_0)) of s4569_0 => (case ((spc_matches_prefix0 s4569_0)) of SOME ((() , s4570_0)) => (case ((string_drop s4569_0 s4570_0)) of s4571_0 => (case ((reg_name_matches_prefix s4571_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4572_0)) => (case ((string_drop s4571_0 s4572_0)) of s4573_0 => (case ((sep_matches_prefix s4573_0)) of SOME ((() , s4574_0)) => (case ((string_drop s4573_0 s4574_0)) of s4575_0 => (case ((freg_name_matches_prefix s4575_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4576_0)) => let p0_ = (string_drop s4575_0 s4576_0) in if (((p0_ = ""))) then SOME (FMV_X_W, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4548_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4548_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s4549_0= ((case s4549_0 of s4550_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s4550_0)) of SOME ((FLE_S, s4551_0)) => (case ((string_drop s4550_0 s4551_0)) of s4552_0 => (case ((spc_matches_prefix0 s4552_0)) of SOME ((() , s4553_0)) => (case ((string_drop s4552_0 s4553_0)) of s4554_0 => (case ((reg_name_matches_prefix s4554_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4555_0)) => (case ((string_drop s4554_0 s4555_0)) of s4556_0 => (case ((sep_matches_prefix s4556_0)) of SOME ((() , s4557_0)) => (case ((string_drop s4556_0 s4557_0)) of s4558_0 => (case ((freg_name_matches_prefix s4558_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4559_0)) => (case ((string_drop s4558_0 s4559_0)) of s4560_0 => (case ((sep_matches_prefix s4560_0)) of SOME ((() , s4561_0)) => (case ((string_drop s4560_0 s4561_0)) of s4562_0 => (case ((freg_name_matches_prefix s4562_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4563_0)) => let p0_ = (string_drop s4562_0 s4563_0) in if (((p0_ = ""))) then SOME (FLE_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4531_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4531_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s4532_0= ((case s4532_0 of s4533_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s4533_0)) of SOME ((FLT_S, s4534_0)) => (case ((string_drop s4533_0 s4534_0)) of s4535_0 => (case ((spc_matches_prefix0 s4535_0)) of SOME ((() , s4536_0)) => (case ((string_drop s4535_0 s4536_0)) of s4537_0 => (case ((reg_name_matches_prefix s4537_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4538_0)) => (case ((string_drop s4537_0 s4538_0)) of s4539_0 => (case ((sep_matches_prefix s4539_0)) of SOME ((() , s4540_0)) => (case ((string_drop s4539_0 s4540_0)) of s4541_0 => (case ((freg_name_matches_prefix s4541_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4542_0)) => (case ((string_drop s4541_0 s4542_0)) of s4543_0 => (case ((sep_matches_prefix s4543_0)) of SOME ((() , s4544_0)) => (case ((string_drop s4543_0 s4544_0)) of s4545_0 => (case ((freg_name_matches_prefix s4545_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4546_0)) => let p0_ = (string_drop s4545_0 s4546_0) in if (((p0_ = ""))) then SOME (FLT_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4514_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4514_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s4515_0= ((case s4515_0 of s4516_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s4516_0)) of SOME ((FEQ_S, s4517_0)) => (case ((string_drop s4516_0 s4517_0)) of s4518_0 => (case ((spc_matches_prefix0 s4518_0)) of SOME ((() , s4519_0)) => (case ((string_drop s4518_0 s4519_0)) of s4520_0 => (case ((reg_name_matches_prefix s4520_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4521_0)) => (case ((string_drop s4520_0 s4521_0)) of s4522_0 => (case ((sep_matches_prefix s4522_0)) of SOME ((() , s4523_0)) => (case ((string_drop s4522_0 s4523_0)) of s4524_0 => (case ((freg_name_matches_prefix s4524_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4525_0)) => (case ((string_drop s4524_0 s4525_0)) of s4526_0 => (case ((sep_matches_prefix s4526_0)) of SOME ((() , s4527_0)) => (case ((string_drop s4526_0 s4527_0)) of s4528_0 => (case ((freg_name_matches_prefix s4528_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4529_0)) => let p0_ = (string_drop s4528_0 s4529_0) in if (((p0_ = ""))) then SOME (FEQ_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4497_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4497_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s4498_0= ((case s4498_0 of s4499_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s4499_0)) of SOME ((FMAX_S, s4500_0)) => (case ((string_drop s4499_0 s4500_0)) of s4501_0 => (case ((spc_matches_prefix0 s4501_0)) of SOME ((() , s4502_0)) => (case ((string_drop s4501_0 s4502_0)) of s4503_0 => (case ((freg_name_matches_prefix s4503_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4504_0)) => (case ((string_drop s4503_0 s4504_0)) of s4505_0 => (case ((sep_matches_prefix s4505_0)) of SOME ((() , s4506_0)) => (case ((string_drop s4505_0 s4506_0)) of s4507_0 => (case ((freg_name_matches_prefix s4507_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4508_0)) => (case ((string_drop s4507_0 s4508_0)) of s4509_0 => (case ((sep_matches_prefix s4509_0)) of SOME ((() , s4510_0)) => (case ((string_drop s4509_0 s4510_0)) of s4511_0 => (case ((freg_name_matches_prefix s4511_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4512_0)) => let p0_ = (string_drop s4511_0 s4512_0) in if (((p0_ = ""))) then SOME (FMAX_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4480_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4480_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s4481_0= ((case s4481_0 of s4482_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s4482_0)) of SOME ((FMIN_S, s4483_0)) => (case ((string_drop s4482_0 s4483_0)) of s4484_0 => (case ((spc_matches_prefix0 s4484_0)) of SOME ((() , s4485_0)) => (case ((string_drop s4484_0 s4485_0)) of s4486_0 => (case ((freg_name_matches_prefix s4486_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4487_0)) => (case ((string_drop s4486_0 s4487_0)) of s4488_0 => (case ((sep_matches_prefix s4488_0)) of SOME ((() , s4489_0)) => (case ((string_drop s4488_0 s4489_0)) of s4490_0 => (case ((freg_name_matches_prefix s4490_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4491_0)) => (case ((string_drop s4490_0 s4491_0)) of s4492_0 => (case ((sep_matches_prefix s4492_0)) of SOME ((() , s4493_0)) => (case ((string_drop s4492_0 s4493_0)) of s4494_0 => (case ((freg_name_matches_prefix s4494_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4495_0)) => let p0_ = (string_drop s4494_0 s4495_0) in if (((p0_ = ""))) then SOME (FMIN_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4463_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4463_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s4464_0= ((case s4464_0 of s4465_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s4465_0)) of SOME ((FSGNJX_S, s4466_0)) => (case ((string_drop s4465_0 s4466_0)) of s4467_0 => (case ((spc_matches_prefix0 s4467_0)) of SOME ((() , s4468_0)) => (case ((string_drop s4467_0 s4468_0)) of s4469_0 => (case ((freg_name_matches_prefix s4469_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4470_0)) => (case ((string_drop s4469_0 s4470_0)) of s4471_0 => (case ((sep_matches_prefix s4471_0)) of SOME ((() , s4472_0)) => (case ((string_drop s4471_0 s4472_0)) of s4473_0 => (case ((freg_name_matches_prefix s4473_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4474_0)) => (case ((string_drop s4473_0 s4474_0)) of s4475_0 => (case ((sep_matches_prefix s4475_0)) of SOME ((() , s4476_0)) => (case ((string_drop s4475_0 s4476_0)) of s4477_0 => (case ((freg_name_matches_prefix s4477_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4478_0)) => let p0_ = (string_drop s4477_0 s4478_0) in if (((p0_ = ""))) then SOME (FSGNJX_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4446_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4446_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s4447_0= ((case s4447_0 of s4448_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s4448_0)) of SOME ((FSGNJN_S, s4449_0)) => (case ((string_drop s4448_0 s4449_0)) of s4450_0 => (case ((spc_matches_prefix0 s4450_0)) of SOME ((() , s4451_0)) => (case ((string_drop s4450_0 s4451_0)) of s4452_0 => (case ((freg_name_matches_prefix s4452_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4453_0)) => (case ((string_drop s4452_0 s4453_0)) of s4454_0 => (case ((sep_matches_prefix s4454_0)) of SOME ((() , s4455_0)) => (case ((string_drop s4454_0 s4455_0)) of s4456_0 => (case ((freg_name_matches_prefix s4456_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4457_0)) => (case ((string_drop s4456_0 s4457_0)) of s4458_0 => (case ((sep_matches_prefix s4458_0)) of SOME ((() , s4459_0)) => (case ((string_drop s4458_0 s4459_0)) of s4460_0 => (case ((freg_name_matches_prefix s4460_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4461_0)) => let p0_ = (string_drop s4460_0 s4461_0) in if (((p0_ = ""))) then SOME (FSGNJN_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4429_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4429_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word)option) s4430_0= ((case s4430_0 of s4431_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s4431_0)) of SOME ((FSGNJ_S, s4432_0)) => (case ((string_drop s4431_0 s4432_0)) of s4433_0 => (case ((spc_matches_prefix0 s4433_0)) of SOME ((() , s4434_0)) => (case ((string_drop s4433_0 s4434_0)) of s4435_0 => (case ((freg_name_matches_prefix s4435_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4436_0)) => (case ((string_drop s4435_0 s4436_0)) of s4437_0 => (case ((sep_matches_prefix s4437_0)) of SOME ((() , s4438_0)) => (case ((string_drop s4437_0 s4438_0)) of s4439_0 => (case ((freg_name_matches_prefix s4439_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4440_0)) => (case ((string_drop s4439_0 s4440_0)) of s4441_0 => (case ((sep_matches_prefix s4441_0)) of SOME ((() , s4442_0)) => (case ((string_drop s4441_0 s4442_0)) of s4443_0 => (case ((freg_name_matches_prefix s4443_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4444_0)) => let p0_ = (string_drop s4443_0 s4444_0) in if (((p0_ = ""))) then SOME (FSGNJ_S, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4412_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4412_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s4413_0= ((case s4413_0 of s4414_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s4414_0)) of SOME ((FCVT_S_LU, s4415_0)) => (case ((string_drop s4414_0 s4415_0)) of s4416_0 => (case ((spc_matches_prefix0 s4416_0)) of SOME ((() , s4417_0)) => (case ((string_drop s4416_0 s4417_0)) of s4418_0 => (case ((freg_name_matches_prefix s4418_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4419_0)) => (case ((string_drop s4418_0 s4419_0)) of s4420_0 => (case ((sep_matches_prefix s4420_0)) of SOME ((() , s4421_0)) => (case ((string_drop s4420_0 s4421_0)) of s4422_0 => (case ((reg_name_matches_prefix s4422_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4423_0)) => (case ((string_drop s4422_0 s4423_0)) of s4424_0 => (case ((sep_matches_prefix s4424_0)) of SOME ((() , s4425_0)) => (case ((string_drop s4424_0 s4425_0)) of s4426_0 => (case ((frm_mnemonic_matches_prefix s4426_0)) of SOME ((rm, s4427_0)) => let p0_ = (string_drop s4426_0 s4427_0) in if (((p0_ = ""))) then SOME (FCVT_S_LU, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4395_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4395_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s4396_0= ((case s4396_0 of s4397_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s4397_0)) of SOME ((FCVT_S_L, s4398_0)) => (case ((string_drop s4397_0 s4398_0)) of s4399_0 => (case ((spc_matches_prefix0 s4399_0)) of SOME ((() , s4400_0)) => (case ((string_drop s4399_0 s4400_0)) of s4401_0 => (case ((freg_name_matches_prefix s4401_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4402_0)) => (case ((string_drop s4401_0 s4402_0)) of s4403_0 => (case ((sep_matches_prefix s4403_0)) of SOME ((() , s4404_0)) => (case ((string_drop s4403_0 s4404_0)) of s4405_0 => (case ((reg_name_matches_prefix s4405_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4406_0)) => (case ((string_drop s4405_0 s4406_0)) of s4407_0 => (case ((sep_matches_prefix s4407_0)) of SOME ((() , s4408_0)) => (case ((string_drop s4407_0 s4408_0)) of s4409_0 => (case ((frm_mnemonic_matches_prefix s4409_0)) of SOME ((rm, s4410_0)) => let p0_ = (string_drop s4409_0 s4410_0) in if (((p0_ = ""))) then SOME (FCVT_S_L, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4378_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4378_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s4379_0= ((case s4379_0 of s4380_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s4380_0)) of SOME ((FCVT_LU_S, s4381_0)) => (case ((string_drop s4380_0 s4381_0)) of s4382_0 => (case ((spc_matches_prefix0 s4382_0)) of SOME ((() , s4383_0)) => (case ((string_drop s4382_0 s4383_0)) of s4384_0 => (case ((reg_name_matches_prefix s4384_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4385_0)) => (case ((string_drop s4384_0 s4385_0)) of s4386_0 => (case ((sep_matches_prefix s4386_0)) of SOME ((() , s4387_0)) => (case ((string_drop s4386_0 s4387_0)) of s4388_0 => (case ((freg_name_matches_prefix s4388_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4389_0)) => (case ((string_drop s4388_0 s4389_0)) of s4390_0 => (case ((sep_matches_prefix s4390_0)) of SOME ((() , s4391_0)) => (case ((string_drop s4390_0 s4391_0)) of s4392_0 => (case ((frm_mnemonic_matches_prefix s4392_0)) of SOME ((rm, s4393_0)) => let p0_ = (string_drop s4392_0 s4393_0) in if (((p0_ = ""))) then SOME (FCVT_LU_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4361_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4361_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s4362_0= ((case s4362_0 of s4363_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s4363_0)) of SOME ((FCVT_L_S, s4364_0)) => (case ((string_drop s4363_0 s4364_0)) of s4365_0 => (case ((spc_matches_prefix0 s4365_0)) of SOME ((() , s4366_0)) => (case ((string_drop s4365_0 s4366_0)) of s4367_0 => (case ((reg_name_matches_prefix s4367_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4368_0)) => (case ((string_drop s4367_0 s4368_0)) of s4369_0 => (case ((sep_matches_prefix s4369_0)) of SOME ((() , s4370_0)) => (case ((string_drop s4369_0 s4370_0)) of s4371_0 => (case ((freg_name_matches_prefix s4371_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4372_0)) => (case ((string_drop s4371_0 s4372_0)) of s4373_0 => (case ((sep_matches_prefix s4373_0)) of SOME ((() , s4374_0)) => (case ((string_drop s4373_0 s4374_0)) of s4375_0 => (case ((frm_mnemonic_matches_prefix s4375_0)) of SOME ((rm, s4376_0)) => let p0_ = (string_drop s4375_0 s4376_0) in if (((p0_ = ""))) then SOME (FCVT_L_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4344_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4344_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s4345_0= ((case s4345_0 of s4346_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s4346_0)) of SOME ((FCVT_S_WU, s4347_0)) => (case ((string_drop s4346_0 s4347_0)) of s4348_0 => (case ((spc_matches_prefix0 s4348_0)) of SOME ((() , s4349_0)) => (case ((string_drop s4348_0 s4349_0)) of s4350_0 => (case ((freg_name_matches_prefix s4350_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4351_0)) => (case ((string_drop s4350_0 s4351_0)) of s4352_0 => (case ((sep_matches_prefix s4352_0)) of SOME ((() , s4353_0)) => (case ((string_drop s4352_0 s4353_0)) of s4354_0 => (case ((reg_name_matches_prefix s4354_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4355_0)) => (case ((string_drop s4354_0 s4355_0)) of s4356_0 => (case ((sep_matches_prefix s4356_0)) of SOME ((() , s4357_0)) => (case ((string_drop s4356_0 s4357_0)) of s4358_0 => (case ((frm_mnemonic_matches_prefix s4358_0)) of SOME ((rm, s4359_0)) => let p0_ = (string_drop s4358_0 s4359_0) in if (((p0_ = ""))) then SOME (FCVT_S_WU, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4327_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4327_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s4328_0= ((case s4328_0 of s4329_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s4329_0)) of SOME ((FCVT_S_W, s4330_0)) => (case ((string_drop s4329_0 s4330_0)) of s4331_0 => (case ((spc_matches_prefix0 s4331_0)) of SOME ((() , s4332_0)) => (case ((string_drop s4331_0 s4332_0)) of s4333_0 => (case ((freg_name_matches_prefix s4333_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4334_0)) => (case ((string_drop s4333_0 s4334_0)) of s4335_0 => (case ((sep_matches_prefix s4335_0)) of SOME ((() , s4336_0)) => (case ((string_drop s4335_0 s4336_0)) of s4337_0 => (case ((reg_name_matches_prefix s4337_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4338_0)) => (case ((string_drop s4337_0 s4338_0)) of s4339_0 => (case ((sep_matches_prefix s4339_0)) of SOME ((() , s4340_0)) => (case ((string_drop s4339_0 s4340_0)) of s4341_0 => (case ((frm_mnemonic_matches_prefix s4341_0)) of SOME ((rm, s4342_0)) => let p0_ = (string_drop s4341_0 s4342_0) in if (((p0_ = ""))) then SOME (FCVT_S_W, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4310_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4310_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s4311_0= ((case s4311_0 of s4312_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s4312_0)) of SOME ((FCVT_WU_S, s4313_0)) => (case ((string_drop s4312_0 s4313_0)) of s4314_0 => (case ((spc_matches_prefix0 s4314_0)) of SOME ((() , s4315_0)) => (case ((string_drop s4314_0 s4315_0)) of s4316_0 => (case ((reg_name_matches_prefix s4316_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4317_0)) => (case ((string_drop s4316_0 s4317_0)) of s4318_0 => (case ((sep_matches_prefix s4318_0)) of SOME ((() , s4319_0)) => (case ((string_drop s4318_0 s4319_0)) of s4320_0 => (case ((freg_name_matches_prefix s4320_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4321_0)) => (case ((string_drop s4320_0 s4321_0)) of s4322_0 => (case ((sep_matches_prefix s4322_0)) of SOME ((() , s4323_0)) => (case ((string_drop s4322_0 s4323_0)) of s4324_0 => (case ((frm_mnemonic_matches_prefix s4324_0)) of SOME ((rm, s4325_0)) => let p0_ = (string_drop s4324_0 s4325_0) in if (((p0_ = ""))) then SOME (FCVT_WU_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4293_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4293_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s4294_0= ((case s4294_0 of s4295_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s4295_0)) of SOME ((FCVT_W_S, s4296_0)) => (case ((string_drop s4295_0 s4296_0)) of s4297_0 => (case ((spc_matches_prefix0 s4297_0)) of SOME ((() , s4298_0)) => (case ((string_drop s4297_0 s4298_0)) of s4299_0 => (case ((reg_name_matches_prefix s4299_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4300_0)) => (case ((string_drop s4299_0 s4300_0)) of s4301_0 => (case ((sep_matches_prefix s4301_0)) of SOME ((() , s4302_0)) => (case ((string_drop s4301_0 s4302_0)) of s4303_0 => (case ((freg_name_matches_prefix s4303_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4304_0)) => (case ((string_drop s4303_0 s4304_0)) of s4305_0 => (case ((sep_matches_prefix s4305_0)) of SOME ((() , s4306_0)) => (case ((string_drop s4305_0 s4306_0)) of s4307_0 => (case ((frm_mnemonic_matches_prefix s4307_0)) of SOME ((rm, s4308_0)) => let p0_ = (string_drop s4307_0 s4308_0) in if (((p0_ = ""))) then SOME (FCVT_W_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4276_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4276_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode)option) s4277_0= ((case s4277_0 of s4278_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s4278_0)) of SOME ((FSQRT_S, s4279_0)) => (case ((string_drop s4278_0 s4279_0)) of s4280_0 => (case ((spc_matches_prefix0 s4280_0)) of SOME ((() , s4281_0)) => (case ((string_drop s4280_0 s4281_0)) of s4282_0 => (case ((freg_name_matches_prefix s4282_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4283_0)) => (case ((string_drop s4282_0 s4283_0)) of s4284_0 => (case ((sep_matches_prefix s4284_0)) of SOME ((() , s4285_0)) => (case ((string_drop s4284_0 s4285_0)) of s4286_0 => (case ((freg_name_matches_prefix s4286_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4287_0)) => (case ((string_drop s4286_0 s4287_0)) of s4288_0 => (case ((sep_matches_prefix s4288_0)) of SOME ((() , s4289_0)) => (case ((string_drop s4288_0 s4289_0)) of s4290_0 => (case ((frm_mnemonic_matches_prefix s4290_0)) of SOME ((rm, s4291_0)) => let p0_ = (string_drop s4290_0 s4291_0) in if (((p0_ = ""))) then SOME (FSQRT_S, rd, rs1, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4255_ : string -> maybe ((f_bin_rm_op_S * mword ty5 * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4255_:string ->(f_bin_rm_op_S#(5)words$word#(5)words$word#(5)words$word#rounding_mode)option) s4256_0= ((case s4256_0 of s4257_0 => (case ((f_bin_rm_type_mnemonic_S_matches_prefix s4257_0)) of SOME ((op, s4258_0)) => (case ((string_drop s4257_0 s4258_0)) of s4259_0 => (case ((spc_matches_prefix0 s4259_0)) of SOME ((() , s4260_0)) => (case ((string_drop s4259_0 s4260_0)) of s4261_0 => (case ((freg_name_matches_prefix s4261_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4262_0)) => (case ((string_drop s4261_0 s4262_0)) of s4263_0 => (case ((sep_matches_prefix s4263_0)) of SOME ((() , s4264_0)) => (case ((string_drop s4263_0 s4264_0)) of s4265_0 => (case ((freg_name_matches_prefix s4265_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4266_0)) => (case ((string_drop s4265_0 s4266_0)) of s4267_0 => (case ((sep_matches_prefix s4267_0)) of SOME ((() , s4268_0)) => (case ((string_drop s4267_0 s4268_0)) of s4269_0 => (case ((freg_name_matches_prefix s4269_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4270_0)) => (case ((string_drop s4269_0 s4270_0)) of s4271_0 => (case ((sep_matches_prefix s4271_0)) of SOME ((() , s4272_0)) => (case ((string_drop s4271_0 s4272_0)) of s4273_0 => (case ((frm_mnemonic_matches_prefix s4273_0)) of SOME ((rm, s4274_0)) => let p0_ = (string_drop s4273_0 s4274_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4230_ : string -> maybe ((f_madd_op_S * mword ty5 * mword ty5 * mword ty5 * mword ty5 * rounding_mode))*) val _ = Define ` ((s4230_:string ->(f_madd_op_S#(5)words$word#(5)words$word#(5)words$word#(5)words$word#rounding_mode)option) s4231_0= ((case s4231_0 of s4232_0 => (case ((f_madd_type_mnemonic_S_matches_prefix s4232_0)) of SOME ((op, s4233_0)) => (case ((string_drop s4232_0 s4233_0)) of s4234_0 => (case ((spc_matches_prefix0 s4234_0)) of SOME ((() , s4235_0)) => (case ((string_drop s4234_0 s4235_0)) of s4236_0 => (case ((freg_name_matches_prefix s4236_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4237_0)) => (case ((string_drop s4236_0 s4237_0)) of s4238_0 => (case ((sep_matches_prefix s4238_0)) of SOME ((() , s4239_0)) => (case ((string_drop s4238_0 s4239_0)) of s4240_0 => (case ((freg_name_matches_prefix s4240_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4241_0)) => (case ((string_drop s4240_0 s4241_0)) of s4242_0 => (case ((sep_matches_prefix s4242_0)) of SOME ((() , s4243_0)) => (case ((string_drop s4242_0 s4243_0)) of s4244_0 => (case ((freg_name_matches_prefix s4244_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4245_0)) => (case ((string_drop s4244_0 s4245_0)) of s4246_0 => (case ((sep_matches_prefix s4246_0)) of SOME ((() , s4247_0)) => (case ((string_drop s4246_0 s4247_0)) of s4248_0 => (case ((freg_name_matches_prefix s4248_0 : (( 5 words$word # ii)) option)) of SOME ((rs3, s4249_0)) => (case ((string_drop s4248_0 s4249_0)) of s4250_0 => (case ((sep_matches_prefix s4250_0)) of SOME ((() , s4251_0)) => (case ((string_drop s4250_0 s4251_0)) of s4252_0 => (case ((frm_mnemonic_matches_prefix s4252_0)) of SOME ((rm, s4253_0)) => let p0_ = (string_drop s4252_0 s4253_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2, rs3, rm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4206_ : string -> maybe ((word_width * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s4206_:string ->(word_width#(5)words$word#(12)words$word#(5)words$word)option) s4207_0= (let s4208_0 = s4207_0 in if ((string_startswith s4208_0 "fs")) then (case ((string_drop s4208_0 ((string_length "fs")))) of s4209_0 => (case ((size_mnemonic_matches_prefix s4209_0)) of SOME ((width, s4210_0)) => (case ((string_drop s4209_0 s4210_0)) of s4211_0 => (case ((spc_matches_prefix0 s4211_0)) of SOME ((() , s4212_0)) => (case ((string_drop s4211_0 s4212_0)) of s4213_0 => (case ((freg_name_matches_prefix s4213_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4214_0)) => (case ((string_drop s4213_0 s4214_0)) of s4215_0 => (case ((sep_matches_prefix s4215_0)) of SOME ((() , s4216_0)) => (case ((string_drop s4215_0 s4216_0)) of s4217_0 => (case ((hex_bits_12_matches_prefix0 s4217_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s4218_0)) => (case ((string_drop s4217_0 s4218_0)) of s4219_0 => (case ((opt_spc_matches_prefix0 s4219_0)) of SOME ((() , s4220_0)) => let s4221_0 = (string_drop s4219_0 s4220_0) in if ((string_startswith s4221_0 "(")) then (case ((string_drop s4221_0 ((string_length "(")))) of s4222_0 => (case ((opt_spc_matches_prefix0 s4222_0)) of SOME ((() , s4223_0)) => (case ((string_drop s4222_0 s4223_0)) of s4224_0 => (case ((reg_name_matches_prefix s4224_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4225_0)) => (case ((string_drop s4224_0 s4225_0)) of s4226_0 => (case ((opt_spc_matches_prefix0 s4226_0)) of SOME ((() , s4227_0)) => let s4228_0 = (string_drop s4226_0 s4227_0) in if ((string_startswith s4228_0 ")")) then let p0_ = (string_drop s4228_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (width, rs2, imm, rs1) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s4182_ : string -> maybe ((word_width * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s4182_:string ->(word_width#(5)words$word#(12)words$word#(5)words$word)option) s4183_0= (let s4184_0 = s4183_0 in if ((string_startswith s4184_0 "fl")) then (case ((string_drop s4184_0 ((string_length "fl")))) of s4185_0 => (case ((size_mnemonic_matches_prefix s4185_0)) of SOME ((width, s4186_0)) => (case ((string_drop s4185_0 s4186_0)) of s4187_0 => (case ((spc_matches_prefix0 s4187_0)) of SOME ((() , s4188_0)) => (case ((string_drop s4187_0 s4188_0)) of s4189_0 => (case ((freg_name_matches_prefix s4189_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4190_0)) => (case ((string_drop s4189_0 s4190_0)) of s4191_0 => (case ((sep_matches_prefix s4191_0)) of SOME ((() , s4192_0)) => (case ((string_drop s4191_0 s4192_0)) of s4193_0 => (case ((hex_bits_12_matches_prefix0 s4193_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s4194_0)) => (case ((string_drop s4193_0 s4194_0)) of s4195_0 => (case ((opt_spc_matches_prefix0 s4195_0)) of SOME ((() , s4196_0)) => let s4197_0 = (string_drop s4195_0 s4196_0) in if ((string_startswith s4197_0 "(")) then (case ((string_drop s4197_0 ((string_length "(")))) of s4198_0 => (case ((opt_spc_matches_prefix0 s4198_0)) of SOME ((() , s4199_0)) => (case ((string_drop s4198_0 s4199_0)) of s4200_0 => (case ((reg_name_matches_prefix s4200_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4201_0)) => (case ((string_drop s4200_0 s4201_0)) of s4202_0 => (case ((opt_spc_matches_prefix0 s4202_0)) of SOME ((() , s4203_0)) => let s4204_0 = (string_drop s4202_0 s4203_0) in if ((string_startswith s4204_0 ")")) then let p0_ = (string_drop s4204_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (width, rd, imm, rs1) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s4170_ : string -> maybe ((mword ty5 * mword ty5 * mword ty12))*) val _ = Define ` ((s4170_:string ->((5)words$word#(5)words$word#(12)words$word)option) s4171_0= (let s4172_0 = s4171_0 in if ((string_startswith s4172_0 "fence.i.reserved.")) then (case ((string_drop s4172_0 ((string_length "fence.i.reserved.")))) of s4173_0 => (case ((reg_name_matches_prefix s4173_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4174_0)) => let s4175_0 = (string_drop s4173_0 s4174_0) in if ((string_startswith s4175_0 ".")) then (case ((string_drop s4175_0 ((string_length ".")))) of s4176_0 => (case ((reg_name_matches_prefix s4176_0 : (( 5 words$word # ii)) option)) of SOME ((rs, s4177_0)) => let s4178_0 = (string_drop s4176_0 s4177_0) in if ((string_startswith s4178_0 ".")) then (case ((string_drop s4178_0 ((string_length ".")))) of s4179_0 => (case ((hex_bits_12_matches_prefix0 s4179_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s4180_0)) => let p0_ = (string_drop s4179_0 s4180_0) in if (((p0_ = ""))) then SOME (rd, rs, imm) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s4152_ : string -> maybe ((mword ty4 * mword ty4 * mword ty5 * mword ty5 * mword ty4))*) val _ = Define ` ((s4152_:string ->((4)words$word#(4)words$word#(5)words$word#(5)words$word#(4)words$word)option) s4153_0= (let s4154_0 = s4153_0 in if ((string_startswith s4154_0 "fence.reserved.")) then (case ((string_drop s4154_0 ((string_length "fence.reserved.")))) of s4155_0 => (case ((fence_bits_matches_prefix s4155_0 : (( 4 words$word # ii)) option)) of SOME ((pred, s4156_0)) => let s4157_0 = (string_drop s4155_0 s4156_0) in if ((string_startswith s4157_0 ".")) then (case ((string_drop s4157_0 ((string_length ".")))) of s4158_0 => (case ((fence_bits_matches_prefix s4158_0 : (( 4 words$word # ii)) option)) of SOME ((succ, s4159_0)) => let s4160_0 = (string_drop s4158_0 s4159_0) in if ((string_startswith s4160_0 ".")) then (case ((string_drop s4160_0 ((string_length ".")))) of s4161_0 => (case ((reg_name_matches_prefix s4161_0 : (( 5 words$word # ii)) option)) of SOME ((rs, s4162_0)) => let s4163_0 = (string_drop s4161_0 s4162_0) in if ((string_startswith s4163_0 ".")) then (case ((string_drop s4163_0 ((string_length ".")))) of s4164_0 => (case ((reg_name_matches_prefix s4164_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4165_0)) => let s4166_0 = (string_drop s4164_0 s4165_0) in if ((string_startswith s4166_0 ".")) then (case ((string_drop s4166_0 ((string_length ".")))) of s4167_0 => (case ((hex_bits_4_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4167_0 : (( 4 words$word # ii)) option)) of SOME ((fm, s4168_0)) => let p0_ = (string_drop s4167_0 s4168_0) in if (((p0_ = ""))) then SOME (pred, succ, rs, rd, fm) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s4146_ : string -> maybe (mword ty3)*) val _ = Define ` ((s4146_:string ->((3)words$word)option) s4147_0= (let s4148_0 = s4147_0 in if ((string_startswith s4148_0 "c.srai.hint.")) then (case ((string_drop s4148_0 ((string_length "c.srai.hint.")))) of s4149_0 => (case ((creg_name_matches_prefix s4149_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s4150_0)) => let p0_ = (string_drop s4149_0 s4150_0) in if (((p0_ = ""))) then SOME rsd else NONE | _ => NONE ) ) else NONE))`; (*val _s4140_ : string -> maybe (mword ty3)*) val _ = Define ` ((s4140_:string ->((3)words$word)option) s4141_0= (let s4142_0 = s4141_0 in if ((string_startswith s4142_0 "c.srli.hint.")) then (case ((string_drop s4142_0 ((string_length "c.srli.hint.")))) of s4143_0 => (case ((creg_name_matches_prefix s4143_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s4144_0)) => let p0_ = (string_drop s4143_0 s4144_0) in if (((p0_ = ""))) then SOME rsd else NONE | _ => NONE ) ) else NONE))`; (*val _s4131_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s4131_:string ->((5)words$word#(6)words$word)option) s4132_0= (let s4133_0 = s4132_0 in if ((string_startswith s4133_0 "c.slli.hint.")) then (case ((string_drop s4133_0 ((string_length "c.slli.hint.")))) of s4134_0 => (case ((reg_name_matches_prefix s4134_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s4135_0)) => let s4136_0 = (string_drop s4134_0 s4135_0) in if ((string_startswith s4136_0 ".")) then (case ((string_drop s4136_0 ((string_length ".")))) of s4137_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4137_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s4138_0)) => let p0_ = (string_drop s4137_0 s4138_0) in if (((p0_ = ""))) then SOME (rsd, shamt) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s4125_ : string -> maybe (mword ty5)*) val _ = Define ` ((s4125_:string ->((5)words$word)option) s4126_0= (let s4127_0 = s4126_0 in if ((string_startswith s4127_0 "c.add.hint.")) then (case ((string_drop s4127_0 ((string_length "c.add.hint.")))) of s4128_0 => (case ((reg_name_matches_prefix s4128_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4129_0)) => let p0_ = (string_drop s4128_0 s4129_0) in if (((p0_ = ""))) then SOME rs2 else NONE | _ => NONE ) ) else NONE))`; (*val _s4119_ : string -> maybe (mword ty5)*) val _ = Define ` ((s4119_:string ->((5)words$word)option) s4120_0= (let s4121_0 = s4120_0 in if ((string_startswith s4121_0 "c.mv.hint.")) then (case ((string_drop s4121_0 ((string_length "c.mv.hint.")))) of s4122_0 => (case ((reg_name_matches_prefix s4122_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4123_0)) => let p0_ = (string_drop s4122_0 s4123_0) in if (((p0_ = ""))) then SOME rs2 else NONE | _ => NONE ) ) else NONE))`; (*val _s4113_ : string -> maybe (mword ty6)*) val _ = Define ` ((s4113_:string ->((6)words$word)option) s4114_0= (let s4115_0 = s4114_0 in if ((string_startswith s4115_0 "c.lui.hint.")) then (case ((string_drop s4115_0 ((string_length "c.lui.hint.")))) of s4116_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4116_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s4117_0)) => let p0_ = (string_drop s4116_0 s4117_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) else NONE))`; (*val _s4107_ : string -> maybe (mword ty6)*) val _ = Define ` ((s4107_:string ->((6)words$word)option) s4108_0= (let s4109_0 = s4108_0 in if ((string_startswith s4109_0 "c.li.hint.")) then (case ((string_drop s4109_0 ((string_length "c.li.hint.")))) of s4110_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4110_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s4111_0)) => let p0_ = (string_drop s4110_0 s4111_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) else NONE))`; (*val _s4101_ : string -> maybe (mword ty5)*) val _ = Define ` ((s4101_:string ->((5)words$word)option) s4102_0= (let s4103_0 = s4102_0 in if ((string_startswith s4103_0 "c.addi.hint.")) then (case ((string_drop s4103_0 ((string_length "c.addi.hint.")))) of s4104_0 => (case ((reg_name_matches_prefix s4104_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s4105_0)) => let p0_ = (string_drop s4104_0 s4105_0) in if (((p0_ = ""))) then SOME rsd else NONE | _ => NONE ) ) else NONE))`; (*val _s4095_ : string -> maybe (mword ty6)*) val _ = Define ` ((s4095_:string ->((6)words$word)option) s4096_0= (let s4097_0 = s4096_0 in if ((string_startswith s4097_0 "c.nop.hint.")) then (case ((string_drop s4097_0 ((string_length "c.nop.hint.")))) of s4098_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4098_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s4099_0)) => let p0_ = (string_drop s4098_0 s4099_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) else NONE))`; (*val _s4078_ : string -> maybe ((csrop * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s4078_:string ->(csrop#(5)words$word#(12)words$word#(5)words$word)option) s4079_0= ((case s4079_0 of s4080_0 => (case ((csr_mnemonic_matches_prefix s4080_0)) of SOME ((op, s4081_0)) => (case ((string_drop s4080_0 s4081_0)) of s4082_0 => (case ((spc_matches_prefix0 s4082_0)) of SOME ((() , s4083_0)) => (case ((string_drop s4082_0 s4083_0)) of s4084_0 => (case ((reg_name_matches_prefix s4084_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4085_0)) => (case ((string_drop s4084_0 s4085_0)) of s4086_0 => (case ((sep_matches_prefix s4086_0)) of SOME ((() , s4087_0)) => (case ((string_drop s4086_0 s4087_0)) of s4088_0 => (case ((csr_name_map_matches_prefix s4088_0 : (( 12 words$word # ii)) option)) of SOME ((csr, s4089_0)) => (case ((string_drop s4088_0 s4089_0)) of s4090_0 => (case ((sep_matches_prefix s4090_0)) of SOME ((() , s4091_0)) => (case ((string_drop s4090_0 s4091_0)) of s4092_0 => (case ((reg_name_matches_prefix s4092_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4093_0)) => let p0_ = (string_drop s4092_0 s4093_0) in if (((p0_ = ""))) then SOME (op, rd, csr, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s4060_ : string -> maybe ((csrop * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s4060_:string ->(csrop#(5)words$word#(12)words$word#(5)words$word)option) s4061_0= ((case s4061_0 of s4062_0 => (case ((csr_mnemonic_matches_prefix s4062_0)) of SOME ((op, s4063_0)) => let s4064_0 = (string_drop s4062_0 s4063_0) in if ((string_startswith s4064_0 "i")) then (case ((string_drop s4064_0 ((string_length "i")))) of s4065_0 => (case ((spc_matches_prefix0 s4065_0)) of SOME ((() , s4066_0)) => (case ((string_drop s4065_0 s4066_0)) of s4067_0 => (case ((reg_name_matches_prefix s4067_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4068_0)) => (case ((string_drop s4067_0 s4068_0)) of s4069_0 => (case ((sep_matches_prefix s4069_0)) of SOME ((() , s4070_0)) => (case ((string_drop s4069_0 s4070_0)) of s4071_0 => (case ((csr_name_map_matches_prefix s4071_0 : (( 12 words$word # ii)) option)) of SOME ((csr, s4072_0)) => (case ((string_drop s4071_0 s4072_0)) of s4073_0 => (case ((sep_matches_prefix s4073_0)) of SOME ((() , s4074_0)) => (case ((string_drop s4073_0 s4074_0)) of s4075_0 => (case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s4075_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4076_0)) => let p0_ = (string_drop s4075_0 s4076_0) in if (((p0_ = ""))) then SOME (op, rd, csr, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) )))`; (*val _s4041_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4041_:string ->(bool#(5)words$word#(5)words$word#(5)words$word)option) s4042_0= (let s4043_0 = s4042_0 in if ((string_startswith s4043_0 "rem")) then (case ((string_drop s4043_0 ((string_length "rem")))) of s4044_0 => (case ((maybe_not_u_matches_prefix s4044_0)) of SOME ((s, s4045_0)) => let s4046_0 = (string_drop s4044_0 s4045_0) in if ((string_startswith s4046_0 "w")) then (case ((string_drop s4046_0 ((string_length "w")))) of s4047_0 => (case ((spc_matches_prefix0 s4047_0)) of SOME ((() , s4048_0)) => (case ((string_drop s4047_0 s4048_0)) of s4049_0 => (case ((reg_name_matches_prefix s4049_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4050_0)) => (case ((string_drop s4049_0 s4050_0)) of s4051_0 => (case ((sep_matches_prefix s4051_0)) of SOME ((() , s4052_0)) => (case ((string_drop s4051_0 s4052_0)) of s4053_0 => (case ((reg_name_matches_prefix s4053_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4054_0)) => (case ((string_drop s4053_0 s4054_0)) of s4055_0 => (case ((sep_matches_prefix s4055_0)) of SOME ((() , s4056_0)) => (case ((string_drop s4055_0 s4056_0)) of s4057_0 => (case ((reg_name_matches_prefix s4057_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4058_0)) => let p0_ = (string_drop s4057_0 s4058_0) in if (((p0_ = ""))) then SOME (s, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s4022_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4022_:string ->(bool#(5)words$word#(5)words$word#(5)words$word)option) s4023_0= (let s4024_0 = s4023_0 in if ((string_startswith s4024_0 "div")) then (case ((string_drop s4024_0 ((string_length "div")))) of s4025_0 => (case ((maybe_not_u_matches_prefix s4025_0)) of SOME ((s, s4026_0)) => let s4027_0 = (string_drop s4025_0 s4026_0) in if ((string_startswith s4027_0 "w")) then (case ((string_drop s4027_0 ((string_length "w")))) of s4028_0 => (case ((spc_matches_prefix0 s4028_0)) of SOME ((() , s4029_0)) => (case ((string_drop s4028_0 s4029_0)) of s4030_0 => (case ((reg_name_matches_prefix s4030_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4031_0)) => (case ((string_drop s4030_0 s4031_0)) of s4032_0 => (case ((sep_matches_prefix s4032_0)) of SOME ((() , s4033_0)) => (case ((string_drop s4032_0 s4033_0)) of s4034_0 => (case ((reg_name_matches_prefix s4034_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4035_0)) => (case ((string_drop s4034_0 s4035_0)) of s4036_0 => (case ((sep_matches_prefix s4036_0)) of SOME ((() , s4037_0)) => (case ((string_drop s4036_0 s4037_0)) of s4038_0 => (case ((reg_name_matches_prefix s4038_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4039_0)) => let p0_ = (string_drop s4038_0 s4039_0) in if (((p0_ = ""))) then SOME (s, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s4006_ : string -> maybe ((mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s4006_:string ->((5)words$word#(5)words$word#(5)words$word)option) s4007_0= (let s4008_0 = s4007_0 in if ((string_startswith s4008_0 "mulw")) then (case ((string_drop s4008_0 ((string_length "mulw")))) of s4009_0 => (case ((spc_matches_prefix0 s4009_0)) of SOME ((() , s4010_0)) => (case ((string_drop s4009_0 s4010_0)) of s4011_0 => (case ((reg_name_matches_prefix s4011_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s4012_0)) => (case ((string_drop s4011_0 s4012_0)) of s4013_0 => (case ((sep_matches_prefix s4013_0)) of SOME ((() , s4014_0)) => (case ((string_drop s4013_0 s4014_0)) of s4015_0 => (case ((reg_name_matches_prefix s4015_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4016_0)) => (case ((string_drop s4015_0 s4016_0)) of s4017_0 => (case ((sep_matches_prefix s4017_0)) of SOME ((() , s4018_0)) => (case ((string_drop s4017_0 s4018_0)) of s4019_0 => (case ((reg_name_matches_prefix s4019_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4020_0)) => let p0_ = (string_drop s4019_0 s4020_0) in if (((p0_ = ""))) then SOME (rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3988_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3988_:string ->(bool#(5)words$word#(5)words$word#(5)words$word)option) s3989_0= (let s3990_0 = s3989_0 in if ((string_startswith s3990_0 "rem")) then (case ((string_drop s3990_0 ((string_length "rem")))) of s3991_0 => (case ((maybe_not_u_matches_prefix s3991_0)) of SOME ((s, s3992_0)) => (case ((string_drop s3991_0 s3992_0)) of s3993_0 => (case ((spc_matches_prefix0 s3993_0)) of SOME ((() , s3994_0)) => (case ((string_drop s3993_0 s3994_0)) of s3995_0 => (case ((reg_name_matches_prefix s3995_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3996_0)) => (case ((string_drop s3995_0 s3996_0)) of s3997_0 => (case ((sep_matches_prefix s3997_0)) of SOME ((() , s3998_0)) => (case ((string_drop s3997_0 s3998_0)) of s3999_0 => (case ((reg_name_matches_prefix s3999_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s4000_0)) => (case ((string_drop s3999_0 s4000_0)) of s4001_0 => (case ((sep_matches_prefix s4001_0)) of SOME ((() , s4002_0)) => (case ((string_drop s4001_0 s4002_0)) of s4003_0 => (case ((reg_name_matches_prefix s4003_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s4004_0)) => let p0_ = (string_drop s4003_0 s4004_0) in if (((p0_ = ""))) then SOME (s, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3970_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3970_:string ->(bool#(5)words$word#(5)words$word#(5)words$word)option) s3971_0= (let s3972_0 = s3971_0 in if ((string_startswith s3972_0 "div")) then (case ((string_drop s3972_0 ((string_length "div")))) of s3973_0 => (case ((maybe_not_u_matches_prefix s3973_0)) of SOME ((s, s3974_0)) => (case ((string_drop s3973_0 s3974_0)) of s3975_0 => (case ((spc_matches_prefix0 s3975_0)) of SOME ((() , s3976_0)) => (case ((string_drop s3975_0 s3976_0)) of s3977_0 => (case ((reg_name_matches_prefix s3977_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3978_0)) => (case ((string_drop s3977_0 s3978_0)) of s3979_0 => (case ((sep_matches_prefix s3979_0)) of SOME ((() , s3980_0)) => (case ((string_drop s3979_0 s3980_0)) of s3981_0 => (case ((reg_name_matches_prefix s3981_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3982_0)) => (case ((string_drop s3981_0 s3982_0)) of s3983_0 => (case ((sep_matches_prefix s3983_0)) of SOME ((() , s3984_0)) => (case ((string_drop s3983_0 s3984_0)) of s3985_0 => (case ((reg_name_matches_prefix s3985_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3986_0)) => let p0_ = (string_drop s3985_0 s3986_0) in if (((p0_ = ""))) then SOME (s, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3953_ : string -> maybe ((bool * bool * bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3953_:string ->(bool#bool#bool#(5)words$word#(5)words$word#(5)words$word)option) s3954_0= ((case s3954_0 of s3955_0 => (case ((mul_mnemonic_matches_prefix s3955_0)) of SOME (((high, signed1, signed2), s3956_0)) => (case ((string_drop s3955_0 s3956_0)) of s3957_0 => (case ((spc_matches_prefix0 s3957_0)) of SOME ((() , s3958_0)) => (case ((string_drop s3957_0 s3958_0)) of s3959_0 => (case ((reg_name_matches_prefix s3959_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3960_0)) => (case ((string_drop s3959_0 s3960_0)) of s3961_0 => (case ((sep_matches_prefix s3961_0)) of SOME ((() , s3962_0)) => (case ((string_drop s3961_0 s3962_0)) of s3963_0 => (case ((reg_name_matches_prefix s3963_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3964_0)) => (case ((string_drop s3963_0 s3964_0)) of s3965_0 => (case ((sep_matches_prefix s3965_0)) of SOME ((() , s3966_0)) => (case ((string_drop s3965_0 s3966_0)) of s3967_0 => (case ((reg_name_matches_prefix s3967_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3968_0)) => let p0_ = (string_drop s3967_0 s3968_0) in if (((p0_ = ""))) then SOME (high, signed1, signed2, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3941_ : string -> maybe ((mword ty5 * mword ty5))*) val _ = Define ` ((s3941_:string ->((5)words$word#(5)words$word)option) s3942_0= (let s3943_0 = s3942_0 in if ((string_startswith s3943_0 "c.add")) then (case ((string_drop s3943_0 ((string_length "c.add")))) of s3944_0 => (case ((spc_matches_prefix0 s3944_0)) of SOME ((() , s3945_0)) => (case ((string_drop s3944_0 s3945_0)) of s3946_0 => (case ((reg_name_matches_prefix s3946_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s3947_0)) => (case ((string_drop s3946_0 s3947_0)) of s3948_0 => (case ((sep_matches_prefix s3948_0)) of SOME ((() , s3949_0)) => (case ((string_drop s3948_0 s3949_0)) of s3950_0 => (case ((reg_name_matches_prefix s3950_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3951_0)) => let p0_ = (string_drop s3950_0 s3951_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3929_ : string -> maybe ((mword ty5 * mword ty5))*) val _ = Define ` ((s3929_:string ->((5)words$word#(5)words$word)option) s3930_0= (let s3931_0 = s3930_0 in if ((string_startswith s3931_0 "c.mv")) then (case ((string_drop s3931_0 ((string_length "c.mv")))) of s3932_0 => (case ((spc_matches_prefix0 s3932_0)) of SOME ((() , s3933_0)) => (case ((string_drop s3932_0 s3933_0)) of s3934_0 => (case ((reg_name_matches_prefix s3934_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3935_0)) => (case ((string_drop s3934_0 s3935_0)) of s3936_0 => (case ((sep_matches_prefix s3936_0)) of SOME ((() , s3937_0)) => (case ((string_drop s3936_0 s3937_0)) of s3938_0 => (case ((reg_name_matches_prefix s3938_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3939_0)) => let p0_ = (string_drop s3938_0 s3939_0) in if (((p0_ = ""))) then SOME (rd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3921_ : string -> maybe (mword ty5)*) val _ = Define ` ((s3921_:string ->((5)words$word)option) s3922_0= (let s3923_0 = s3922_0 in if ((string_startswith s3923_0 "c.jalr")) then (case ((string_drop s3923_0 ((string_length "c.jalr")))) of s3924_0 => (case ((spc_matches_prefix0 s3924_0)) of SOME ((() , s3925_0)) => (case ((string_drop s3924_0 s3925_0)) of s3926_0 => (case ((reg_name_matches_prefix s3926_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3927_0)) => let p0_ = (string_drop s3926_0 s3927_0) in if (((p0_ = ""))) then SOME rs1 else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3913_ : string -> maybe (mword ty5)*) val _ = Define ` ((s3913_:string ->((5)words$word)option) s3914_0= (let s3915_0 = s3914_0 in if ((string_startswith s3915_0 "c.jr")) then (case ((string_drop s3915_0 ((string_length "c.jr")))) of s3916_0 => (case ((spc_matches_prefix0 s3916_0)) of SOME ((() , s3917_0)) => (case ((string_drop s3916_0 s3917_0)) of s3918_0 => (case ((reg_name_matches_prefix s3918_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3919_0)) => let p0_ = (string_drop s3918_0 s3919_0) in if (((p0_ = ""))) then SOME rs1 else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3901_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3901_:string ->((5)words$word#(6)words$word)option) s3902_0= (let s3903_0 = s3902_0 in if ((string_startswith s3903_0 "c.sdsp")) then (case ((string_drop s3903_0 ((string_length "c.sdsp")))) of s3904_0 => (case ((spc_matches_prefix0 s3904_0)) of SOME ((() , s3905_0)) => (case ((string_drop s3904_0 s3905_0)) of s3906_0 => (case ((reg_name_matches_prefix s3906_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3907_0)) => (case ((string_drop s3906_0 s3907_0)) of s3908_0 => (case ((sep_matches_prefix s3908_0)) of SOME ((() , s3909_0)) => (case ((string_drop s3908_0 s3909_0)) of s3910_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3910_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s3911_0)) => let p0_ = (string_drop s3910_0 s3911_0) in if (((p0_ = ""))) then SOME (rs2, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3889_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3889_:string ->((5)words$word#(6)words$word)option) s3890_0= (let s3891_0 = s3890_0 in if ((string_startswith s3891_0 "c.swsp")) then (case ((string_drop s3891_0 ((string_length "c.swsp")))) of s3892_0 => (case ((spc_matches_prefix0 s3892_0)) of SOME ((() , s3893_0)) => (case ((string_drop s3892_0 s3893_0)) of s3894_0 => (case ((reg_name_matches_prefix s3894_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3895_0)) => (case ((string_drop s3894_0 s3895_0)) of s3896_0 => (case ((sep_matches_prefix s3896_0)) of SOME ((() , s3897_0)) => (case ((string_drop s3896_0 s3897_0)) of s3898_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3898_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s3899_0)) => let p0_ = (string_drop s3898_0 s3899_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3877_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3877_:string ->((5)words$word#(6)words$word)option) s3878_0= (let s3879_0 = s3878_0 in if ((string_startswith s3879_0 "c.ldsp")) then (case ((string_drop s3879_0 ((string_length "c.ldsp")))) of s3880_0 => (case ((spc_matches_prefix0 s3880_0)) of SOME ((() , s3881_0)) => (case ((string_drop s3880_0 s3881_0)) of s3882_0 => (case ((reg_name_matches_prefix s3882_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3883_0)) => (case ((string_drop s3882_0 s3883_0)) of s3884_0 => (case ((sep_matches_prefix s3884_0)) of SOME ((() , s3885_0)) => (case ((string_drop s3884_0 s3885_0)) of s3886_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3886_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s3887_0)) => let p0_ = (string_drop s3886_0 s3887_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3865_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3865_:string ->((5)words$word#(6)words$word)option) s3866_0= (let s3867_0 = s3866_0 in if ((string_startswith s3867_0 "c.lwsp")) then (case ((string_drop s3867_0 ((string_length "c.lwsp")))) of s3868_0 => (case ((spc_matches_prefix0 s3868_0)) of SOME ((() , s3869_0)) => (case ((string_drop s3868_0 s3869_0)) of s3870_0 => (case ((reg_name_matches_prefix s3870_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3871_0)) => (case ((string_drop s3870_0 s3871_0)) of s3872_0 => (case ((sep_matches_prefix s3872_0)) of SOME ((() , s3873_0)) => (case ((string_drop s3872_0 s3873_0)) of s3874_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3874_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s3875_0)) => let p0_ = (string_drop s3874_0 s3875_0) in if (((p0_ = ""))) then SOME (rd, uimm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3853_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3853_:string ->((5)words$word#(6)words$word)option) s3854_0= (let s3855_0 = s3854_0 in if ((string_startswith s3855_0 "c.slli")) then (case ((string_drop s3855_0 ((string_length "c.slli")))) of s3856_0 => (case ((spc_matches_prefix0 s3856_0)) of SOME ((() , s3857_0)) => (case ((string_drop s3856_0 s3857_0)) of s3858_0 => (case ((reg_name_matches_prefix s3858_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s3859_0)) => (case ((string_drop s3858_0 s3859_0)) of s3860_0 => (case ((sep_matches_prefix s3860_0)) of SOME ((() , s3861_0)) => (case ((string_drop s3860_0 s3861_0)) of s3862_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3862_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s3863_0)) => let p0_ = (string_drop s3862_0 s3863_0) in if (((p0_ = ""))) then SOME (rsd, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3841_ : string -> maybe ((mword ty3 * mword ty8))*) val _ = Define ` ((s3841_:string ->((3)words$word#(8)words$word)option) s3842_0= (let s3843_0 = s3842_0 in if ((string_startswith s3843_0 "c.bnez")) then (case ((string_drop s3843_0 ((string_length "c.bnez")))) of s3844_0 => (case ((spc_matches_prefix0 s3844_0)) of SOME ((() , s3845_0)) => (case ((string_drop s3844_0 s3845_0)) of s3846_0 => (case ((creg_name_matches_prefix s3846_0 : (( 3 words$word # ii)) option)) of SOME ((rs, s3847_0)) => (case ((string_drop s3846_0 s3847_0)) of s3848_0 => (case ((sep_matches_prefix s3848_0)) of SOME ((() , s3849_0)) => (case ((string_drop s3848_0 s3849_0)) of s3850_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3850_0 : (( 8 words$word # ii)) option)) of SOME ((imm, s3851_0)) => let p0_ = (string_drop s3850_0 s3851_0) in if (((p0_ = ""))) then SOME (rs, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3829_ : string -> maybe ((mword ty3 * mword ty8))*) val _ = Define ` ((s3829_:string ->((3)words$word#(8)words$word)option) s3830_0= (let s3831_0 = s3830_0 in if ((string_startswith s3831_0 "c.beqz")) then (case ((string_drop s3831_0 ((string_length "c.beqz")))) of s3832_0 => (case ((spc_matches_prefix0 s3832_0)) of SOME ((() , s3833_0)) => (case ((string_drop s3832_0 s3833_0)) of s3834_0 => (case ((creg_name_matches_prefix s3834_0 : (( 3 words$word # ii)) option)) of SOME ((rs, s3835_0)) => (case ((string_drop s3834_0 s3835_0)) of s3836_0 => (case ((sep_matches_prefix s3836_0)) of SOME ((() , s3837_0)) => (case ((string_drop s3836_0 s3837_0)) of s3838_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3838_0 : (( 8 words$word # ii)) option)) of SOME ((imm, s3839_0)) => let p0_ = (string_drop s3838_0 s3839_0) in if (((p0_ = ""))) then SOME (rs, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3821_ : string -> maybe (mword ty11)*) val _ = Define ` ((s3821_:string ->((11)words$word)option) s3822_0= (let s3823_0 = s3822_0 in if ((string_startswith s3823_0 "c.j")) then (case ((string_drop s3823_0 ((string_length "c.j")))) of s3824_0 => (case ((spc_matches_prefix0 s3824_0)) of SOME ((() , s3825_0)) => (case ((string_drop s3824_0 s3825_0)) of s3826_0 => (case ((hex_bits_11_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3826_0 : (( 11 words$word # ii)) option)) of SOME ((imm, s3827_0)) => let p0_ = (string_drop s3826_0 s3827_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3809_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s3809_:string ->((3)words$word#(3)words$word)option) s3810_0= (let s3811_0 = s3810_0 in if ((string_startswith s3811_0 "c.addw")) then (case ((string_drop s3811_0 ((string_length "c.addw")))) of s3812_0 => (case ((spc_matches_prefix0 s3812_0)) of SOME ((() , s3813_0)) => (case ((string_drop s3812_0 s3813_0)) of s3814_0 => (case ((creg_name_matches_prefix s3814_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s3815_0)) => (case ((string_drop s3814_0 s3815_0)) of s3816_0 => (case ((sep_matches_prefix s3816_0)) of SOME ((() , s3817_0)) => (case ((string_drop s3816_0 s3817_0)) of s3818_0 => (case ((creg_name_matches_prefix s3818_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s3819_0)) => let p0_ = (string_drop s3818_0 s3819_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3797_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s3797_:string ->((3)words$word#(3)words$word)option) s3798_0= (let s3799_0 = s3798_0 in if ((string_startswith s3799_0 "c.subw")) then (case ((string_drop s3799_0 ((string_length "c.subw")))) of s3800_0 => (case ((spc_matches_prefix0 s3800_0)) of SOME ((() , s3801_0)) => (case ((string_drop s3800_0 s3801_0)) of s3802_0 => (case ((creg_name_matches_prefix s3802_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s3803_0)) => (case ((string_drop s3802_0 s3803_0)) of s3804_0 => (case ((sep_matches_prefix s3804_0)) of SOME ((() , s3805_0)) => (case ((string_drop s3804_0 s3805_0)) of s3806_0 => (case ((creg_name_matches_prefix s3806_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s3807_0)) => let p0_ = (string_drop s3806_0 s3807_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3785_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s3785_:string ->((3)words$word#(3)words$word)option) s3786_0= (let s3787_0 = s3786_0 in if ((string_startswith s3787_0 "c.and")) then (case ((string_drop s3787_0 ((string_length "c.and")))) of s3788_0 => (case ((spc_matches_prefix0 s3788_0)) of SOME ((() , s3789_0)) => (case ((string_drop s3788_0 s3789_0)) of s3790_0 => (case ((creg_name_matches_prefix s3790_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s3791_0)) => (case ((string_drop s3790_0 s3791_0)) of s3792_0 => (case ((sep_matches_prefix s3792_0)) of SOME ((() , s3793_0)) => (case ((string_drop s3792_0 s3793_0)) of s3794_0 => (case ((creg_name_matches_prefix s3794_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s3795_0)) => let p0_ = (string_drop s3794_0 s3795_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3773_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s3773_:string ->((3)words$word#(3)words$word)option) s3774_0= (let s3775_0 = s3774_0 in if ((string_startswith s3775_0 "c.or")) then (case ((string_drop s3775_0 ((string_length "c.or")))) of s3776_0 => (case ((spc_matches_prefix0 s3776_0)) of SOME ((() , s3777_0)) => (case ((string_drop s3776_0 s3777_0)) of s3778_0 => (case ((creg_name_matches_prefix s3778_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s3779_0)) => (case ((string_drop s3778_0 s3779_0)) of s3780_0 => (case ((sep_matches_prefix s3780_0)) of SOME ((() , s3781_0)) => (case ((string_drop s3780_0 s3781_0)) of s3782_0 => (case ((creg_name_matches_prefix s3782_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s3783_0)) => let p0_ = (string_drop s3782_0 s3783_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3761_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s3761_:string ->((3)words$word#(3)words$word)option) s3762_0= (let s3763_0 = s3762_0 in if ((string_startswith s3763_0 "c.xor")) then (case ((string_drop s3763_0 ((string_length "c.xor")))) of s3764_0 => (case ((spc_matches_prefix0 s3764_0)) of SOME ((() , s3765_0)) => (case ((string_drop s3764_0 s3765_0)) of s3766_0 => (case ((creg_name_matches_prefix s3766_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s3767_0)) => (case ((string_drop s3766_0 s3767_0)) of s3768_0 => (case ((sep_matches_prefix s3768_0)) of SOME ((() , s3769_0)) => (case ((string_drop s3768_0 s3769_0)) of s3770_0 => (case ((creg_name_matches_prefix s3770_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s3771_0)) => let p0_ = (string_drop s3770_0 s3771_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3749_ : string -> maybe ((mword ty3 * mword ty3))*) val _ = Define ` ((s3749_:string ->((3)words$word#(3)words$word)option) s3750_0= (let s3751_0 = s3750_0 in if ((string_startswith s3751_0 "c.sub")) then (case ((string_drop s3751_0 ((string_length "c.sub")))) of s3752_0 => (case ((spc_matches_prefix0 s3752_0)) of SOME ((() , s3753_0)) => (case ((string_drop s3752_0 s3753_0)) of s3754_0 => (case ((creg_name_matches_prefix s3754_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s3755_0)) => (case ((string_drop s3754_0 s3755_0)) of s3756_0 => (case ((sep_matches_prefix s3756_0)) of SOME ((() , s3757_0)) => (case ((string_drop s3756_0 s3757_0)) of s3758_0 => (case ((creg_name_matches_prefix s3758_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s3759_0)) => let p0_ = (string_drop s3758_0 s3759_0) in if (((p0_ = ""))) then SOME (rsd, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3737_ : string -> maybe ((mword ty3 * mword ty6))*) val _ = Define ` ((s3737_:string ->((3)words$word#(6)words$word)option) s3738_0= (let s3739_0 = s3738_0 in if ((string_startswith s3739_0 "c.andi")) then (case ((string_drop s3739_0 ((string_length "c.andi")))) of s3740_0 => (case ((spc_matches_prefix0 s3740_0)) of SOME ((() , s3741_0)) => (case ((string_drop s3740_0 s3741_0)) of s3742_0 => (case ((creg_name_matches_prefix s3742_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s3743_0)) => (case ((string_drop s3742_0 s3743_0)) of s3744_0 => (case ((sep_matches_prefix s3744_0)) of SOME ((() , s3745_0)) => (case ((string_drop s3744_0 s3745_0)) of s3746_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3746_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s3747_0)) => let p0_ = (string_drop s3746_0 s3747_0) in if (((p0_ = ""))) then SOME (rsd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3725_ : string -> maybe ((mword ty3 * mword ty6))*) val _ = Define ` ((s3725_:string ->((3)words$word#(6)words$word)option) s3726_0= (let s3727_0 = s3726_0 in if ((string_startswith s3727_0 "c.srai")) then (case ((string_drop s3727_0 ((string_length "c.srai")))) of s3728_0 => (case ((spc_matches_prefix0 s3728_0)) of SOME ((() , s3729_0)) => (case ((string_drop s3728_0 s3729_0)) of s3730_0 => (case ((creg_name_matches_prefix s3730_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s3731_0)) => (case ((string_drop s3730_0 s3731_0)) of s3732_0 => (case ((sep_matches_prefix s3732_0)) of SOME ((() , s3733_0)) => (case ((string_drop s3732_0 s3733_0)) of s3734_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3734_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s3735_0)) => let p0_ = (string_drop s3734_0 s3735_0) in if (((p0_ = ""))) then SOME (rsd, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3713_ : string -> maybe ((mword ty3 * mword ty6))*) val _ = Define ` ((s3713_:string ->((3)words$word#(6)words$word)option) s3714_0= (let s3715_0 = s3714_0 in if ((string_startswith s3715_0 "c.srli")) then (case ((string_drop s3715_0 ((string_length "c.srli")))) of s3716_0 => (case ((spc_matches_prefix0 s3716_0)) of SOME ((() , s3717_0)) => (case ((string_drop s3716_0 s3717_0)) of s3718_0 => (case ((creg_name_matches_prefix s3718_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s3719_0)) => (case ((string_drop s3718_0 s3719_0)) of s3720_0 => (case ((sep_matches_prefix s3720_0)) of SOME ((() , s3721_0)) => (case ((string_drop s3720_0 s3721_0)) of s3722_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3722_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s3723_0)) => let p0_ = (string_drop s3722_0 s3723_0) in if (((p0_ = ""))) then SOME (rsd, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3701_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3701_:string ->((5)words$word#(6)words$word)option) s3702_0= (let s3703_0 = s3702_0 in if ((string_startswith s3703_0 "c.lui")) then (case ((string_drop s3703_0 ((string_length "c.lui")))) of s3704_0 => (case ((spc_matches_prefix0 s3704_0)) of SOME ((() , s3705_0)) => (case ((string_drop s3704_0 s3705_0)) of s3706_0 => (case ((reg_name_matches_prefix s3706_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3707_0)) => (case ((string_drop s3706_0 s3707_0)) of s3708_0 => (case ((sep_matches_prefix s3708_0)) of SOME ((() , s3709_0)) => (case ((string_drop s3708_0 s3709_0)) of s3710_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3710_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s3711_0)) => let p0_ = (string_drop s3710_0 s3711_0) in if (((p0_ = ""))) then SOME (rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3693_ : string -> maybe (mword ty6)*) val _ = Define ` ((s3693_:string ->((6)words$word)option) s3694_0= (let s3695_0 = s3694_0 in if ((string_startswith s3695_0 "c.addi16sp")) then (case ((string_drop s3695_0 ((string_length "c.addi16sp")))) of s3696_0 => (case ((spc_matches_prefix0 s3696_0)) of SOME ((() , s3697_0)) => (case ((string_drop s3696_0 s3697_0)) of s3698_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3698_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s3699_0)) => let p0_ = (string_drop s3698_0 s3699_0) in if (((p0_ = ""))) then SOME imm else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3681_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3681_:string ->((5)words$word#(6)words$word)option) s3682_0= (let s3683_0 = s3682_0 in if ((string_startswith s3683_0 "c.li")) then (case ((string_drop s3683_0 ((string_length "c.li")))) of s3684_0 => (case ((spc_matches_prefix0 s3684_0)) of SOME ((() , s3685_0)) => (case ((string_drop s3684_0 s3685_0)) of s3686_0 => (case ((reg_name_matches_prefix s3686_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3687_0)) => (case ((string_drop s3686_0 s3687_0)) of s3688_0 => (case ((sep_matches_prefix s3688_0)) of SOME ((() , s3689_0)) => (case ((string_drop s3688_0 s3689_0)) of s3690_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3690_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s3691_0)) => let p0_ = (string_drop s3690_0 s3691_0) in if (((p0_ = ""))) then SOME (rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3669_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3669_:string ->((5)words$word#(6)words$word)option) s3670_0= (let s3671_0 = s3670_0 in if ((string_startswith s3671_0 "c.addiw")) then (case ((string_drop s3671_0 ((string_length "c.addiw")))) of s3672_0 => (case ((spc_matches_prefix0 s3672_0)) of SOME ((() , s3673_0)) => (case ((string_drop s3672_0 s3673_0)) of s3674_0 => (case ((reg_name_matches_prefix s3674_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s3675_0)) => (case ((string_drop s3674_0 s3675_0)) of s3676_0 => (case ((sep_matches_prefix s3676_0)) of SOME ((() , s3677_0)) => (case ((string_drop s3676_0 s3677_0)) of s3678_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3678_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s3679_0)) => let p0_ = (string_drop s3678_0 s3679_0) in if (((p0_ = ""))) then SOME (rsd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3661_ : string -> maybe (mword ty11)*) val _ = Define ` ((s3661_:string ->((11)words$word)option) s3662_0= (let s3663_0 = s3662_0 in if ((string_startswith s3663_0 "c.jal")) then (case ((string_drop s3663_0 ((string_length "c.jal")))) of s3664_0 => (case ((spc_matches_prefix0 s3664_0)) of SOME ((() , s3665_0)) => (case ((string_drop s3664_0 s3665_0)) of s3666_0 => (case ((hex_bits_12_matches_prefix0 s3666_0 : (( 12 words$word # ii)) option)) of SOME ((v__1470, s3667_0)) => if (((((subrange_vec_dec v__1470 (( 0 : int): ii) (( 0 : int): ii) : 1 words$word)) = (0b0w : 1 words$word)))) then let (imm : 11 words$word) = ((subrange_vec_dec v__1470 (( 11 : int): ii) (( 1 : int): ii) : 11 words$word)) in let (imm : 11 words$word) = ((subrange_vec_dec v__1470 (( 11 : int): ii) (( 1 : int): ii) : 11 words$word)) in let p0_ = (string_drop s3666_0 s3667_0) in if (((p0_ = ""))) then SOME imm else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3649_ : string -> maybe ((mword ty5 * mword ty6))*) val _ = Define ` ((s3649_:string ->((5)words$word#(6)words$word)option) s3650_0= (let s3651_0 = s3650_0 in if ((string_startswith s3651_0 "c.addi")) then (case ((string_drop s3651_0 ((string_length "c.addi")))) of s3652_0 => (case ((spc_matches_prefix0 s3652_0)) of SOME ((() , s3653_0)) => (case ((string_drop s3652_0 s3653_0)) of s3654_0 => (case ((reg_name_matches_prefix s3654_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s3655_0)) => (case ((string_drop s3654_0 s3655_0)) of s3656_0 => (case ((sep_matches_prefix s3656_0)) of SOME ((() , s3657_0)) => (case ((string_drop s3656_0 s3657_0)) of s3658_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3658_0 : (( 6 words$word # ii)) option)) of SOME ((nzi, s3659_0)) => let p0_ = (string_drop s3658_0 s3659_0) in if (((p0_ = ""))) then SOME (rsd, nzi) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3633_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s3633_:string ->((3)words$word#(3)words$word#(5)words$word)option) s3634_0= (let s3635_0 = s3634_0 in if ((string_startswith s3635_0 "c.sd")) then (case ((string_drop s3635_0 ((string_length "c.sd")))) of s3636_0 => (case ((spc_matches_prefix0 s3636_0)) of SOME ((() , s3637_0)) => (case ((string_drop s3636_0 s3637_0)) of s3638_0 => (case ((creg_name_matches_prefix s3638_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s3639_0)) => (case ((string_drop s3638_0 s3639_0)) of s3640_0 => (case ((sep_matches_prefix s3640_0)) of SOME ((() , s3641_0)) => (case ((string_drop s3640_0 s3641_0)) of s3642_0 => (case ((creg_name_matches_prefix s3642_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s3643_0)) => (case ((string_drop s3642_0 s3643_0)) of s3644_0 => (case ((sep_matches_prefix s3644_0)) of SOME ((() , s3645_0)) => (case ((string_drop s3644_0 s3645_0)) of s3646_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3646_0 : (( 8 words$word # ii)) option)) of SOME ((v__1472, s3647_0)) => if (((((subrange_vec_dec v__1472 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1472 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1472 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let p0_ = (string_drop s3646_0 s3647_0) in if (((p0_ = ""))) then SOME (rsc1, rsc2, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3617_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s3617_:string ->((3)words$word#(3)words$word#(5)words$word)option) s3618_0= (let s3619_0 = s3618_0 in if ((string_startswith s3619_0 "c.sw")) then (case ((string_drop s3619_0 ((string_length "c.sw")))) of s3620_0 => (case ((spc_matches_prefix0 s3620_0)) of SOME ((() , s3621_0)) => (case ((string_drop s3620_0 s3621_0)) of s3622_0 => (case ((creg_name_matches_prefix s3622_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s3623_0)) => (case ((string_drop s3622_0 s3623_0)) of s3624_0 => (case ((sep_matches_prefix s3624_0)) of SOME ((() , s3625_0)) => (case ((string_drop s3624_0 s3625_0)) of s3626_0 => (case ((creg_name_matches_prefix s3626_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s3627_0)) => (case ((string_drop s3626_0 s3627_0)) of s3628_0 => (case ((sep_matches_prefix s3628_0)) of SOME ((() , s3629_0)) => (case ((string_drop s3628_0 s3629_0)) of s3630_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3630_0 : (( 7 words$word # ii)) option)) of SOME ((v__1474, s3631_0)) => if (((((subrange_vec_dec v__1474 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1474 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1474 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let p0_ = (string_drop s3630_0 s3631_0) in if (((p0_ = ""))) then SOME (rsc1, rsc2, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3601_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s3601_:string ->((3)words$word#(3)words$word#(5)words$word)option) s3602_0= (let s3603_0 = s3602_0 in if ((string_startswith s3603_0 "c.ld")) then (case ((string_drop s3603_0 ((string_length "c.ld")))) of s3604_0 => (case ((spc_matches_prefix0 s3604_0)) of SOME ((() , s3605_0)) => (case ((string_drop s3604_0 s3605_0)) of s3606_0 => (case ((creg_name_matches_prefix s3606_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s3607_0)) => (case ((string_drop s3606_0 s3607_0)) of s3608_0 => (case ((sep_matches_prefix s3608_0)) of SOME ((() , s3609_0)) => (case ((string_drop s3608_0 s3609_0)) of s3610_0 => (case ((creg_name_matches_prefix s3610_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s3611_0)) => (case ((string_drop s3610_0 s3611_0)) of s3612_0 => (case ((sep_matches_prefix s3612_0)) of SOME ((() , s3613_0)) => (case ((string_drop s3612_0 s3613_0)) of s3614_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3614_0 : (( 8 words$word # ii)) option)) of SOME ((v__1476, s3615_0)) => if (((((subrange_vec_dec v__1476 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1476 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1476 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let p0_ = (string_drop s3614_0 s3615_0) in if (((p0_ = ""))) then SOME (rdc, rsc, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3585_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5))*) val _ = Define ` ((s3585_:string ->((3)words$word#(3)words$word#(5)words$word)option) s3586_0= (let s3587_0 = s3586_0 in if ((string_startswith s3587_0 "c.lw")) then (case ((string_drop s3587_0 ((string_length "c.lw")))) of s3588_0 => (case ((spc_matches_prefix0 s3588_0)) of SOME ((() , s3589_0)) => (case ((string_drop s3588_0 s3589_0)) of s3590_0 => (case ((creg_name_matches_prefix s3590_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s3591_0)) => (case ((string_drop s3590_0 s3591_0)) of s3592_0 => (case ((sep_matches_prefix s3592_0)) of SOME ((() , s3593_0)) => (case ((string_drop s3592_0 s3593_0)) of s3594_0 => (case ((creg_name_matches_prefix s3594_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s3595_0)) => (case ((string_drop s3594_0 s3595_0)) of s3596_0 => (case ((sep_matches_prefix s3596_0)) of SOME ((() , s3597_0)) => (case ((string_drop s3596_0 s3597_0)) of s3598_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3598_0 : (( 7 words$word # ii)) option)) of SOME ((v__1478, s3599_0)) => if (((((subrange_vec_dec v__1478 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1478 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1478 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let p0_ = (string_drop s3598_0 s3599_0) in if (((p0_ = ""))) then SOME (rdc, rsc, uimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3573_ : string -> maybe ((mword ty3 * mword ty8))*) val _ = Define ` ((s3573_:string ->((3)words$word#(8)words$word)option) s3574_0= (let s3575_0 = s3574_0 in if ((string_startswith s3575_0 "c.addi4spn")) then (case ((string_drop s3575_0 ((string_length "c.addi4spn")))) of s3576_0 => (case ((spc_matches_prefix0 s3576_0)) of SOME ((() , s3577_0)) => (case ((string_drop s3576_0 s3577_0)) of s3578_0 => (case ((creg_name_matches_prefix s3578_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s3579_0)) => (case ((string_drop s3578_0 s3579_0)) of s3580_0 => (case ((sep_matches_prefix s3580_0)) of SOME ((() , s3581_0)) => (case ((string_drop s3580_0 s3581_0)) of s3582_0 => (case ((hex_bits_10_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3582_0 : (( 10 words$word # ii)) option)) of SOME ((v__1480, s3583_0)) => if (((((subrange_vec_dec v__1480 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (nzimm : 8 words$word) = ((subrange_vec_dec v__1480 (( 9 : int): ii) (( 2 : int): ii) : 8 words$word)) in let (nzimm : 8 words$word) = ((subrange_vec_dec v__1480 (( 9 : int): ii) (( 2 : int): ii) : 8 words$word)) in let p0_ = (string_drop s3582_0 s3583_0) in if (((p0_ = ""))) then SOME (rdc, nzimm) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3547_ : string -> maybe ((amoop * word_width * bool * bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3547_:string ->(amoop#word_width#bool#bool#(5)words$word#(5)words$word#(5)words$word)option) s3548_0= ((case s3548_0 of s3549_0 => (case ((amo_mnemonic_matches_prefix s3549_0)) of SOME ((op, s3550_0)) => let s3551_0 = (string_drop s3549_0 s3550_0) in if ((string_startswith s3551_0 ".")) then (case ((string_drop s3551_0 ((string_length ".")))) of s3552_0 => (case ((size_mnemonic_matches_prefix s3552_0)) of SOME ((width, s3553_0)) => (case ((string_drop s3552_0 s3553_0)) of s3554_0 => (case ((maybe_aq_matches_prefix s3554_0)) of SOME ((aq, s3555_0)) => (case ((string_drop s3554_0 s3555_0)) of s3556_0 => (case ((maybe_rl_matches_prefix s3556_0)) of SOME ((rl, s3557_0)) => (case ((string_drop s3556_0 s3557_0)) of s3558_0 => (case ((spc_matches_prefix0 s3558_0)) of SOME ((() , s3559_0)) => (case ((string_drop s3558_0 s3559_0)) of s3560_0 => (case ((reg_name_matches_prefix s3560_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3561_0)) => (case ((string_drop s3560_0 s3561_0)) of s3562_0 => (case ((sep_matches_prefix s3562_0)) of SOME ((() , s3563_0)) => (case ((string_drop s3562_0 s3563_0)) of s3564_0 => (case ((reg_name_matches_prefix s3564_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3565_0)) => (case ((string_drop s3564_0 s3565_0)) of s3566_0 => (case ((sep_matches_prefix s3566_0)) of SOME ((() , s3567_0)) => let s3568_0 = (string_drop s3566_0 s3567_0) in if ((string_startswith s3568_0 "(")) then (case ((string_drop s3568_0 ((string_length "(")))) of s3569_0 => (case ((reg_name_matches_prefix s3569_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3570_0)) => let s3571_0 = (string_drop s3569_0 s3570_0) in if ((string_startswith s3571_0 ")")) then let p0_ = (string_drop s3571_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (op, width, aq, rl, rd, rs2, rs1) else NONE else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) )))`; (*val _s3525_ : string -> maybe ((word_width * bool * bool * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3525_:string ->(word_width#bool#bool#(5)words$word#(5)words$word#(5)words$word)option) s3526_0= (let s3527_0 = s3526_0 in if ((string_startswith s3527_0 "sc.")) then (case ((string_drop s3527_0 ((string_length "sc.")))) of s3528_0 => (case ((size_mnemonic_matches_prefix s3528_0)) of SOME ((size1, s3529_0)) => (case ((string_drop s3528_0 s3529_0)) of s3530_0 => (case ((maybe_aq_matches_prefix s3530_0)) of SOME ((aq, s3531_0)) => (case ((string_drop s3530_0 s3531_0)) of s3532_0 => (case ((maybe_rl_matches_prefix s3532_0)) of SOME ((rl, s3533_0)) => (case ((string_drop s3532_0 s3533_0)) of s3534_0 => (case ((spc_matches_prefix0 s3534_0)) of SOME ((() , s3535_0)) => (case ((string_drop s3534_0 s3535_0)) of s3536_0 => (case ((reg_name_matches_prefix s3536_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3537_0)) => (case ((string_drop s3536_0 s3537_0)) of s3538_0 => (case ((sep_matches_prefix s3538_0)) of SOME ((() , s3539_0)) => (case ((string_drop s3538_0 s3539_0)) of s3540_0 => (case ((reg_name_matches_prefix s3540_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3541_0)) => (case ((string_drop s3540_0 s3541_0)) of s3542_0 => (case ((sep_matches_prefix s3542_0)) of SOME ((() , s3543_0)) => (case ((string_drop s3542_0 s3543_0)) of s3544_0 => (case ((reg_name_matches_prefix s3544_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3545_0)) => let p0_ = (string_drop s3544_0 s3545_0) in if (((p0_ = ""))) then SOME (size1, aq, rl, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3507_ : string -> maybe ((word_width * bool * bool * mword ty5 * mword ty5))*) val _ = Define ` ((s3507_:string ->(word_width#bool#bool#(5)words$word#(5)words$word)option) s3508_0= (let s3509_0 = s3508_0 in if ((string_startswith s3509_0 "lr.")) then (case ((string_drop s3509_0 ((string_length "lr.")))) of s3510_0 => (case ((size_mnemonic_matches_prefix s3510_0)) of SOME ((size1, s3511_0)) => (case ((string_drop s3510_0 s3511_0)) of s3512_0 => (case ((maybe_aq_matches_prefix s3512_0)) of SOME ((aq, s3513_0)) => (case ((string_drop s3512_0 s3513_0)) of s3514_0 => (case ((maybe_rl_matches_prefix s3514_0)) of SOME ((rl, s3515_0)) => (case ((string_drop s3514_0 s3515_0)) of s3516_0 => (case ((spc_matches_prefix0 s3516_0)) of SOME ((() , s3517_0)) => (case ((string_drop s3516_0 s3517_0)) of s3518_0 => (case ((reg_name_matches_prefix s3518_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3519_0)) => (case ((string_drop s3518_0 s3519_0)) of s3520_0 => (case ((sep_matches_prefix s3520_0)) of SOME ((() , s3521_0)) => (case ((string_drop s3520_0 s3521_0)) of s3522_0 => (case ((reg_name_matches_prefix s3522_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3523_0)) => let p0_ = (string_drop s3522_0 s3523_0) in if (((p0_ = ""))) then SOME (size1, aq, rl, rd, rs1) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3495_ : string -> maybe ((mword ty5 * mword ty5))*) val _ = Define ` ((s3495_:string ->((5)words$word#(5)words$word)option) s3496_0= (let s3497_0 = s3496_0 in if ((string_startswith s3497_0 "sfence.vma")) then (case ((string_drop s3497_0 ((string_length "sfence.vma")))) of s3498_0 => (case ((spc_matches_prefix0 s3498_0)) of SOME ((() , s3499_0)) => (case ((string_drop s3498_0 s3499_0)) of s3500_0 => (case ((reg_name_matches_prefix s3500_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3501_0)) => (case ((string_drop s3500_0 s3501_0)) of s3502_0 => (case ((sep_matches_prefix s3502_0)) of SOME ((() , s3503_0)) => (case ((string_drop s3502_0 s3503_0)) of s3504_0 => (case ((reg_name_matches_prefix s3504_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3505_0)) => let p0_ = (string_drop s3504_0 s3505_0) in if (((p0_ = ""))) then SOME (rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3483_ : string -> maybe ((mword ty4 * mword ty4))*) val _ = Define ` ((s3483_:string ->((4)words$word#(4)words$word)option) s3484_0= (let s3485_0 = s3484_0 in if ((string_startswith s3485_0 "fence.tso")) then (case ((string_drop s3485_0 ((string_length "fence.tso")))) of s3486_0 => (case ((spc_matches_prefix0 s3486_0)) of SOME ((() , s3487_0)) => (case ((string_drop s3486_0 s3487_0)) of s3488_0 => (case ((fence_bits_matches_prefix s3488_0 : (( 4 words$word # ii)) option)) of SOME ((pred, s3489_0)) => (case ((string_drop s3488_0 s3489_0)) of s3490_0 => (case ((sep_matches_prefix s3490_0)) of SOME ((() , s3491_0)) => (case ((string_drop s3490_0 s3491_0)) of s3492_0 => (case ((fence_bits_matches_prefix s3492_0 : (( 4 words$word # ii)) option)) of SOME ((succ, s3493_0)) => let p0_ = (string_drop s3492_0 s3493_0) in if (((p0_ = ""))) then SOME (pred, succ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3471_ : string -> maybe ((mword ty4 * mword ty4))*) val _ = Define ` ((s3471_:string ->((4)words$word#(4)words$word)option) s3472_0= (let s3473_0 = s3472_0 in if ((string_startswith s3473_0 "fence")) then (case ((string_drop s3473_0 ((string_length "fence")))) of s3474_0 => (case ((spc_matches_prefix0 s3474_0)) of SOME ((() , s3475_0)) => (case ((string_drop s3474_0 s3475_0)) of s3476_0 => (case ((fence_bits_matches_prefix s3476_0 : (( 4 words$word # ii)) option)) of SOME ((pred, s3477_0)) => (case ((string_drop s3476_0 s3477_0)) of s3478_0 => (case ((sep_matches_prefix s3478_0)) of SOME ((() , s3479_0)) => (case ((string_drop s3478_0 s3479_0)) of s3480_0 => (case ((fence_bits_matches_prefix s3480_0 : (( 4 words$word # ii)) option)) of SOME ((succ, s3481_0)) => let p0_ = (string_drop s3480_0 s3481_0) in if (((p0_ = ""))) then SOME (pred, succ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3454_ : string -> maybe ((sopw * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3454_:string ->(sopw#(5)words$word#(5)words$word#(5)words$word)option) s3455_0= ((case s3455_0 of s3456_0 => (case ((shiftiwop_mnemonic_matches_prefix s3456_0)) of SOME ((op, s3457_0)) => (case ((string_drop s3456_0 s3457_0)) of s3458_0 => (case ((spc_matches_prefix0 s3458_0)) of SOME ((() , s3459_0)) => (case ((string_drop s3458_0 s3459_0)) of s3460_0 => (case ((reg_name_matches_prefix s3460_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3461_0)) => (case ((string_drop s3460_0 s3461_0)) of s3462_0 => (case ((sep_matches_prefix s3462_0)) of SOME ((() , s3463_0)) => (case ((string_drop s3462_0 s3463_0)) of s3464_0 => (case ((reg_name_matches_prefix s3464_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3465_0)) => (case ((string_drop s3464_0 s3465_0)) of s3466_0 => (case ((sep_matches_prefix s3466_0)) of SOME ((() , s3467_0)) => (case ((string_drop s3466_0 s3467_0)) of s3468_0 => (case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3468_0 : (( 5 words$word # ii)) option)) of SOME ((shamt, s3469_0)) => let p0_ = (string_drop s3468_0 s3469_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3437_ : string -> maybe ((ropw * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3437_:string ->(ropw#(5)words$word#(5)words$word#(5)words$word)option) s3438_0= ((case s3438_0 of s3439_0 => (case ((rtypew_mnemonic_matches_prefix s3439_0)) of SOME ((op, s3440_0)) => (case ((string_drop s3439_0 s3440_0)) of s3441_0 => (case ((spc_matches_prefix0 s3441_0)) of SOME ((() , s3442_0)) => (case ((string_drop s3441_0 s3442_0)) of s3443_0 => (case ((reg_name_matches_prefix s3443_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3444_0)) => (case ((string_drop s3443_0 s3444_0)) of s3445_0 => (case ((sep_matches_prefix s3445_0)) of SOME ((() , s3446_0)) => (case ((string_drop s3445_0 s3446_0)) of s3447_0 => (case ((reg_name_matches_prefix s3447_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3448_0)) => (case ((string_drop s3447_0 s3448_0)) of s3449_0 => (case ((sep_matches_prefix s3449_0)) of SOME ((() , s3450_0)) => (case ((string_drop s3449_0 s3450_0)) of s3451_0 => (case ((reg_name_matches_prefix s3451_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3452_0)) => let p0_ = (string_drop s3451_0 s3452_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3420_ : string -> maybe ((sop * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3420_:string ->(sop#(5)words$word#(5)words$word#(5)words$word)option) s3421_0= ((case s3421_0 of s3422_0 => (case ((shiftw_mnemonic_matches_prefix s3422_0)) of SOME ((op, s3423_0)) => (case ((string_drop s3422_0 s3423_0)) of s3424_0 => (case ((spc_matches_prefix0 s3424_0)) of SOME ((() , s3425_0)) => (case ((string_drop s3424_0 s3425_0)) of s3426_0 => (case ((reg_name_matches_prefix s3426_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3427_0)) => (case ((string_drop s3426_0 s3427_0)) of s3428_0 => (case ((sep_matches_prefix s3428_0)) of SOME ((() , s3429_0)) => (case ((string_drop s3428_0 s3429_0)) of s3430_0 => (case ((reg_name_matches_prefix s3430_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3431_0)) => (case ((string_drop s3430_0 s3431_0)) of s3432_0 => (case ((sep_matches_prefix s3432_0)) of SOME ((() , s3433_0)) => (case ((string_drop s3432_0 s3433_0)) of s3434_0 => (case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3434_0 : (( 5 words$word # ii)) option)) of SOME ((shamt, s3435_0)) => let p0_ = (string_drop s3434_0 s3435_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3404_ : string -> maybe ((mword ty5 * mword ty5 * mword ty12))*) val _ = Define ` ((s3404_:string ->((5)words$word#(5)words$word#(12)words$word)option) s3405_0= (let s3406_0 = s3405_0 in if ((string_startswith s3406_0 "addiw")) then (case ((string_drop s3406_0 ((string_length "addiw")))) of s3407_0 => (case ((spc_matches_prefix0 s3407_0)) of SOME ((() , s3408_0)) => (case ((string_drop s3407_0 s3408_0)) of s3409_0 => (case ((reg_name_matches_prefix s3409_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3410_0)) => (case ((string_drop s3409_0 s3410_0)) of s3411_0 => (case ((sep_matches_prefix s3411_0)) of SOME ((() , s3412_0)) => (case ((string_drop s3411_0 s3412_0)) of s3413_0 => (case ((reg_name_matches_prefix s3413_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3414_0)) => (case ((string_drop s3413_0 s3414_0)) of s3415_0 => (case ((sep_matches_prefix s3415_0)) of SOME ((() , s3416_0)) => (case ((string_drop s3415_0 s3416_0)) of s3417_0 => (case ((hex_bits_12_matches_prefix0 s3417_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s3418_0)) => let p0_ = (string_drop s3417_0 s3418_0) in if (((p0_ = ""))) then SOME (rd, rs1, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3376_ : string -> maybe ((word_width * bool * bool * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s3376_:string ->(word_width#bool#bool#(5)words$word#(12)words$word#(5)words$word)option) s3377_0= (let s3378_0 = s3377_0 in if ((string_startswith s3378_0 "s")) then (case ((string_drop s3378_0 ((string_length "s")))) of s3379_0 => (case ((size_mnemonic_matches_prefix s3379_0)) of SOME ((size1, s3380_0)) => (case ((string_drop s3379_0 s3380_0)) of s3381_0 => (case ((maybe_aq_matches_prefix s3381_0)) of SOME ((aq, s3382_0)) => (case ((string_drop s3381_0 s3382_0)) of s3383_0 => (case ((maybe_rl_matches_prefix s3383_0)) of SOME ((rl, s3384_0)) => (case ((string_drop s3383_0 s3384_0)) of s3385_0 => (case ((spc_matches_prefix0 s3385_0)) of SOME ((() , s3386_0)) => (case ((string_drop s3385_0 s3386_0)) of s3387_0 => (case ((reg_name_matches_prefix s3387_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3388_0)) => (case ((string_drop s3387_0 s3388_0)) of s3389_0 => (case ((sep_matches_prefix s3389_0)) of SOME ((() , s3390_0)) => (case ((string_drop s3389_0 s3390_0)) of s3391_0 => (case ((hex_bits_12_matches_prefix0 s3391_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s3392_0)) => (case ((string_drop s3391_0 s3392_0)) of s3393_0 => (case ((opt_spc_matches_prefix0 s3393_0)) of SOME ((() , s3394_0)) => let s3395_0 = (string_drop s3393_0 s3394_0) in if ((string_startswith s3395_0 "(")) then (case ((string_drop s3395_0 ((string_length "(")))) of s3396_0 => (case ((opt_spc_matches_prefix0 s3396_0)) of SOME ((() , s3397_0)) => (case ((string_drop s3396_0 s3397_0)) of s3398_0 => (case ((reg_name_matches_prefix s3398_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3399_0)) => (case ((string_drop s3398_0 s3399_0)) of s3400_0 => (case ((opt_spc_matches_prefix0 s3400_0)) of SOME ((() , s3401_0)) => let s3402_0 = (string_drop s3400_0 s3401_0) in if ((string_startswith s3402_0 ")")) then let p0_ = (string_drop s3402_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (size1, aq, rl, rs2, imm, rs1) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3346_ : string -> maybe ((word_width * bool * bool * bool * mword ty5 * mword ty12 * mword ty5))*) val _ = Define ` ((s3346_:string ->(word_width#bool#bool#bool#(5)words$word#(12)words$word#(5)words$word)option) s3347_0= (let s3348_0 = s3347_0 in if ((string_startswith s3348_0 "l")) then (case ((string_drop s3348_0 ((string_length "l")))) of s3349_0 => (case ((size_mnemonic_matches_prefix s3349_0)) of SOME ((size1, s3350_0)) => (case ((string_drop s3349_0 s3350_0)) of s3351_0 => (case ((maybe_u_matches_prefix s3351_0)) of SOME ((is_unsigned, s3352_0)) => (case ((string_drop s3351_0 s3352_0)) of s3353_0 => (case ((maybe_aq_matches_prefix s3353_0)) of SOME ((aq, s3354_0)) => (case ((string_drop s3353_0 s3354_0)) of s3355_0 => (case ((maybe_rl_matches_prefix s3355_0)) of SOME ((rl, s3356_0)) => (case ((string_drop s3355_0 s3356_0)) of s3357_0 => (case ((spc_matches_prefix0 s3357_0)) of SOME ((() , s3358_0)) => (case ((string_drop s3357_0 s3358_0)) of s3359_0 => (case ((reg_name_matches_prefix s3359_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3360_0)) => (case ((string_drop s3359_0 s3360_0)) of s3361_0 => (case ((sep_matches_prefix s3361_0)) of SOME ((() , s3362_0)) => (case ((string_drop s3361_0 s3362_0)) of s3363_0 => (case ((hex_bits_12_matches_prefix0 s3363_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s3364_0)) => (case ((string_drop s3363_0 s3364_0)) of s3365_0 => (case ((opt_spc_matches_prefix0 s3365_0)) of SOME ((() , s3366_0)) => let s3367_0 = (string_drop s3365_0 s3366_0) in if ((string_startswith s3367_0 "(")) then (case ((string_drop s3367_0 ((string_length "(")))) of s3368_0 => (case ((opt_spc_matches_prefix0 s3368_0)) of SOME ((() , s3369_0)) => (case ((string_drop s3368_0 s3369_0)) of s3370_0 => (case ((reg_name_matches_prefix s3370_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3371_0)) => (case ((string_drop s3370_0 s3371_0)) of s3372_0 => (case ((opt_spc_matches_prefix0 s3372_0)) of SOME ((() , s3373_0)) => let s3374_0 = (string_drop s3372_0 s3373_0) in if ((string_startswith s3374_0 ")")) then let p0_ = (string_drop s3374_0 ((string_length ")"))) in if (((p0_ = ""))) then SOME (size1, is_unsigned, aq, rl, rd, imm, rs1) else NONE else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3329_ : string -> maybe ((rop * mword ty5 * mword ty5 * mword ty5))*) val _ = Define ` ((s3329_:string ->(rop#(5)words$word#(5)words$word#(5)words$word)option) s3330_0= ((case s3330_0 of s3331_0 => (case ((rtype_mnemonic_matches_prefix s3331_0)) of SOME ((op, s3332_0)) => (case ((string_drop s3331_0 s3332_0)) of s3333_0 => (case ((spc_matches_prefix0 s3333_0)) of SOME ((() , s3334_0)) => (case ((string_drop s3333_0 s3334_0)) of s3335_0 => (case ((reg_name_matches_prefix s3335_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3336_0)) => (case ((string_drop s3335_0 s3336_0)) of s3337_0 => (case ((sep_matches_prefix s3337_0)) of SOME ((() , s3338_0)) => (case ((string_drop s3337_0 s3338_0)) of s3339_0 => (case ((reg_name_matches_prefix s3339_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3340_0)) => (case ((string_drop s3339_0 s3340_0)) of s3341_0 => (case ((sep_matches_prefix s3341_0)) of SOME ((() , s3342_0)) => (case ((string_drop s3341_0 s3342_0)) of s3343_0 => (case ((reg_name_matches_prefix s3343_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3344_0)) => let p0_ = (string_drop s3343_0 s3344_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, rs2) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3312_ : string -> maybe ((sop * mword ty5 * mword ty5 * mword ty6))*) val _ = Define ` ((s3312_:string ->(sop#(5)words$word#(5)words$word#(6)words$word)option) s3313_0= ((case s3313_0 of s3314_0 => (case ((shiftiop_mnemonic_matches_prefix s3314_0)) of SOME ((op, s3315_0)) => (case ((string_drop s3314_0 s3315_0)) of s3316_0 => (case ((spc_matches_prefix0 s3316_0)) of SOME ((() , s3317_0)) => (case ((string_drop s3316_0 s3317_0)) of s3318_0 => (case ((reg_name_matches_prefix s3318_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3319_0)) => (case ((string_drop s3318_0 s3319_0)) of s3320_0 => (case ((sep_matches_prefix s3320_0)) of SOME ((() , s3321_0)) => (case ((string_drop s3320_0 s3321_0)) of s3322_0 => (case ((reg_name_matches_prefix s3322_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3323_0)) => (case ((string_drop s3322_0 s3323_0)) of s3324_0 => (case ((sep_matches_prefix s3324_0)) of SOME ((() , s3325_0)) => (case ((string_drop s3324_0 s3325_0)) of s3326_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3326_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s3327_0)) => let p0_ = (string_drop s3326_0 s3327_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, shamt) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3295_ : string -> maybe ((iop * mword ty5 * mword ty5 * mword ty12))*) val _ = Define ` ((s3295_:string ->(iop#(5)words$word#(5)words$word#(12)words$word)option) s3296_0= ((case s3296_0 of s3297_0 => (case ((itype_mnemonic_matches_prefix s3297_0)) of SOME ((op, s3298_0)) => (case ((string_drop s3297_0 s3298_0)) of s3299_0 => (case ((spc_matches_prefix0 s3299_0)) of SOME ((() , s3300_0)) => (case ((string_drop s3299_0 s3300_0)) of s3301_0 => (case ((reg_name_matches_prefix s3301_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3302_0)) => (case ((string_drop s3301_0 s3302_0)) of s3303_0 => (case ((sep_matches_prefix s3303_0)) of SOME ((() , s3304_0)) => (case ((string_drop s3303_0 s3304_0)) of s3305_0 => (case ((reg_name_matches_prefix s3305_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3306_0)) => (case ((string_drop s3305_0 s3306_0)) of s3307_0 => (case ((sep_matches_prefix s3307_0)) of SOME ((() , s3308_0)) => (case ((string_drop s3307_0 s3308_0)) of s3309_0 => (case ((hex_bits_12_matches_prefix0 s3309_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s3310_0)) => let p0_ = (string_drop s3309_0 s3310_0) in if (((p0_ = ""))) then SOME (op, rd, rs1, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3278_ : string -> maybe ((bop * mword ty5 * mword ty5 * mword ty13))*) val _ = Define ` ((s3278_:string ->(bop#(5)words$word#(5)words$word#(13)words$word)option) s3279_0= ((case s3279_0 of s3280_0 => (case ((btype_mnemonic_matches_prefix s3280_0)) of SOME ((op, s3281_0)) => (case ((string_drop s3280_0 s3281_0)) of s3282_0 => (case ((spc_matches_prefix0 s3282_0)) of SOME ((() , s3283_0)) => (case ((string_drop s3282_0 s3283_0)) of s3284_0 => (case ((reg_name_matches_prefix s3284_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3285_0)) => (case ((string_drop s3284_0 s3285_0)) of s3286_0 => (case ((sep_matches_prefix s3286_0)) of SOME ((() , s3287_0)) => (case ((string_drop s3286_0 s3287_0)) of s3288_0 => (case ((reg_name_matches_prefix s3288_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s3289_0)) => (case ((string_drop s3288_0 s3289_0)) of s3290_0 => (case ((sep_matches_prefix s3290_0)) of SOME ((() , s3291_0)) => (case ((string_drop s3290_0 s3291_0)) of s3292_0 => (case ((hex_bits_13_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3292_0 : (( 13 words$word # ii)) option)) of SOME ((imm, s3293_0)) => let p0_ = (string_drop s3292_0 s3293_0) in if (((p0_ = ""))) then SOME (op, rs1, rs2, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s3262_ : string -> maybe ((mword ty5 * mword ty5 * mword ty12))*) val _ = Define ` ((s3262_:string ->((5)words$word#(5)words$word#(12)words$word)option) s3263_0= (let s3264_0 = s3263_0 in if ((string_startswith s3264_0 "jalr")) then (case ((string_drop s3264_0 ((string_length "jalr")))) of s3265_0 => (case ((spc_matches_prefix0 s3265_0)) of SOME ((() , s3266_0)) => (case ((string_drop s3265_0 s3266_0)) of s3267_0 => (case ((reg_name_matches_prefix s3267_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3268_0)) => (case ((string_drop s3267_0 s3268_0)) of s3269_0 => (case ((sep_matches_prefix s3269_0)) of SOME ((() , s3270_0)) => (case ((string_drop s3269_0 s3270_0)) of s3271_0 => (case ((reg_name_matches_prefix s3271_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s3272_0)) => (case ((string_drop s3271_0 s3272_0)) of s3273_0 => (case ((sep_matches_prefix s3273_0)) of SOME ((() , s3274_0)) => (case ((string_drop s3273_0 s3274_0)) of s3275_0 => (case ((hex_bits_12_matches_prefix0 s3275_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s3276_0)) => let p0_ = (string_drop s3275_0 s3276_0) in if (((p0_ = ""))) then SOME (rd, rs1, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3250_ : string -> maybe ((mword ty5 * mword ty21))*) val _ = Define ` ((s3250_:string ->((5)words$word#(21)words$word)option) s3251_0= (let s3252_0 = s3251_0 in if ((string_startswith s3252_0 "jal")) then (case ((string_drop s3252_0 ((string_length "jal")))) of s3253_0 => (case ((spc_matches_prefix0 s3253_0)) of SOME ((() , s3254_0)) => (case ((string_drop s3253_0 s3254_0)) of s3255_0 => (case ((reg_name_matches_prefix s3255_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3256_0)) => (case ((string_drop s3255_0 s3256_0)) of s3257_0 => (case ((sep_matches_prefix s3257_0)) of SOME ((() , s3258_0)) => (case ((string_drop s3257_0 s3258_0)) of s3259_0 => (case ((hex_bits_21_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3259_0 : (( 21 words$word # ii)) option)) of SOME ((imm, s3260_0)) => let p0_ = (string_drop s3259_0 s3260_0) in if (((p0_ = ""))) then SOME (rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s3237_ : string -> maybe ((uop * mword ty5 * mword ty20))*) val _ = Define ` ((s3237_:string ->(uop#(5)words$word#(20)words$word)option) s3238_0= ((case s3238_0 of s3239_0 => (case ((utype_mnemonic_matches_prefix s3239_0)) of SOME ((op, s3240_0)) => (case ((string_drop s3239_0 s3240_0)) of s3241_0 => (case ((spc_matches_prefix0 s3241_0)) of SOME ((() , s3242_0)) => (case ((string_drop s3241_0 s3242_0)) of s3243_0 => (case ((reg_name_matches_prefix s3243_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s3244_0)) => (case ((string_drop s3243_0 s3244_0)) of s3245_0 => (case ((sep_matches_prefix s3245_0)) of SOME ((() , s3246_0)) => (case ((string_drop s3245_0 s3246_0)) of s3247_0 => (case ((hex_bits_20_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s3247_0 : (( 20 words$word # ii)) option)) of SOME ((imm, s3248_0)) => let p0_ = (string_drop s3247_0 s3248_0) in if (((p0_ = ""))) then SOME (op, rd, imm) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; val _ = Define ` ((assembly_backwards_matches:string -> bool) arg_= (let s3249_0 = arg_ in if ((case ((s3237_ s3249_0 : ((uop # 5 words$word # 20 words$word))option)) of SOME ((op, rd, imm)) => T | _ => F )) then (case (s3237_ s3249_0 : (( uop # 5 words$word # 20 words$word)) option) of (SOME ((op, rd, imm))) => T ) else if ((case ((s3250_ s3249_0 : (( 5 words$word # 21 words$word))option)) of SOME ((rd, imm)) => T | _ => F )) then (case (s3250_ s3249_0 : (( 5 words$word # 21 words$word)) option) of (SOME ((rd, imm))) => T ) else if ((case ((s3262_ s3249_0 : (( 5 words$word # 5 words$word # 12 words$word))option)) of SOME ((rd, rs1, imm)) => T | _ => F )) then (case (s3262_ s3249_0 : (( 5 words$word # 5 words$word # 12 words$word)) option) of (SOME ((rd, rs1, imm))) => T ) else if ((case ((s3278_ s3249_0 : ((bop # 5 words$word # 5 words$word # 13 words$word))option)) of SOME ((op, rs1, rs2, imm)) => T | _ => F )) then (case (s3278_ s3249_0 : (( bop # 5 words$word # 5 words$word # 13 words$word)) option) of (SOME ((op, rs1, rs2, imm))) => T ) else if ((case ((s3295_ s3249_0 : ((iop # 5 words$word # 5 words$word # 12 words$word))option)) of SOME ((op, rd, rs1, imm)) => T | _ => F )) then (case (s3295_ s3249_0 : (( iop # 5 words$word # 5 words$word # 12 words$word)) option) of (SOME ((op, rd, rs1, imm))) => T ) else if ((case ((s3312_ s3249_0 : ((sop # 5 words$word # 5 words$word # 6 words$word))option)) of SOME ((op, rd, rs1, shamt)) => T | _ => F )) then (case (s3312_ s3249_0 : (( sop # 5 words$word # 5 words$word # 6 words$word)) option) of (SOME ((op, rd, rs1, shamt))) => T ) else if ((case ((s3329_ s3249_0 : ((rop # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, rd, rs1, rs2)) => T | _ => F )) then (case (s3329_ s3249_0 : (( rop # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, rd, rs1, rs2))) => T ) else if ((case ((s3346_ s3249_0 : ((word_width # bool # bool # bool # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((size1, is_unsigned, aq, rl, rd, imm, rs1)) => T | _ => F )) then (case (s3346_ s3249_0 : (( word_width # bool # bool # bool # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((size1, is_unsigned, aq, rl, rd, imm, rs1))) => T ) else if ((case ((s3376_ s3249_0 : ((word_width # bool # bool # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((size1, aq, rl, rs2, imm, rs1)) => T | _ => F )) then (case (s3376_ s3249_0 : (( word_width # bool # bool # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((size1, aq, rl, rs2, imm, rs1))) => T ) else if ((case ((s3404_ s3249_0 : (( 5 words$word # 5 words$word # 12 words$word))option)) of SOME ((rd, rs1, imm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3404_ s3249_0 : (( 5 words$word # 5 words$word # 12 words$word)) option) of (SOME ((rd, rs1, imm))) => T ) else if ((case ((s3420_ s3249_0 : ((sop # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, rd, rs1, shamt)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3420_ s3249_0 : (( sop # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, rd, rs1, shamt))) => T ) else if ((case ((s3437_ s3249_0 : ((ropw # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, rd, rs1, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3437_ s3249_0 : (( ropw # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, rd, rs1, rs2))) => T ) else if ((case ((s3454_ s3249_0 : ((sopw # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, rd, rs1, shamt)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3454_ s3249_0 : (( sopw # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, rd, rs1, shamt))) => T ) else if ((case ((s3471_ s3249_0 : (( 4 words$word # 4 words$word))option)) of SOME ((pred, succ)) => T | _ => F )) then (case (s3471_ s3249_0 : (( 4 words$word # 4 words$word)) option) of (SOME ((pred, succ))) => T ) else if ((case ((s3483_ s3249_0 : (( 4 words$word # 4 words$word))option)) of SOME ((pred, succ)) => T | _ => F )) then (case (s3483_ s3249_0 : (( 4 words$word # 4 words$word)) option) of (SOME ((pred, succ))) => T ) else if (((s3249_0 = "fence.i"))) then T else if (((s3249_0 = "ecall"))) then T else if (((s3249_0 = "mret"))) then T else if (((s3249_0 = "sret"))) then T else if (((s3249_0 = "ebreak"))) then T else if (((s3249_0 = "wfi"))) then T else if ((case ((s3495_ s3249_0 : (( 5 words$word # 5 words$word))option)) of SOME ((rs1, rs2)) => T | _ => F )) then (case (s3495_ s3249_0 : (( 5 words$word # 5 words$word)) option) of (SOME ((rs1, rs2))) => T ) else if ((case ((s3507_ s3249_0 : ((word_width # bool # bool # 5 words$word # 5 words$word))option)) of SOME ((size1, aq, rl, rd, rs1)) => T | _ => F )) then (case (s3507_ s3249_0 : (( word_width # bool # bool # 5 words$word # 5 words$word)) option) of (SOME ((size1, aq, rl, rd, rs1))) => T ) else if ((case ((s3525_ s3249_0 : ((word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((size1, aq, rl, rd, rs1, rs2)) => T | _ => F )) then (case (s3525_ s3249_0 : (( word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((size1, aq, rl, rd, rs1, rs2))) => T ) else if ((case ((s3547_ s3249_0 : ((amoop # word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((op, width, aq, rl, rd, rs2, rs1)) => T | _ => F )) then (case (s3547_ s3249_0 : (( amoop # word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((op, width, aq, rl, rd, rs2, rs1))) => T ) else if (((s3249_0 = "c.nop"))) then T else if ((case ((s3573_ s3249_0 : (( 3 words$word # 8 words$word))option)) of SOME ((rdc, nzimm)) => (nzimm <> (0x00w : 8 words$word)) | _ => F )) then (case (s3573_ s3249_0 : (( 3 words$word # 8 words$word)) option) of (SOME ((rdc, nzimm))) => T ) else if ((case ((s3585_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rdc, rsc, uimm)) => T | _ => F )) then (case (s3585_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rdc, rsc, uimm))) => T ) else if ((case ((s3601_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rdc, rsc, uimm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3601_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rdc, rsc, uimm))) => T ) else if ((case ((s3617_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rsc1, rsc2, uimm)) => T | _ => F )) then (case (s3617_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rsc1, rsc2, uimm))) => T ) else if ((case ((s3633_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rsc1, rsc2, uimm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3633_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rsc1, rsc2, uimm))) => T ) else if ((case ((s3649_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rsd, nzi)) => ((((nzi <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))) | _ => F )) then (case (s3649_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rsd, nzi))) => T ) else if ((case ((s3661_ s3249_0 : ( 11 words$word)option)) of SOME (imm) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s3661_ s3249_0 : ( 11 words$word) option) of (SOME (imm)) => T ) else if ((case ((s3669_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rsd, imm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3669_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rsd, imm))) => T ) else if ((case ((s3681_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, imm)) => (rd <> zreg) | _ => F )) then (case (s3681_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, imm))) => T ) else if ((case ((s3693_ s3249_0 : ( 6 words$word)option)) of SOME (imm) => (imm <> (0b000000w : 6 words$word)) | _ => F )) then (case (s3693_ s3249_0 : ( 6 words$word) option) of (SOME (imm)) => T ) else if ((case ((s3701_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, imm)) => ((((rd <> zreg))) /\ ((((((rd <> sp))) /\ (((imm <> (0b000000w : 6 words$word)))))))) | _ => F )) then (case (s3701_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, imm))) => T ) else if ((case ((s3713_ s3249_0 : (( 3 words$word # 6 words$word))option)) of SOME ((rsd, shamt)) => (shamt <> (0b000000w : 6 words$word)) | _ => F )) then (case (s3713_ s3249_0 : (( 3 words$word # 6 words$word)) option) of (SOME ((rsd, shamt))) => T ) else if ((case ((s3725_ s3249_0 : (( 3 words$word # 6 words$word))option)) of SOME ((rsd, shamt)) => (shamt <> (0b000000w : 6 words$word)) | _ => F )) then (case (s3725_ s3249_0 : (( 3 words$word # 6 words$word)) option) of (SOME ((rsd, shamt))) => T ) else if ((case ((s3737_ s3249_0 : (( 3 words$word # 6 words$word))option)) of SOME ((rsd, imm)) => T | _ => F )) then (case (s3737_ s3249_0 : (( 3 words$word # 6 words$word)) option) of (SOME ((rsd, imm))) => T ) else if ((case ((s3749_ s3249_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => T | _ => F )) then (case (s3749_ s3249_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => T ) else if ((case ((s3761_ s3249_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => T | _ => F )) then (case (s3761_ s3249_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => T ) else if ((case ((s3773_ s3249_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => T | _ => F )) then (case (s3773_ s3249_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => T ) else if ((case ((s3785_ s3249_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => T | _ => F )) then (case (s3785_ s3249_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => T ) else if ((case ((s3797_ s3249_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3797_ s3249_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => T ) else if ((case ((s3809_ s3249_0 : (( 3 words$word # 3 words$word))option)) of SOME ((rsd, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3809_ s3249_0 : (( 3 words$word # 3 words$word)) option) of (SOME ((rsd, rs2))) => T ) else if ((case ((s3821_ s3249_0 : ( 11 words$word)option)) of SOME (imm) => T | _ => F )) then (case (s3821_ s3249_0 : ( 11 words$word) option) of (SOME (imm)) => T ) else if ((case ((s3829_ s3249_0 : (( 3 words$word # 8 words$word))option)) of SOME ((rs, imm)) => T | _ => F )) then (case (s3829_ s3249_0 : (( 3 words$word # 8 words$word)) option) of (SOME ((rs, imm))) => T ) else if ((case ((s3841_ s3249_0 : (( 3 words$word # 8 words$word))option)) of SOME ((rs, imm)) => T | _ => F )) then (case (s3841_ s3249_0 : (( 3 words$word # 8 words$word)) option) of (SOME ((rs, imm))) => T ) else if ((case ((s3853_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rsd, shamt)) => ((((shamt <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))) | _ => F )) then (case (s3853_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rsd, shamt))) => T ) else if ((case ((s3865_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => (rd <> zreg) | _ => F )) then (case (s3865_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => T ) else if ((case ((s3877_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => ((((rd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s3877_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => T ) else if ((case ((s3889_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => T | _ => F )) then (case (s3889_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => T ) else if ((case ((s3901_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rs2, uimm)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s3901_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rs2, uimm))) => T ) else if ((case ((s3913_ s3249_0 : ( 5 words$word)option)) of SOME (rs1) => (rs1 <> zreg) | _ => F )) then (case (s3913_ s3249_0 : ( 5 words$word) option) of (SOME (rs1)) => T ) else if ((case ((s3921_ s3249_0 : ( 5 words$word)option)) of SOME (rs1) => (rs1 <> zreg) | _ => F )) then (case (s3921_ s3249_0 : ( 5 words$word) option) of (SOME (rs1)) => T ) else if ((case ((s3929_ s3249_0 : (( 5 words$word # 5 words$word))option)) of SOME ((rd, rs2)) => ((((rd <> zreg))) /\ (((rs2 <> zreg)))) | _ => F )) then (case (s3929_ s3249_0 : (( 5 words$word # 5 words$word)) option) of (SOME ((rd, rs2))) => T ) else if (((s3249_0 = "c.ebreak"))) then T else if ((case ((s3941_ s3249_0 : (( 5 words$word # 5 words$word))option)) of SOME ((rsd, rs2)) => ((((rsd <> zreg))) /\ (((rs2 <> zreg)))) | _ => F )) then (case (s3941_ s3249_0 : (( 5 words$word # 5 words$word)) option) of (SOME ((rsd, rs2))) => T ) else if ((case ((s3953_ s3249_0 : ((bool # bool # bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((high, signed1, signed2, rd, rs1, rs2)) => T | _ => F )) then (case (s3953_ s3249_0 : (( bool # bool # bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((high, signed1, signed2, rd, rs1, rs2))) => T ) else if ((case ((s3970_ s3249_0 : ((bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((s, rd, rs1, rs2)) => T | _ => F )) then (case (s3970_ s3249_0 : (( bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((s, rd, rs1, rs2))) => T ) else if ((case ((s3988_ s3249_0 : ((bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((s, rd, rs1, rs2)) => T | _ => F )) then (case (s3988_ s3249_0 : (( bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((s, rd, rs1, rs2))) => T ) else if ((case ((s4006_ s3249_0 : (( 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((rd, rs1, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s4006_ s3249_0 : (( 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((rd, rs1, rs2))) => T ) else if ((case ((s4022_ s3249_0 : ((bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((s, rd, rs1, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s4022_ s3249_0 : (( bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((s, rd, rs1, rs2))) => T ) else if ((case ((s4041_ s3249_0 : ((bool # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((s, rd, rs1, rs2)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s4041_ s3249_0 : (( bool # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((s, rd, rs1, rs2))) => T ) else if ((case ((s4060_ s3249_0 : ((csrop # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((op, rd, csr, rs1)) => T | _ => F )) then (case (s4060_ s3249_0 : (( csrop # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((op, rd, csr, rs1))) => T ) else if ((case ((s4078_ s3249_0 : ((csrop # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((op, rd, csr, rs1)) => T | _ => F )) then (case (s4078_ s3249_0 : (( csrop # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((op, rd, csr, rs1))) => T ) else if (((s3249_0 = "uret"))) then T else if ((case ((s4095_ s3249_0 : ( 6 words$word)option)) of SOME (imm) => T | _ => F )) then (case (s4095_ s3249_0 : ( 6 words$word) option) of (SOME (imm)) => T ) else if ((case ((s4101_ s3249_0 : ( 5 words$word)option)) of SOME (rsd) => (rsd <> zreg) | _ => F )) then (case (s4101_ s3249_0 : ( 5 words$word) option) of (SOME (rsd)) => T ) else if ((case ((s4107_ s3249_0 : ( 6 words$word)option)) of SOME (imm) => T | _ => F )) then (case (s4107_ s3249_0 : ( 6 words$word) option) of (SOME (imm)) => T ) else if ((case ((s4113_ s3249_0 : ( 6 words$word)option)) of SOME (imm) => (imm <> (0b000000w : 6 words$word)) | _ => F )) then (case (s4113_ s3249_0 : ( 6 words$word) option) of (SOME (imm)) => T ) else if ((case ((s4119_ s3249_0 : ( 5 words$word)option)) of SOME (rs2) => (rs2 <> zreg) | _ => F )) then (case (s4119_ s3249_0 : ( 5 words$word) option) of (SOME (rs2)) => T ) else if ((case ((s4125_ s3249_0 : ( 5 words$word)option)) of SOME (rs2) => (rs2 <> zreg) | _ => F )) then (case (s4125_ s3249_0 : ( 5 words$word) option) of (SOME (rs2)) => T ) else if ((case ((s4131_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rsd, shamt)) => ((((shamt = (0b000000w : 6 words$word)))) \/ (((rsd = zreg)))) | _ => F )) then (case (s4131_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rsd, shamt))) => T ) else if ((case ((s4140_ s3249_0 : ( 3 words$word)option)) of SOME (rsd) => T | _ => F )) then (case (s4140_ s3249_0 : ( 3 words$word) option) of (SOME (rsd)) => T ) else if ((case ((s4146_ s3249_0 : ( 3 words$word)option)) of SOME (rsd) => T | _ => F )) then (case (s4146_ s3249_0 : ( 3 words$word) option) of (SOME (rsd)) => T ) else if ((case ((s4152_ s3249_0 : (( 4 words$word # 4 words$word # 5 words$word # 5 words$word # 4 words$word))option)) of SOME ((pred, succ, rs, rd, fm)) => (((((((fm <> (0x0w : 4 words$word)))) /\ (((fm <> (0x8w : 4 words$word))))))) \/ ((((((rs <> (0b00000w : 5 words$word)))) \/ (((rd <> (0b00000w : 5 words$word)))))))) | _ => F )) then (case (s4152_ s3249_0 : (( 4 words$word # 4 words$word # 5 words$word # 5 words$word # 4 words$word)) option) of (SOME ((pred, succ, rs, rd, fm))) => T ) else if ((case ((s4170_ s3249_0 : (( 5 words$word # 5 words$word # 12 words$word))option)) of SOME ((rd, rs, imm)) => ((((imm <> (0x000w : 12 words$word)))) \/ ((((((rs <> zreg))) \/ (((rd <> zreg))))))) | _ => F )) then (case (s4170_ s3249_0 : (( 5 words$word # 5 words$word # 12 words$word)) option) of (SOME ((rd, rs, imm))) => T ) else if ((case ((s4182_ s3249_0 : ((word_width # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((width, rd, imm, rs1)) => T | _ => F )) then (case (s4182_ s3249_0 : (( word_width # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((width, rd, imm, rs1))) => T ) else if ((case ((s4206_ s3249_0 : ((word_width # 5 words$word # 12 words$word # 5 words$word))option)) of SOME ((width, rs2, imm, rs1)) => T | _ => F )) then (case (s4206_ s3249_0 : (( word_width # 5 words$word # 12 words$word # 5 words$word)) option) of (SOME ((width, rs2, imm, rs1))) => T ) else if ((case ((s4230_ s3249_0 : ((f_madd_op_S # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((op, rd, rs1, rs2, rs3, rm)) => T | _ => F )) then (case (s4230_ s3249_0 : (( f_madd_op_S # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((op, rd, rs1, rs2, rs3, rm))) => T ) else if ((case ((s4255_ s3249_0 : ((f_bin_rm_op_S # 5 words$word # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((op, rd, rs1, rs2, rm)) => T | _ => F )) then (case (s4255_ s3249_0 : (( f_bin_rm_op_S # 5 words$word # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((op, rd, rs1, rs2, rm))) => T ) else if ((case ((s4276_ s3249_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FSQRT_S, rd, rs1, rm)) => T | _ => F )) then (case (s4276_ s3249_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FSQRT_S, rd, rs1, rm))) => T ) else if ((case ((s4293_ s3249_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_W_S, rd, rs1, rm)) => T | _ => F )) then (case (s4293_ s3249_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_W_S, rd, rs1, rm))) => T ) else if ((case ((s4310_ s3249_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_WU_S, rd, rs1, rm)) => T | _ => F )) then (case (s4310_ s3249_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_WU_S, rd, rs1, rm))) => T ) else if ((case ((s4327_ s3249_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_W, rd, rs1, rm)) => T | _ => F )) then (case (s4327_ s3249_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_W, rd, rs1, rm))) => T ) else if ((case ((s4344_ s3249_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_WU, rd, rs1, rm)) => T | _ => F )) then (case (s4344_ s3249_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_WU, rd, rs1, rm))) => T ) else if ((case ((s4361_ s3249_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_L_S, rd, rs1, rm)) => T | _ => F )) then (case (s4361_ s3249_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_L_S, rd, rs1, rm))) => T ) else if ((case ((s4378_ s3249_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_LU_S, rd, rs1, rm)) => T | _ => F )) then (case (s4378_ s3249_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_LU_S, rd, rs1, rm))) => T ) else if ((case ((s4395_ s3249_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_L, rd, rs1, rm)) => T | _ => F )) then (case (s4395_ s3249_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_L, rd, rs1, rm))) => T ) else if ((case ((s4412_ s3249_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_LU, rd, rs1, rm)) => T | _ => F )) then (case (s4412_ s3249_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_LU, rd, rs1, rm))) => T ) else if ((case ((s4429_ s3249_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJ_S, rd, rs1, rs2)) => T | _ => F )) then (case (s4429_ s3249_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJ_S, rd, rs1, rs2))) => T ) else if ((case ((s4446_ s3249_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJN_S, rd, rs1, rs2)) => T | _ => F )) then (case (s4446_ s3249_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJN_S, rd, rs1, rs2))) => T ) else if ((case ((s4463_ s3249_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJX_S, rd, rs1, rs2)) => T | _ => F )) then (case (s4463_ s3249_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJX_S, rd, rs1, rs2))) => T ) else if ((case ((s4480_ s3249_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FMIN_S, rd, rs1, rs2)) => T | _ => F )) then (case (s4480_ s3249_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FMIN_S, rd, rs1, rs2))) => T ) else if ((case ((s4497_ s3249_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FMAX_S, rd, rs1, rs2)) => T | _ => F )) then (case (s4497_ s3249_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FMAX_S, rd, rs1, rs2))) => T ) else if ((case ((s4514_ s3249_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FEQ_S, rd, rs1, rs2)) => T | _ => F )) then (case (s4514_ s3249_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FEQ_S, rd, rs1, rs2))) => T ) else if ((case ((s4531_ s3249_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FLT_S, rd, rs1, rs2)) => T | _ => F )) then (case (s4531_ s3249_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FLT_S, rd, rs1, rs2))) => T ) else if ((case ((s4548_ s3249_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FLE_S, rd, rs1, rs2)) => T | _ => F )) then (case (s4548_ s3249_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FLE_S, rd, rs1, rs2))) => T ) else if ((case ((s4565_ s3249_0 : ((f_un_op_S # 5 words$word # 5 words$word))option)) of SOME ((FMV_X_W, rd, rs1)) => T | _ => F )) then (case (s4565_ s3249_0 : (( f_un_op_S # 5 words$word # 5 words$word)) option) of (SOME ((FMV_X_W, rd, rs1))) => T ) else if ((case ((s4578_ s3249_0 : ((f_un_op_S # 5 words$word # 5 words$word))option)) of SOME ((FMV_W_X, rd, rs1)) => T | _ => F )) then (case (s4578_ s3249_0 : (( f_un_op_S # 5 words$word # 5 words$word)) option) of (SOME ((FMV_W_X, rd, rs1))) => T ) else if ((case ((s4591_ s3249_0 : ((f_un_op_S # 5 words$word # 5 words$word))option)) of SOME ((FCLASS_S, rd, rs1)) => T | _ => F )) then (case (s4591_ s3249_0 : (( f_un_op_S # 5 words$word # 5 words$word)) option) of (SOME ((FCLASS_S, rd, rs1))) => T ) else if ((case ((s4604_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, imm)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s4604_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, imm))) => T ) else if ((case ((s4616_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s4616_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => T ) else if ((case ((s4628_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rdc, rsc, uimm)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s4628_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rdc, rsc, uimm))) => T ) else if ((case ((s4644_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rsc1, rsc2, uimm)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s4644_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rsc1, rsc2, uimm))) => T ) else if ((case ((s4660_ s3249_0 : ((f_madd_op_D # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((op, rd, rs1, rs2, rs3, rm)) => T | _ => F )) then (case (s4660_ s3249_0 : (( f_madd_op_D # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((op, rd, rs1, rs2, rs3, rm))) => T ) else if ((case ((s4685_ s3249_0 : ((f_bin_rm_op_D # 5 words$word # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((op, rd, rs1, rs2, rm)) => T | _ => F )) then (case (s4685_ s3249_0 : (( f_bin_rm_op_D # 5 words$word # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((op, rd, rs1, rs2, rm))) => T ) else if ((case ((s4706_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FSQRT_D, rd, rs1, rm)) => T | _ => F )) then (case (s4706_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FSQRT_D, rd, rs1, rm))) => T ) else if ((case ((s4723_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_W_D, rd, rs1, rm)) => T | _ => F )) then (case (s4723_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_W_D, rd, rs1, rm))) => T ) else if ((case ((s4740_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_WU_D, rd, rs1, rm)) => T | _ => F )) then (case (s4740_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_WU_D, rd, rs1, rm))) => T ) else if ((case ((s4757_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_W, rd, rs1, rm)) => T | _ => F )) then (case (s4757_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_W, rd, rs1, rm))) => T ) else if ((case ((s4774_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_WU, rd, rs1, rm)) => T | _ => F )) then (case (s4774_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_WU, rd, rs1, rm))) => T ) else if ((case ((s4791_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_L_D, rd, rs1, rm)) => T | _ => F )) then (case (s4791_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_L_D, rd, rs1, rm))) => T ) else if ((case ((s4808_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_LU_D, rd, rs1, rm)) => T | _ => F )) then (case (s4808_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_LU_D, rd, rs1, rm))) => T ) else if ((case ((s4825_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_L, rd, rs1, rm)) => T | _ => F )) then (case (s4825_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_L, rd, rs1, rm))) => T ) else if ((case ((s4842_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_LU, rd, rs1, rm)) => T | _ => F )) then (case (s4842_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_LU, rd, rs1, rm))) => T ) else if ((case ((s4859_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_S_D, rd, rs1, rm)) => T | _ => F )) then (case (s4859_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_S_D, rd, rs1, rm))) => T ) else if ((case ((s4876_ s3249_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode))option)) of SOME ((FCVT_D_S, rd, rs1, rm)) => T | _ => F )) then (case (s4876_ s3249_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode)) option) of (SOME ((FCVT_D_S, rd, rs1, rm))) => T ) else if ((case ((s4893_ s3249_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJ_D, rd, rs1, rs2)) => T | _ => F )) then (case (s4893_ s3249_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJ_D, rd, rs1, rs2))) => T ) else if ((case ((s4910_ s3249_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJN_D, rd, rs1, rs2)) => T | _ => F )) then (case (s4910_ s3249_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJN_D, rd, rs1, rs2))) => T ) else if ((case ((s4927_ s3249_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FSGNJX_D, rd, rs1, rs2)) => T | _ => F )) then (case (s4927_ s3249_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FSGNJX_D, rd, rs1, rs2))) => T ) else if ((case ((s4944_ s3249_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FMIN_D, rd, rs1, rs2)) => T | _ => F )) then (case (s4944_ s3249_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FMIN_D, rd, rs1, rs2))) => T ) else if ((case ((s4961_ s3249_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FMAX_D, rd, rs1, rs2)) => T | _ => F )) then (case (s4961_ s3249_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FMAX_D, rd, rs1, rs2))) => T ) else if ((case ((s4978_ s3249_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FEQ_D, rd, rs1, rs2)) => T | _ => F )) then (case (s4978_ s3249_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FEQ_D, rd, rs1, rs2))) => T ) else if ((case ((s4995_ s3249_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FLT_D, rd, rs1, rs2)) => T | _ => F )) then (case (s4995_ s3249_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FLT_D, rd, rs1, rs2))) => T ) else if ((case ((s5012_ s3249_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word))option)) of SOME ((FLE_D, rd, rs1, rs2)) => T | _ => F )) then (case (s5012_ s3249_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word)) option) of (SOME ((FLE_D, rd, rs1, rs2))) => T ) else if ((case ((s5029_ s3249_0 : ((f_un_op_D # 5 words$word # 5 words$word))option)) of SOME ((FMV_X_D, rd, rs1)) => T | _ => F )) then (case (s5029_ s3249_0 : (( f_un_op_D # 5 words$word # 5 words$word)) option) of (SOME ((FMV_X_D, rd, rs1))) => T ) else if ((case ((s5042_ s3249_0 : ((f_un_op_D # 5 words$word # 5 words$word))option)) of SOME ((FMV_D_X, rd, rs1)) => T | _ => F )) then (case (s5042_ s3249_0 : (( f_un_op_D # 5 words$word # 5 words$word)) option) of (SOME ((FMV_D_X, rd, rs1))) => T ) else if ((case ((s5055_ s3249_0 : ((f_un_op_D # 5 words$word # 5 words$word))option)) of SOME ((FCLASS_D, rd, rs1)) => T | _ => F )) then (case (s5055_ s3249_0 : (( f_un_op_D # 5 words$word # 5 words$word)) option) of (SOME ((FCLASS_D, rd, rs1))) => T ) else if ((case ((s5068_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rd, uimm)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s5068_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rd, uimm))) => T ) else if ((case ((s5080_ s3249_0 : (( 5 words$word # 6 words$word))option)) of SOME ((rs2, uimm)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s5080_ s3249_0 : (( 5 words$word # 6 words$word)) option) of (SOME ((rs2, uimm))) => T ) else if ((case ((s5092_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rdc, rsc, uimm)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s5092_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rdc, rsc, uimm))) => T ) else if ((case ((s5108_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word))option)) of SOME ((rsc1, rsc2, uimm)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s5108_ s3249_0 : (( 3 words$word # 3 words$word # 5 words$word)) option) of (SOME ((rsc1, rsc2, uimm))) => T ) else if ((case ((s5124_ s3249_0 : ( 32 words$word)option)) of SOME (s) => T | _ => F )) then (case (s5124_ s3249_0 : ( 32 words$word) option) of (SOME (s)) => T ) else if ((case ((s5132_ s3249_0 : ( 16 words$word)option)) of SOME (s) => T | _ => F )) then (case (s5132_ s3249_0 : ( 16 words$word) option) of (SOME (s)) => T ) else F))`; (*val _s7071_ : string -> maybe ((mword ty16 * string))*) val _ = Define ` ((s7071_:string ->((16)words$word#string)option) s7072_0= (let s7073_0 = s7072_0 in if ((string_startswith s7073_0 "c.illegal")) then (case ((string_drop s7073_0 ((string_length "c.illegal")))) of s7074_0 => (case ((spc_matches_prefix0 s7074_0)) of SOME ((() , s7075_0)) => (case ((string_drop s7074_0 s7075_0)) of s7076_0 => (case ((hex_bits_16_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s7076_0 : (( 16 words$word # ii)) option)) of SOME ((s, s7077_0)) => (case ((string_drop s7076_0 s7077_0)) of s_ => SOME (s, s_) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s7063_ : string -> maybe ((mword ty32 * string))*) val _ = Define ` ((s7063_:string ->((32)words$word#string)option) s7064_0= (let s7065_0 = s7064_0 in if ((string_startswith s7065_0 "illegal")) then (case ((string_drop s7065_0 ((string_length "illegal")))) of s7066_0 => (case ((spc_matches_prefix0 s7066_0)) of SOME ((() , s7067_0)) => (case ((string_drop s7066_0 s7067_0)) of s7068_0 => (case ((hex_bits_32_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s7068_0 : (( 32 words$word # ii)) option)) of SOME ((s, s7069_0)) => (case ((string_drop s7068_0 s7069_0)) of s_ => SOME (s, s_) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s7047_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5 * string))*) val _ = Define ` ((s7047_:string ->((3)words$word#(3)words$word#(5)words$word#string)option) s7048_0= (let s7049_0 = s7048_0 in if ((string_startswith s7049_0 "c.fsd")) then (case ((string_drop s7049_0 ((string_length "c.fsd")))) of s7050_0 => (case ((spc_matches_prefix0 s7050_0)) of SOME ((() , s7051_0)) => (case ((string_drop s7050_0 s7051_0)) of s7052_0 => (case ((creg_name_matches_prefix s7052_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s7053_0)) => (case ((string_drop s7052_0 s7053_0)) of s7054_0 => (case ((sep_matches_prefix s7054_0)) of SOME ((() , s7055_0)) => (case ((string_drop s7054_0 s7055_0)) of s7056_0 => (case ((creg_name_matches_prefix s7056_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s7057_0)) => (case ((string_drop s7056_0 s7057_0)) of s7058_0 => (case ((sep_matches_prefix s7058_0)) of SOME ((() , s7059_0)) => (case ((string_drop s7058_0 s7059_0)) of s7060_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s7060_0 : (( 8 words$word # ii)) option)) of SOME ((v__1482, s7061_0)) => if (((((subrange_vec_dec v__1482 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1482 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1482 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in (case ((string_drop s7060_0 s7061_0)) of s_ => SOME (rsc1, rsc2, uimm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s7031_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5 * string))*) val _ = Define ` ((s7031_:string ->((3)words$word#(3)words$word#(5)words$word#string)option) s7032_0= (let s7033_0 = s7032_0 in if ((string_startswith s7033_0 "c.fld")) then (case ((string_drop s7033_0 ((string_length "c.fld")))) of s7034_0 => (case ((spc_matches_prefix0 s7034_0)) of SOME ((() , s7035_0)) => (case ((string_drop s7034_0 s7035_0)) of s7036_0 => (case ((creg_name_matches_prefix s7036_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s7037_0)) => (case ((string_drop s7036_0 s7037_0)) of s7038_0 => (case ((sep_matches_prefix s7038_0)) of SOME ((() , s7039_0)) => (case ((string_drop s7038_0 s7039_0)) of s7040_0 => (case ((creg_name_matches_prefix s7040_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s7041_0)) => (case ((string_drop s7040_0 s7041_0)) of s7042_0 => (case ((sep_matches_prefix s7042_0)) of SOME ((() , s7043_0)) => (case ((string_drop s7042_0 s7043_0)) of s7044_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s7044_0 : (( 8 words$word # ii)) option)) of SOME ((v__1484, s7045_0)) => if (((((subrange_vec_dec v__1484 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1484 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1484 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in (case ((string_drop s7044_0 s7045_0)) of s_ => SOME (rdc, rsc, uimm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s7019_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s7019_:string ->((5)words$word#(6)words$word#string)option) s7020_0= (let s7021_0 = s7020_0 in if ((string_startswith s7021_0 "c.fsdsp")) then (case ((string_drop s7021_0 ((string_length "c.fsdsp")))) of s7022_0 => (case ((spc_matches_prefix0 s7022_0)) of SOME ((() , s7023_0)) => (case ((string_drop s7022_0 s7023_0)) of s7024_0 => (case ((reg_name_matches_prefix s7024_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s7025_0)) => (case ((string_drop s7024_0 s7025_0)) of s7026_0 => (case ((sep_matches_prefix s7026_0)) of SOME ((() , s7027_0)) => (case ((string_drop s7026_0 s7027_0)) of s7028_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s7028_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s7029_0)) => (case ((string_drop s7028_0 s7029_0)) of s_ => SOME (rs2, uimm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s7007_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s7007_:string ->((5)words$word#(6)words$word#string)option) s7008_0= (let s7009_0 = s7008_0 in if ((string_startswith s7009_0 "c.fldsp")) then (case ((string_drop s7009_0 ((string_length "c.fldsp")))) of s7010_0 => (case ((spc_matches_prefix0 s7010_0)) of SOME ((() , s7011_0)) => (case ((string_drop s7010_0 s7011_0)) of s7012_0 => (case ((reg_name_matches_prefix s7012_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s7013_0)) => (case ((string_drop s7012_0 s7013_0)) of s7014_0 => (case ((sep_matches_prefix s7014_0)) of SOME ((() , s7015_0)) => (case ((string_drop s7014_0 s7015_0)) of s7016_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s7016_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s7017_0)) => (case ((string_drop s7016_0 s7017_0)) of s_ => SOME (rd, uimm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s6994_ : string -> maybe ((f_un_op_D * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6994_:string ->(f_un_op_D#(5)words$word#(5)words$word#string)option) s6995_0= ((case s6995_0 of s6996_0 => (case ((f_un_type_mnemonic_D_matches_prefix s6996_0)) of SOME ((FCLASS_D, s6997_0)) => (case ((string_drop s6996_0 s6997_0)) of s6998_0 => (case ((spc_matches_prefix0 s6998_0)) of SOME ((() , s6999_0)) => (case ((string_drop s6998_0 s6999_0)) of s7000_0 => (case ((reg_name_matches_prefix s7000_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s7001_0)) => (case ((string_drop s7000_0 s7001_0)) of s7002_0 => (case ((sep_matches_prefix s7002_0)) of SOME ((() , s7003_0)) => (case ((string_drop s7002_0 s7003_0)) of s7004_0 => (case ((freg_name_matches_prefix s7004_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s7005_0)) => (case ((string_drop s7004_0 s7005_0)) of s_ => SOME (FCLASS_D, rd, rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6981_ : string -> maybe ((f_un_op_D * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6981_:string ->(f_un_op_D#(5)words$word#(5)words$word#string)option) s6982_0= ((case s6982_0 of s6983_0 => (case ((f_un_type_mnemonic_D_matches_prefix s6983_0)) of SOME ((FMV_D_X, s6984_0)) => (case ((string_drop s6983_0 s6984_0)) of s6985_0 => (case ((spc_matches_prefix0 s6985_0)) of SOME ((() , s6986_0)) => (case ((string_drop s6985_0 s6986_0)) of s6987_0 => (case ((freg_name_matches_prefix s6987_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6988_0)) => (case ((string_drop s6987_0 s6988_0)) of s6989_0 => (case ((sep_matches_prefix s6989_0)) of SOME ((() , s6990_0)) => (case ((string_drop s6989_0 s6990_0)) of s6991_0 => (case ((reg_name_matches_prefix s6991_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6992_0)) => (case ((string_drop s6991_0 s6992_0)) of s_ => SOME (FMV_D_X, rd, rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6968_ : string -> maybe ((f_un_op_D * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6968_:string ->(f_un_op_D#(5)words$word#(5)words$word#string)option) s6969_0= ((case s6969_0 of s6970_0 => (case ((f_un_type_mnemonic_D_matches_prefix s6970_0)) of SOME ((FMV_X_D, s6971_0)) => (case ((string_drop s6970_0 s6971_0)) of s6972_0 => (case ((spc_matches_prefix0 s6972_0)) of SOME ((() , s6973_0)) => (case ((string_drop s6972_0 s6973_0)) of s6974_0 => (case ((reg_name_matches_prefix s6974_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6975_0)) => (case ((string_drop s6974_0 s6975_0)) of s6976_0 => (case ((sep_matches_prefix s6976_0)) of SOME ((() , s6977_0)) => (case ((string_drop s6976_0 s6977_0)) of s6978_0 => (case ((freg_name_matches_prefix s6978_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6979_0)) => (case ((string_drop s6978_0 s6979_0)) of s_ => SOME (FMV_X_D, rd, rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6951_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6951_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word#string)option) s6952_0= ((case s6952_0 of s6953_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s6953_0)) of SOME ((FLE_D, s6954_0)) => (case ((string_drop s6953_0 s6954_0)) of s6955_0 => (case ((spc_matches_prefix0 s6955_0)) of SOME ((() , s6956_0)) => (case ((string_drop s6955_0 s6956_0)) of s6957_0 => (case ((reg_name_matches_prefix s6957_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6958_0)) => (case ((string_drop s6957_0 s6958_0)) of s6959_0 => (case ((sep_matches_prefix s6959_0)) of SOME ((() , s6960_0)) => (case ((string_drop s6959_0 s6960_0)) of s6961_0 => (case ((freg_name_matches_prefix s6961_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6962_0)) => (case ((string_drop s6961_0 s6962_0)) of s6963_0 => (case ((sep_matches_prefix s6963_0)) of SOME ((() , s6964_0)) => (case ((string_drop s6963_0 s6964_0)) of s6965_0 => (case ((freg_name_matches_prefix s6965_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6966_0)) => (case ((string_drop s6965_0 s6966_0)) of s_ => SOME (FLE_D, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6934_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6934_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word#string)option) s6935_0= ((case s6935_0 of s6936_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s6936_0)) of SOME ((FLT_D, s6937_0)) => (case ((string_drop s6936_0 s6937_0)) of s6938_0 => (case ((spc_matches_prefix0 s6938_0)) of SOME ((() , s6939_0)) => (case ((string_drop s6938_0 s6939_0)) of s6940_0 => (case ((reg_name_matches_prefix s6940_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6941_0)) => (case ((string_drop s6940_0 s6941_0)) of s6942_0 => (case ((sep_matches_prefix s6942_0)) of SOME ((() , s6943_0)) => (case ((string_drop s6942_0 s6943_0)) of s6944_0 => (case ((freg_name_matches_prefix s6944_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6945_0)) => (case ((string_drop s6944_0 s6945_0)) of s6946_0 => (case ((sep_matches_prefix s6946_0)) of SOME ((() , s6947_0)) => (case ((string_drop s6946_0 s6947_0)) of s6948_0 => (case ((freg_name_matches_prefix s6948_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6949_0)) => (case ((string_drop s6948_0 s6949_0)) of s_ => SOME (FLT_D, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6917_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6917_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word#string)option) s6918_0= ((case s6918_0 of s6919_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s6919_0)) of SOME ((FEQ_D, s6920_0)) => (case ((string_drop s6919_0 s6920_0)) of s6921_0 => (case ((spc_matches_prefix0 s6921_0)) of SOME ((() , s6922_0)) => (case ((string_drop s6921_0 s6922_0)) of s6923_0 => (case ((reg_name_matches_prefix s6923_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6924_0)) => (case ((string_drop s6923_0 s6924_0)) of s6925_0 => (case ((sep_matches_prefix s6925_0)) of SOME ((() , s6926_0)) => (case ((string_drop s6925_0 s6926_0)) of s6927_0 => (case ((freg_name_matches_prefix s6927_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6928_0)) => (case ((string_drop s6927_0 s6928_0)) of s6929_0 => (case ((sep_matches_prefix s6929_0)) of SOME ((() , s6930_0)) => (case ((string_drop s6929_0 s6930_0)) of s6931_0 => (case ((freg_name_matches_prefix s6931_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6932_0)) => (case ((string_drop s6931_0 s6932_0)) of s_ => SOME (FEQ_D, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6900_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6900_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word#string)option) s6901_0= ((case s6901_0 of s6902_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s6902_0)) of SOME ((FMAX_D, s6903_0)) => (case ((string_drop s6902_0 s6903_0)) of s6904_0 => (case ((spc_matches_prefix0 s6904_0)) of SOME ((() , s6905_0)) => (case ((string_drop s6904_0 s6905_0)) of s6906_0 => (case ((freg_name_matches_prefix s6906_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6907_0)) => (case ((string_drop s6906_0 s6907_0)) of s6908_0 => (case ((sep_matches_prefix s6908_0)) of SOME ((() , s6909_0)) => (case ((string_drop s6908_0 s6909_0)) of s6910_0 => (case ((freg_name_matches_prefix s6910_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6911_0)) => (case ((string_drop s6910_0 s6911_0)) of s6912_0 => (case ((sep_matches_prefix s6912_0)) of SOME ((() , s6913_0)) => (case ((string_drop s6912_0 s6913_0)) of s6914_0 => (case ((freg_name_matches_prefix s6914_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6915_0)) => (case ((string_drop s6914_0 s6915_0)) of s_ => SOME (FMAX_D, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6883_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6883_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word#string)option) s6884_0= ((case s6884_0 of s6885_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s6885_0)) of SOME ((FMIN_D, s6886_0)) => (case ((string_drop s6885_0 s6886_0)) of s6887_0 => (case ((spc_matches_prefix0 s6887_0)) of SOME ((() , s6888_0)) => (case ((string_drop s6887_0 s6888_0)) of s6889_0 => (case ((freg_name_matches_prefix s6889_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6890_0)) => (case ((string_drop s6889_0 s6890_0)) of s6891_0 => (case ((sep_matches_prefix s6891_0)) of SOME ((() , s6892_0)) => (case ((string_drop s6891_0 s6892_0)) of s6893_0 => (case ((freg_name_matches_prefix s6893_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6894_0)) => (case ((string_drop s6893_0 s6894_0)) of s6895_0 => (case ((sep_matches_prefix s6895_0)) of SOME ((() , s6896_0)) => (case ((string_drop s6895_0 s6896_0)) of s6897_0 => (case ((freg_name_matches_prefix s6897_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6898_0)) => (case ((string_drop s6897_0 s6898_0)) of s_ => SOME (FMIN_D, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6866_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6866_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word#string)option) s6867_0= ((case s6867_0 of s6868_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s6868_0)) of SOME ((FSGNJX_D, s6869_0)) => (case ((string_drop s6868_0 s6869_0)) of s6870_0 => (case ((spc_matches_prefix0 s6870_0)) of SOME ((() , s6871_0)) => (case ((string_drop s6870_0 s6871_0)) of s6872_0 => (case ((freg_name_matches_prefix s6872_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6873_0)) => (case ((string_drop s6872_0 s6873_0)) of s6874_0 => (case ((sep_matches_prefix s6874_0)) of SOME ((() , s6875_0)) => (case ((string_drop s6874_0 s6875_0)) of s6876_0 => (case ((freg_name_matches_prefix s6876_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6877_0)) => (case ((string_drop s6876_0 s6877_0)) of s6878_0 => (case ((sep_matches_prefix s6878_0)) of SOME ((() , s6879_0)) => (case ((string_drop s6878_0 s6879_0)) of s6880_0 => (case ((freg_name_matches_prefix s6880_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6881_0)) => (case ((string_drop s6880_0 s6881_0)) of s_ => SOME (FSGNJX_D, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6849_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6849_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word#string)option) s6850_0= ((case s6850_0 of s6851_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s6851_0)) of SOME ((FSGNJN_D, s6852_0)) => (case ((string_drop s6851_0 s6852_0)) of s6853_0 => (case ((spc_matches_prefix0 s6853_0)) of SOME ((() , s6854_0)) => (case ((string_drop s6853_0 s6854_0)) of s6855_0 => (case ((freg_name_matches_prefix s6855_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6856_0)) => (case ((string_drop s6855_0 s6856_0)) of s6857_0 => (case ((sep_matches_prefix s6857_0)) of SOME ((() , s6858_0)) => (case ((string_drop s6857_0 s6858_0)) of s6859_0 => (case ((freg_name_matches_prefix s6859_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6860_0)) => (case ((string_drop s6859_0 s6860_0)) of s6861_0 => (case ((sep_matches_prefix s6861_0)) of SOME ((() , s6862_0)) => (case ((string_drop s6861_0 s6862_0)) of s6863_0 => (case ((freg_name_matches_prefix s6863_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6864_0)) => (case ((string_drop s6863_0 s6864_0)) of s_ => SOME (FSGNJN_D, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6832_ : string -> maybe ((f_bin_op_D * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6832_:string ->(f_bin_op_D#(5)words$word#(5)words$word#(5)words$word#string)option) s6833_0= ((case s6833_0 of s6834_0 => (case ((f_bin_type_mnemonic_D_matches_prefix s6834_0)) of SOME ((FSGNJ_D, s6835_0)) => (case ((string_drop s6834_0 s6835_0)) of s6836_0 => (case ((spc_matches_prefix0 s6836_0)) of SOME ((() , s6837_0)) => (case ((string_drop s6836_0 s6837_0)) of s6838_0 => (case ((freg_name_matches_prefix s6838_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6839_0)) => (case ((string_drop s6838_0 s6839_0)) of s6840_0 => (case ((sep_matches_prefix s6840_0)) of SOME ((() , s6841_0)) => (case ((string_drop s6840_0 s6841_0)) of s6842_0 => (case ((freg_name_matches_prefix s6842_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6843_0)) => (case ((string_drop s6842_0 s6843_0)) of s6844_0 => (case ((sep_matches_prefix s6844_0)) of SOME ((() , s6845_0)) => (case ((string_drop s6844_0 s6845_0)) of s6846_0 => (case ((freg_name_matches_prefix s6846_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6847_0)) => (case ((string_drop s6846_0 s6847_0)) of s_ => SOME (FSGNJ_D, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6815_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6815_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6816_0= ((case s6816_0 of s6817_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6817_0)) of SOME ((FCVT_D_S, s6818_0)) => (case ((string_drop s6817_0 s6818_0)) of s6819_0 => (case ((spc_matches_prefix0 s6819_0)) of SOME ((() , s6820_0)) => (case ((string_drop s6819_0 s6820_0)) of s6821_0 => (case ((freg_name_matches_prefix s6821_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6822_0)) => (case ((string_drop s6821_0 s6822_0)) of s6823_0 => (case ((sep_matches_prefix s6823_0)) of SOME ((() , s6824_0)) => (case ((string_drop s6823_0 s6824_0)) of s6825_0 => (case ((freg_name_matches_prefix s6825_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6826_0)) => (case ((string_drop s6825_0 s6826_0)) of s6827_0 => (case ((sep_matches_prefix s6827_0)) of SOME ((() , s6828_0)) => (case ((string_drop s6827_0 s6828_0)) of s6829_0 => (case ((frm_mnemonic_matches_prefix s6829_0)) of SOME ((rm, s6830_0)) => (case ((string_drop s6829_0 s6830_0)) of s_ => SOME (FCVT_D_S, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6798_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6798_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6799_0= ((case s6799_0 of s6800_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6800_0)) of SOME ((FCVT_S_D, s6801_0)) => (case ((string_drop s6800_0 s6801_0)) of s6802_0 => (case ((spc_matches_prefix0 s6802_0)) of SOME ((() , s6803_0)) => (case ((string_drop s6802_0 s6803_0)) of s6804_0 => (case ((freg_name_matches_prefix s6804_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6805_0)) => (case ((string_drop s6804_0 s6805_0)) of s6806_0 => (case ((sep_matches_prefix s6806_0)) of SOME ((() , s6807_0)) => (case ((string_drop s6806_0 s6807_0)) of s6808_0 => (case ((freg_name_matches_prefix s6808_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6809_0)) => (case ((string_drop s6808_0 s6809_0)) of s6810_0 => (case ((sep_matches_prefix s6810_0)) of SOME ((() , s6811_0)) => (case ((string_drop s6810_0 s6811_0)) of s6812_0 => (case ((frm_mnemonic_matches_prefix s6812_0)) of SOME ((rm, s6813_0)) => (case ((string_drop s6812_0 s6813_0)) of s_ => SOME (FCVT_S_D, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6781_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6781_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6782_0= ((case s6782_0 of s6783_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6783_0)) of SOME ((FCVT_D_LU, s6784_0)) => (case ((string_drop s6783_0 s6784_0)) of s6785_0 => (case ((spc_matches_prefix0 s6785_0)) of SOME ((() , s6786_0)) => (case ((string_drop s6785_0 s6786_0)) of s6787_0 => (case ((freg_name_matches_prefix s6787_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6788_0)) => (case ((string_drop s6787_0 s6788_0)) of s6789_0 => (case ((sep_matches_prefix s6789_0)) of SOME ((() , s6790_0)) => (case ((string_drop s6789_0 s6790_0)) of s6791_0 => (case ((reg_name_matches_prefix s6791_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6792_0)) => (case ((string_drop s6791_0 s6792_0)) of s6793_0 => (case ((sep_matches_prefix s6793_0)) of SOME ((() , s6794_0)) => (case ((string_drop s6793_0 s6794_0)) of s6795_0 => (case ((frm_mnemonic_matches_prefix s6795_0)) of SOME ((rm, s6796_0)) => (case ((string_drop s6795_0 s6796_0)) of s_ => SOME (FCVT_D_LU, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6764_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6764_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6765_0= ((case s6765_0 of s6766_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6766_0)) of SOME ((FCVT_D_L, s6767_0)) => (case ((string_drop s6766_0 s6767_0)) of s6768_0 => (case ((spc_matches_prefix0 s6768_0)) of SOME ((() , s6769_0)) => (case ((string_drop s6768_0 s6769_0)) of s6770_0 => (case ((freg_name_matches_prefix s6770_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6771_0)) => (case ((string_drop s6770_0 s6771_0)) of s6772_0 => (case ((sep_matches_prefix s6772_0)) of SOME ((() , s6773_0)) => (case ((string_drop s6772_0 s6773_0)) of s6774_0 => (case ((reg_name_matches_prefix s6774_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6775_0)) => (case ((string_drop s6774_0 s6775_0)) of s6776_0 => (case ((sep_matches_prefix s6776_0)) of SOME ((() , s6777_0)) => (case ((string_drop s6776_0 s6777_0)) of s6778_0 => (case ((frm_mnemonic_matches_prefix s6778_0)) of SOME ((rm, s6779_0)) => (case ((string_drop s6778_0 s6779_0)) of s_ => SOME (FCVT_D_L, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6747_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6747_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6748_0= ((case s6748_0 of s6749_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6749_0)) of SOME ((FCVT_LU_D, s6750_0)) => (case ((string_drop s6749_0 s6750_0)) of s6751_0 => (case ((spc_matches_prefix0 s6751_0)) of SOME ((() , s6752_0)) => (case ((string_drop s6751_0 s6752_0)) of s6753_0 => (case ((reg_name_matches_prefix s6753_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6754_0)) => (case ((string_drop s6753_0 s6754_0)) of s6755_0 => (case ((sep_matches_prefix s6755_0)) of SOME ((() , s6756_0)) => (case ((string_drop s6755_0 s6756_0)) of s6757_0 => (case ((freg_name_matches_prefix s6757_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6758_0)) => (case ((string_drop s6757_0 s6758_0)) of s6759_0 => (case ((sep_matches_prefix s6759_0)) of SOME ((() , s6760_0)) => (case ((string_drop s6759_0 s6760_0)) of s6761_0 => (case ((frm_mnemonic_matches_prefix s6761_0)) of SOME ((rm, s6762_0)) => (case ((string_drop s6761_0 s6762_0)) of s_ => SOME (FCVT_LU_D, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6730_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6730_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6731_0= ((case s6731_0 of s6732_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6732_0)) of SOME ((FCVT_L_D, s6733_0)) => (case ((string_drop s6732_0 s6733_0)) of s6734_0 => (case ((spc_matches_prefix0 s6734_0)) of SOME ((() , s6735_0)) => (case ((string_drop s6734_0 s6735_0)) of s6736_0 => (case ((reg_name_matches_prefix s6736_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6737_0)) => (case ((string_drop s6736_0 s6737_0)) of s6738_0 => (case ((sep_matches_prefix s6738_0)) of SOME ((() , s6739_0)) => (case ((string_drop s6738_0 s6739_0)) of s6740_0 => (case ((freg_name_matches_prefix s6740_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6741_0)) => (case ((string_drop s6740_0 s6741_0)) of s6742_0 => (case ((sep_matches_prefix s6742_0)) of SOME ((() , s6743_0)) => (case ((string_drop s6742_0 s6743_0)) of s6744_0 => (case ((frm_mnemonic_matches_prefix s6744_0)) of SOME ((rm, s6745_0)) => (case ((string_drop s6744_0 s6745_0)) of s_ => SOME (FCVT_L_D, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6713_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6713_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6714_0= ((case s6714_0 of s6715_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6715_0)) of SOME ((FCVT_D_WU, s6716_0)) => (case ((string_drop s6715_0 s6716_0)) of s6717_0 => (case ((spc_matches_prefix0 s6717_0)) of SOME ((() , s6718_0)) => (case ((string_drop s6717_0 s6718_0)) of s6719_0 => (case ((freg_name_matches_prefix s6719_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6720_0)) => (case ((string_drop s6719_0 s6720_0)) of s6721_0 => (case ((sep_matches_prefix s6721_0)) of SOME ((() , s6722_0)) => (case ((string_drop s6721_0 s6722_0)) of s6723_0 => (case ((reg_name_matches_prefix s6723_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6724_0)) => (case ((string_drop s6723_0 s6724_0)) of s6725_0 => (case ((sep_matches_prefix s6725_0)) of SOME ((() , s6726_0)) => (case ((string_drop s6725_0 s6726_0)) of s6727_0 => (case ((frm_mnemonic_matches_prefix s6727_0)) of SOME ((rm, s6728_0)) => (case ((string_drop s6727_0 s6728_0)) of s_ => SOME (FCVT_D_WU, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6696_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6696_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6697_0= ((case s6697_0 of s6698_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6698_0)) of SOME ((FCVT_D_W, s6699_0)) => (case ((string_drop s6698_0 s6699_0)) of s6700_0 => (case ((spc_matches_prefix0 s6700_0)) of SOME ((() , s6701_0)) => (case ((string_drop s6700_0 s6701_0)) of s6702_0 => (case ((freg_name_matches_prefix s6702_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6703_0)) => (case ((string_drop s6702_0 s6703_0)) of s6704_0 => (case ((sep_matches_prefix s6704_0)) of SOME ((() , s6705_0)) => (case ((string_drop s6704_0 s6705_0)) of s6706_0 => (case ((reg_name_matches_prefix s6706_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6707_0)) => (case ((string_drop s6706_0 s6707_0)) of s6708_0 => (case ((sep_matches_prefix s6708_0)) of SOME ((() , s6709_0)) => (case ((string_drop s6708_0 s6709_0)) of s6710_0 => (case ((frm_mnemonic_matches_prefix s6710_0)) of SOME ((rm, s6711_0)) => (case ((string_drop s6710_0 s6711_0)) of s_ => SOME (FCVT_D_W, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6679_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6679_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6680_0= ((case s6680_0 of s6681_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6681_0)) of SOME ((FCVT_WU_D, s6682_0)) => (case ((string_drop s6681_0 s6682_0)) of s6683_0 => (case ((spc_matches_prefix0 s6683_0)) of SOME ((() , s6684_0)) => (case ((string_drop s6683_0 s6684_0)) of s6685_0 => (case ((reg_name_matches_prefix s6685_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6686_0)) => (case ((string_drop s6685_0 s6686_0)) of s6687_0 => (case ((sep_matches_prefix s6687_0)) of SOME ((() , s6688_0)) => (case ((string_drop s6687_0 s6688_0)) of s6689_0 => (case ((freg_name_matches_prefix s6689_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6690_0)) => (case ((string_drop s6689_0 s6690_0)) of s6691_0 => (case ((sep_matches_prefix s6691_0)) of SOME ((() , s6692_0)) => (case ((string_drop s6691_0 s6692_0)) of s6693_0 => (case ((frm_mnemonic_matches_prefix s6693_0)) of SOME ((rm, s6694_0)) => (case ((string_drop s6693_0 s6694_0)) of s_ => SOME (FCVT_WU_D, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6662_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6662_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6663_0= ((case s6663_0 of s6664_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6664_0)) of SOME ((FCVT_W_D, s6665_0)) => (case ((string_drop s6664_0 s6665_0)) of s6666_0 => (case ((spc_matches_prefix0 s6666_0)) of SOME ((() , s6667_0)) => (case ((string_drop s6666_0 s6667_0)) of s6668_0 => (case ((reg_name_matches_prefix s6668_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6669_0)) => (case ((string_drop s6668_0 s6669_0)) of s6670_0 => (case ((sep_matches_prefix s6670_0)) of SOME ((() , s6671_0)) => (case ((string_drop s6670_0 s6671_0)) of s6672_0 => (case ((freg_name_matches_prefix s6672_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6673_0)) => (case ((string_drop s6672_0 s6673_0)) of s6674_0 => (case ((sep_matches_prefix s6674_0)) of SOME ((() , s6675_0)) => (case ((string_drop s6674_0 s6675_0)) of s6676_0 => (case ((frm_mnemonic_matches_prefix s6676_0)) of SOME ((rm, s6677_0)) => (case ((string_drop s6676_0 s6677_0)) of s_ => SOME (FCVT_W_D, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6645_ : string -> maybe ((f_un_rm_op_D * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6645_:string ->(f_un_rm_op_D#(5)words$word#(5)words$word#rounding_mode#string)option) s6646_0= ((case s6646_0 of s6647_0 => (case ((f_un_rm_type_mnemonic_D_matches_prefix s6647_0)) of SOME ((FSQRT_D, s6648_0)) => (case ((string_drop s6647_0 s6648_0)) of s6649_0 => (case ((spc_matches_prefix0 s6649_0)) of SOME ((() , s6650_0)) => (case ((string_drop s6649_0 s6650_0)) of s6651_0 => (case ((freg_name_matches_prefix s6651_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6652_0)) => (case ((string_drop s6651_0 s6652_0)) of s6653_0 => (case ((sep_matches_prefix s6653_0)) of SOME ((() , s6654_0)) => (case ((string_drop s6653_0 s6654_0)) of s6655_0 => (case ((freg_name_matches_prefix s6655_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6656_0)) => (case ((string_drop s6655_0 s6656_0)) of s6657_0 => (case ((sep_matches_prefix s6657_0)) of SOME ((() , s6658_0)) => (case ((string_drop s6657_0 s6658_0)) of s6659_0 => (case ((frm_mnemonic_matches_prefix s6659_0)) of SOME ((rm, s6660_0)) => (case ((string_drop s6659_0 s6660_0)) of s_ => SOME (FSQRT_D, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6624_ : string -> maybe ((f_bin_rm_op_D * mword ty5 * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6624_:string ->(f_bin_rm_op_D#(5)words$word#(5)words$word#(5)words$word#rounding_mode#string)option) s6625_0= ((case s6625_0 of s6626_0 => (case ((f_bin_rm_type_mnemonic_D_matches_prefix s6626_0)) of SOME ((op, s6627_0)) => (case ((string_drop s6626_0 s6627_0)) of s6628_0 => (case ((spc_matches_prefix0 s6628_0)) of SOME ((() , s6629_0)) => (case ((string_drop s6628_0 s6629_0)) of s6630_0 => (case ((freg_name_matches_prefix s6630_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6631_0)) => (case ((string_drop s6630_0 s6631_0)) of s6632_0 => (case ((sep_matches_prefix s6632_0)) of SOME ((() , s6633_0)) => (case ((string_drop s6632_0 s6633_0)) of s6634_0 => (case ((freg_name_matches_prefix s6634_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6635_0)) => (case ((string_drop s6634_0 s6635_0)) of s6636_0 => (case ((sep_matches_prefix s6636_0)) of SOME ((() , s6637_0)) => (case ((string_drop s6636_0 s6637_0)) of s6638_0 => (case ((freg_name_matches_prefix s6638_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6639_0)) => (case ((string_drop s6638_0 s6639_0)) of s6640_0 => (case ((sep_matches_prefix s6640_0)) of SOME ((() , s6641_0)) => (case ((string_drop s6640_0 s6641_0)) of s6642_0 => (case ((frm_mnemonic_matches_prefix s6642_0)) of SOME ((rm, s6643_0)) => (case ((string_drop s6642_0 s6643_0)) of s_ => SOME (op, rd, rs1, rs2, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6599_ : string -> maybe ((f_madd_op_D * mword ty5 * mword ty5 * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6599_:string ->(f_madd_op_D#(5)words$word#(5)words$word#(5)words$word#(5)words$word#rounding_mode#string)option) s6600_0= ((case s6600_0 of s6601_0 => (case ((f_madd_type_mnemonic_D_matches_prefix s6601_0)) of SOME ((op, s6602_0)) => (case ((string_drop s6601_0 s6602_0)) of s6603_0 => (case ((spc_matches_prefix0 s6603_0)) of SOME ((() , s6604_0)) => (case ((string_drop s6603_0 s6604_0)) of s6605_0 => (case ((freg_name_matches_prefix s6605_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6606_0)) => (case ((string_drop s6605_0 s6606_0)) of s6607_0 => (case ((sep_matches_prefix s6607_0)) of SOME ((() , s6608_0)) => (case ((string_drop s6607_0 s6608_0)) of s6609_0 => (case ((freg_name_matches_prefix s6609_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6610_0)) => (case ((string_drop s6609_0 s6610_0)) of s6611_0 => (case ((sep_matches_prefix s6611_0)) of SOME ((() , s6612_0)) => (case ((string_drop s6611_0 s6612_0)) of s6613_0 => (case ((freg_name_matches_prefix s6613_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6614_0)) => (case ((string_drop s6613_0 s6614_0)) of s6615_0 => (case ((sep_matches_prefix s6615_0)) of SOME ((() , s6616_0)) => (case ((string_drop s6615_0 s6616_0)) of s6617_0 => (case ((freg_name_matches_prefix s6617_0 : (( 5 words$word # ii)) option)) of SOME ((rs3, s6618_0)) => (case ((string_drop s6617_0 s6618_0)) of s6619_0 => (case ((sep_matches_prefix s6619_0)) of SOME ((() , s6620_0)) => (case ((string_drop s6619_0 s6620_0)) of s6621_0 => (case ((frm_mnemonic_matches_prefix s6621_0)) of SOME ((rm, s6622_0)) => (case ((string_drop s6621_0 s6622_0)) of s_ => SOME (op, rd, rs1, rs2, rs3, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6583_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5 * string))*) val _ = Define ` ((s6583_:string ->((3)words$word#(3)words$word#(5)words$word#string)option) s6584_0= (let s6585_0 = s6584_0 in if ((string_startswith s6585_0 "c.fsw")) then (case ((string_drop s6585_0 ((string_length "c.fsw")))) of s6586_0 => (case ((spc_matches_prefix0 s6586_0)) of SOME ((() , s6587_0)) => (case ((string_drop s6586_0 s6587_0)) of s6588_0 => (case ((creg_name_matches_prefix s6588_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s6589_0)) => (case ((string_drop s6588_0 s6589_0)) of s6590_0 => (case ((sep_matches_prefix s6590_0)) of SOME ((() , s6591_0)) => (case ((string_drop s6590_0 s6591_0)) of s6592_0 => (case ((creg_name_matches_prefix s6592_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s6593_0)) => (case ((string_drop s6592_0 s6593_0)) of s6594_0 => (case ((sep_matches_prefix s6594_0)) of SOME ((() , s6595_0)) => (case ((string_drop s6594_0 s6595_0)) of s6596_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6596_0 : (( 7 words$word # ii)) option)) of SOME ((v__1486, s6597_0)) => if (((((subrange_vec_dec v__1486 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1486 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1486 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in (case ((string_drop s6596_0 s6597_0)) of s_ => SOME (rsc1, rsc2, uimm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s6567_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5 * string))*) val _ = Define ` ((s6567_:string ->((3)words$word#(3)words$word#(5)words$word#string)option) s6568_0= (let s6569_0 = s6568_0 in if ((string_startswith s6569_0 "c.flw")) then (case ((string_drop s6569_0 ((string_length "c.flw")))) of s6570_0 => (case ((spc_matches_prefix0 s6570_0)) of SOME ((() , s6571_0)) => (case ((string_drop s6570_0 s6571_0)) of s6572_0 => (case ((creg_name_matches_prefix s6572_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s6573_0)) => (case ((string_drop s6572_0 s6573_0)) of s6574_0 => (case ((sep_matches_prefix s6574_0)) of SOME ((() , s6575_0)) => (case ((string_drop s6574_0 s6575_0)) of s6576_0 => (case ((creg_name_matches_prefix s6576_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s6577_0)) => (case ((string_drop s6576_0 s6577_0)) of s6578_0 => (case ((sep_matches_prefix s6578_0)) of SOME ((() , s6579_0)) => (case ((string_drop s6578_0 s6579_0)) of s6580_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6580_0 : (( 7 words$word # ii)) option)) of SOME ((v__1488, s6581_0)) => if (((((subrange_vec_dec v__1488 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1488 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1488 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in (case ((string_drop s6580_0 s6581_0)) of s_ => SOME (rdc, rsc, uimm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s6555_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s6555_:string ->((5)words$word#(6)words$word#string)option) s6556_0= (let s6557_0 = s6556_0 in if ((string_startswith s6557_0 "c.fswsp")) then (case ((string_drop s6557_0 ((string_length "c.fswsp")))) of s6558_0 => (case ((spc_matches_prefix0 s6558_0)) of SOME ((() , s6559_0)) => (case ((string_drop s6558_0 s6559_0)) of s6560_0 => (case ((reg_name_matches_prefix s6560_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6561_0)) => (case ((string_drop s6560_0 s6561_0)) of s6562_0 => (case ((sep_matches_prefix s6562_0)) of SOME ((() , s6563_0)) => (case ((string_drop s6562_0 s6563_0)) of s6564_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6564_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s6565_0)) => (case ((string_drop s6564_0 s6565_0)) of s_ => SOME (rd, uimm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s6543_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s6543_:string ->((5)words$word#(6)words$word#string)option) s6544_0= (let s6545_0 = s6544_0 in if ((string_startswith s6545_0 "c.flwsp")) then (case ((string_drop s6545_0 ((string_length "c.flwsp")))) of s6546_0 => (case ((spc_matches_prefix0 s6546_0)) of SOME ((() , s6547_0)) => (case ((string_drop s6546_0 s6547_0)) of s6548_0 => (case ((reg_name_matches_prefix s6548_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6549_0)) => (case ((string_drop s6548_0 s6549_0)) of s6550_0 => (case ((sep_matches_prefix s6550_0)) of SOME ((() , s6551_0)) => (case ((string_drop s6550_0 s6551_0)) of s6552_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6552_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s6553_0)) => (case ((string_drop s6552_0 s6553_0)) of s_ => SOME (rd, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s6530_ : string -> maybe ((f_un_op_S * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6530_:string ->(f_un_op_S#(5)words$word#(5)words$word#string)option) s6531_0= ((case s6531_0 of s6532_0 => (case ((f_un_type_mnemonic_S_matches_prefix s6532_0)) of SOME ((FCLASS_S, s6533_0)) => (case ((string_drop s6532_0 s6533_0)) of s6534_0 => (case ((spc_matches_prefix0 s6534_0)) of SOME ((() , s6535_0)) => (case ((string_drop s6534_0 s6535_0)) of s6536_0 => (case ((reg_name_matches_prefix s6536_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6537_0)) => (case ((string_drop s6536_0 s6537_0)) of s6538_0 => (case ((sep_matches_prefix s6538_0)) of SOME ((() , s6539_0)) => (case ((string_drop s6538_0 s6539_0)) of s6540_0 => (case ((freg_name_matches_prefix s6540_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6541_0)) => (case ((string_drop s6540_0 s6541_0)) of s_ => SOME (FCLASS_S, rd, rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6517_ : string -> maybe ((f_un_op_S * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6517_:string ->(f_un_op_S#(5)words$word#(5)words$word#string)option) s6518_0= ((case s6518_0 of s6519_0 => (case ((f_un_type_mnemonic_S_matches_prefix s6519_0)) of SOME ((FMV_W_X, s6520_0)) => (case ((string_drop s6519_0 s6520_0)) of s6521_0 => (case ((spc_matches_prefix0 s6521_0)) of SOME ((() , s6522_0)) => (case ((string_drop s6521_0 s6522_0)) of s6523_0 => (case ((freg_name_matches_prefix s6523_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6524_0)) => (case ((string_drop s6523_0 s6524_0)) of s6525_0 => (case ((sep_matches_prefix s6525_0)) of SOME ((() , s6526_0)) => (case ((string_drop s6525_0 s6526_0)) of s6527_0 => (case ((reg_name_matches_prefix s6527_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6528_0)) => (case ((string_drop s6527_0 s6528_0)) of s_ => SOME (FMV_W_X, rd, rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6504_ : string -> maybe ((f_un_op_S * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6504_:string ->(f_un_op_S#(5)words$word#(5)words$word#string)option) s6505_0= ((case s6505_0 of s6506_0 => (case ((f_un_type_mnemonic_S_matches_prefix s6506_0)) of SOME ((FMV_X_W, s6507_0)) => (case ((string_drop s6506_0 s6507_0)) of s6508_0 => (case ((spc_matches_prefix0 s6508_0)) of SOME ((() , s6509_0)) => (case ((string_drop s6508_0 s6509_0)) of s6510_0 => (case ((reg_name_matches_prefix s6510_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6511_0)) => (case ((string_drop s6510_0 s6511_0)) of s6512_0 => (case ((sep_matches_prefix s6512_0)) of SOME ((() , s6513_0)) => (case ((string_drop s6512_0 s6513_0)) of s6514_0 => (case ((freg_name_matches_prefix s6514_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6515_0)) => (case ((string_drop s6514_0 s6515_0)) of s_ => SOME (FMV_X_W, rd, rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6487_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6487_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word#string)option) s6488_0= ((case s6488_0 of s6489_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s6489_0)) of SOME ((FLE_S, s6490_0)) => (case ((string_drop s6489_0 s6490_0)) of s6491_0 => (case ((spc_matches_prefix0 s6491_0)) of SOME ((() , s6492_0)) => (case ((string_drop s6491_0 s6492_0)) of s6493_0 => (case ((reg_name_matches_prefix s6493_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6494_0)) => (case ((string_drop s6493_0 s6494_0)) of s6495_0 => (case ((sep_matches_prefix s6495_0)) of SOME ((() , s6496_0)) => (case ((string_drop s6495_0 s6496_0)) of s6497_0 => (case ((freg_name_matches_prefix s6497_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6498_0)) => (case ((string_drop s6497_0 s6498_0)) of s6499_0 => (case ((sep_matches_prefix s6499_0)) of SOME ((() , s6500_0)) => (case ((string_drop s6499_0 s6500_0)) of s6501_0 => (case ((freg_name_matches_prefix s6501_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6502_0)) => (case ((string_drop s6501_0 s6502_0)) of s_ => SOME (FLE_S, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6470_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6470_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word#string)option) s6471_0= ((case s6471_0 of s6472_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s6472_0)) of SOME ((FLT_S, s6473_0)) => (case ((string_drop s6472_0 s6473_0)) of s6474_0 => (case ((spc_matches_prefix0 s6474_0)) of SOME ((() , s6475_0)) => (case ((string_drop s6474_0 s6475_0)) of s6476_0 => (case ((reg_name_matches_prefix s6476_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6477_0)) => (case ((string_drop s6476_0 s6477_0)) of s6478_0 => (case ((sep_matches_prefix s6478_0)) of SOME ((() , s6479_0)) => (case ((string_drop s6478_0 s6479_0)) of s6480_0 => (case ((freg_name_matches_prefix s6480_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6481_0)) => (case ((string_drop s6480_0 s6481_0)) of s6482_0 => (case ((sep_matches_prefix s6482_0)) of SOME ((() , s6483_0)) => (case ((string_drop s6482_0 s6483_0)) of s6484_0 => (case ((freg_name_matches_prefix s6484_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6485_0)) => (case ((string_drop s6484_0 s6485_0)) of s_ => SOME (FLT_S, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6453_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6453_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word#string)option) s6454_0= ((case s6454_0 of s6455_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s6455_0)) of SOME ((FEQ_S, s6456_0)) => (case ((string_drop s6455_0 s6456_0)) of s6457_0 => (case ((spc_matches_prefix0 s6457_0)) of SOME ((() , s6458_0)) => (case ((string_drop s6457_0 s6458_0)) of s6459_0 => (case ((reg_name_matches_prefix s6459_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6460_0)) => (case ((string_drop s6459_0 s6460_0)) of s6461_0 => (case ((sep_matches_prefix s6461_0)) of SOME ((() , s6462_0)) => (case ((string_drop s6461_0 s6462_0)) of s6463_0 => (case ((freg_name_matches_prefix s6463_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6464_0)) => (case ((string_drop s6463_0 s6464_0)) of s6465_0 => (case ((sep_matches_prefix s6465_0)) of SOME ((() , s6466_0)) => (case ((string_drop s6465_0 s6466_0)) of s6467_0 => (case ((freg_name_matches_prefix s6467_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6468_0)) => (case ((string_drop s6467_0 s6468_0)) of s_ => SOME (FEQ_S, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6436_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6436_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word#string)option) s6437_0= ((case s6437_0 of s6438_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s6438_0)) of SOME ((FMAX_S, s6439_0)) => (case ((string_drop s6438_0 s6439_0)) of s6440_0 => (case ((spc_matches_prefix0 s6440_0)) of SOME ((() , s6441_0)) => (case ((string_drop s6440_0 s6441_0)) of s6442_0 => (case ((freg_name_matches_prefix s6442_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6443_0)) => (case ((string_drop s6442_0 s6443_0)) of s6444_0 => (case ((sep_matches_prefix s6444_0)) of SOME ((() , s6445_0)) => (case ((string_drop s6444_0 s6445_0)) of s6446_0 => (case ((freg_name_matches_prefix s6446_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6447_0)) => (case ((string_drop s6446_0 s6447_0)) of s6448_0 => (case ((sep_matches_prefix s6448_0)) of SOME ((() , s6449_0)) => (case ((string_drop s6448_0 s6449_0)) of s6450_0 => (case ((freg_name_matches_prefix s6450_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6451_0)) => (case ((string_drop s6450_0 s6451_0)) of s_ => SOME (FMAX_S, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6419_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6419_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word#string)option) s6420_0= ((case s6420_0 of s6421_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s6421_0)) of SOME ((FMIN_S, s6422_0)) => (case ((string_drop s6421_0 s6422_0)) of s6423_0 => (case ((spc_matches_prefix0 s6423_0)) of SOME ((() , s6424_0)) => (case ((string_drop s6423_0 s6424_0)) of s6425_0 => (case ((freg_name_matches_prefix s6425_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6426_0)) => (case ((string_drop s6425_0 s6426_0)) of s6427_0 => (case ((sep_matches_prefix s6427_0)) of SOME ((() , s6428_0)) => (case ((string_drop s6427_0 s6428_0)) of s6429_0 => (case ((freg_name_matches_prefix s6429_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6430_0)) => (case ((string_drop s6429_0 s6430_0)) of s6431_0 => (case ((sep_matches_prefix s6431_0)) of SOME ((() , s6432_0)) => (case ((string_drop s6431_0 s6432_0)) of s6433_0 => (case ((freg_name_matches_prefix s6433_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6434_0)) => (case ((string_drop s6433_0 s6434_0)) of s_ => SOME (FMIN_S, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6402_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6402_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word#string)option) s6403_0= ((case s6403_0 of s6404_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s6404_0)) of SOME ((FSGNJX_S, s6405_0)) => (case ((string_drop s6404_0 s6405_0)) of s6406_0 => (case ((spc_matches_prefix0 s6406_0)) of SOME ((() , s6407_0)) => (case ((string_drop s6406_0 s6407_0)) of s6408_0 => (case ((freg_name_matches_prefix s6408_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6409_0)) => (case ((string_drop s6408_0 s6409_0)) of s6410_0 => (case ((sep_matches_prefix s6410_0)) of SOME ((() , s6411_0)) => (case ((string_drop s6410_0 s6411_0)) of s6412_0 => (case ((freg_name_matches_prefix s6412_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6413_0)) => (case ((string_drop s6412_0 s6413_0)) of s6414_0 => (case ((sep_matches_prefix s6414_0)) of SOME ((() , s6415_0)) => (case ((string_drop s6414_0 s6415_0)) of s6416_0 => (case ((freg_name_matches_prefix s6416_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6417_0)) => (case ((string_drop s6416_0 s6417_0)) of s_ => SOME (FSGNJX_S, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6385_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6385_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word#string)option) s6386_0= ((case s6386_0 of s6387_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s6387_0)) of SOME ((FSGNJN_S, s6388_0)) => (case ((string_drop s6387_0 s6388_0)) of s6389_0 => (case ((spc_matches_prefix0 s6389_0)) of SOME ((() , s6390_0)) => (case ((string_drop s6389_0 s6390_0)) of s6391_0 => (case ((freg_name_matches_prefix s6391_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6392_0)) => (case ((string_drop s6391_0 s6392_0)) of s6393_0 => (case ((sep_matches_prefix s6393_0)) of SOME ((() , s6394_0)) => (case ((string_drop s6393_0 s6394_0)) of s6395_0 => (case ((freg_name_matches_prefix s6395_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6396_0)) => (case ((string_drop s6395_0 s6396_0)) of s6397_0 => (case ((sep_matches_prefix s6397_0)) of SOME ((() , s6398_0)) => (case ((string_drop s6397_0 s6398_0)) of s6399_0 => (case ((freg_name_matches_prefix s6399_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6400_0)) => (case ((string_drop s6399_0 s6400_0)) of s_ => SOME (FSGNJN_S, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6368_ : string -> maybe ((f_bin_op_S * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s6368_:string ->(f_bin_op_S#(5)words$word#(5)words$word#(5)words$word#string)option) s6369_0= ((case s6369_0 of s6370_0 => (case ((f_bin_type_mnemonic_S_matches_prefix s6370_0)) of SOME ((FSGNJ_S, s6371_0)) => (case ((string_drop s6370_0 s6371_0)) of s6372_0 => (case ((spc_matches_prefix0 s6372_0)) of SOME ((() , s6373_0)) => (case ((string_drop s6372_0 s6373_0)) of s6374_0 => (case ((freg_name_matches_prefix s6374_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6375_0)) => (case ((string_drop s6374_0 s6375_0)) of s6376_0 => (case ((sep_matches_prefix s6376_0)) of SOME ((() , s6377_0)) => (case ((string_drop s6376_0 s6377_0)) of s6378_0 => (case ((freg_name_matches_prefix s6378_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6379_0)) => (case ((string_drop s6378_0 s6379_0)) of s6380_0 => (case ((sep_matches_prefix s6380_0)) of SOME ((() , s6381_0)) => (case ((string_drop s6380_0 s6381_0)) of s6382_0 => (case ((freg_name_matches_prefix s6382_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6383_0)) => (case ((string_drop s6382_0 s6383_0)) of s_ => SOME (FSGNJ_S, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6351_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6351_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode#string)option) s6352_0= ((case s6352_0 of s6353_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s6353_0)) of SOME ((FCVT_S_LU, s6354_0)) => (case ((string_drop s6353_0 s6354_0)) of s6355_0 => (case ((spc_matches_prefix0 s6355_0)) of SOME ((() , s6356_0)) => (case ((string_drop s6355_0 s6356_0)) of s6357_0 => (case ((freg_name_matches_prefix s6357_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6358_0)) => (case ((string_drop s6357_0 s6358_0)) of s6359_0 => (case ((sep_matches_prefix s6359_0)) of SOME ((() , s6360_0)) => (case ((string_drop s6359_0 s6360_0)) of s6361_0 => (case ((reg_name_matches_prefix s6361_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6362_0)) => (case ((string_drop s6361_0 s6362_0)) of s6363_0 => (case ((sep_matches_prefix s6363_0)) of SOME ((() , s6364_0)) => (case ((string_drop s6363_0 s6364_0)) of s6365_0 => (case ((frm_mnemonic_matches_prefix s6365_0)) of SOME ((rm, s6366_0)) => (case ((string_drop s6365_0 s6366_0)) of s_ => SOME (FCVT_S_LU, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6334_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6334_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode#string)option) s6335_0= ((case s6335_0 of s6336_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s6336_0)) of SOME ((FCVT_S_L, s6337_0)) => (case ((string_drop s6336_0 s6337_0)) of s6338_0 => (case ((spc_matches_prefix0 s6338_0)) of SOME ((() , s6339_0)) => (case ((string_drop s6338_0 s6339_0)) of s6340_0 => (case ((freg_name_matches_prefix s6340_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6341_0)) => (case ((string_drop s6340_0 s6341_0)) of s6342_0 => (case ((sep_matches_prefix s6342_0)) of SOME ((() , s6343_0)) => (case ((string_drop s6342_0 s6343_0)) of s6344_0 => (case ((reg_name_matches_prefix s6344_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6345_0)) => (case ((string_drop s6344_0 s6345_0)) of s6346_0 => (case ((sep_matches_prefix s6346_0)) of SOME ((() , s6347_0)) => (case ((string_drop s6346_0 s6347_0)) of s6348_0 => (case ((frm_mnemonic_matches_prefix s6348_0)) of SOME ((rm, s6349_0)) => (case ((string_drop s6348_0 s6349_0)) of s_ => SOME (FCVT_S_L, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6317_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6317_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode#string)option) s6318_0= ((case s6318_0 of s6319_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s6319_0)) of SOME ((FCVT_LU_S, s6320_0)) => (case ((string_drop s6319_0 s6320_0)) of s6321_0 => (case ((spc_matches_prefix0 s6321_0)) of SOME ((() , s6322_0)) => (case ((string_drop s6321_0 s6322_0)) of s6323_0 => (case ((reg_name_matches_prefix s6323_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6324_0)) => (case ((string_drop s6323_0 s6324_0)) of s6325_0 => (case ((sep_matches_prefix s6325_0)) of SOME ((() , s6326_0)) => (case ((string_drop s6325_0 s6326_0)) of s6327_0 => (case ((freg_name_matches_prefix s6327_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6328_0)) => (case ((string_drop s6327_0 s6328_0)) of s6329_0 => (case ((sep_matches_prefix s6329_0)) of SOME ((() , s6330_0)) => (case ((string_drop s6329_0 s6330_0)) of s6331_0 => (case ((frm_mnemonic_matches_prefix s6331_0)) of SOME ((rm, s6332_0)) => (case ((string_drop s6331_0 s6332_0)) of s_ => SOME (FCVT_LU_S, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6300_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6300_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode#string)option) s6301_0= ((case s6301_0 of s6302_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s6302_0)) of SOME ((FCVT_L_S, s6303_0)) => (case ((string_drop s6302_0 s6303_0)) of s6304_0 => (case ((spc_matches_prefix0 s6304_0)) of SOME ((() , s6305_0)) => (case ((string_drop s6304_0 s6305_0)) of s6306_0 => (case ((reg_name_matches_prefix s6306_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6307_0)) => (case ((string_drop s6306_0 s6307_0)) of s6308_0 => (case ((sep_matches_prefix s6308_0)) of SOME ((() , s6309_0)) => (case ((string_drop s6308_0 s6309_0)) of s6310_0 => (case ((freg_name_matches_prefix s6310_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6311_0)) => (case ((string_drop s6310_0 s6311_0)) of s6312_0 => (case ((sep_matches_prefix s6312_0)) of SOME ((() , s6313_0)) => (case ((string_drop s6312_0 s6313_0)) of s6314_0 => (case ((frm_mnemonic_matches_prefix s6314_0)) of SOME ((rm, s6315_0)) => (case ((string_drop s6314_0 s6315_0)) of s_ => SOME (FCVT_L_S, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6283_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6283_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode#string)option) s6284_0= ((case s6284_0 of s6285_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s6285_0)) of SOME ((FCVT_S_WU, s6286_0)) => (case ((string_drop s6285_0 s6286_0)) of s6287_0 => (case ((spc_matches_prefix0 s6287_0)) of SOME ((() , s6288_0)) => (case ((string_drop s6287_0 s6288_0)) of s6289_0 => (case ((freg_name_matches_prefix s6289_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6290_0)) => (case ((string_drop s6289_0 s6290_0)) of s6291_0 => (case ((sep_matches_prefix s6291_0)) of SOME ((() , s6292_0)) => (case ((string_drop s6291_0 s6292_0)) of s6293_0 => (case ((reg_name_matches_prefix s6293_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6294_0)) => (case ((string_drop s6293_0 s6294_0)) of s6295_0 => (case ((sep_matches_prefix s6295_0)) of SOME ((() , s6296_0)) => (case ((string_drop s6295_0 s6296_0)) of s6297_0 => (case ((frm_mnemonic_matches_prefix s6297_0)) of SOME ((rm, s6298_0)) => (case ((string_drop s6297_0 s6298_0)) of s_ => SOME (FCVT_S_WU, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6266_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6266_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode#string)option) s6267_0= ((case s6267_0 of s6268_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s6268_0)) of SOME ((FCVT_S_W, s6269_0)) => (case ((string_drop s6268_0 s6269_0)) of s6270_0 => (case ((spc_matches_prefix0 s6270_0)) of SOME ((() , s6271_0)) => (case ((string_drop s6270_0 s6271_0)) of s6272_0 => (case ((freg_name_matches_prefix s6272_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6273_0)) => (case ((string_drop s6272_0 s6273_0)) of s6274_0 => (case ((sep_matches_prefix s6274_0)) of SOME ((() , s6275_0)) => (case ((string_drop s6274_0 s6275_0)) of s6276_0 => (case ((reg_name_matches_prefix s6276_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6277_0)) => (case ((string_drop s6276_0 s6277_0)) of s6278_0 => (case ((sep_matches_prefix s6278_0)) of SOME ((() , s6279_0)) => (case ((string_drop s6278_0 s6279_0)) of s6280_0 => (case ((frm_mnemonic_matches_prefix s6280_0)) of SOME ((rm, s6281_0)) => (case ((string_drop s6280_0 s6281_0)) of s_ => SOME (FCVT_S_W, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6249_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6249_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode#string)option) s6250_0= ((case s6250_0 of s6251_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s6251_0)) of SOME ((FCVT_WU_S, s6252_0)) => (case ((string_drop s6251_0 s6252_0)) of s6253_0 => (case ((spc_matches_prefix0 s6253_0)) of SOME ((() , s6254_0)) => (case ((string_drop s6253_0 s6254_0)) of s6255_0 => (case ((reg_name_matches_prefix s6255_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6256_0)) => (case ((string_drop s6255_0 s6256_0)) of s6257_0 => (case ((sep_matches_prefix s6257_0)) of SOME ((() , s6258_0)) => (case ((string_drop s6257_0 s6258_0)) of s6259_0 => (case ((freg_name_matches_prefix s6259_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6260_0)) => (case ((string_drop s6259_0 s6260_0)) of s6261_0 => (case ((sep_matches_prefix s6261_0)) of SOME ((() , s6262_0)) => (case ((string_drop s6261_0 s6262_0)) of s6263_0 => (case ((frm_mnemonic_matches_prefix s6263_0)) of SOME ((rm, s6264_0)) => (case ((string_drop s6263_0 s6264_0)) of s_ => SOME (FCVT_WU_S, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6232_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6232_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode#string)option) s6233_0= ((case s6233_0 of s6234_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s6234_0)) of SOME ((FCVT_W_S, s6235_0)) => (case ((string_drop s6234_0 s6235_0)) of s6236_0 => (case ((spc_matches_prefix0 s6236_0)) of SOME ((() , s6237_0)) => (case ((string_drop s6236_0 s6237_0)) of s6238_0 => (case ((reg_name_matches_prefix s6238_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6239_0)) => (case ((string_drop s6238_0 s6239_0)) of s6240_0 => (case ((sep_matches_prefix s6240_0)) of SOME ((() , s6241_0)) => (case ((string_drop s6240_0 s6241_0)) of s6242_0 => (case ((freg_name_matches_prefix s6242_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6243_0)) => (case ((string_drop s6242_0 s6243_0)) of s6244_0 => (case ((sep_matches_prefix s6244_0)) of SOME ((() , s6245_0)) => (case ((string_drop s6244_0 s6245_0)) of s6246_0 => (case ((frm_mnemonic_matches_prefix s6246_0)) of SOME ((rm, s6247_0)) => (case ((string_drop s6246_0 s6247_0)) of s_ => SOME (FCVT_W_S, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6215_ : string -> maybe ((f_un_rm_op_S * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6215_:string ->(f_un_rm_op_S#(5)words$word#(5)words$word#rounding_mode#string)option) s6216_0= ((case s6216_0 of s6217_0 => (case ((f_un_rm_type_mnemonic_S_matches_prefix s6217_0)) of SOME ((FSQRT_S, s6218_0)) => (case ((string_drop s6217_0 s6218_0)) of s6219_0 => (case ((spc_matches_prefix0 s6219_0)) of SOME ((() , s6220_0)) => (case ((string_drop s6219_0 s6220_0)) of s6221_0 => (case ((freg_name_matches_prefix s6221_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6222_0)) => (case ((string_drop s6221_0 s6222_0)) of s6223_0 => (case ((sep_matches_prefix s6223_0)) of SOME ((() , s6224_0)) => (case ((string_drop s6223_0 s6224_0)) of s6225_0 => (case ((freg_name_matches_prefix s6225_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6226_0)) => (case ((string_drop s6225_0 s6226_0)) of s6227_0 => (case ((sep_matches_prefix s6227_0)) of SOME ((() , s6228_0)) => (case ((string_drop s6227_0 s6228_0)) of s6229_0 => (case ((frm_mnemonic_matches_prefix s6229_0)) of SOME ((rm, s6230_0)) => (case ((string_drop s6229_0 s6230_0)) of s_ => SOME (FSQRT_S, rd, rs1, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6194_ : string -> maybe ((f_bin_rm_op_S * mword ty5 * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6194_:string ->(f_bin_rm_op_S#(5)words$word#(5)words$word#(5)words$word#rounding_mode#string)option) s6195_0= ((case s6195_0 of s6196_0 => (case ((f_bin_rm_type_mnemonic_S_matches_prefix s6196_0)) of SOME ((op, s6197_0)) => (case ((string_drop s6196_0 s6197_0)) of s6198_0 => (case ((spc_matches_prefix0 s6198_0)) of SOME ((() , s6199_0)) => (case ((string_drop s6198_0 s6199_0)) of s6200_0 => (case ((freg_name_matches_prefix s6200_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6201_0)) => (case ((string_drop s6200_0 s6201_0)) of s6202_0 => (case ((sep_matches_prefix s6202_0)) of SOME ((() , s6203_0)) => (case ((string_drop s6202_0 s6203_0)) of s6204_0 => (case ((freg_name_matches_prefix s6204_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6205_0)) => (case ((string_drop s6204_0 s6205_0)) of s6206_0 => (case ((sep_matches_prefix s6206_0)) of SOME ((() , s6207_0)) => (case ((string_drop s6206_0 s6207_0)) of s6208_0 => (case ((freg_name_matches_prefix s6208_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6209_0)) => (case ((string_drop s6208_0 s6209_0)) of s6210_0 => (case ((sep_matches_prefix s6210_0)) of SOME ((() , s6211_0)) => (case ((string_drop s6210_0 s6211_0)) of s6212_0 => (case ((frm_mnemonic_matches_prefix s6212_0)) of SOME ((rm, s6213_0)) => (case ((string_drop s6212_0 s6213_0)) of s_ => SOME (op, rd, rs1, rs2, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6169_ : string -> maybe ((f_madd_op_S * mword ty5 * mword ty5 * mword ty5 * mword ty5 * rounding_mode * string))*) val _ = Define ` ((s6169_:string ->(f_madd_op_S#(5)words$word#(5)words$word#(5)words$word#(5)words$word#rounding_mode#string)option) s6170_0= ((case s6170_0 of s6171_0 => (case ((f_madd_type_mnemonic_S_matches_prefix s6171_0)) of SOME ((op, s6172_0)) => (case ((string_drop s6171_0 s6172_0)) of s6173_0 => (case ((spc_matches_prefix0 s6173_0)) of SOME ((() , s6174_0)) => (case ((string_drop s6173_0 s6174_0)) of s6175_0 => (case ((freg_name_matches_prefix s6175_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6176_0)) => (case ((string_drop s6175_0 s6176_0)) of s6177_0 => (case ((sep_matches_prefix s6177_0)) of SOME ((() , s6178_0)) => (case ((string_drop s6177_0 s6178_0)) of s6179_0 => (case ((freg_name_matches_prefix s6179_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6180_0)) => (case ((string_drop s6179_0 s6180_0)) of s6181_0 => (case ((sep_matches_prefix s6181_0)) of SOME ((() , s6182_0)) => (case ((string_drop s6181_0 s6182_0)) of s6183_0 => (case ((freg_name_matches_prefix s6183_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6184_0)) => (case ((string_drop s6183_0 s6184_0)) of s6185_0 => (case ((sep_matches_prefix s6185_0)) of SOME ((() , s6186_0)) => (case ((string_drop s6185_0 s6186_0)) of s6187_0 => (case ((freg_name_matches_prefix s6187_0 : (( 5 words$word # ii)) option)) of SOME ((rs3, s6188_0)) => (case ((string_drop s6187_0 s6188_0)) of s6189_0 => (case ((sep_matches_prefix s6189_0)) of SOME ((() , s6190_0)) => (case ((string_drop s6189_0 s6190_0)) of s6191_0 => (case ((frm_mnemonic_matches_prefix s6191_0)) of SOME ((rm, s6192_0)) => (case ((string_drop s6191_0 s6192_0)) of s_ => SOME (op, rd, rs1, rs2, rs3, rm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s6145_ : string -> maybe ((word_width * mword ty5 * mword ty12 * mword ty5 * string))*) val _ = Define ` ((s6145_:string ->(word_width#(5)words$word#(12)words$word#(5)words$word#string)option) s6146_0= (let s6147_0 = s6146_0 in if ((string_startswith s6147_0 "fs")) then (case ((string_drop s6147_0 ((string_length "fs")))) of s6148_0 => (case ((size_mnemonic_matches_prefix s6148_0)) of SOME ((width, s6149_0)) => (case ((string_drop s6148_0 s6149_0)) of s6150_0 => (case ((spc_matches_prefix0 s6150_0)) of SOME ((() , s6151_0)) => (case ((string_drop s6150_0 s6151_0)) of s6152_0 => (case ((freg_name_matches_prefix s6152_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6153_0)) => (case ((string_drop s6152_0 s6153_0)) of s6154_0 => (case ((sep_matches_prefix s6154_0)) of SOME ((() , s6155_0)) => (case ((string_drop s6154_0 s6155_0)) of s6156_0 => (case ((hex_bits_12_matches_prefix0 s6156_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s6157_0)) => (case ((string_drop s6156_0 s6157_0)) of s6158_0 => (case ((opt_spc_matches_prefix0 s6158_0)) of SOME ((() , s6159_0)) => let s6160_0 = (string_drop s6158_0 s6159_0) in if ((string_startswith s6160_0 "(")) then (case ((string_drop s6160_0 ((string_length "(")))) of s6161_0 => (case ((opt_spc_matches_prefix0 s6161_0)) of SOME ((() , s6162_0)) => (case ((string_drop s6161_0 s6162_0)) of s6163_0 => (case ((reg_name_matches_prefix s6163_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6164_0)) => (case ((string_drop s6163_0 s6164_0)) of s6165_0 => (case ((opt_spc_matches_prefix0 s6165_0)) of SOME ((() , s6166_0)) => let s6167_0 = (string_drop s6165_0 s6166_0) in if ((string_startswith s6167_0 ")")) then (case ((string_drop s6167_0 ((string_length ")")))) of s_ => SOME (width, rs2, imm, rs1, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s6121_ : string -> maybe ((word_width * mword ty5 * mword ty12 * mword ty5 * string))*) val _ = Define ` ((s6121_:string ->(word_width#(5)words$word#(12)words$word#(5)words$word#string)option) s6122_0= (let s6123_0 = s6122_0 in if ((string_startswith s6123_0 "fl")) then (case ((string_drop s6123_0 ((string_length "fl")))) of s6124_0 => (case ((size_mnemonic_matches_prefix s6124_0)) of SOME ((width, s6125_0)) => (case ((string_drop s6124_0 s6125_0)) of s6126_0 => (case ((spc_matches_prefix0 s6126_0)) of SOME ((() , s6127_0)) => (case ((string_drop s6126_0 s6127_0)) of s6128_0 => (case ((freg_name_matches_prefix s6128_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6129_0)) => (case ((string_drop s6128_0 s6129_0)) of s6130_0 => (case ((sep_matches_prefix s6130_0)) of SOME ((() , s6131_0)) => (case ((string_drop s6130_0 s6131_0)) of s6132_0 => (case ((hex_bits_12_matches_prefix0 s6132_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s6133_0)) => (case ((string_drop s6132_0 s6133_0)) of s6134_0 => (case ((opt_spc_matches_prefix0 s6134_0)) of SOME ((() , s6135_0)) => let s6136_0 = (string_drop s6134_0 s6135_0) in if ((string_startswith s6136_0 "(")) then (case ((string_drop s6136_0 ((string_length "(")))) of s6137_0 => (case ((opt_spc_matches_prefix0 s6137_0)) of SOME ((() , s6138_0)) => (case ((string_drop s6137_0 s6138_0)) of s6139_0 => (case ((reg_name_matches_prefix s6139_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6140_0)) => (case ((string_drop s6139_0 s6140_0)) of s6141_0 => (case ((opt_spc_matches_prefix0 s6141_0)) of SOME ((() , s6142_0)) => let s6143_0 = (string_drop s6141_0 s6142_0) in if ((string_startswith s6143_0 ")")) then (case ((string_drop s6143_0 ((string_length ")")))) of s_ => SOME (width, rd, imm, rs1, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s6109_ : string -> maybe ((mword ty5 * mword ty5 * mword ty12 * string))*) val _ = Define ` ((s6109_:string ->((5)words$word#(5)words$word#(12)words$word#string)option) s6110_0= (let s6111_0 = s6110_0 in if ((string_startswith s6111_0 "fence.i.reserved.")) then (case ((string_drop s6111_0 ((string_length "fence.i.reserved.")))) of s6112_0 => (case ((reg_name_matches_prefix s6112_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6113_0)) => let s6114_0 = (string_drop s6112_0 s6113_0) in if ((string_startswith s6114_0 ".")) then (case ((string_drop s6114_0 ((string_length ".")))) of s6115_0 => (case ((reg_name_matches_prefix s6115_0 : (( 5 words$word # ii)) option)) of SOME ((rs, s6116_0)) => let s6117_0 = (string_drop s6115_0 s6116_0) in if ((string_startswith s6117_0 ".")) then (case ((string_drop s6117_0 ((string_length ".")))) of s6118_0 => (case ((hex_bits_12_matches_prefix0 s6118_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s6119_0)) => (case ((string_drop s6118_0 s6119_0)) of s_ => SOME (rd, rs, imm, s_) ) | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s6091_ : string -> maybe ((mword ty4 * mword ty4 * mword ty5 * mword ty5 * mword ty4 * string))*) val _ = Define ` ((s6091_:string ->((4)words$word#(4)words$word#(5)words$word#(5)words$word#(4)words$word#string)option) s6092_0= (let s6093_0 = s6092_0 in if ((string_startswith s6093_0 "fence.reserved.")) then (case ((string_drop s6093_0 ((string_length "fence.reserved.")))) of s6094_0 => (case ((fence_bits_matches_prefix s6094_0 : (( 4 words$word # ii)) option)) of SOME ((pred, s6095_0)) => let s6096_0 = (string_drop s6094_0 s6095_0) in if ((string_startswith s6096_0 ".")) then (case ((string_drop s6096_0 ((string_length ".")))) of s6097_0 => (case ((fence_bits_matches_prefix s6097_0 : (( 4 words$word # ii)) option)) of SOME ((succ, s6098_0)) => let s6099_0 = (string_drop s6097_0 s6098_0) in if ((string_startswith s6099_0 ".")) then (case ((string_drop s6099_0 ((string_length ".")))) of s6100_0 => (case ((reg_name_matches_prefix s6100_0 : (( 5 words$word # ii)) option)) of SOME ((rs, s6101_0)) => let s6102_0 = (string_drop s6100_0 s6101_0) in if ((string_startswith s6102_0 ".")) then (case ((string_drop s6102_0 ((string_length ".")))) of s6103_0 => (case ((reg_name_matches_prefix s6103_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6104_0)) => let s6105_0 = (string_drop s6103_0 s6104_0) in if ((string_startswith s6105_0 ".")) then (case ((string_drop s6105_0 ((string_length ".")))) of s6106_0 => (case ((hex_bits_4_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6106_0 : (( 4 words$word # ii)) option)) of SOME ((fm, s6107_0)) => (case ((string_drop s6106_0 s6107_0)) of s_ => SOME (pred, succ, rs, rd, fm, s_) ) | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s6085_ : string -> maybe ((mword ty3 * string))*) val _ = Define ` ((s6085_:string ->((3)words$word#string)option) s6086_0= (let s6087_0 = s6086_0 in if ((string_startswith s6087_0 "c.srai.hint.")) then (case ((string_drop s6087_0 ((string_length "c.srai.hint.")))) of s6088_0 => (case ((creg_name_matches_prefix s6088_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s6089_0)) => (case ((string_drop s6088_0 s6089_0)) of s_ => SOME (rsd, s_) ) | _ => NONE ) ) else NONE))`; (*val _s6079_ : string -> maybe ((mword ty3 * string))*) val _ = Define ` ((s6079_:string ->((3)words$word#string)option) s6080_0= (let s6081_0 = s6080_0 in if ((string_startswith s6081_0 "c.srli.hint.")) then (case ((string_drop s6081_0 ((string_length "c.srli.hint.")))) of s6082_0 => (case ((creg_name_matches_prefix s6082_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s6083_0)) => (case ((string_drop s6082_0 s6083_0)) of s_ => SOME (rsd, s_) ) | _ => NONE ) ) else NONE))`; (*val _s6070_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s6070_:string ->((5)words$word#(6)words$word#string)option) s6071_0= (let s6072_0 = s6071_0 in if ((string_startswith s6072_0 "c.slli.hint.")) then (case ((string_drop s6072_0 ((string_length "c.slli.hint.")))) of s6073_0 => (case ((reg_name_matches_prefix s6073_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s6074_0)) => let s6075_0 = (string_drop s6073_0 s6074_0) in if ((string_startswith s6075_0 ".")) then (case ((string_drop s6075_0 ((string_length ".")))) of s6076_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6076_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s6077_0)) => (case ((string_drop s6076_0 s6077_0)) of s_ => SOME (rsd, shamt, s_) ) | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s6064_ : string -> maybe ((mword ty5 * string))*) val _ = Define ` ((s6064_:string ->((5)words$word#string)option) s6065_0= (let s6066_0 = s6065_0 in if ((string_startswith s6066_0 "c.add.hint.")) then (case ((string_drop s6066_0 ((string_length "c.add.hint.")))) of s6067_0 => (case ((reg_name_matches_prefix s6067_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6068_0)) => (case ((string_drop s6067_0 s6068_0)) of s_ => SOME (rs2, s_) ) | _ => NONE ) ) else NONE))`; (*val _s6058_ : string -> maybe ((mword ty5 * string))*) val _ = Define ` ((s6058_:string ->((5)words$word#string)option) s6059_0= (let s6060_0 = s6059_0 in if ((string_startswith s6060_0 "c.mv.hint.")) then (case ((string_drop s6060_0 ((string_length "c.mv.hint.")))) of s6061_0 => (case ((reg_name_matches_prefix s6061_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s6062_0)) => (case ((string_drop s6061_0 s6062_0)) of s_ => SOME (rs2, s_) ) | _ => NONE ) ) else NONE))`; (*val _s6052_ : string -> maybe ((mword ty6 * string))*) val _ = Define ` ((s6052_:string ->((6)words$word#string)option) s6053_0= (let s6054_0 = s6053_0 in if ((string_startswith s6054_0 "c.lui.hint.")) then (case ((string_drop s6054_0 ((string_length "c.lui.hint.")))) of s6055_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6055_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s6056_0)) => (case ((string_drop s6055_0 s6056_0)) of s_ => SOME (imm, s_) ) | _ => NONE ) ) else NONE))`; (*val _s6046_ : string -> maybe ((mword ty6 * string))*) val _ = Define ` ((s6046_:string ->((6)words$word#string)option) s6047_0= (let s6048_0 = s6047_0 in if ((string_startswith s6048_0 "c.li.hint.")) then (case ((string_drop s6048_0 ((string_length "c.li.hint.")))) of s6049_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6049_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s6050_0)) => (case ((string_drop s6049_0 s6050_0)) of s_ => SOME (imm, s_) ) | _ => NONE ) ) else NONE))`; (*val _s6040_ : string -> maybe ((mword ty5 * string))*) val _ = Define ` ((s6040_:string ->((5)words$word#string)option) s6041_0= (let s6042_0 = s6041_0 in if ((string_startswith s6042_0 "c.addi.hint.")) then (case ((string_drop s6042_0 ((string_length "c.addi.hint.")))) of s6043_0 => (case ((reg_name_matches_prefix s6043_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s6044_0)) => (case ((string_drop s6043_0 s6044_0)) of s_ => SOME (rsd, s_) ) | _ => NONE ) ) else NONE))`; (*val _s6034_ : string -> maybe ((mword ty6 * string))*) val _ = Define ` ((s6034_:string ->((6)words$word#string)option) s6035_0= (let s6036_0 = s6035_0 in if ((string_startswith s6036_0 "c.nop.hint.")) then (case ((string_drop s6036_0 ((string_length "c.nop.hint.")))) of s6037_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6037_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s6038_0)) => (case ((string_drop s6037_0 s6038_0)) of s_ => SOME (imm, s_) ) | _ => NONE ) ) else NONE))`; (*val _s6030_ : string -> maybe string*) val _ = Define ` ((s6030_:string ->(string)option) s6031_0= (let s6032_0 = s6031_0 in if ((string_startswith s6032_0 "uret")) then (case ((string_drop s6032_0 ((string_length "uret")))) of s_ => SOME s_ ) else NONE))`; (*val _s6013_ : string -> maybe ((csrop * mword ty5 * mword ty12 * mword ty5 * string))*) val _ = Define ` ((s6013_:string ->(csrop#(5)words$word#(12)words$word#(5)words$word#string)option) s6014_0= ((case s6014_0 of s6015_0 => (case ((csr_mnemonic_matches_prefix s6015_0)) of SOME ((op, s6016_0)) => (case ((string_drop s6015_0 s6016_0)) of s6017_0 => (case ((spc_matches_prefix0 s6017_0)) of SOME ((() , s6018_0)) => (case ((string_drop s6017_0 s6018_0)) of s6019_0 => (case ((reg_name_matches_prefix s6019_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6020_0)) => (case ((string_drop s6019_0 s6020_0)) of s6021_0 => (case ((sep_matches_prefix s6021_0)) of SOME ((() , s6022_0)) => (case ((string_drop s6021_0 s6022_0)) of s6023_0 => (case ((csr_name_map_matches_prefix s6023_0 : (( 12 words$word # ii)) option)) of SOME ((csr, s6024_0)) => (case ((string_drop s6023_0 s6024_0)) of s6025_0 => (case ((sep_matches_prefix s6025_0)) of SOME ((() , s6026_0)) => (case ((string_drop s6025_0 s6026_0)) of s6027_0 => (case ((reg_name_matches_prefix s6027_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6028_0)) => (case ((string_drop s6027_0 s6028_0)) of s_ => SOME (op, rd, csr, rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5995_ : string -> maybe ((csrop * mword ty5 * mword ty12 * mword ty5 * string))*) val _ = Define ` ((s5995_:string ->(csrop#(5)words$word#(12)words$word#(5)words$word#string)option) s5996_0= ((case s5996_0 of s5997_0 => (case ((csr_mnemonic_matches_prefix s5997_0)) of SOME ((op, s5998_0)) => let s5999_0 = (string_drop s5997_0 s5998_0) in if ((string_startswith s5999_0 "i")) then (case ((string_drop s5999_0 ((string_length "i")))) of s6000_0 => (case ((spc_matches_prefix0 s6000_0)) of SOME ((() , s6001_0)) => (case ((string_drop s6000_0 s6001_0)) of s6002_0 => (case ((reg_name_matches_prefix s6002_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s6003_0)) => (case ((string_drop s6002_0 s6003_0)) of s6004_0 => (case ((sep_matches_prefix s6004_0)) of SOME ((() , s6005_0)) => (case ((string_drop s6004_0 s6005_0)) of s6006_0 => (case ((csr_name_map_matches_prefix s6006_0 : (( 12 words$word # ii)) option)) of SOME ((csr, s6007_0)) => (case ((string_drop s6006_0 s6007_0)) of s6008_0 => (case ((sep_matches_prefix s6008_0)) of SOME ((() , s6009_0)) => (case ((string_drop s6008_0 s6009_0)) of s6010_0 => (case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s6010_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s6011_0)) => (case ((string_drop s6010_0 s6011_0)) of s_ => SOME (op, rd, csr, rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) )))`; (*val _s5976_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5976_:string ->(bool#(5)words$word#(5)words$word#(5)words$word#string)option) s5977_0= (let s5978_0 = s5977_0 in if ((string_startswith s5978_0 "rem")) then (case ((string_drop s5978_0 ((string_length "rem")))) of s5979_0 => (case ((maybe_not_u_matches_prefix s5979_0)) of SOME ((s, s5980_0)) => let s5981_0 = (string_drop s5979_0 s5980_0) in if ((string_startswith s5981_0 "w")) then (case ((string_drop s5981_0 ((string_length "w")))) of s5982_0 => (case ((spc_matches_prefix0 s5982_0)) of SOME ((() , s5983_0)) => (case ((string_drop s5982_0 s5983_0)) of s5984_0 => (case ((reg_name_matches_prefix s5984_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5985_0)) => (case ((string_drop s5984_0 s5985_0)) of s5986_0 => (case ((sep_matches_prefix s5986_0)) of SOME ((() , s5987_0)) => (case ((string_drop s5986_0 s5987_0)) of s5988_0 => (case ((reg_name_matches_prefix s5988_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5989_0)) => (case ((string_drop s5988_0 s5989_0)) of s5990_0 => (case ((sep_matches_prefix s5990_0)) of SOME ((() , s5991_0)) => (case ((string_drop s5990_0 s5991_0)) of s5992_0 => (case ((reg_name_matches_prefix s5992_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5993_0)) => (case ((string_drop s5992_0 s5993_0)) of s_ => SOME (s, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s5957_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5957_:string ->(bool#(5)words$word#(5)words$word#(5)words$word#string)option) s5958_0= (let s5959_0 = s5958_0 in if ((string_startswith s5959_0 "div")) then (case ((string_drop s5959_0 ((string_length "div")))) of s5960_0 => (case ((maybe_not_u_matches_prefix s5960_0)) of SOME ((s, s5961_0)) => let s5962_0 = (string_drop s5960_0 s5961_0) in if ((string_startswith s5962_0 "w")) then (case ((string_drop s5962_0 ((string_length "w")))) of s5963_0 => (case ((spc_matches_prefix0 s5963_0)) of SOME ((() , s5964_0)) => (case ((string_drop s5963_0 s5964_0)) of s5965_0 => (case ((reg_name_matches_prefix s5965_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5966_0)) => (case ((string_drop s5965_0 s5966_0)) of s5967_0 => (case ((sep_matches_prefix s5967_0)) of SOME ((() , s5968_0)) => (case ((string_drop s5967_0 s5968_0)) of s5969_0 => (case ((reg_name_matches_prefix s5969_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5970_0)) => (case ((string_drop s5969_0 s5970_0)) of s5971_0 => (case ((sep_matches_prefix s5971_0)) of SOME ((() , s5972_0)) => (case ((string_drop s5971_0 s5972_0)) of s5973_0 => (case ((reg_name_matches_prefix s5973_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5974_0)) => (case ((string_drop s5973_0 s5974_0)) of s_ => SOME (s, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) else NONE))`; (*val _s5941_ : string -> maybe ((mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5941_:string ->((5)words$word#(5)words$word#(5)words$word#string)option) s5942_0= (let s5943_0 = s5942_0 in if ((string_startswith s5943_0 "mulw")) then (case ((string_drop s5943_0 ((string_length "mulw")))) of s5944_0 => (case ((spc_matches_prefix0 s5944_0)) of SOME ((() , s5945_0)) => (case ((string_drop s5944_0 s5945_0)) of s5946_0 => (case ((reg_name_matches_prefix s5946_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5947_0)) => (case ((string_drop s5946_0 s5947_0)) of s5948_0 => (case ((sep_matches_prefix s5948_0)) of SOME ((() , s5949_0)) => (case ((string_drop s5948_0 s5949_0)) of s5950_0 => (case ((reg_name_matches_prefix s5950_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5951_0)) => (case ((string_drop s5950_0 s5951_0)) of s5952_0 => (case ((sep_matches_prefix s5952_0)) of SOME ((() , s5953_0)) => (case ((string_drop s5952_0 s5953_0)) of s5954_0 => (case ((reg_name_matches_prefix s5954_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5955_0)) => (case ((string_drop s5954_0 s5955_0)) of s_ => SOME (rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5923_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5923_:string ->(bool#(5)words$word#(5)words$word#(5)words$word#string)option) s5924_0= (let s5925_0 = s5924_0 in if ((string_startswith s5925_0 "rem")) then (case ((string_drop s5925_0 ((string_length "rem")))) of s5926_0 => (case ((maybe_not_u_matches_prefix s5926_0)) of SOME ((s, s5927_0)) => (case ((string_drop s5926_0 s5927_0)) of s5928_0 => (case ((spc_matches_prefix0 s5928_0)) of SOME ((() , s5929_0)) => (case ((string_drop s5928_0 s5929_0)) of s5930_0 => (case ((reg_name_matches_prefix s5930_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5931_0)) => (case ((string_drop s5930_0 s5931_0)) of s5932_0 => (case ((sep_matches_prefix s5932_0)) of SOME ((() , s5933_0)) => (case ((string_drop s5932_0 s5933_0)) of s5934_0 => (case ((reg_name_matches_prefix s5934_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5935_0)) => (case ((string_drop s5934_0 s5935_0)) of s5936_0 => (case ((sep_matches_prefix s5936_0)) of SOME ((() , s5937_0)) => (case ((string_drop s5936_0 s5937_0)) of s5938_0 => (case ((reg_name_matches_prefix s5938_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5939_0)) => (case ((string_drop s5938_0 s5939_0)) of s_ => SOME (s, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5905_ : string -> maybe ((bool * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5905_:string ->(bool#(5)words$word#(5)words$word#(5)words$word#string)option) s5906_0= (let s5907_0 = s5906_0 in if ((string_startswith s5907_0 "div")) then (case ((string_drop s5907_0 ((string_length "div")))) of s5908_0 => (case ((maybe_not_u_matches_prefix s5908_0)) of SOME ((s, s5909_0)) => (case ((string_drop s5908_0 s5909_0)) of s5910_0 => (case ((spc_matches_prefix0 s5910_0)) of SOME ((() , s5911_0)) => (case ((string_drop s5910_0 s5911_0)) of s5912_0 => (case ((reg_name_matches_prefix s5912_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5913_0)) => (case ((string_drop s5912_0 s5913_0)) of s5914_0 => (case ((sep_matches_prefix s5914_0)) of SOME ((() , s5915_0)) => (case ((string_drop s5914_0 s5915_0)) of s5916_0 => (case ((reg_name_matches_prefix s5916_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5917_0)) => (case ((string_drop s5916_0 s5917_0)) of s5918_0 => (case ((sep_matches_prefix s5918_0)) of SOME ((() , s5919_0)) => (case ((string_drop s5918_0 s5919_0)) of s5920_0 => (case ((reg_name_matches_prefix s5920_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5921_0)) => (case ((string_drop s5920_0 s5921_0)) of s_ => SOME (s, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5888_ : string -> maybe ((bool * bool * bool * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5888_:string ->(bool#bool#bool#(5)words$word#(5)words$word#(5)words$word#string)option) s5889_0= ((case s5889_0 of s5890_0 => (case ((mul_mnemonic_matches_prefix s5890_0)) of SOME (((high, signed1, signed2), s5891_0)) => (case ((string_drop s5890_0 s5891_0)) of s5892_0 => (case ((spc_matches_prefix0 s5892_0)) of SOME ((() , s5893_0)) => (case ((string_drop s5892_0 s5893_0)) of s5894_0 => (case ((reg_name_matches_prefix s5894_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5895_0)) => (case ((string_drop s5894_0 s5895_0)) of s5896_0 => (case ((sep_matches_prefix s5896_0)) of SOME ((() , s5897_0)) => (case ((string_drop s5896_0 s5897_0)) of s5898_0 => (case ((reg_name_matches_prefix s5898_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5899_0)) => (case ((string_drop s5898_0 s5899_0)) of s5900_0 => (case ((sep_matches_prefix s5900_0)) of SOME ((() , s5901_0)) => (case ((string_drop s5900_0 s5901_0)) of s5902_0 => (case ((reg_name_matches_prefix s5902_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5903_0)) => (case ((string_drop s5902_0 s5903_0)) of s_ => SOME (high, signed1, signed2, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5876_ : string -> maybe ((mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5876_:string ->((5)words$word#(5)words$word#string)option) s5877_0= (let s5878_0 = s5877_0 in if ((string_startswith s5878_0 "c.add")) then (case ((string_drop s5878_0 ((string_length "c.add")))) of s5879_0 => (case ((spc_matches_prefix0 s5879_0)) of SOME ((() , s5880_0)) => (case ((string_drop s5879_0 s5880_0)) of s5881_0 => (case ((reg_name_matches_prefix s5881_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s5882_0)) => (case ((string_drop s5881_0 s5882_0)) of s5883_0 => (case ((sep_matches_prefix s5883_0)) of SOME ((() , s5884_0)) => (case ((string_drop s5883_0 s5884_0)) of s5885_0 => (case ((reg_name_matches_prefix s5885_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5886_0)) => (case ((string_drop s5885_0 s5886_0)) of s_ => SOME (rsd, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5872_ : string -> maybe string*) val _ = Define ` ((s5872_:string ->(string)option) s5873_0= (let s5874_0 = s5873_0 in if ((string_startswith s5874_0 "c.ebreak")) then (case ((string_drop s5874_0 ((string_length "c.ebreak")))) of s_ => SOME s_ ) else NONE))`; (*val _s5860_ : string -> maybe ((mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5860_:string ->((5)words$word#(5)words$word#string)option) s5861_0= (let s5862_0 = s5861_0 in if ((string_startswith s5862_0 "c.mv")) then (case ((string_drop s5862_0 ((string_length "c.mv")))) of s5863_0 => (case ((spc_matches_prefix0 s5863_0)) of SOME ((() , s5864_0)) => (case ((string_drop s5863_0 s5864_0)) of s5865_0 => (case ((reg_name_matches_prefix s5865_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5866_0)) => (case ((string_drop s5865_0 s5866_0)) of s5867_0 => (case ((sep_matches_prefix s5867_0)) of SOME ((() , s5868_0)) => (case ((string_drop s5867_0 s5868_0)) of s5869_0 => (case ((reg_name_matches_prefix s5869_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5870_0)) => (case ((string_drop s5869_0 s5870_0)) of s_ => SOME (rd, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5852_ : string -> maybe ((mword ty5 * string))*) val _ = Define ` ((s5852_:string ->((5)words$word#string)option) s5853_0= (let s5854_0 = s5853_0 in if ((string_startswith s5854_0 "c.jalr")) then (case ((string_drop s5854_0 ((string_length "c.jalr")))) of s5855_0 => (case ((spc_matches_prefix0 s5855_0)) of SOME ((() , s5856_0)) => (case ((string_drop s5855_0 s5856_0)) of s5857_0 => (case ((reg_name_matches_prefix s5857_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5858_0)) => (case ((string_drop s5857_0 s5858_0)) of s_ => SOME (rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5844_ : string -> maybe ((mword ty5 * string))*) val _ = Define ` ((s5844_:string ->((5)words$word#string)option) s5845_0= (let s5846_0 = s5845_0 in if ((string_startswith s5846_0 "c.jr")) then (case ((string_drop s5846_0 ((string_length "c.jr")))) of s5847_0 => (case ((spc_matches_prefix0 s5847_0)) of SOME ((() , s5848_0)) => (case ((string_drop s5847_0 s5848_0)) of s5849_0 => (case ((reg_name_matches_prefix s5849_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5850_0)) => (case ((string_drop s5849_0 s5850_0)) of s_ => SOME (rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5832_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5832_:string ->((5)words$word#(6)words$word#string)option) s5833_0= (let s5834_0 = s5833_0 in if ((string_startswith s5834_0 "c.sdsp")) then (case ((string_drop s5834_0 ((string_length "c.sdsp")))) of s5835_0 => (case ((spc_matches_prefix0 s5835_0)) of SOME ((() , s5836_0)) => (case ((string_drop s5835_0 s5836_0)) of s5837_0 => (case ((reg_name_matches_prefix s5837_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5838_0)) => (case ((string_drop s5837_0 s5838_0)) of s5839_0 => (case ((sep_matches_prefix s5839_0)) of SOME ((() , s5840_0)) => (case ((string_drop s5839_0 s5840_0)) of s5841_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5841_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s5842_0)) => (case ((string_drop s5841_0 s5842_0)) of s_ => SOME (rs2, uimm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5820_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5820_:string ->((5)words$word#(6)words$word#string)option) s5821_0= (let s5822_0 = s5821_0 in if ((string_startswith s5822_0 "c.swsp")) then (case ((string_drop s5822_0 ((string_length "c.swsp")))) of s5823_0 => (case ((spc_matches_prefix0 s5823_0)) of SOME ((() , s5824_0)) => (case ((string_drop s5823_0 s5824_0)) of s5825_0 => (case ((reg_name_matches_prefix s5825_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5826_0)) => (case ((string_drop s5825_0 s5826_0)) of s5827_0 => (case ((sep_matches_prefix s5827_0)) of SOME ((() , s5828_0)) => (case ((string_drop s5827_0 s5828_0)) of s5829_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5829_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s5830_0)) => (case ((string_drop s5829_0 s5830_0)) of s_ => SOME (rd, uimm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5808_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5808_:string ->((5)words$word#(6)words$word#string)option) s5809_0= (let s5810_0 = s5809_0 in if ((string_startswith s5810_0 "c.ldsp")) then (case ((string_drop s5810_0 ((string_length "c.ldsp")))) of s5811_0 => (case ((spc_matches_prefix0 s5811_0)) of SOME ((() , s5812_0)) => (case ((string_drop s5811_0 s5812_0)) of s5813_0 => (case ((reg_name_matches_prefix s5813_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5814_0)) => (case ((string_drop s5813_0 s5814_0)) of s5815_0 => (case ((sep_matches_prefix s5815_0)) of SOME ((() , s5816_0)) => (case ((string_drop s5815_0 s5816_0)) of s5817_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5817_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s5818_0)) => (case ((string_drop s5817_0 s5818_0)) of s_ => SOME (rd, uimm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5796_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5796_:string ->((5)words$word#(6)words$word#string)option) s5797_0= (let s5798_0 = s5797_0 in if ((string_startswith s5798_0 "c.lwsp")) then (case ((string_drop s5798_0 ((string_length "c.lwsp")))) of s5799_0 => (case ((spc_matches_prefix0 s5799_0)) of SOME ((() , s5800_0)) => (case ((string_drop s5799_0 s5800_0)) of s5801_0 => (case ((reg_name_matches_prefix s5801_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5802_0)) => (case ((string_drop s5801_0 s5802_0)) of s5803_0 => (case ((sep_matches_prefix s5803_0)) of SOME ((() , s5804_0)) => (case ((string_drop s5803_0 s5804_0)) of s5805_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5805_0 : (( 6 words$word # ii)) option)) of SOME ((uimm, s5806_0)) => (case ((string_drop s5805_0 s5806_0)) of s_ => SOME (rd, uimm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5784_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5784_:string ->((5)words$word#(6)words$word#string)option) s5785_0= (let s5786_0 = s5785_0 in if ((string_startswith s5786_0 "c.slli")) then (case ((string_drop s5786_0 ((string_length "c.slli")))) of s5787_0 => (case ((spc_matches_prefix0 s5787_0)) of SOME ((() , s5788_0)) => (case ((string_drop s5787_0 s5788_0)) of s5789_0 => (case ((reg_name_matches_prefix s5789_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s5790_0)) => (case ((string_drop s5789_0 s5790_0)) of s5791_0 => (case ((sep_matches_prefix s5791_0)) of SOME ((() , s5792_0)) => (case ((string_drop s5791_0 s5792_0)) of s5793_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5793_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s5794_0)) => (case ((string_drop s5793_0 s5794_0)) of s_ => SOME (rsd, shamt, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5772_ : string -> maybe ((mword ty3 * mword ty8 * string))*) val _ = Define ` ((s5772_:string ->((3)words$word#(8)words$word#string)option) s5773_0= (let s5774_0 = s5773_0 in if ((string_startswith s5774_0 "c.bnez")) then (case ((string_drop s5774_0 ((string_length "c.bnez")))) of s5775_0 => (case ((spc_matches_prefix0 s5775_0)) of SOME ((() , s5776_0)) => (case ((string_drop s5775_0 s5776_0)) of s5777_0 => (case ((creg_name_matches_prefix s5777_0 : (( 3 words$word # ii)) option)) of SOME ((rs, s5778_0)) => (case ((string_drop s5777_0 s5778_0)) of s5779_0 => (case ((sep_matches_prefix s5779_0)) of SOME ((() , s5780_0)) => (case ((string_drop s5779_0 s5780_0)) of s5781_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5781_0 : (( 8 words$word # ii)) option)) of SOME ((imm, s5782_0)) => (case ((string_drop s5781_0 s5782_0)) of s_ => SOME (rs, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5760_ : string -> maybe ((mword ty3 * mword ty8 * string))*) val _ = Define ` ((s5760_:string ->((3)words$word#(8)words$word#string)option) s5761_0= (let s5762_0 = s5761_0 in if ((string_startswith s5762_0 "c.beqz")) then (case ((string_drop s5762_0 ((string_length "c.beqz")))) of s5763_0 => (case ((spc_matches_prefix0 s5763_0)) of SOME ((() , s5764_0)) => (case ((string_drop s5763_0 s5764_0)) of s5765_0 => (case ((creg_name_matches_prefix s5765_0 : (( 3 words$word # ii)) option)) of SOME ((rs, s5766_0)) => (case ((string_drop s5765_0 s5766_0)) of s5767_0 => (case ((sep_matches_prefix s5767_0)) of SOME ((() , s5768_0)) => (case ((string_drop s5767_0 s5768_0)) of s5769_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5769_0 : (( 8 words$word # ii)) option)) of SOME ((imm, s5770_0)) => (case ((string_drop s5769_0 s5770_0)) of s_ => SOME (rs, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5752_ : string -> maybe ((mword ty11 * string))*) val _ = Define ` ((s5752_:string ->((11)words$word#string)option) s5753_0= (let s5754_0 = s5753_0 in if ((string_startswith s5754_0 "c.j")) then (case ((string_drop s5754_0 ((string_length "c.j")))) of s5755_0 => (case ((spc_matches_prefix0 s5755_0)) of SOME ((() , s5756_0)) => (case ((string_drop s5755_0 s5756_0)) of s5757_0 => (case ((hex_bits_11_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5757_0 : (( 11 words$word # ii)) option)) of SOME ((imm, s5758_0)) => (case ((string_drop s5757_0 s5758_0)) of s_ => SOME (imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5740_ : string -> maybe ((mword ty3 * mword ty3 * string))*) val _ = Define ` ((s5740_:string ->((3)words$word#(3)words$word#string)option) s5741_0= (let s5742_0 = s5741_0 in if ((string_startswith s5742_0 "c.addw")) then (case ((string_drop s5742_0 ((string_length "c.addw")))) of s5743_0 => (case ((spc_matches_prefix0 s5743_0)) of SOME ((() , s5744_0)) => (case ((string_drop s5743_0 s5744_0)) of s5745_0 => (case ((creg_name_matches_prefix s5745_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s5746_0)) => (case ((string_drop s5745_0 s5746_0)) of s5747_0 => (case ((sep_matches_prefix s5747_0)) of SOME ((() , s5748_0)) => (case ((string_drop s5747_0 s5748_0)) of s5749_0 => (case ((creg_name_matches_prefix s5749_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s5750_0)) => (case ((string_drop s5749_0 s5750_0)) of s_ => SOME (rsd, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5728_ : string -> maybe ((mword ty3 * mword ty3 * string))*) val _ = Define ` ((s5728_:string ->((3)words$word#(3)words$word#string)option) s5729_0= (let s5730_0 = s5729_0 in if ((string_startswith s5730_0 "c.subw")) then (case ((string_drop s5730_0 ((string_length "c.subw")))) of s5731_0 => (case ((spc_matches_prefix0 s5731_0)) of SOME ((() , s5732_0)) => (case ((string_drop s5731_0 s5732_0)) of s5733_0 => (case ((creg_name_matches_prefix s5733_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s5734_0)) => (case ((string_drop s5733_0 s5734_0)) of s5735_0 => (case ((sep_matches_prefix s5735_0)) of SOME ((() , s5736_0)) => (case ((string_drop s5735_0 s5736_0)) of s5737_0 => (case ((creg_name_matches_prefix s5737_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s5738_0)) => (case ((string_drop s5737_0 s5738_0)) of s_ => SOME (rsd, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5716_ : string -> maybe ((mword ty3 * mword ty3 * string))*) val _ = Define ` ((s5716_:string ->((3)words$word#(3)words$word#string)option) s5717_0= (let s5718_0 = s5717_0 in if ((string_startswith s5718_0 "c.and")) then (case ((string_drop s5718_0 ((string_length "c.and")))) of s5719_0 => (case ((spc_matches_prefix0 s5719_0)) of SOME ((() , s5720_0)) => (case ((string_drop s5719_0 s5720_0)) of s5721_0 => (case ((creg_name_matches_prefix s5721_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s5722_0)) => (case ((string_drop s5721_0 s5722_0)) of s5723_0 => (case ((sep_matches_prefix s5723_0)) of SOME ((() , s5724_0)) => (case ((string_drop s5723_0 s5724_0)) of s5725_0 => (case ((creg_name_matches_prefix s5725_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s5726_0)) => (case ((string_drop s5725_0 s5726_0)) of s_ => SOME (rsd, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5704_ : string -> maybe ((mword ty3 * mword ty3 * string))*) val _ = Define ` ((s5704_:string ->((3)words$word#(3)words$word#string)option) s5705_0= (let s5706_0 = s5705_0 in if ((string_startswith s5706_0 "c.or")) then (case ((string_drop s5706_0 ((string_length "c.or")))) of s5707_0 => (case ((spc_matches_prefix0 s5707_0)) of SOME ((() , s5708_0)) => (case ((string_drop s5707_0 s5708_0)) of s5709_0 => (case ((creg_name_matches_prefix s5709_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s5710_0)) => (case ((string_drop s5709_0 s5710_0)) of s5711_0 => (case ((sep_matches_prefix s5711_0)) of SOME ((() , s5712_0)) => (case ((string_drop s5711_0 s5712_0)) of s5713_0 => (case ((creg_name_matches_prefix s5713_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s5714_0)) => (case ((string_drop s5713_0 s5714_0)) of s_ => SOME (rsd, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5692_ : string -> maybe ((mword ty3 * mword ty3 * string))*) val _ = Define ` ((s5692_:string ->((3)words$word#(3)words$word#string)option) s5693_0= (let s5694_0 = s5693_0 in if ((string_startswith s5694_0 "c.xor")) then (case ((string_drop s5694_0 ((string_length "c.xor")))) of s5695_0 => (case ((spc_matches_prefix0 s5695_0)) of SOME ((() , s5696_0)) => (case ((string_drop s5695_0 s5696_0)) of s5697_0 => (case ((creg_name_matches_prefix s5697_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s5698_0)) => (case ((string_drop s5697_0 s5698_0)) of s5699_0 => (case ((sep_matches_prefix s5699_0)) of SOME ((() , s5700_0)) => (case ((string_drop s5699_0 s5700_0)) of s5701_0 => (case ((creg_name_matches_prefix s5701_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s5702_0)) => (case ((string_drop s5701_0 s5702_0)) of s_ => SOME (rsd, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5680_ : string -> maybe ((mword ty3 * mword ty3 * string))*) val _ = Define ` ((s5680_:string ->((3)words$word#(3)words$word#string)option) s5681_0= (let s5682_0 = s5681_0 in if ((string_startswith s5682_0 "c.sub")) then (case ((string_drop s5682_0 ((string_length "c.sub")))) of s5683_0 => (case ((spc_matches_prefix0 s5683_0)) of SOME ((() , s5684_0)) => (case ((string_drop s5683_0 s5684_0)) of s5685_0 => (case ((creg_name_matches_prefix s5685_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s5686_0)) => (case ((string_drop s5685_0 s5686_0)) of s5687_0 => (case ((sep_matches_prefix s5687_0)) of SOME ((() , s5688_0)) => (case ((string_drop s5687_0 s5688_0)) of s5689_0 => (case ((creg_name_matches_prefix s5689_0 : (( 3 words$word # ii)) option)) of SOME ((rs2, s5690_0)) => (case ((string_drop s5689_0 s5690_0)) of s_ => SOME (rsd, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5668_ : string -> maybe ((mword ty3 * mword ty6 * string))*) val _ = Define ` ((s5668_:string ->((3)words$word#(6)words$word#string)option) s5669_0= (let s5670_0 = s5669_0 in if ((string_startswith s5670_0 "c.andi")) then (case ((string_drop s5670_0 ((string_length "c.andi")))) of s5671_0 => (case ((spc_matches_prefix0 s5671_0)) of SOME ((() , s5672_0)) => (case ((string_drop s5671_0 s5672_0)) of s5673_0 => (case ((creg_name_matches_prefix s5673_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s5674_0)) => (case ((string_drop s5673_0 s5674_0)) of s5675_0 => (case ((sep_matches_prefix s5675_0)) of SOME ((() , s5676_0)) => (case ((string_drop s5675_0 s5676_0)) of s5677_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5677_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s5678_0)) => (case ((string_drop s5677_0 s5678_0)) of s_ => SOME (rsd, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5656_ : string -> maybe ((mword ty3 * mword ty6 * string))*) val _ = Define ` ((s5656_:string ->((3)words$word#(6)words$word#string)option) s5657_0= (let s5658_0 = s5657_0 in if ((string_startswith s5658_0 "c.srai")) then (case ((string_drop s5658_0 ((string_length "c.srai")))) of s5659_0 => (case ((spc_matches_prefix0 s5659_0)) of SOME ((() , s5660_0)) => (case ((string_drop s5659_0 s5660_0)) of s5661_0 => (case ((creg_name_matches_prefix s5661_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s5662_0)) => (case ((string_drop s5661_0 s5662_0)) of s5663_0 => (case ((sep_matches_prefix s5663_0)) of SOME ((() , s5664_0)) => (case ((string_drop s5663_0 s5664_0)) of s5665_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5665_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s5666_0)) => (case ((string_drop s5665_0 s5666_0)) of s_ => SOME (rsd, shamt, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5644_ : string -> maybe ((mword ty3 * mword ty6 * string))*) val _ = Define ` ((s5644_:string ->((3)words$word#(6)words$word#string)option) s5645_0= (let s5646_0 = s5645_0 in if ((string_startswith s5646_0 "c.srli")) then (case ((string_drop s5646_0 ((string_length "c.srli")))) of s5647_0 => (case ((spc_matches_prefix0 s5647_0)) of SOME ((() , s5648_0)) => (case ((string_drop s5647_0 s5648_0)) of s5649_0 => (case ((creg_name_matches_prefix s5649_0 : (( 3 words$word # ii)) option)) of SOME ((rsd, s5650_0)) => (case ((string_drop s5649_0 s5650_0)) of s5651_0 => (case ((sep_matches_prefix s5651_0)) of SOME ((() , s5652_0)) => (case ((string_drop s5651_0 s5652_0)) of s5653_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5653_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s5654_0)) => (case ((string_drop s5653_0 s5654_0)) of s_ => SOME (rsd, shamt, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5632_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5632_:string ->((5)words$word#(6)words$word#string)option) s5633_0= (let s5634_0 = s5633_0 in if ((string_startswith s5634_0 "c.lui")) then (case ((string_drop s5634_0 ((string_length "c.lui")))) of s5635_0 => (case ((spc_matches_prefix0 s5635_0)) of SOME ((() , s5636_0)) => (case ((string_drop s5635_0 s5636_0)) of s5637_0 => (case ((reg_name_matches_prefix s5637_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5638_0)) => (case ((string_drop s5637_0 s5638_0)) of s5639_0 => (case ((sep_matches_prefix s5639_0)) of SOME ((() , s5640_0)) => (case ((string_drop s5639_0 s5640_0)) of s5641_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5641_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s5642_0)) => (case ((string_drop s5641_0 s5642_0)) of s_ => SOME (rd, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5624_ : string -> maybe ((mword ty6 * string))*) val _ = Define ` ((s5624_:string ->((6)words$word#string)option) s5625_0= (let s5626_0 = s5625_0 in if ((string_startswith s5626_0 "c.addi16sp")) then (case ((string_drop s5626_0 ((string_length "c.addi16sp")))) of s5627_0 => (case ((spc_matches_prefix0 s5627_0)) of SOME ((() , s5628_0)) => (case ((string_drop s5627_0 s5628_0)) of s5629_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5629_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s5630_0)) => (case ((string_drop s5629_0 s5630_0)) of s_ => SOME (imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5612_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5612_:string ->((5)words$word#(6)words$word#string)option) s5613_0= (let s5614_0 = s5613_0 in if ((string_startswith s5614_0 "c.li")) then (case ((string_drop s5614_0 ((string_length "c.li")))) of s5615_0 => (case ((spc_matches_prefix0 s5615_0)) of SOME ((() , s5616_0)) => (case ((string_drop s5615_0 s5616_0)) of s5617_0 => (case ((reg_name_matches_prefix s5617_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5618_0)) => (case ((string_drop s5617_0 s5618_0)) of s5619_0 => (case ((sep_matches_prefix s5619_0)) of SOME ((() , s5620_0)) => (case ((string_drop s5619_0 s5620_0)) of s5621_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5621_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s5622_0)) => (case ((string_drop s5621_0 s5622_0)) of s_ => SOME (rd, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5600_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5600_:string ->((5)words$word#(6)words$word#string)option) s5601_0= (let s5602_0 = s5601_0 in if ((string_startswith s5602_0 "c.addiw")) then (case ((string_drop s5602_0 ((string_length "c.addiw")))) of s5603_0 => (case ((spc_matches_prefix0 s5603_0)) of SOME ((() , s5604_0)) => (case ((string_drop s5603_0 s5604_0)) of s5605_0 => (case ((reg_name_matches_prefix s5605_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s5606_0)) => (case ((string_drop s5605_0 s5606_0)) of s5607_0 => (case ((sep_matches_prefix s5607_0)) of SOME ((() , s5608_0)) => (case ((string_drop s5607_0 s5608_0)) of s5609_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5609_0 : (( 6 words$word # ii)) option)) of SOME ((imm, s5610_0)) => (case ((string_drop s5609_0 s5610_0)) of s_ => SOME (rsd, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5592_ : string -> maybe ((mword ty11 * string))*) val _ = Define ` ((s5592_:string ->((11)words$word#string)option) s5593_0= (let s5594_0 = s5593_0 in if ((string_startswith s5594_0 "c.jal")) then (case ((string_drop s5594_0 ((string_length "c.jal")))) of s5595_0 => (case ((spc_matches_prefix0 s5595_0)) of SOME ((() , s5596_0)) => (case ((string_drop s5595_0 s5596_0)) of s5597_0 => (case ((hex_bits_12_matches_prefix0 s5597_0 : (( 12 words$word # ii)) option)) of SOME ((v__1490, s5598_0)) => if (((((subrange_vec_dec v__1490 (( 0 : int): ii) (( 0 : int): ii) : 1 words$word)) = (0b0w : 1 words$word)))) then let (imm : 11 words$word) = ((subrange_vec_dec v__1490 (( 11 : int): ii) (( 1 : int): ii) : 11 words$word)) in let (imm : 11 words$word) = ((subrange_vec_dec v__1490 (( 11 : int): ii) (( 1 : int): ii) : 11 words$word)) in (case ((string_drop s5597_0 s5598_0)) of s_ => SOME (imm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5580_ : string -> maybe ((mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5580_:string ->((5)words$word#(6)words$word#string)option) s5581_0= (let s5582_0 = s5581_0 in if ((string_startswith s5582_0 "c.addi")) then (case ((string_drop s5582_0 ((string_length "c.addi")))) of s5583_0 => (case ((spc_matches_prefix0 s5583_0)) of SOME ((() , s5584_0)) => (case ((string_drop s5583_0 s5584_0)) of s5585_0 => (case ((reg_name_matches_prefix s5585_0 : (( 5 words$word # ii)) option)) of SOME ((rsd, s5586_0)) => (case ((string_drop s5585_0 s5586_0)) of s5587_0 => (case ((sep_matches_prefix s5587_0)) of SOME ((() , s5588_0)) => (case ((string_drop s5587_0 s5588_0)) of s5589_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5589_0 : (( 6 words$word # ii)) option)) of SOME ((nzi, s5590_0)) => (case ((string_drop s5589_0 s5590_0)) of s_ => SOME (rsd, nzi, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5564_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5 * string))*) val _ = Define ` ((s5564_:string ->((3)words$word#(3)words$word#(5)words$word#string)option) s5565_0= (let s5566_0 = s5565_0 in if ((string_startswith s5566_0 "c.sd")) then (case ((string_drop s5566_0 ((string_length "c.sd")))) of s5567_0 => (case ((spc_matches_prefix0 s5567_0)) of SOME ((() , s5568_0)) => (case ((string_drop s5567_0 s5568_0)) of s5569_0 => (case ((creg_name_matches_prefix s5569_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s5570_0)) => (case ((string_drop s5569_0 s5570_0)) of s5571_0 => (case ((sep_matches_prefix s5571_0)) of SOME ((() , s5572_0)) => (case ((string_drop s5571_0 s5572_0)) of s5573_0 => (case ((creg_name_matches_prefix s5573_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s5574_0)) => (case ((string_drop s5573_0 s5574_0)) of s5575_0 => (case ((sep_matches_prefix s5575_0)) of SOME ((() , s5576_0)) => (case ((string_drop s5575_0 s5576_0)) of s5577_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5577_0 : (( 8 words$word # ii)) option)) of SOME ((v__1492, s5578_0)) => if (((((subrange_vec_dec v__1492 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1492 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1492 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in (case ((string_drop s5577_0 s5578_0)) of s_ => SOME (rsc1, rsc2, uimm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5548_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5 * string))*) val _ = Define ` ((s5548_:string ->((3)words$word#(3)words$word#(5)words$word#string)option) s5549_0= (let s5550_0 = s5549_0 in if ((string_startswith s5550_0 "c.sw")) then (case ((string_drop s5550_0 ((string_length "c.sw")))) of s5551_0 => (case ((spc_matches_prefix0 s5551_0)) of SOME ((() , s5552_0)) => (case ((string_drop s5551_0 s5552_0)) of s5553_0 => (case ((creg_name_matches_prefix s5553_0 : (( 3 words$word # ii)) option)) of SOME ((rsc1, s5554_0)) => (case ((string_drop s5553_0 s5554_0)) of s5555_0 => (case ((sep_matches_prefix s5555_0)) of SOME ((() , s5556_0)) => (case ((string_drop s5555_0 s5556_0)) of s5557_0 => (case ((creg_name_matches_prefix s5557_0 : (( 3 words$word # ii)) option)) of SOME ((rsc2, s5558_0)) => (case ((string_drop s5557_0 s5558_0)) of s5559_0 => (case ((sep_matches_prefix s5559_0)) of SOME ((() , s5560_0)) => (case ((string_drop s5559_0 s5560_0)) of s5561_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5561_0 : (( 7 words$word # ii)) option)) of SOME ((v__1494, s5562_0)) => if (((((subrange_vec_dec v__1494 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1494 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1494 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in (case ((string_drop s5561_0 s5562_0)) of s_ => SOME (rsc1, rsc2, uimm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5532_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5 * string))*) val _ = Define ` ((s5532_:string ->((3)words$word#(3)words$word#(5)words$word#string)option) s5533_0= (let s5534_0 = s5533_0 in if ((string_startswith s5534_0 "c.ld")) then (case ((string_drop s5534_0 ((string_length "c.ld")))) of s5535_0 => (case ((spc_matches_prefix0 s5535_0)) of SOME ((() , s5536_0)) => (case ((string_drop s5535_0 s5536_0)) of s5537_0 => (case ((creg_name_matches_prefix s5537_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s5538_0)) => (case ((string_drop s5537_0 s5538_0)) of s5539_0 => (case ((sep_matches_prefix s5539_0)) of SOME ((() , s5540_0)) => (case ((string_drop s5539_0 s5540_0)) of s5541_0 => (case ((creg_name_matches_prefix s5541_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s5542_0)) => (case ((string_drop s5541_0 s5542_0)) of s5543_0 => (case ((sep_matches_prefix s5543_0)) of SOME ((() , s5544_0)) => (case ((string_drop s5543_0 s5544_0)) of s5545_0 => (case ((hex_bits_8_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5545_0 : (( 8 words$word # ii)) option)) of SOME ((v__1496, s5546_0)) => if (((((subrange_vec_dec v__1496 (( 2 : int): ii) (( 0 : int): ii) : 3 words$word)) = (0b000w : 3 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1496 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1496 (( 7 : int): ii) (( 3 : int): ii) : 5 words$word)) in (case ((string_drop s5545_0 s5546_0)) of s_ => SOME (rdc, rsc, uimm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5516_ : string -> maybe ((mword ty3 * mword ty3 * mword ty5 * string))*) val _ = Define ` ((s5516_:string ->((3)words$word#(3)words$word#(5)words$word#string)option) s5517_0= (let s5518_0 = s5517_0 in if ((string_startswith s5518_0 "c.lw")) then (case ((string_drop s5518_0 ((string_length "c.lw")))) of s5519_0 => (case ((spc_matches_prefix0 s5519_0)) of SOME ((() , s5520_0)) => (case ((string_drop s5519_0 s5520_0)) of s5521_0 => (case ((creg_name_matches_prefix s5521_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s5522_0)) => (case ((string_drop s5521_0 s5522_0)) of s5523_0 => (case ((sep_matches_prefix s5523_0)) of SOME ((() , s5524_0)) => (case ((string_drop s5523_0 s5524_0)) of s5525_0 => (case ((creg_name_matches_prefix s5525_0 : (( 3 words$word # ii)) option)) of SOME ((rsc, s5526_0)) => (case ((string_drop s5525_0 s5526_0)) of s5527_0 => (case ((sep_matches_prefix s5527_0)) of SOME ((() , s5528_0)) => (case ((string_drop s5527_0 s5528_0)) of s5529_0 => (case ((hex_bits_7_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5529_0 : (( 7 words$word # ii)) option)) of SOME ((v__1498, s5530_0)) => if (((((subrange_vec_dec v__1498 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (uimm : 5 words$word) = ((subrange_vec_dec v__1498 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in let (uimm : 5 words$word) = ((subrange_vec_dec v__1498 (( 6 : int): ii) (( 2 : int): ii) : 5 words$word)) in (case ((string_drop s5529_0 s5530_0)) of s_ => SOME (rdc, rsc, uimm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5504_ : string -> maybe ((mword ty3 * mword ty8 * string))*) val _ = Define ` ((s5504_:string ->((3)words$word#(8)words$word#string)option) s5505_0= (let s5506_0 = s5505_0 in if ((string_startswith s5506_0 "c.addi4spn")) then (case ((string_drop s5506_0 ((string_length "c.addi4spn")))) of s5507_0 => (case ((spc_matches_prefix0 s5507_0)) of SOME ((() , s5508_0)) => (case ((string_drop s5507_0 s5508_0)) of s5509_0 => (case ((creg_name_matches_prefix s5509_0 : (( 3 words$word # ii)) option)) of SOME ((rdc, s5510_0)) => (case ((string_drop s5509_0 s5510_0)) of s5511_0 => (case ((sep_matches_prefix s5511_0)) of SOME ((() , s5512_0)) => (case ((string_drop s5511_0 s5512_0)) of s5513_0 => (case ((hex_bits_10_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5513_0 : (( 10 words$word # ii)) option)) of SOME ((v__1500, s5514_0)) => if (((((subrange_vec_dec v__1500 (( 1 : int): ii) (( 0 : int): ii) : 2 words$word)) = (0b00w : 2 words$word)))) then let (nzimm : 8 words$word) = ((subrange_vec_dec v__1500 (( 9 : int): ii) (( 2 : int): ii) : 8 words$word)) in let (nzimm : 8 words$word) = ((subrange_vec_dec v__1500 (( 9 : int): ii) (( 2 : int): ii) : 8 words$word)) in (case ((string_drop s5513_0 s5514_0)) of s_ => SOME (rdc, nzimm, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5500_ : string -> maybe string*) val _ = Define ` ((s5500_:string ->(string)option) s5501_0= (let s5502_0 = s5501_0 in if ((string_startswith s5502_0 "c.nop")) then (case ((string_drop s5502_0 ((string_length "c.nop")))) of s_ => SOME s_ ) else NONE))`; (*val _s5474_ : string -> maybe ((amoop * word_width * bool * bool * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5474_:string ->(amoop#word_width#bool#bool#(5)words$word#(5)words$word#(5)words$word#string)option) s5475_0= ((case s5475_0 of s5476_0 => (case ((amo_mnemonic_matches_prefix s5476_0)) of SOME ((op, s5477_0)) => let s5478_0 = (string_drop s5476_0 s5477_0) in if ((string_startswith s5478_0 ".")) then (case ((string_drop s5478_0 ((string_length ".")))) of s5479_0 => (case ((size_mnemonic_matches_prefix s5479_0)) of SOME ((width, s5480_0)) => (case ((string_drop s5479_0 s5480_0)) of s5481_0 => (case ((maybe_aq_matches_prefix s5481_0)) of SOME ((aq, s5482_0)) => (case ((string_drop s5481_0 s5482_0)) of s5483_0 => (case ((maybe_rl_matches_prefix s5483_0)) of SOME ((rl, s5484_0)) => (case ((string_drop s5483_0 s5484_0)) of s5485_0 => (case ((spc_matches_prefix0 s5485_0)) of SOME ((() , s5486_0)) => (case ((string_drop s5485_0 s5486_0)) of s5487_0 => (case ((reg_name_matches_prefix s5487_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5488_0)) => (case ((string_drop s5487_0 s5488_0)) of s5489_0 => (case ((sep_matches_prefix s5489_0)) of SOME ((() , s5490_0)) => (case ((string_drop s5489_0 s5490_0)) of s5491_0 => (case ((reg_name_matches_prefix s5491_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5492_0)) => (case ((string_drop s5491_0 s5492_0)) of s5493_0 => (case ((sep_matches_prefix s5493_0)) of SOME ((() , s5494_0)) => let s5495_0 = (string_drop s5493_0 s5494_0) in if ((string_startswith s5495_0 "(")) then (case ((string_drop s5495_0 ((string_length "(")))) of s5496_0 => (case ((reg_name_matches_prefix s5496_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5497_0)) => let s5498_0 = (string_drop s5496_0 s5497_0) in if ((string_startswith s5498_0 ")")) then (case ((string_drop s5498_0 ((string_length ")")))) of s_ => SOME (op, width, aq, rl, rd, rs2, rs1, s_) ) else NONE | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) )))`; (*val _s5452_ : string -> maybe ((word_width * bool * bool * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5452_:string ->(word_width#bool#bool#(5)words$word#(5)words$word#(5)words$word#string)option) s5453_0= (let s5454_0 = s5453_0 in if ((string_startswith s5454_0 "sc.")) then (case ((string_drop s5454_0 ((string_length "sc.")))) of s5455_0 => (case ((size_mnemonic_matches_prefix s5455_0)) of SOME ((size1, s5456_0)) => (case ((string_drop s5455_0 s5456_0)) of s5457_0 => (case ((maybe_aq_matches_prefix s5457_0)) of SOME ((aq, s5458_0)) => (case ((string_drop s5457_0 s5458_0)) of s5459_0 => (case ((maybe_rl_matches_prefix s5459_0)) of SOME ((rl, s5460_0)) => (case ((string_drop s5459_0 s5460_0)) of s5461_0 => (case ((spc_matches_prefix0 s5461_0)) of SOME ((() , s5462_0)) => (case ((string_drop s5461_0 s5462_0)) of s5463_0 => (case ((reg_name_matches_prefix s5463_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5464_0)) => (case ((string_drop s5463_0 s5464_0)) of s5465_0 => (case ((sep_matches_prefix s5465_0)) of SOME ((() , s5466_0)) => (case ((string_drop s5465_0 s5466_0)) of s5467_0 => (case ((reg_name_matches_prefix s5467_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5468_0)) => (case ((string_drop s5467_0 s5468_0)) of s5469_0 => (case ((sep_matches_prefix s5469_0)) of SOME ((() , s5470_0)) => (case ((string_drop s5469_0 s5470_0)) of s5471_0 => (case ((reg_name_matches_prefix s5471_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5472_0)) => (case ((string_drop s5471_0 s5472_0)) of s_ => SOME (size1, aq, rl, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5434_ : string -> maybe ((word_width * bool * bool * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5434_:string ->(word_width#bool#bool#(5)words$word#(5)words$word#string)option) s5435_0= (let s5436_0 = s5435_0 in if ((string_startswith s5436_0 "lr.")) then (case ((string_drop s5436_0 ((string_length "lr.")))) of s5437_0 => (case ((size_mnemonic_matches_prefix s5437_0)) of SOME ((size1, s5438_0)) => (case ((string_drop s5437_0 s5438_0)) of s5439_0 => (case ((maybe_aq_matches_prefix s5439_0)) of SOME ((aq, s5440_0)) => (case ((string_drop s5439_0 s5440_0)) of s5441_0 => (case ((maybe_rl_matches_prefix s5441_0)) of SOME ((rl, s5442_0)) => (case ((string_drop s5441_0 s5442_0)) of s5443_0 => (case ((spc_matches_prefix0 s5443_0)) of SOME ((() , s5444_0)) => (case ((string_drop s5443_0 s5444_0)) of s5445_0 => (case ((reg_name_matches_prefix s5445_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5446_0)) => (case ((string_drop s5445_0 s5446_0)) of s5447_0 => (case ((sep_matches_prefix s5447_0)) of SOME ((() , s5448_0)) => (case ((string_drop s5447_0 s5448_0)) of s5449_0 => (case ((reg_name_matches_prefix s5449_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5450_0)) => (case ((string_drop s5449_0 s5450_0)) of s_ => SOME (size1, aq, rl, rd, rs1, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5422_ : string -> maybe ((mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5422_:string ->((5)words$word#(5)words$word#string)option) s5423_0= (let s5424_0 = s5423_0 in if ((string_startswith s5424_0 "sfence.vma")) then (case ((string_drop s5424_0 ((string_length "sfence.vma")))) of s5425_0 => (case ((spc_matches_prefix0 s5425_0)) of SOME ((() , s5426_0)) => (case ((string_drop s5425_0 s5426_0)) of s5427_0 => (case ((reg_name_matches_prefix s5427_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5428_0)) => (case ((string_drop s5427_0 s5428_0)) of s5429_0 => (case ((sep_matches_prefix s5429_0)) of SOME ((() , s5430_0)) => (case ((string_drop s5429_0 s5430_0)) of s5431_0 => (case ((reg_name_matches_prefix s5431_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5432_0)) => (case ((string_drop s5431_0 s5432_0)) of s_ => SOME (rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5418_ : string -> maybe string*) val _ = Define ` ((s5418_:string ->(string)option) s5419_0= (let s5420_0 = s5419_0 in if ((string_startswith s5420_0 "wfi")) then (case ((string_drop s5420_0 ((string_length "wfi")))) of s_ => SOME s_ ) else NONE))`; (*val _s5414_ : string -> maybe string*) val _ = Define ` ((s5414_:string ->(string)option) s5415_0= (let s5416_0 = s5415_0 in if ((string_startswith s5416_0 "ebreak")) then (case ((string_drop s5416_0 ((string_length "ebreak")))) of s_ => SOME s_ ) else NONE))`; (*val _s5410_ : string -> maybe string*) val _ = Define ` ((s5410_:string ->(string)option) s5411_0= (let s5412_0 = s5411_0 in if ((string_startswith s5412_0 "sret")) then (case ((string_drop s5412_0 ((string_length "sret")))) of s_ => SOME s_ ) else NONE))`; (*val _s5406_ : string -> maybe string*) val _ = Define ` ((s5406_:string ->(string)option) s5407_0= (let s5408_0 = s5407_0 in if ((string_startswith s5408_0 "mret")) then (case ((string_drop s5408_0 ((string_length "mret")))) of s_ => SOME s_ ) else NONE))`; (*val _s5402_ : string -> maybe string*) val _ = Define ` ((s5402_:string ->(string)option) s5403_0= (let s5404_0 = s5403_0 in if ((string_startswith s5404_0 "ecall")) then (case ((string_drop s5404_0 ((string_length "ecall")))) of s_ => SOME s_ ) else NONE))`; (*val _s5398_ : string -> maybe string*) val _ = Define ` ((s5398_:string ->(string)option) s5399_0= (let s5400_0 = s5399_0 in if ((string_startswith s5400_0 "fence.i")) then (case ((string_drop s5400_0 ((string_length "fence.i")))) of s_ => SOME s_ ) else NONE))`; (*val _s5386_ : string -> maybe ((mword ty4 * mword ty4 * string))*) val _ = Define ` ((s5386_:string ->((4)words$word#(4)words$word#string)option) s5387_0= (let s5388_0 = s5387_0 in if ((string_startswith s5388_0 "fence.tso")) then (case ((string_drop s5388_0 ((string_length "fence.tso")))) of s5389_0 => (case ((spc_matches_prefix0 s5389_0)) of SOME ((() , s5390_0)) => (case ((string_drop s5389_0 s5390_0)) of s5391_0 => (case ((fence_bits_matches_prefix s5391_0 : (( 4 words$word # ii)) option)) of SOME ((pred, s5392_0)) => (case ((string_drop s5391_0 s5392_0)) of s5393_0 => (case ((sep_matches_prefix s5393_0)) of SOME ((() , s5394_0)) => (case ((string_drop s5393_0 s5394_0)) of s5395_0 => (case ((fence_bits_matches_prefix s5395_0 : (( 4 words$word # ii)) option)) of SOME ((succ, s5396_0)) => (case ((string_drop s5395_0 s5396_0)) of s_ => SOME (pred, succ, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5374_ : string -> maybe ((mword ty4 * mword ty4 * string))*) val _ = Define ` ((s5374_:string ->((4)words$word#(4)words$word#string)option) s5375_0= (let s5376_0 = s5375_0 in if ((string_startswith s5376_0 "fence")) then (case ((string_drop s5376_0 ((string_length "fence")))) of s5377_0 => (case ((spc_matches_prefix0 s5377_0)) of SOME ((() , s5378_0)) => (case ((string_drop s5377_0 s5378_0)) of s5379_0 => (case ((fence_bits_matches_prefix s5379_0 : (( 4 words$word # ii)) option)) of SOME ((pred, s5380_0)) => (case ((string_drop s5379_0 s5380_0)) of s5381_0 => (case ((sep_matches_prefix s5381_0)) of SOME ((() , s5382_0)) => (case ((string_drop s5381_0 s5382_0)) of s5383_0 => (case ((fence_bits_matches_prefix s5383_0 : (( 4 words$word # ii)) option)) of SOME ((succ, s5384_0)) => (case ((string_drop s5383_0 s5384_0)) of s_ => SOME (pred, succ, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5357_ : string -> maybe ((sopw * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5357_:string ->(sopw#(5)words$word#(5)words$word#(5)words$word#string)option) s5358_0= ((case s5358_0 of s5359_0 => (case ((shiftiwop_mnemonic_matches_prefix s5359_0)) of SOME ((op, s5360_0)) => (case ((string_drop s5359_0 s5360_0)) of s5361_0 => (case ((spc_matches_prefix0 s5361_0)) of SOME ((() , s5362_0)) => (case ((string_drop s5361_0 s5362_0)) of s5363_0 => (case ((reg_name_matches_prefix s5363_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5364_0)) => (case ((string_drop s5363_0 s5364_0)) of s5365_0 => (case ((sep_matches_prefix s5365_0)) of SOME ((() , s5366_0)) => (case ((string_drop s5365_0 s5366_0)) of s5367_0 => (case ((reg_name_matches_prefix s5367_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5368_0)) => (case ((string_drop s5367_0 s5368_0)) of s5369_0 => (case ((sep_matches_prefix s5369_0)) of SOME ((() , s5370_0)) => (case ((string_drop s5369_0 s5370_0)) of s5371_0 => (case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5371_0 : (( 5 words$word # ii)) option)) of SOME ((shamt, s5372_0)) => (case ((string_drop s5371_0 s5372_0)) of s_ => SOME (op, rd, rs1, shamt, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5340_ : string -> maybe ((ropw * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5340_:string ->(ropw#(5)words$word#(5)words$word#(5)words$word#string)option) s5341_0= ((case s5341_0 of s5342_0 => (case ((rtypew_mnemonic_matches_prefix s5342_0)) of SOME ((op, s5343_0)) => (case ((string_drop s5342_0 s5343_0)) of s5344_0 => (case ((spc_matches_prefix0 s5344_0)) of SOME ((() , s5345_0)) => (case ((string_drop s5344_0 s5345_0)) of s5346_0 => (case ((reg_name_matches_prefix s5346_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5347_0)) => (case ((string_drop s5346_0 s5347_0)) of s5348_0 => (case ((sep_matches_prefix s5348_0)) of SOME ((() , s5349_0)) => (case ((string_drop s5348_0 s5349_0)) of s5350_0 => (case ((reg_name_matches_prefix s5350_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5351_0)) => (case ((string_drop s5350_0 s5351_0)) of s5352_0 => (case ((sep_matches_prefix s5352_0)) of SOME ((() , s5353_0)) => (case ((string_drop s5352_0 s5353_0)) of s5354_0 => (case ((reg_name_matches_prefix s5354_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5355_0)) => (case ((string_drop s5354_0 s5355_0)) of s_ => SOME (op, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5323_ : string -> maybe ((sop * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5323_:string ->(sop#(5)words$word#(5)words$word#(5)words$word#string)option) s5324_0= ((case s5324_0 of s5325_0 => (case ((shiftw_mnemonic_matches_prefix s5325_0)) of SOME ((op, s5326_0)) => (case ((string_drop s5325_0 s5326_0)) of s5327_0 => (case ((spc_matches_prefix0 s5327_0)) of SOME ((() , s5328_0)) => (case ((string_drop s5327_0 s5328_0)) of s5329_0 => (case ((reg_name_matches_prefix s5329_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5330_0)) => (case ((string_drop s5329_0 s5330_0)) of s5331_0 => (case ((sep_matches_prefix s5331_0)) of SOME ((() , s5332_0)) => (case ((string_drop s5331_0 s5332_0)) of s5333_0 => (case ((reg_name_matches_prefix s5333_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5334_0)) => (case ((string_drop s5333_0 s5334_0)) of s5335_0 => (case ((sep_matches_prefix s5335_0)) of SOME ((() , s5336_0)) => (case ((string_drop s5335_0 s5336_0)) of s5337_0 => (case ((hex_bits_5_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5337_0 : (( 5 words$word # ii)) option)) of SOME ((shamt, s5338_0)) => (case ((string_drop s5337_0 s5338_0)) of s_ => SOME (op, rd, rs1, shamt, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5307_ : string -> maybe ((mword ty5 * mword ty5 * mword ty12 * string))*) val _ = Define ` ((s5307_:string ->((5)words$word#(5)words$word#(12)words$word#string)option) s5308_0= (let s5309_0 = s5308_0 in if ((string_startswith s5309_0 "addiw")) then (case ((string_drop s5309_0 ((string_length "addiw")))) of s5310_0 => (case ((spc_matches_prefix0 s5310_0)) of SOME ((() , s5311_0)) => (case ((string_drop s5310_0 s5311_0)) of s5312_0 => (case ((reg_name_matches_prefix s5312_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5313_0)) => (case ((string_drop s5312_0 s5313_0)) of s5314_0 => (case ((sep_matches_prefix s5314_0)) of SOME ((() , s5315_0)) => (case ((string_drop s5314_0 s5315_0)) of s5316_0 => (case ((reg_name_matches_prefix s5316_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5317_0)) => (case ((string_drop s5316_0 s5317_0)) of s5318_0 => (case ((sep_matches_prefix s5318_0)) of SOME ((() , s5319_0)) => (case ((string_drop s5318_0 s5319_0)) of s5320_0 => (case ((hex_bits_12_matches_prefix0 s5320_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s5321_0)) => (case ((string_drop s5320_0 s5321_0)) of s_ => SOME (rd, rs1, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5279_ : string -> maybe ((word_width * bool * bool * mword ty5 * mword ty12 * mword ty5 * string))*) val _ = Define ` ((s5279_:string ->(word_width#bool#bool#(5)words$word#(12)words$word#(5)words$word#string)option) s5280_0= (let s5281_0 = s5280_0 in if ((string_startswith s5281_0 "s")) then (case ((string_drop s5281_0 ((string_length "s")))) of s5282_0 => (case ((size_mnemonic_matches_prefix s5282_0)) of SOME ((size1, s5283_0)) => (case ((string_drop s5282_0 s5283_0)) of s5284_0 => (case ((maybe_aq_matches_prefix s5284_0)) of SOME ((aq, s5285_0)) => (case ((string_drop s5284_0 s5285_0)) of s5286_0 => (case ((maybe_rl_matches_prefix s5286_0)) of SOME ((rl, s5287_0)) => (case ((string_drop s5286_0 s5287_0)) of s5288_0 => (case ((spc_matches_prefix0 s5288_0)) of SOME ((() , s5289_0)) => (case ((string_drop s5288_0 s5289_0)) of s5290_0 => (case ((reg_name_matches_prefix s5290_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5291_0)) => (case ((string_drop s5290_0 s5291_0)) of s5292_0 => (case ((sep_matches_prefix s5292_0)) of SOME ((() , s5293_0)) => (case ((string_drop s5292_0 s5293_0)) of s5294_0 => (case ((hex_bits_12_matches_prefix0 s5294_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s5295_0)) => (case ((string_drop s5294_0 s5295_0)) of s5296_0 => (case ((opt_spc_matches_prefix0 s5296_0)) of SOME ((() , s5297_0)) => let s5298_0 = (string_drop s5296_0 s5297_0) in if ((string_startswith s5298_0 "(")) then (case ((string_drop s5298_0 ((string_length "(")))) of s5299_0 => (case ((opt_spc_matches_prefix0 s5299_0)) of SOME ((() , s5300_0)) => (case ((string_drop s5299_0 s5300_0)) of s5301_0 => (case ((reg_name_matches_prefix s5301_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5302_0)) => (case ((string_drop s5301_0 s5302_0)) of s5303_0 => (case ((opt_spc_matches_prefix0 s5303_0)) of SOME ((() , s5304_0)) => let s5305_0 = (string_drop s5303_0 s5304_0) in if ((string_startswith s5305_0 ")")) then (case ((string_drop s5305_0 ((string_length ")")))) of s_ => SOME (size1, aq, rl, rs2, imm, rs1, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5249_ : string -> maybe ((word_width * bool * bool * bool * mword ty5 * mword ty12 * mword ty5 * string))*) val _ = Define ` ((s5249_:string ->(word_width#bool#bool#bool#(5)words$word#(12)words$word#(5)words$word#string)option) s5250_0= (let s5251_0 = s5250_0 in if ((string_startswith s5251_0 "l")) then (case ((string_drop s5251_0 ((string_length "l")))) of s5252_0 => (case ((size_mnemonic_matches_prefix s5252_0)) of SOME ((size1, s5253_0)) => (case ((string_drop s5252_0 s5253_0)) of s5254_0 => (case ((maybe_u_matches_prefix s5254_0)) of SOME ((is_unsigned, s5255_0)) => (case ((string_drop s5254_0 s5255_0)) of s5256_0 => (case ((maybe_aq_matches_prefix s5256_0)) of SOME ((aq, s5257_0)) => (case ((string_drop s5256_0 s5257_0)) of s5258_0 => (case ((maybe_rl_matches_prefix s5258_0)) of SOME ((rl, s5259_0)) => (case ((string_drop s5258_0 s5259_0)) of s5260_0 => (case ((spc_matches_prefix0 s5260_0)) of SOME ((() , s5261_0)) => (case ((string_drop s5260_0 s5261_0)) of s5262_0 => (case ((reg_name_matches_prefix s5262_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5263_0)) => (case ((string_drop s5262_0 s5263_0)) of s5264_0 => (case ((sep_matches_prefix s5264_0)) of SOME ((() , s5265_0)) => (case ((string_drop s5264_0 s5265_0)) of s5266_0 => (case ((hex_bits_12_matches_prefix0 s5266_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s5267_0)) => (case ((string_drop s5266_0 s5267_0)) of s5268_0 => (case ((opt_spc_matches_prefix0 s5268_0)) of SOME ((() , s5269_0)) => let s5270_0 = (string_drop s5268_0 s5269_0) in if ((string_startswith s5270_0 "(")) then (case ((string_drop s5270_0 ((string_length "(")))) of s5271_0 => (case ((opt_spc_matches_prefix0 s5271_0)) of SOME ((() , s5272_0)) => (case ((string_drop s5271_0 s5272_0)) of s5273_0 => (case ((reg_name_matches_prefix s5273_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5274_0)) => (case ((string_drop s5273_0 s5274_0)) of s5275_0 => (case ((opt_spc_matches_prefix0 s5275_0)) of SOME ((() , s5276_0)) => let s5277_0 = (string_drop s5275_0 s5276_0) in if ((string_startswith s5277_0 ")")) then (case ((string_drop s5277_0 ((string_length ")")))) of s_ => SOME (size1, is_unsigned, aq, rl, rd, imm, rs1, s_) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5232_ : string -> maybe ((rop * mword ty5 * mword ty5 * mword ty5 * string))*) val _ = Define ` ((s5232_:string ->(rop#(5)words$word#(5)words$word#(5)words$word#string)option) s5233_0= ((case s5233_0 of s5234_0 => (case ((rtype_mnemonic_matches_prefix s5234_0)) of SOME ((op, s5235_0)) => (case ((string_drop s5234_0 s5235_0)) of s5236_0 => (case ((spc_matches_prefix0 s5236_0)) of SOME ((() , s5237_0)) => (case ((string_drop s5236_0 s5237_0)) of s5238_0 => (case ((reg_name_matches_prefix s5238_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5239_0)) => (case ((string_drop s5238_0 s5239_0)) of s5240_0 => (case ((sep_matches_prefix s5240_0)) of SOME ((() , s5241_0)) => (case ((string_drop s5240_0 s5241_0)) of s5242_0 => (case ((reg_name_matches_prefix s5242_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5243_0)) => (case ((string_drop s5242_0 s5243_0)) of s5244_0 => (case ((sep_matches_prefix s5244_0)) of SOME ((() , s5245_0)) => (case ((string_drop s5244_0 s5245_0)) of s5246_0 => (case ((reg_name_matches_prefix s5246_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5247_0)) => (case ((string_drop s5246_0 s5247_0)) of s_ => SOME (op, rd, rs1, rs2, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5215_ : string -> maybe ((sop * mword ty5 * mword ty5 * mword ty6 * string))*) val _ = Define ` ((s5215_:string ->(sop#(5)words$word#(5)words$word#(6)words$word#string)option) s5216_0= ((case s5216_0 of s5217_0 => (case ((shiftiop_mnemonic_matches_prefix s5217_0)) of SOME ((op, s5218_0)) => (case ((string_drop s5217_0 s5218_0)) of s5219_0 => (case ((spc_matches_prefix0 s5219_0)) of SOME ((() , s5220_0)) => (case ((string_drop s5219_0 s5220_0)) of s5221_0 => (case ((reg_name_matches_prefix s5221_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5222_0)) => (case ((string_drop s5221_0 s5222_0)) of s5223_0 => (case ((sep_matches_prefix s5223_0)) of SOME ((() , s5224_0)) => (case ((string_drop s5223_0 s5224_0)) of s5225_0 => (case ((reg_name_matches_prefix s5225_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5226_0)) => (case ((string_drop s5225_0 s5226_0)) of s5227_0 => (case ((sep_matches_prefix s5227_0)) of SOME ((() , s5228_0)) => (case ((string_drop s5227_0 s5228_0)) of s5229_0 => (case ((hex_bits_6_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5229_0 : (( 6 words$word # ii)) option)) of SOME ((shamt, s5230_0)) => (case ((string_drop s5229_0 s5230_0)) of s_ => SOME (op, rd, rs1, shamt, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5198_ : string -> maybe ((iop * mword ty5 * mword ty5 * mword ty12 * string))*) val _ = Define ` ((s5198_:string ->(iop#(5)words$word#(5)words$word#(12)words$word#string)option) s5199_0= ((case s5199_0 of s5200_0 => (case ((itype_mnemonic_matches_prefix s5200_0)) of SOME ((op, s5201_0)) => (case ((string_drop s5200_0 s5201_0)) of s5202_0 => (case ((spc_matches_prefix0 s5202_0)) of SOME ((() , s5203_0)) => (case ((string_drop s5202_0 s5203_0)) of s5204_0 => (case ((reg_name_matches_prefix s5204_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5205_0)) => (case ((string_drop s5204_0 s5205_0)) of s5206_0 => (case ((sep_matches_prefix s5206_0)) of SOME ((() , s5207_0)) => (case ((string_drop s5206_0 s5207_0)) of s5208_0 => (case ((reg_name_matches_prefix s5208_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5209_0)) => (case ((string_drop s5208_0 s5209_0)) of s5210_0 => (case ((sep_matches_prefix s5210_0)) of SOME ((() , s5211_0)) => (case ((string_drop s5210_0 s5211_0)) of s5212_0 => (case ((hex_bits_12_matches_prefix0 s5212_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s5213_0)) => (case ((string_drop s5212_0 s5213_0)) of s_ => SOME (op, rd, rs1, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5181_ : string -> maybe ((bop * mword ty5 * mword ty5 * mword ty13 * string))*) val _ = Define ` ((s5181_:string ->(bop#(5)words$word#(5)words$word#(13)words$word#string)option) s5182_0= ((case s5182_0 of s5183_0 => (case ((btype_mnemonic_matches_prefix s5183_0)) of SOME ((op, s5184_0)) => (case ((string_drop s5183_0 s5184_0)) of s5185_0 => (case ((spc_matches_prefix0 s5185_0)) of SOME ((() , s5186_0)) => (case ((string_drop s5185_0 s5186_0)) of s5187_0 => (case ((reg_name_matches_prefix s5187_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5188_0)) => (case ((string_drop s5187_0 s5188_0)) of s5189_0 => (case ((sep_matches_prefix s5189_0)) of SOME ((() , s5190_0)) => (case ((string_drop s5189_0 s5190_0)) of s5191_0 => (case ((reg_name_matches_prefix s5191_0 : (( 5 words$word # ii)) option)) of SOME ((rs2, s5192_0)) => (case ((string_drop s5191_0 s5192_0)) of s5193_0 => (case ((sep_matches_prefix s5193_0)) of SOME ((() , s5194_0)) => (case ((string_drop s5193_0 s5194_0)) of s5195_0 => (case ((hex_bits_13_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5195_0 : (( 13 words$word # ii)) option)) of SOME ((imm, s5196_0)) => (case ((string_drop s5195_0 s5196_0)) of s_ => SOME (op, rs1, rs2, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; (*val _s5165_ : string -> maybe ((mword ty5 * mword ty5 * mword ty12 * string))*) val _ = Define ` ((s5165_:string ->((5)words$word#(5)words$word#(12)words$word#string)option) s5166_0= (let s5167_0 = s5166_0 in if ((string_startswith s5167_0 "jalr")) then (case ((string_drop s5167_0 ((string_length "jalr")))) of s5168_0 => (case ((spc_matches_prefix0 s5168_0)) of SOME ((() , s5169_0)) => (case ((string_drop s5168_0 s5169_0)) of s5170_0 => (case ((reg_name_matches_prefix s5170_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5171_0)) => (case ((string_drop s5170_0 s5171_0)) of s5172_0 => (case ((sep_matches_prefix s5172_0)) of SOME ((() , s5173_0)) => (case ((string_drop s5172_0 s5173_0)) of s5174_0 => (case ((reg_name_matches_prefix s5174_0 : (( 5 words$word # ii)) option)) of SOME ((rs1, s5175_0)) => (case ((string_drop s5174_0 s5175_0)) of s5176_0 => (case ((sep_matches_prefix s5176_0)) of SOME ((() , s5177_0)) => (case ((string_drop s5176_0 s5177_0)) of s5178_0 => (case ((hex_bits_12_matches_prefix0 s5178_0 : (( 12 words$word # ii)) option)) of SOME ((imm, s5179_0)) => (case ((string_drop s5178_0 s5179_0)) of s_ => SOME (rd, rs1, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5153_ : string -> maybe ((mword ty5 * mword ty21 * string))*) val _ = Define ` ((s5153_:string ->((5)words$word#(21)words$word#string)option) s5154_0= (let s5155_0 = s5154_0 in if ((string_startswith s5155_0 "jal")) then (case ((string_drop s5155_0 ((string_length "jal")))) of s5156_0 => (case ((spc_matches_prefix0 s5156_0)) of SOME ((() , s5157_0)) => (case ((string_drop s5156_0 s5157_0)) of s5158_0 => (case ((reg_name_matches_prefix s5158_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5159_0)) => (case ((string_drop s5158_0 s5159_0)) of s5160_0 => (case ((sep_matches_prefix s5160_0)) of SOME ((() , s5161_0)) => (case ((string_drop s5160_0 s5161_0)) of s5162_0 => (case ((hex_bits_21_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5162_0 : (( 21 words$word # ii)) option)) of SOME ((imm, s5163_0)) => (case ((string_drop s5162_0 s5163_0)) of s_ => SOME (rd, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) else NONE))`; (*val _s5140_ : string -> maybe ((uop * mword ty5 * mword ty20 * string))*) val _ = Define ` ((s5140_:string ->(uop#(5)words$word#(20)words$word#string)option) s5141_0= ((case s5141_0 of s5142_0 => (case ((utype_mnemonic_matches_prefix s5142_0)) of SOME ((op, s5143_0)) => (case ((string_drop s5142_0 s5143_0)) of s5144_0 => (case ((spc_matches_prefix0 s5144_0)) of SOME ((() , s5145_0)) => (case ((string_drop s5144_0 s5145_0)) of s5146_0 => (case ((reg_name_matches_prefix s5146_0 : (( 5 words$word # ii)) option)) of SOME ((rd, s5147_0)) => (case ((string_drop s5146_0 s5147_0)) of s5148_0 => (case ((sep_matches_prefix s5148_0)) of SOME ((() , s5149_0)) => (case ((string_drop s5148_0 s5149_0)) of s5150_0 => (case ((hex_bits_20_matches_prefix instance_Sail2_values_Bitvector_Machine_word_mword_dict s5150_0 : (( 20 words$word # ii)) option)) of SOME ((imm, s5151_0)) => (case ((string_drop s5150_0 s5151_0)) of s_ => SOME (op, rd, imm, s_) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) ) | _ => NONE ) )))`; val _ = Define ` ((assembly_matches_prefix:string ->(ast#int)option) arg_= (let s5152_0 = arg_ in if ((case ((s5140_ s5152_0 : ((uop # 5 words$word # 20 words$word # string))option)) of SOME ((op, rd, imm, s_)) => T | _ => F )) then (case (s5140_ s5152_0 : (( uop # 5 words$word # 20 words$word # string)) option) of (SOME ((op, rd, imm, s_))) => SOME (UTYPE (imm, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5153_ s5152_0 : (( 5 words$word # 21 words$word # string))option)) of SOME ((rd, imm, s_)) => T | _ => F )) then (case (s5153_ s5152_0 : (( 5 words$word # 21 words$word # string)) option) of (SOME ((rd, imm, s_))) => SOME (RISCV_JAL (imm, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5165_ s5152_0 : (( 5 words$word # 5 words$word # 12 words$word # string))option)) of SOME ((rd, rs1, imm, s_)) => T | _ => F )) then (case (s5165_ s5152_0 : (( 5 words$word # 5 words$word # 12 words$word # string)) option) of (SOME ((rd, rs1, imm, s_))) => SOME (RISCV_JALR (imm, rs1, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5181_ s5152_0 : ((bop # 5 words$word # 5 words$word # 13 words$word # string))option)) of SOME ((op, rs1, rs2, imm, s_)) => T | _ => F )) then (case (s5181_ s5152_0 : (( bop # 5 words$word # 5 words$word # 13 words$word # string)) option) of (SOME ((op, rs1, rs2, imm, s_))) => SOME (BTYPE (imm, rs2, rs1, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5198_ s5152_0 : ((iop # 5 words$word # 5 words$word # 12 words$word # string))option)) of SOME ((op, rd, rs1, imm, s_)) => T | _ => F )) then (case (s5198_ s5152_0 : (( iop # 5 words$word # 5 words$word # 12 words$word # string)) option) of (SOME ((op, rd, rs1, imm, s_))) => SOME (ITYPE (imm, rs1, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5215_ s5152_0 : ((sop # 5 words$word # 5 words$word # 6 words$word # string))option)) of SOME ((op, rd, rs1, shamt, s_)) => T | _ => F )) then (case (s5215_ s5152_0 : (( sop # 5 words$word # 5 words$word # 6 words$word # string)) option) of (SOME ((op, rd, rs1, shamt, s_))) => SOME (SHIFTIOP (shamt, rs1, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5232_ s5152_0 : ((rop # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((op, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s5232_ s5152_0 : (( rop # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((op, rd, rs1, rs2, s_))) => SOME (RTYPE (rs2, rs1, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5249_ s5152_0 : ((word_width # bool # bool # bool # 5 words$word # 12 words$word # 5 words$word # string))option)) of SOME ((size1, is_unsigned, aq, rl, rd, imm, rs1, s_)) => T | _ => F )) then (case (s5249_ s5152_0 : (( word_width # bool # bool # bool # 5 words$word # 12 words$word # 5 words$word # string)) option) of (SOME ((size1, is_unsigned, aq, rl, rd, imm, rs1, s_))) => SOME (LOAD (imm, rs1, rd, is_unsigned, size1, aq, rl), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5279_ s5152_0 : ((word_width # bool # bool # 5 words$word # 12 words$word # 5 words$word # string))option)) of SOME ((size1, aq, rl, rs2, imm, rs1, s_)) => T | _ => F )) then (case (s5279_ s5152_0 : (( word_width # bool # bool # 5 words$word # 12 words$word # 5 words$word # string)) option) of (SOME ((size1, aq, rl, rs2, imm, rs1, s_))) => SOME (STORE (imm, rs2, rs1, size1, aq, rl), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5307_ s5152_0 : (( 5 words$word # 5 words$word # 12 words$word # string))option)) of SOME ((rd, rs1, imm, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5307_ s5152_0 : (( 5 words$word # 5 words$word # 12 words$word # string)) option) of (SOME ((rd, rs1, imm, s_))) => SOME (ADDIW (imm, rs1, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5323_ s5152_0 : ((sop # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((op, rd, rs1, shamt, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5323_ s5152_0 : (( sop # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((op, rd, rs1, shamt, s_))) => SOME (SHIFTW (shamt, rs1, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5340_ s5152_0 : ((ropw # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((op, rd, rs1, rs2, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5340_ s5152_0 : (( ropw # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((op, rd, rs1, rs2, s_))) => SOME (RTYPEW (rs2, rs1, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5357_ s5152_0 : ((sopw # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((op, rd, rs1, shamt, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5357_ s5152_0 : (( sopw # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((op, rd, rs1, shamt, s_))) => SOME (SHIFTIWOP (shamt, rs1, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5374_ s5152_0 : (( 4 words$word # 4 words$word # string))option)) of SOME ((pred, succ, s_)) => T | _ => F )) then (case (s5374_ s5152_0 : (( 4 words$word # 4 words$word # string)) option) of (SOME ((pred, succ, s_))) => SOME (FENCE (pred, succ), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5386_ s5152_0 : (( 4 words$word # 4 words$word # string))option)) of SOME ((pred, succ, s_)) => T | _ => F )) then (case (s5386_ s5152_0 : (( 4 words$word # 4 words$word # string)) option) of (SOME ((pred, succ, s_))) => SOME (FENCE_TSO (pred, succ), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5398_ s5152_0)) of SOME (s_) => T | _ => F )) then (case s5398_ s5152_0 of (SOME (s_)) => SOME (FENCEI () , ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5402_ s5152_0)) of SOME (s_) => T | _ => F )) then (case s5402_ s5152_0 of (SOME (s_)) => SOME (ECALL () , ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5406_ s5152_0)) of SOME (s_) => T | _ => F )) then (case s5406_ s5152_0 of (SOME (s_)) => SOME (MRET () , ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5410_ s5152_0)) of SOME (s_) => T | _ => F )) then (case s5410_ s5152_0 of (SOME (s_)) => SOME (SRET () , ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5414_ s5152_0)) of SOME (s_) => T | _ => F )) then (case s5414_ s5152_0 of (SOME (s_)) => SOME (EBREAK () , ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5418_ s5152_0)) of SOME (s_) => T | _ => F )) then (case s5418_ s5152_0 of (SOME (s_)) => SOME (WFI () , ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5422_ s5152_0 : (( 5 words$word # 5 words$word # string))option)) of SOME ((rs1, rs2, s_)) => T | _ => F )) then (case (s5422_ s5152_0 : (( 5 words$word # 5 words$word # string)) option) of (SOME ((rs1, rs2, s_))) => SOME (SFENCE_VMA (rs1, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5434_ s5152_0 : ((word_width # bool # bool # 5 words$word # 5 words$word # string))option)) of SOME ((size1, aq, rl, rd, rs1, s_)) => T | _ => F )) then (case (s5434_ s5152_0 : (( word_width # bool # bool # 5 words$word # 5 words$word # string)) option) of (SOME ((size1, aq, rl, rd, rs1, s_))) => SOME (LOADRES (aq, rl, rs1, size1, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5452_ s5152_0 : ((word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((size1, aq, rl, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s5452_ s5152_0 : (( word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((size1, aq, rl, rd, rs1, rs2, s_))) => SOME (STORECON (aq, rl, rs2, rs1, size1, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5474_ s5152_0 : ((amoop # word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((op, width, aq, rl, rd, rs2, rs1, s_)) => T | _ => F )) then (case (s5474_ s5152_0 : (( amoop # word_width # bool # bool # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((op, width, aq, rl, rd, rs2, rs1, s_))) => SOME (AMO (op, aq, rl, rs2, rs1, width, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5500_ s5152_0)) of SOME (s_) => T | _ => F )) then (case s5500_ s5152_0 of (SOME (s_)) => SOME (C_NOP () , ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5504_ s5152_0 : (( 3 words$word # 8 words$word # string))option)) of SOME ((rdc, nzimm, s_)) => (nzimm <> (0x00w : 8 words$word)) | _ => F )) then (case (s5504_ s5152_0 : (( 3 words$word # 8 words$word # string)) option) of (SOME ((rdc, nzimm, s_))) => SOME (C_ADDI4SPN (rdc, nzimm), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5516_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string))option)) of SOME ((rdc, rsc, uimm, s_)) => T | _ => F )) then (case (s5516_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string)) option) of (SOME ((rdc, rsc, uimm, s_))) => SOME (C_LW (uimm, rsc, rdc), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5532_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string))option)) of SOME ((rdc, rsc, uimm, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5532_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string)) option) of (SOME ((rdc, rsc, uimm, s_))) => SOME (C_LD (uimm, rsc, rdc), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5548_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string))option)) of SOME ((rsc1, rsc2, uimm, s_)) => T | _ => F )) then (case (s5548_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string)) option) of (SOME ((rsc1, rsc2, uimm, s_))) => SOME (C_SW (uimm, rsc1, rsc2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5564_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string))option)) of SOME ((rsc1, rsc2, uimm, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5564_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string)) option) of (SOME ((rsc1, rsc2, uimm, s_))) => SOME (C_SD (uimm, rsc1, rsc2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5580_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rsd, nzi, s_)) => ((((nzi <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))) | _ => F )) then (case (s5580_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rsd, nzi, s_))) => SOME (C_ADDI (nzi, rsd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5592_ s5152_0 : (( 11 words$word # string))option)) of SOME ((imm, s_)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s5592_ s5152_0 : (( 11 words$word # string)) option) of (SOME ((imm, s_))) => SOME (C_JAL imm, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5600_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rsd, imm, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5600_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rsd, imm, s_))) => SOME (C_ADDIW (imm, rsd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5612_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rd, imm, s_)) => (rd <> zreg) | _ => F )) then (case (s5612_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rd, imm, s_))) => SOME (C_LI (imm, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5624_ s5152_0 : (( 6 words$word # string))option)) of SOME ((imm, s_)) => (imm <> (0b000000w : 6 words$word)) | _ => F )) then (case (s5624_ s5152_0 : (( 6 words$word # string)) option) of (SOME ((imm, s_))) => SOME (C_ADDI16SP imm, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5632_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rd, imm, s_)) => ((((rd <> zreg))) /\ ((((((rd <> sp))) /\ (((imm <> (0b000000w : 6 words$word)))))))) | _ => F )) then (case (s5632_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rd, imm, s_))) => SOME (C_LUI (imm, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5644_ s5152_0 : (( 3 words$word # 6 words$word # string))option)) of SOME ((rsd, shamt, s_)) => (shamt <> (0b000000w : 6 words$word)) | _ => F )) then (case (s5644_ s5152_0 : (( 3 words$word # 6 words$word # string)) option) of (SOME ((rsd, shamt, s_))) => SOME (C_SRLI (shamt, rsd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5656_ s5152_0 : (( 3 words$word # 6 words$word # string))option)) of SOME ((rsd, shamt, s_)) => (shamt <> (0b000000w : 6 words$word)) | _ => F )) then (case (s5656_ s5152_0 : (( 3 words$word # 6 words$word # string)) option) of (SOME ((rsd, shamt, s_))) => SOME (C_SRAI (shamt, rsd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5668_ s5152_0 : (( 3 words$word # 6 words$word # string))option)) of SOME ((rsd, imm, s_)) => T | _ => F )) then (case (s5668_ s5152_0 : (( 3 words$word # 6 words$word # string)) option) of (SOME ((rsd, imm, s_))) => SOME (C_ANDI (imm, rsd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5680_ s5152_0 : (( 3 words$word # 3 words$word # string))option)) of SOME ((rsd, rs2, s_)) => T | _ => F )) then (case (s5680_ s5152_0 : (( 3 words$word # 3 words$word # string)) option) of (SOME ((rsd, rs2, s_))) => SOME (C_SUB (rsd, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5692_ s5152_0 : (( 3 words$word # 3 words$word # string))option)) of SOME ((rsd, rs2, s_)) => T | _ => F )) then (case (s5692_ s5152_0 : (( 3 words$word # 3 words$word # string)) option) of (SOME ((rsd, rs2, s_))) => SOME (C_XOR (rsd, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5704_ s5152_0 : (( 3 words$word # 3 words$word # string))option)) of SOME ((rsd, rs2, s_)) => T | _ => F )) then (case (s5704_ s5152_0 : (( 3 words$word # 3 words$word # string)) option) of (SOME ((rsd, rs2, s_))) => SOME (C_OR (rsd, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5716_ s5152_0 : (( 3 words$word # 3 words$word # string))option)) of SOME ((rsd, rs2, s_)) => T | _ => F )) then (case (s5716_ s5152_0 : (( 3 words$word # 3 words$word # string)) option) of (SOME ((rsd, rs2, s_))) => SOME (C_AND (rsd, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5728_ s5152_0 : (( 3 words$word # 3 words$word # string))option)) of SOME ((rsd, rs2, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5728_ s5152_0 : (( 3 words$word # 3 words$word # string)) option) of (SOME ((rsd, rs2, s_))) => SOME (C_SUBW (rsd, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5740_ s5152_0 : (( 3 words$word # 3 words$word # string))option)) of SOME ((rsd, rs2, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5740_ s5152_0 : (( 3 words$word # 3 words$word # string)) option) of (SOME ((rsd, rs2, s_))) => SOME (C_ADDW (rsd, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5752_ s5152_0 : (( 11 words$word # string))option)) of SOME ((imm, s_)) => T | _ => F )) then (case (s5752_ s5152_0 : (( 11 words$word # string)) option) of (SOME ((imm, s_))) => SOME (C_J imm, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5760_ s5152_0 : (( 3 words$word # 8 words$word # string))option)) of SOME ((rs, imm, s_)) => T | _ => F )) then (case (s5760_ s5152_0 : (( 3 words$word # 8 words$word # string)) option) of (SOME ((rs, imm, s_))) => SOME (C_BEQZ (imm, rs), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5772_ s5152_0 : (( 3 words$word # 8 words$word # string))option)) of SOME ((rs, imm, s_)) => T | _ => F )) then (case (s5772_ s5152_0 : (( 3 words$word # 8 words$word # string)) option) of (SOME ((rs, imm, s_))) => SOME (C_BNEZ (imm, rs), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5784_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rsd, shamt, s_)) => ((((shamt <> (0b000000w : 6 words$word)))) /\ (((rsd <> zreg)))) | _ => F )) then (case (s5784_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rsd, shamt, s_))) => SOME (C_SLLI (shamt, rsd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5796_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rd, uimm, s_)) => (rd <> zreg) | _ => F )) then (case (s5796_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rd, uimm, s_))) => SOME (C_LWSP (uimm, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5808_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rd, uimm, s_)) => ((((rd <> zreg))) /\ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s5808_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rd, uimm, s_))) => SOME (C_LDSP (uimm, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5820_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rd, uimm, s_)) => T | _ => F )) then (case (s5820_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rd, uimm, s_))) => SOME (C_SWSP (uimm, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5832_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rs2, uimm, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5832_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rs2, uimm, s_))) => SOME (C_SDSP (uimm, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5844_ s5152_0 : (( 5 words$word # string))option)) of SOME ((rs1, s_)) => (rs1 <> zreg) | _ => F )) then (case (s5844_ s5152_0 : (( 5 words$word # string)) option) of (SOME ((rs1, s_))) => SOME (C_JR rs1, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5852_ s5152_0 : (( 5 words$word # string))option)) of SOME ((rs1, s_)) => (rs1 <> zreg) | _ => F )) then (case (s5852_ s5152_0 : (( 5 words$word # string)) option) of (SOME ((rs1, s_))) => SOME (C_JALR rs1, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5860_ s5152_0 : (( 5 words$word # 5 words$word # string))option)) of SOME ((rd, rs2, s_)) => ((((rd <> zreg))) /\ (((rs2 <> zreg)))) | _ => F )) then (case (s5860_ s5152_0 : (( 5 words$word # 5 words$word # string)) option) of (SOME ((rd, rs2, s_))) => SOME (C_MV (rd, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5872_ s5152_0)) of SOME (s_) => T | _ => F )) then (case s5872_ s5152_0 of (SOME (s_)) => SOME (C_EBREAK () , ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5876_ s5152_0 : (( 5 words$word # 5 words$word # string))option)) of SOME ((rsd, rs2, s_)) => ((((rsd <> zreg))) /\ (((rs2 <> zreg)))) | _ => F )) then (case (s5876_ s5152_0 : (( 5 words$word # 5 words$word # string)) option) of (SOME ((rsd, rs2, s_))) => SOME (C_ADD (rsd, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5888_ s5152_0 : ((bool # bool # bool # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((high, signed1, signed2, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s5888_ s5152_0 : (( bool # bool # bool # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((high, signed1, signed2, rd, rs1, rs2, s_))) => SOME (MUL (rs2, rs1, rd, high, signed1, signed2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5905_ s5152_0 : ((bool # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((s, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s5905_ s5152_0 : (( bool # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((s, rd, rs1, rs2, s_))) => SOME (DIV0 (rs2, rs1, rd, s), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5923_ s5152_0 : ((bool # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((s, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s5923_ s5152_0 : (( bool # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((s, rd, rs1, rs2, s_))) => SOME (REM (rs2, rs1, rd, s), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5941_ s5152_0 : (( 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((rd, rs1, rs2, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5941_ s5152_0 : (( 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((rd, rs1, rs2, s_))) => SOME (MULW (rs2, rs1, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5957_ s5152_0 : ((bool # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((s, rd, rs1, rs2, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5957_ s5152_0 : (( bool # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((s, rd, rs1, rs2, s_))) => SOME (DIVW (rs2, rs1, rd, s), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5976_ s5152_0 : ((bool # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((s, rd, rs1, rs2, s_)) => ((( 64 : int):ii) = (( 64 : int):ii)) | _ => F )) then (case (s5976_ s5152_0 : (( bool # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((s, rd, rs1, rs2, s_))) => SOME (REMW (rs2, rs1, rd, s), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s5995_ s5152_0 : ((csrop # 5 words$word # 12 words$word # 5 words$word # string))option)) of SOME ((op, rd, csr, rs1, s_)) => T | _ => F )) then (case (s5995_ s5152_0 : (( csrop # 5 words$word # 12 words$word # 5 words$word # string)) option) of (SOME ((op, rd, csr, rs1, s_))) => SOME (CSR (csr, rs1, rd, T, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6013_ s5152_0 : ((csrop # 5 words$word # 12 words$word # 5 words$word # string))option)) of SOME ((op, rd, csr, rs1, s_)) => T | _ => F )) then (case (s6013_ s5152_0 : (( csrop # 5 words$word # 12 words$word # 5 words$word # string)) option) of (SOME ((op, rd, csr, rs1, s_))) => SOME (CSR (csr, rs1, rd, F, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6030_ s5152_0)) of SOME (s_) => T | _ => F )) then (case s6030_ s5152_0 of (SOME (s_)) => SOME (URET () , ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6034_ s5152_0 : (( 6 words$word # string))option)) of SOME ((imm, s_)) => T | _ => F )) then (case (s6034_ s5152_0 : (( 6 words$word # string)) option) of (SOME ((imm, s_))) => SOME (C_NOP_HINT imm, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6040_ s5152_0 : (( 5 words$word # string))option)) of SOME ((rsd, s_)) => (rsd <> zreg) | _ => F )) then (case (s6040_ s5152_0 : (( 5 words$word # string)) option) of (SOME ((rsd, s_))) => SOME (C_ADDI_HINT rsd, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6046_ s5152_0 : (( 6 words$word # string))option)) of SOME ((imm, s_)) => T | _ => F )) then (case (s6046_ s5152_0 : (( 6 words$word # string)) option) of (SOME ((imm, s_))) => SOME (C_LI_HINT imm, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6052_ s5152_0 : (( 6 words$word # string))option)) of SOME ((imm, s_)) => (imm <> (0b000000w : 6 words$word)) | _ => F )) then (case (s6052_ s5152_0 : (( 6 words$word # string)) option) of (SOME ((imm, s_))) => SOME (C_LUI_HINT imm, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6058_ s5152_0 : (( 5 words$word # string))option)) of SOME ((rs2, s_)) => (rs2 <> zreg) | _ => F )) then (case (s6058_ s5152_0 : (( 5 words$word # string)) option) of (SOME ((rs2, s_))) => SOME (C_MV_HINT rs2, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6064_ s5152_0 : (( 5 words$word # string))option)) of SOME ((rs2, s_)) => (rs2 <> zreg) | _ => F )) then (case (s6064_ s5152_0 : (( 5 words$word # string)) option) of (SOME ((rs2, s_))) => SOME (C_ADD_HINT rs2, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6070_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rsd, shamt, s_)) => ((((shamt = (0b000000w : 6 words$word)))) \/ (((rsd = zreg)))) | _ => F )) then (case (s6070_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rsd, shamt, s_))) => SOME (C_SLLI_HINT (shamt, rsd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6079_ s5152_0 : (( 3 words$word # string))option)) of SOME ((rsd, s_)) => T | _ => F )) then (case (s6079_ s5152_0 : (( 3 words$word # string)) option) of (SOME ((rsd, s_))) => SOME (C_SRLI_HINT rsd, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6085_ s5152_0 : (( 3 words$word # string))option)) of SOME ((rsd, s_)) => T | _ => F )) then (case (s6085_ s5152_0 : (( 3 words$word # string)) option) of (SOME ((rsd, s_))) => SOME (C_SRAI_HINT rsd, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6091_ s5152_0 : (( 4 words$word # 4 words$word # 5 words$word # 5 words$word # 4 words$word # string))option)) of SOME ((pred, succ, rs, rd, fm, s_)) => (((((((fm <> (0x0w : 4 words$word)))) /\ (((fm <> (0x8w : 4 words$word))))))) \/ ((((((rs <> (0b00000w : 5 words$word)))) \/ (((rd <> (0b00000w : 5 words$word)))))))) | _ => F )) then (case (s6091_ s5152_0 : (( 4 words$word # 4 words$word # 5 words$word # 5 words$word # 4 words$word # string)) option) of (SOME ((pred, succ, rs, rd, fm, s_))) => SOME (FENCE_RESERVED (fm, pred, succ, rs, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6109_ s5152_0 : (( 5 words$word # 5 words$word # 12 words$word # string))option)) of SOME ((rd, rs, imm, s_)) => ((((imm <> (0x000w : 12 words$word)))) \/ ((((((rs <> zreg))) \/ (((rd <> zreg))))))) | _ => F )) then (case (s6109_ s5152_0 : (( 5 words$word # 5 words$word # 12 words$word # string)) option) of (SOME ((rd, rs, imm, s_))) => SOME (FENCEI_RESERVED (imm, rs, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6121_ s5152_0 : ((word_width # 5 words$word # 12 words$word # 5 words$word # string))option)) of SOME ((width, rd, imm, rs1, s_)) => T | _ => F )) then (case (s6121_ s5152_0 : (( word_width # 5 words$word # 12 words$word # 5 words$word # string)) option) of (SOME ((width, rd, imm, rs1, s_))) => SOME (LOAD_FP (imm, rs1, rd, width), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6145_ s5152_0 : ((word_width # 5 words$word # 12 words$word # 5 words$word # string))option)) of SOME ((width, rs2, imm, rs1, s_)) => T | _ => F )) then (case (s6145_ s5152_0 : (( word_width # 5 words$word # 12 words$word # 5 words$word # string)) option) of (SOME ((width, rs2, imm, rs1, s_))) => SOME (STORE_FP (imm, rs2, rs1, width), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6169_ s5152_0 : ((f_madd_op_S # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((op, rd, rs1, rs2, rs3, rm, s_)) => T | _ => F )) then (case (s6169_ s5152_0 : (( f_madd_op_S # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((op, rd, rs1, rs2, rs3, rm, s_))) => SOME (F_MADD_TYPE_S (rs3, rs2, rs1, rm, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6194_ s5152_0 : ((f_bin_rm_op_S # 5 words$word # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((op, rd, rs1, rs2, rm, s_)) => T | _ => F )) then (case (s6194_ s5152_0 : (( f_bin_rm_op_S # 5 words$word # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((op, rd, rs1, rs2, rm, s_))) => SOME (F_BIN_RM_TYPE_S (rs2, rs1, rm, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6215_ s5152_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FSQRT_S, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6215_ s5152_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FSQRT_S, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_S (rs1, rm, rd, FSQRT_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6232_ s5152_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_W_S, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6232_ s5152_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_W_S, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_W_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6249_ s5152_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_WU_S, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6249_ s5152_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_WU_S, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_WU_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6266_ s5152_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_S_W, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6266_ s5152_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_S_W, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_W), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6283_ s5152_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_S_WU, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6283_ s5152_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_S_WU, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_WU), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6300_ s5152_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_L_S, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6300_ s5152_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_L_S, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_L_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6317_ s5152_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_LU_S, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6317_ s5152_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_LU_S, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_LU_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6334_ s5152_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_S_L, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6334_ s5152_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_S_L, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_L), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6351_ s5152_0 : ((f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_S_LU, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6351_ s5152_0 : (( f_un_rm_op_S # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_S_LU, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_S (rs1, rm, rd, FCVT_S_LU), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6368_ s5152_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FSGNJ_S, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6368_ s5152_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FSGNJ_S, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_S (rs2, rs1, rd, FSGNJ_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6385_ s5152_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FSGNJN_S, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6385_ s5152_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FSGNJN_S, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_S (rs2, rs1, rd, FSGNJN_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6402_ s5152_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FSGNJX_S, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6402_ s5152_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FSGNJX_S, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_S (rs2, rs1, rd, FSGNJX_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6419_ s5152_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FMIN_S, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6419_ s5152_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FMIN_S, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_S (rs2, rs1, rd, FMIN_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6436_ s5152_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FMAX_S, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6436_ s5152_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FMAX_S, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_S (rs2, rs1, rd, FMAX_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6453_ s5152_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FEQ_S, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6453_ s5152_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FEQ_S, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_S (rs2, rs1, rd, FEQ_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6470_ s5152_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FLT_S, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6470_ s5152_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FLT_S, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_S (rs2, rs1, rd, FLT_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6487_ s5152_0 : ((f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FLE_S, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6487_ s5152_0 : (( f_bin_op_S # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FLE_S, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_S (rs2, rs1, rd, FLE_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6504_ s5152_0 : ((f_un_op_S # 5 words$word # 5 words$word # string))option)) of SOME ((FMV_X_W, rd, rs1, s_)) => T | _ => F )) then (case (s6504_ s5152_0 : (( f_un_op_S # 5 words$word # 5 words$word # string)) option) of (SOME ((FMV_X_W, rd, rs1, s_))) => SOME (F_UN_TYPE_S (rs1, rd, FMV_X_W), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6517_ s5152_0 : ((f_un_op_S # 5 words$word # 5 words$word # string))option)) of SOME ((FMV_W_X, rd, rs1, s_)) => T | _ => F )) then (case (s6517_ s5152_0 : (( f_un_op_S # 5 words$word # 5 words$word # string)) option) of (SOME ((FMV_W_X, rd, rs1, s_))) => SOME (F_UN_TYPE_S (rs1, rd, FMV_W_X), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6530_ s5152_0 : ((f_un_op_S # 5 words$word # 5 words$word # string))option)) of SOME ((FCLASS_S, rd, rs1, s_)) => T | _ => F )) then (case (s6530_ s5152_0 : (( f_un_op_S # 5 words$word # 5 words$word # string)) option) of (SOME ((FCLASS_S, rd, rs1, s_))) => SOME (F_UN_TYPE_S (rs1, rd, FCLASS_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6543_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rd, imm, s_)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s6543_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rd, imm, s_))) => SOME (C_FLWSP (imm, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6555_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rd, uimm, s_)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s6555_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rd, uimm, s_))) => SOME (C_FSWSP (uimm, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6567_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string))option)) of SOME ((rdc, rsc, uimm, s_)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s6567_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string)) option) of (SOME ((rdc, rsc, uimm, s_))) => SOME (C_FLW (uimm, rsc, rdc), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6583_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string))option)) of SOME ((rsc1, rsc2, uimm, s_)) => ((( 64 : int):ii) = (( 32 : int):ii)) | _ => F )) then (case (s6583_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string)) option) of (SOME ((rsc1, rsc2, uimm, s_))) => SOME (C_FSW (uimm, rsc1, rsc2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6599_ s5152_0 : ((f_madd_op_D # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((op, rd, rs1, rs2, rs3, rm, s_)) => T | _ => F )) then (case (s6599_ s5152_0 : (( f_madd_op_D # 5 words$word # 5 words$word # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((op, rd, rs1, rs2, rs3, rm, s_))) => SOME (F_MADD_TYPE_D (rs3, rs2, rs1, rm, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6624_ s5152_0 : ((f_bin_rm_op_D # 5 words$word # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((op, rd, rs1, rs2, rm, s_)) => T | _ => F )) then (case (s6624_ s5152_0 : (( f_bin_rm_op_D # 5 words$word # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((op, rd, rs1, rs2, rm, s_))) => SOME (F_BIN_RM_TYPE_D (rs2, rs1, rm, rd, op), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6645_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FSQRT_D, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6645_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FSQRT_D, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FSQRT_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6662_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_W_D, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6662_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_W_D, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_W_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6679_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_WU_D, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6679_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_WU_D, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_WU_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6696_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_D_W, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6696_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_D_W, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_W), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6713_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_D_WU, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6713_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_D_WU, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_WU), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6730_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_L_D, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6730_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_L_D, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_L_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6747_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_LU_D, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6747_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_LU_D, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_LU_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6764_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_D_L, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6764_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_D_L, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_L), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6781_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_D_LU, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6781_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_D_LU, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_LU), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6798_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_S_D, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6798_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_S_D, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_S_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6815_ s5152_0 : ((f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string))option)) of SOME ((FCVT_D_S, rd, rs1, rm, s_)) => T | _ => F )) then (case (s6815_ s5152_0 : (( f_un_rm_op_D # 5 words$word # 5 words$word # rounding_mode # string)) option) of (SOME ((FCVT_D_S, rd, rs1, rm, s_))) => SOME (F_UN_RM_TYPE_D (rs1, rm, rd, FCVT_D_S), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6832_ s5152_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FSGNJ_D, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6832_ s5152_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FSGNJ_D, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_D (rs2, rs1, rd, FSGNJ_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6849_ s5152_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FSGNJN_D, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6849_ s5152_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FSGNJN_D, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_D (rs2, rs1, rd, FSGNJN_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6866_ s5152_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FSGNJX_D, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6866_ s5152_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FSGNJX_D, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_D (rs2, rs1, rd, FSGNJX_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6883_ s5152_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FMIN_D, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6883_ s5152_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FMIN_D, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_D (rs2, rs1, rd, FMIN_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6900_ s5152_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FMAX_D, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6900_ s5152_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FMAX_D, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_D (rs2, rs1, rd, FMAX_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6917_ s5152_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FEQ_D, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6917_ s5152_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FEQ_D, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_D (rs2, rs1, rd, FEQ_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6934_ s5152_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FLT_D, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6934_ s5152_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FLT_D, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_D (rs2, rs1, rd, FLT_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6951_ s5152_0 : ((f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string))option)) of SOME ((FLE_D, rd, rs1, rs2, s_)) => T | _ => F )) then (case (s6951_ s5152_0 : (( f_bin_op_D # 5 words$word # 5 words$word # 5 words$word # string)) option) of (SOME ((FLE_D, rd, rs1, rs2, s_))) => SOME (F_BIN_TYPE_D (rs2, rs1, rd, FLE_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6968_ s5152_0 : ((f_un_op_D # 5 words$word # 5 words$word # string))option)) of SOME ((FMV_X_D, rd, rs1, s_)) => T | _ => F )) then (case (s6968_ s5152_0 : (( f_un_op_D # 5 words$word # 5 words$word # string)) option) of (SOME ((FMV_X_D, rd, rs1, s_))) => SOME (F_UN_TYPE_D (rs1, rd, FMV_X_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6981_ s5152_0 : ((f_un_op_D # 5 words$word # 5 words$word # string))option)) of SOME ((FMV_D_X, rd, rs1, s_)) => T | _ => F )) then (case (s6981_ s5152_0 : (( f_un_op_D # 5 words$word # 5 words$word # string)) option) of (SOME ((FMV_D_X, rd, rs1, s_))) => SOME (F_UN_TYPE_D (rs1, rd, FMV_D_X), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s6994_ s5152_0 : ((f_un_op_D # 5 words$word # 5 words$word # string))option)) of SOME ((FCLASS_D, rd, rs1, s_)) => T | _ => F )) then (case (s6994_ s5152_0 : (( f_un_op_D # 5 words$word # 5 words$word # string)) option) of (SOME ((FCLASS_D, rd, rs1, s_))) => SOME (F_UN_TYPE_D (rs1, rd, FCLASS_D), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s7007_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rd, uimm, s_)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s7007_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rd, uimm, s_))) => SOME (C_FLDSP (uimm, rd), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s7019_ s5152_0 : (( 5 words$word # 6 words$word # string))option)) of SOME ((rs2, uimm, s_)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s7019_ s5152_0 : (( 5 words$word # 6 words$word # string)) option) of (SOME ((rs2, uimm, s_))) => SOME (C_FSDSP (uimm, rs2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s7031_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string))option)) of SOME ((rdc, rsc, uimm, s_)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s7031_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string)) option) of (SOME ((rdc, rsc, uimm, s_))) => SOME (C_FLD (uimm, rsc, rdc), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s7047_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string))option)) of SOME ((rsc1, rsc2, uimm, s_)) => (((((( 64 : int):ii) = (( 32 : int):ii)))) \/ ((((( 64 : int):ii) = (( 64 : int):ii))))) | _ => F )) then (case (s7047_ s5152_0 : (( 3 words$word # 3 words$word # 5 words$word # string)) option) of (SOME ((rsc1, rsc2, uimm, s_))) => SOME (C_FSD (uimm, rsc1, rsc2), ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s7063_ s5152_0 : (( 32 words$word # string))option)) of SOME ((s, s_)) => T | _ => F )) then (case (s7063_ s5152_0 : (( 32 words$word # string)) option) of (SOME ((s, s_))) => SOME (ILLEGAL s, ((string_length arg_)) - ((string_length s_))) ) else if ((case ((s7071_ s5152_0 : (( 16 words$word # string))option)) of SOME ((s, s_)) => T | _ => F )) then (case (s7071_ s5152_0 : (( 16 words$word # string)) option) of (SOME ((s, s_))) => SOME (C_ILLEGAL s, ((string_length arg_)) - ((string_length s_))) ) else NONE))`; val _ = Define ` ((print_insn:ast ->(regstate)sail2_state_monad$sequential_state ->(((string),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) insn= (assembly_forwards insn))`; (*val decode : mword ty32 -> M ast*) val _ = Define ` ((decode:(32)words$word ->(regstate)sail2_state_monad$sequential_state ->(((ast),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) bv= (encdec_backwards bv))`; (*val decodeCompressed : mword ty16 -> M ast*) val _ = Define ` ((decodeCompressed:(16)words$word ->(regstate)sail2_state_monad$sequential_state ->(((ast),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) bv= (encdec_compressed_backwards bv))`; (*val ext_init : unit -> unit*) val _ = Define ` ((ext_init:unit -> unit) () = () )`; (*val ext_fetch_hook : FetchResult -> FetchResult*) val _ = Define ` ((ext_fetch_hook:FetchResult -> FetchResult) f= f)`; (*val ext_pre_step_hook : unit -> unit*) val _ = Define ` ((ext_pre_step_hook:unit -> unit) () = () )`; (*val ext_post_step_hook : unit -> unit*) val _ = Define ` ((ext_post_step_hook:unit -> unit) () = () )`; (*val ext_post_decode_hook : ast -> M ast*) val _ = Define ` ((ext_post_decode_hook:ast ->(regstate)sail2_state_monad$sequential_state ->(((ast),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) x= (sail2_state_monad$returnS x))`; (*val isRVC : mword ty16 -> bool*) val _ = Define ` ((isRVC:(16)words$word -> bool) h= (~ (((((subrange_vec_dec h (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word))))))`; (*val fetch : unit -> M FetchResult*) val _ = Define ` ((fetch:unit ->(regstate)sail2_state_monad$sequential_state ->(((FetchResult),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . (case ((ext_fetch_check_pc w__0 w__1)) of Ext_FetchAddr_Error (e) => sail2_state_monad$returnS (F_Ext_Error e) | Ext_FetchAddr_OK (use_pc) => sail2_state_monad$bindS (sail2_state$or_boolS (sail2_state_monad$returnS (((((access_vec_dec use_pc (( 0 : int):ii))) <> B0)))) (sail2_state$and_boolS (sail2_state_monad$returnS (((((access_vec_dec use_pc (( 1 : int):ii))) <> B0)))) ( sail2_state_monad$bindS(haveRVC () ) (\ (w__2 : bool) . sail2_state_monad$returnS ((~ w__2)))))) (\ (w__4 : bool) . if w__4 then sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__5 : 64 words$word) . sail2_state_monad$returnS (F_Error (E_Fetch_Addr_Align () , w__5))) else sail2_state_monad$bindS (translateAddr use_pc (Execute () ) : ( (( 64 words$word), ExceptionType)TR_Result) M) (\ (w__6 : (( 64 words$word), ExceptionType) TR_Result) . (case w__6 of TR_Failure ((e, _)) => sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__7 : 64 words$word) . sail2_state_monad$returnS (F_Error (e, w__7))) | TR_Address ((ppclo, _)) => sail2_state_monad$bindS (mem_read (Execute () ) ppclo (( 2 : int):ii) F F F : ( ( 16 words$word)MemoryOpResult) M) (\ (w__8 : ( 16 words$word) MemoryOpResult) . (case w__8 of MemException (e) => sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__9 : 64 words$word) . sail2_state_monad$returnS (F_Error (e, w__9))) | MemValue (ilo) => if ((isRVC ilo)) then sail2_state_monad$returnS (F_RVC ilo) else sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__10 : 64 words$word) . let (PC_hi : xlenbits) = ((add_vec_int w__10 (( 2 : int):ii) : 64 words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__11 : 64 words$word) . (case ((ext_fetch_check_pc w__11 PC_hi)) of Ext_FetchAddr_Error (e) => sail2_state_monad$returnS (F_Ext_Error e) | Ext_FetchAddr_OK (use_pc_hi) => sail2_state_monad$bindS (translateAddr use_pc_hi (Execute () ) : ( (( 64 words$word), ExceptionType)TR_Result) M) (\ (w__12 : (( 64 words$word), ExceptionType) TR_Result) . (case w__12 of TR_Failure ((e, _)) => sail2_state_monad$returnS (F_Error (e, PC_hi)) | TR_Address ((ppchi, _)) => sail2_state_monad$bindS (mem_read (Execute () ) ppchi (( 2 : int):ii) F F F : ( ( 16 words$word)MemoryOpResult) M) (\ (w__13 : ( 16 words$word) MemoryOpResult) . sail2_state_monad$returnS ((case w__13 of MemException (e) => F_Error (e, PC_hi) | MemValue (ihi) => F_Base ((concat_vec ihi ilo : 32 words$word)) ))) )) ))) )) ))) )))))`; (*val step : ii -> M bool*) val _ = Define ` ((step:int ->(regstate)sail2_state_monad$sequential_state ->(((bool),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) step_no= (let (_ : unit) = (ext_pre_step_hook () ) in sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS minstret_written_ref F) (sail2_state_monad$read_regS cur_privilege_ref)) (\ (w__0 : Privilege) . sail2_state_monad$bindS (dispatchInterrupt w__0) (\ (w__1 : ((InterruptType # Privilege))option) . sail2_state_monad$bindS (case w__1 of SOME ((intr, priv)) => let (_ : unit) = (if ((get_config_print_instr () )) then print_bits0 "Handling interrupt: " ((interruptType_to_bits intr : 8 words$word)) else () ) in sail2_state_monad$seqS (handle_interrupt intr priv) (sail2_state_monad$returnS (RETIRE_FAIL, F)) | NONE => sail2_state_monad$bindS (fetch () ) (\ (w__2 : FetchResult) . let (f : FetchResult) = (ext_fetch_hook w__2) in (case f of F_Ext_Error (e) => let (_ : unit) = (ext_handle_fetch_check_error e) in sail2_state_monad$returnS (RETIRE_FAIL, F) | F_Error ((e, addr)) => sail2_state_monad$seqS (handle_mem_exception addr e) (sail2_state_monad$returnS (RETIRE_FAIL, F)) | F_RVC (h) => sail2_state_monad$bindS (decodeCompressed h) (\ ast . sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_instr () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__3 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__4 : 64 words$word) . sail2_state_monad$bindS (print_insn ast) (\ (w__5 : string) . sail2_state_monad$returnS ((print_dbg ((STRCAT "[" ((STRCAT ((stringFromInteger step_no)) ((STRCAT "] [" ((STRCAT ((privLevel_to_str w__3)) ((STRCAT "]: " ((STRCAT ((string_of_bits w__4)) ((STRCAT " (" ((STRCAT ((string_of_bits h)) ((STRCAT ") " w__5))))))))))))))))))))))) else sail2_state_monad$returnS () ) (haveRVC () )) (\ (w__6 : bool) . if w__6 then sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__7 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS nextPC_ref ((add_vec_int w__7 (( 2 : int):ii) : 64 words$word))) (ext_post_decode_hook ast)) (\ (w__8 : ast) . sail2_state_monad$bindS (execute w__8) (\ (w__9 : Retired) . sail2_state_monad$returnS (w__9, T)))) else sail2_state_monad$seqS (handle_illegal () ) (sail2_state_monad$returnS (RETIRE_FAIL, T)))) | F_Base (w) => sail2_state_monad$bindS (decode w) (\ ast . sail2_state_monad$bindS (sail2_state_monad$seqS (if ((get_config_print_instr () )) then sail2_state_monad$bindS (sail2_state_monad$read_regS cur_privilege_ref) (\ (w__11 : Privilege) . sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__12 : 64 words$word) . sail2_state_monad$bindS (print_insn ast) (\ (w__13 : string) . sail2_state_monad$returnS ((print_dbg ((STRCAT "[" ((STRCAT ((stringFromInteger step_no)) ((STRCAT "] [" ((STRCAT ((privLevel_to_str w__11)) ((STRCAT "]: " ((STRCAT ((string_of_bits w__12)) ((STRCAT " (" ((STRCAT ((string_of_bits w)) ((STRCAT ") " w__13))))))))))))))))))))))) else sail2_state_monad$returnS () ) (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M)) (\ (w__14 : 64 words$word) . sail2_state_monad$bindS (sail2_state_monad$seqS (sail2_state_monad$write_regS nextPC_ref ((add_vec_int w__14 (( 4 : int):ii) : 64 words$word))) (ext_post_decode_hook ast)) (\ (w__15 : ast) . sail2_state_monad$bindS (execute w__15) (\ (w__16 : Retired) . sail2_state_monad$returnS (w__16, T))))) )) ) (\ varstup . let ((retired : Retired), (stepped : bool)) = varstup in sail2_state_monad$seqS (sail2_state_monad$seqS (tick_pc () ) (case retired of RETIRE_SUCCESS => retire_instruction () | RETIRE_FAIL => sail2_state_monad$returnS () )) (let (_ : unit) = (ext_post_step_hook () ) in sail2_state_monad$returnS stepped))))))`; (*val loop : unit -> M unit*) val _ = Define ` ((loop:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (let insns_per_tick = (plat_insns_per_tick () ) in let (i : ii) = ((( 0 : int):ii)) in let (step_no : ii) = ((( 0 : int):ii)) in sail2_state_monad$bindS (sail2_state$whileS (i, step_no) (\ varstup . let (i, step_no) = varstup in sail2_state_monad$bindS (sail2_state_monad$read_regS htif_done_ref) (\ (w__0 : bool) . sail2_state_monad$returnS ((~ w__0)))) (\ varstup . let (i, step_no) = varstup in sail2_state_monad$bindS (step step_no) (\ stepped . let (step_no : ii) = (if stepped then step_no + (( 1 : int):ii) else step_no) in sail2_state_monad$bindS (sail2_state_monad$read_regS htif_done_ref) (\ (w__1 : bool) . sail2_state_monad$bindS (if w__1 then sail2_state_monad$bindS (sail2_state_monad$read_regS htif_exit_code_ref : ( 64 words$word) M) (\ (w__2 : 64 words$word) . let exit_val = (lem$w2ui w__2) in sail2_state_monad$returnS (let (_ : unit) = (if (((exit_val = (( 0 : int):ii)))) then print_endline "SUCCESS" else print_int "FAILURE: " exit_val) in i)) else let i = (i + (( 1 : int):ii)) in if (((i = insns_per_tick))) then sail2_state_monad$seqS (sail2_state_monad$seqS (tick_clock () ) (tick_platform () )) (sail2_state_monad$returnS (( 0 : int):ii)) else sail2_state_monad$returnS i) (\ (i : ii) . sail2_state_monad$returnS (i, step_no)))))) (\ varstup . let ((i : ii), (step_no : ii)) = varstup in sail2_state_monad$returnS () )))`; (*val init_model : unit -> M unit*) val _ = Define ` ((init_model:unit ->(regstate)sail2_state_monad$sequential_state ->(((unit),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) () = (sail2_state_monad$seqS (sail2_state_monad$seqS (sail2_state_monad$seqS (init_platform () ) (init_sys () )) (init_vmem () )) (let (_ : unit) = (ext_init () ) in ext_init_regs () )))`; val _ = Define ` ((GPRstrs:(string)list)= (["x31";"x30";"x29";"x28";"x27";"x26";"x25";"x24";"x23";"x22";"x21";"x20";"x19";"x18";"x17";"x16"; "x15";"x14";"x13";"x12";"x11";"x10";"x9";"x8";"x7";"x6";"x5";"x4";"x3";"x2";"x1";"x0"]))`; (*val GPRstr : mword ty5 -> string*) val _ = Define ` ((GPRstr:(5)words$word -> string) i= (access_list_dec GPRstrs ((lem$w2ui i))))`; val _ = Define ` ((CIA_fp:regfp)= (RFull "CIA"))`; val _ = Define ` ((NIA_fp:regfp)= (RFull "NIA"))`; (*val initial_analysis : ast -> M (list regfp * list regfp * list regfp * list niafp * diafp * instruction_kind)*) val _ = Define ` ((initial_analysis:ast ->(regstate)sail2_state_monad$sequential_state ->((((regfp)list#(regfp)list#(regfp)list#(niafp)list#diafp#instruction_kind),(exception))sail2_state_monad$result#(regstate)sail2_state_monad$sequential_state)set) instr= (let iR = ([]) in let oR = ([]) in let aR = ([]) in let ik = (IK_simple () ) in let Nias = ([NIAFP_successor () ]) in let Dia = (DIAFP_none () ) in sail2_state_monad$bindS (case instr of EBREAK (() ) => sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | UTYPE ((imm, rd, op)) => let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | RISCV_JAL ((imm, rd)) => let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in let (offset : 64 bits) = ((EXTS (( 64 : int):ii) imm : 64 words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__0 : 64 words$word) . let (Nias : niafp list) = ([NIAFP_concrete_address ((add_vec w__0 offset : 64 words$word))]) in let (ik : instruction_kind) = (IK_branch () ) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR)) | RISCV_JALR ((imm, rs, rd)) => let (iR : regfp list) = (if (((rs = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs))) :: iR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in let (offset : 64 bits) = ((EXTS (( 64 : int):ii) imm : 64 words$word)) in let (Nias : niafp list) = ([NIAFP_indirect_address () ]) in let (ik : instruction_kind) = (IK_branch () ) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | BTYPE ((imm, rs2, rs1, op)) => let (iR : regfp list) = (if (((rs2 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs2))) :: iR) in let (iR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs1))) :: iR) in let ik = (IK_branch () ) in let (offset : 64 bits) = ((EXTS (( 64 : int):ii) imm : 64 words$word)) in sail2_state_monad$bindS (sail2_state_monad$read_regS PC_ref : ( 64 words$word) M) (\ (w__1 : 64 words$word) . let (Nias : niafp list) = ([NIAFP_concrete_address ((add_vec w__1 offset : 64 words$word));NIAFP_successor () ]) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR)) | ITYPE ((imm, rs, rd, op)) => let (iR : regfp list) = (if (((rs = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs))) :: iR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | SHIFTIOP ((imm, rs, rd, op)) => let (iR : regfp list) = (if (((rs = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs))) :: iR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | RTYPE ((rs2, rs1, rd, op)) => let (iR : regfp list) = (if (((rs2 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs2))) :: iR) in let (iR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs1))) :: iR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | CSR ((csr, rs1, rd, is_imm, op)) => let (isWrite : bool) = ((case op of CSRRW => T | _ => if is_imm then (((lem$w2ui rs1)) <> (( 0 : int):ii)) else (((lem$w2ui rs1)) <> (( 0 : int):ii)) )) in let (iR : regfp list) = ((RFull ((csr_name csr))) :: iR) in let (iR : regfp list) = (if ((~ is_imm)) then (RFull ((GPRstr rs1))) :: iR else iR) in let (oR : regfp list) = (if isWrite then (RFull ((csr_name csr))) :: oR else oR) in let (oR : regfp list) = ((RFull ((GPRstr rd))) :: oR) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | LOAD ((imm, rs, rd, unsign, width, aq, rl)) => let (iR : regfp list) = (if (((rs = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs))) :: iR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in let aR = iR in sail2_state_monad$bindS (case (aq, rl) of (F, F) => sail2_state_monad$returnS (IK_mem_read Read_plain) | (T, F) => sail2_state_monad$returnS (IK_mem_read Read_RISCV_acquire) | (T, T) => sail2_state_monad$returnS (IK_mem_read Read_RISCV_strong_acquire) | _ => internal_error "LOAD type not implemented in initial_analysis" ) (\ (w__3 : instruction_kind) . let (ik : instruction_kind) = w__3 in sail2_state_monad$returnS (Nias, aR, iR, ik, oR)) | STORE ((imm, rs2, rs1, width, aq, rl)) => let (iR : regfp list) = (if (((rs2 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs2))) :: iR) in let (iR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs1))) :: iR) in let (aR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then aR else (RFull ((GPRstr rs1))) :: aR) in sail2_state_monad$bindS (case (aq, rl) of (F, F) => sail2_state_monad$returnS (IK_mem_write Write_plain) | (F, T) => sail2_state_monad$returnS (IK_mem_write Write_RISCV_release) | (T, T) => sail2_state_monad$returnS (IK_mem_write Write_RISCV_strong_release) | _ => internal_error "STORE type not implemented in initial_analysis" ) (\ (w__5 : instruction_kind) . let (ik : instruction_kind) = w__5 in sail2_state_monad$returnS (Nias, aR, iR, ik, oR)) | ADDIW ((imm, rs, rd)) => let (iR : regfp list) = (if (((rs = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs))) :: iR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | SHIFTW ((imm, rs, rd, op)) => let (iR : regfp list) = (if (((rs = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs))) :: iR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | RTYPEW ((rs2, rs1, rd, op)) => let (iR : regfp list) = (if (((rs2 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs2))) :: iR) in let (iR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs1))) :: iR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | FENCE ((pred, succ)) => sail2_state_monad$bindS (case (pred, succ) of (v__1502, v__1503) => if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_rw_rw () )) else if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_r_rw () )) else if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_r_r () )) else if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_rw_w () )) else if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_w_w () )) else if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_w_rw () )) else if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_rw_r () )) else if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_r_w () )) else if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b01w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b10w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_w_r () )) else if ((((((((subrange_vec_dec v__1502 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word)))) /\ (((((subrange_vec_dec v__1503 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b00w : 2 words$word))))))) then sail2_state_monad$returnS (IK_simple () ) else internal_error "barrier type not implemented in initial_analysis" ) (\ (w__17 : instruction_kind) . let (ik : instruction_kind) = w__17 in sail2_state_monad$returnS (Nias, aR, iR, ik, oR)) | FENCE_TSO ((pred, succ)) => sail2_state_monad$bindS (case (pred, succ) of (v__1542, v__1543) => if ((((((((subrange_vec_dec v__1542 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word)))) /\ (((((subrange_vec_dec v__1543 (( 1 : int):ii) (( 0 : int):ii) : 2 words$word)) = (0b11w : 2 words$word))))))) then sail2_state_monad$returnS (IK_barrier (Barrier_RISCV_tso () )) else internal_error "barrier type not implemented in initial_analysis" ) (\ (w__20 : instruction_kind) . let (ik : instruction_kind) = w__20 in sail2_state_monad$returnS (Nias, aR, iR, ik, oR)) | FENCEI (() ) => let (ik : instruction_kind) = (IK_simple () ) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | LOADRES ((aq, rl, rs1, width, rd)) => let (iR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs1))) :: iR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in let aR = iR in sail2_state_monad$bindS (case (aq, rl) of (F, F) => sail2_state_monad$returnS (IK_mem_read Read_RISCV_reserved) | (T, F) => sail2_state_monad$returnS (IK_mem_read Read_RISCV_reserved_acquire) | (T, T) => sail2_state_monad$returnS (IK_mem_read Read_RISCV_reserved_strong_acquire) | (F, T) => internal_error "LOADRES type not implemented in initial_analysis" ) (\ (w__22 : instruction_kind) . let (ik : instruction_kind) = w__22 in sail2_state_monad$returnS (Nias, aR, iR, ik, oR)) | STORECON ((aq, rl, rs2, rs1, width, rd)) => let (iR : regfp list) = (if (((rs2 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs2))) :: iR) in let (iR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs1))) :: iR) in let (aR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then aR else (RFull ((GPRstr rs1))) :: aR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in sail2_state_monad$bindS (case (aq, rl) of (F, F) => sail2_state_monad$returnS (IK_mem_write Write_RISCV_conditional) | (F, T) => sail2_state_monad$returnS (IK_mem_write Write_RISCV_conditional_release) | (T, T) => sail2_state_monad$returnS (IK_mem_write Write_RISCV_conditional_strong_release) | (T, F) => internal_error "STORECON type not implemented in initial_analysis" ) (\ (w__24 : instruction_kind) . let (ik : instruction_kind) = w__24 in sail2_state_monad$returnS (Nias, aR, iR, ik, oR)) | AMO ((op, aq, rl, rs2, rs1, width, rd)) => let (iR : regfp list) = (if (((rs2 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs2))) :: iR) in let (iR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then iR else (RFull ((GPRstr rs1))) :: iR) in let (aR : regfp list) = (if (((rs1 = (0b00000w : 5 words$word)))) then aR else (RFull ((GPRstr rs1))) :: aR) in let (oR : regfp list) = (if (((rd = (0b00000w : 5 words$word)))) then oR else (RFull ((GPRstr rd))) :: oR) in let (ik : instruction_kind) = ((case (aq, rl) of (F, F) => IK_mem_rmw (Read_RISCV_reserved, Write_RISCV_conditional) | (F, T) => IK_mem_rmw (Read_RISCV_reserved, Write_RISCV_conditional_release) | (T, F) => IK_mem_rmw (Read_RISCV_reserved_acquire, Write_RISCV_conditional) | (T, T) => IK_mem_rmw (Read_RISCV_reserved_acquire, Write_RISCV_conditional_release) )) in sail2_state_monad$returnS (Nias, aR, iR, ik, oR) | _ => sail2_state_monad$returnS (Nias, aR, iR, ik, oR) ) (\ varstup . let ((Nias : niafp list), (aR : regfp list), (iR : regfp list), (ik : instruction_kind), (oR : regfp list)) = varstup in sail2_state_monad$returnS (iR, oR, aR, Nias, Dia, ik))))`; val _ = export_theory()