Debian Codegraph @

src/Bedrock/Field/Translation/Parameters/Defaults32.v

raw
1 From Coq Require Import ZArith.
2 From Coq Require Import String.
3 From Coq Require Import List.
4 Require Import bedrock2.Syntax.
5 Require Import bedrock2.Semantics.
6 Require Import bedrock2.BasicC32Semantics.
7 Require Import Crypto.Bedrock.Field.Common.Types.
8 Require Import Crypto.Bedrock.Field.Common.Names.VarnameGenerator.
9 Require Import Crypto.Bedrock.Field.Translation.Parameters.Defaults.
10 Require Import Crypto.BoundsPipeline.
11 Require Import Crypto.Language.API.
12 Require Import Crypto.Util.ZRange.
13 Import API.Compilers.
14
15 Require Import Crypto.Util.Notations.
16 Import Types.Notations ListNotations.
17 Local Open Scope Z_scope.
18 Local Open Scope string_scope.
19
20 (* Declares default parameters for the bedrock2 backend specific to systems with
21 a 32-bit word size. *)
22
23 Section Defaults_32.
24 Definition machine_wordsize := 32.
25
26 Let wordsize_bytes := Eval vm_compute in (machine_wordsize / 8)%Z.
27 Instance default_parameters : Types.parameters
28 (word := BasicC32Semantics.word)
29 (varname_gen := default_varname_gen)
30 (error := expr.var Defaults.ERROR)
31 := tt.
32 Instance default_parameters_ok : Types.ok.
33 Proof using Type. constructor; try exact _; try apply prefix_name_gen_unique. Qed.
34 End Defaults_32.
35
36 Module Notations.
37 Notation "'uint32,uint32'" := (ident.Literal
38 (r[0 ~> 4294967295]%zrange,
39 r[0 ~> 4294967295]%zrange)%core) : expr_scope.
40 Notation "'uint32'" :=
41 (ident.Literal (t:=Compilers.zrange) r[0 ~> 4294967295]%zrange) : expr_scope.
42 End Notations.