| 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.FE310CSemantics. |
| 7 |
Require Import coqutil.Word.Naive. |
| 8 |
Require Import coqutil.Map.SortedListWord. |
| 9 |
Require Import Crypto.Bedrock.Field.Common.Types. |
| 10 |
Require Import Crypto.Bedrock.Field.Common.Names.VarnameGenerator. |
| 11 |
Require Import Crypto.Bedrock.Field.Translation.Parameters.Defaults. |
| 12 |
Require Import Crypto.BoundsPipeline. |
| 13 |
Require Import Crypto.Language.API. |
| 14 |
Require Import Crypto.Util.ZRange. |
| 15 |
Import API.Compilers. |
| 16 |
|
| 17 |
Require Import Crypto.Util.Notations. |
| 18 |
Import Types.Notations ListNotations. |
| 19 |
Local Open Scope Z_scope. |
| 20 |
Local Open Scope string_scope. |
| 21 |
|
| 22 |
(* Declares default parameters for the bedrock2 backend specific to systems with |
| 23 |
a 32-bit word size. *) |
| 24 |
|
| 25 |
Section Defaults_32. |
| 26 |
Definition machine_wordsize := 32. |
| 27 |
|
| 28 |
Let wordsize_bytes := Eval vm_compute in (machine_wordsize / 8)%Z. |
| 29 |
|
| 30 |
Instance default_parameters : Types.parameters |
| 31 |
(word := Naive.word32) |
| 32 |
(mem:=SortedListWord.map _ _) |
| 33 |
(varname_gen := default_varname_gen) |
| 34 |
(error := expr.var Defaults.ERROR) |
| 35 |
:= tt. |
| 36 |
Instance default_parameters_ok : Types.ok. |
| 37 |
Proof. constructor; try exact _; try apply prefix_name_gen_unique. Qed. |
| 38 |
End Defaults_32. |
| 39 |
|
| 40 |
Module Notations. |
| 41 |
Notation "'uint32,uint32'" := (ident.Literal |
| 42 |
(r[0 ~> 4294967295]%zrange, |
| 43 |
r[0 ~> 4294967295]%zrange)%core) : expr_scope. |
| 44 |
Notation "'uint32'" := |
| 45 |
(ident.Literal (t:=Compilers.zrange) r[0 ~> 4294967295]%zrange) : expr_scope. |
| 46 |
End Notations. |