From 3025b810b248bc23a08a07989828f62344332a35 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 16 Jul 2009 18:18:16 +0000 Subject: [PATCH] * doc/porting.texi (Conventions): Add docs on writing integers. --- ChangeLog | 2 ++ doc/porting.texi | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1ffd50c..d98acbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-07-16 Doug Evans + * doc/porting.texi (Conventions): Add docs on writing integers. + * cpu/simplify.inc (*): One line doc strings don't need \n. (df): Invoke define-full-ifield instead of claiming it's an alias. (dno): Define. diff --git a/doc/porting.texi b/doc/porting.texi index 9d26d3c..6655e63 100644 --- a/doc/porting.texi +++ b/doc/porting.texi @@ -125,7 +125,8 @@ descriptions of each type of entry that appears in the description file. First a digression on conventions and programming style. -@enumerate +@itemize @bullet + @item @code{define-foo} vs. @code{define-normal-foo} Each CPU description @code{define-} entry generally provides two forms: @@ -162,8 +163,39 @@ The convention is to have most things lowercase with words separated by values and mode names. @c FIXME: Seems to me there's a few others. This convention must be followed. + +@item Integers + +There are two things to keep in mind regarding integers in CGEN. + +@enumerate + +@item Unspecified width + +Integers in CGEN generally don't specify a width. +The width is imposed by context. + +@item RTL canonicalization + +Integers in RTL may simply be written as a number, +or in the full canonical form as +@samp{(const [] [] )}. + +The ``option list'', if specified, must be @samp{()} +as there are currently no options for constants. +It is optional and is generally elided when written. + +The ``mode'' of the number specifies the precision. +The default mode is @samp{INT} meaning arbitrary precision. + +In RTL, whether to write just the number, e.g. @samp{24}, +or the full canonical form, e.g., @samp{(const () INT 24)}, +or anything in between is a matter of style. + @end enumerate +@end itemize + @node simplify.inc @subsection simplify.inc @cindex simplify.inc -- 2.43.5