2009-07-16 Doug Evans <dje@sebabeach.org>
+ * 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.
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:
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 [<option-list>] [<mode>] <value>)}.
+
+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