From 2cf9dc9d40794912ce8af7d776326b271f52d942 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Fri, 5 Jan 2018 17:26:07 +0000 Subject: Added bitfield syntax to replicate register bits type For example: bitfield cr : vector(8, dec, bit) = { CR0 : 7 .. 4, LT : 7, CR1 : 3 .. 2, CR2 : 1, CR3 : 0, } The difference this creates a newtype wrapper around the vector type, then generates getters and setters for all the fields once, rather than having to handle this construct separately in every backend. --- src/parse_ast.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/parse_ast.ml') diff --git a/src/parse_ast.ml b/src/parse_ast.ml index e84e8a60..362333f3 100644 --- a/src/parse_ast.ml +++ b/src/parse_ast.ml @@ -429,8 +429,7 @@ type_def_aux = (* Type definition body *) | TD_record of id * name_scm_opt * typquant * ((atyp * id)) list * bool (* struct type definition *) | TD_variant of id * name_scm_opt * typquant * (type_union) list * bool (* union type definition *) | TD_enum of id * name_scm_opt * (id) list * bool (* enumeration type definition *) - | TD_register of id * atyp * atyp * ((index_range * id)) list (* register mutable bitfield type definition *) - + | TD_bitfield of id * atyp * (id * index_range) list (* register mutable bitfield type definition *) type val_spec_aux = (* Value type specification *) -- cgit v1.2.3