From 89634fa645e4fa8640a2eb0e9698e55a7646b5e4 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 13 Jul 2017 16:23:41 -0700 Subject: [PATCH] Add documentation for immediates with type bool. This makes the documentation for the new bconst instruction more complete. --- docs/langref.rst | 7 +++++++ lib/cretonne/meta/base/immediates.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/langref.rst b/docs/langref.rst index 78953ed8b0..49593e3f09 100644 --- a/docs/langref.rst +++ b/docs/langref.rst @@ -265,6 +265,13 @@ indicate the different kinds of immediate operands on an instruction. A 64-bit immediate floating point number in the IEEE 754-2008 binary64 interchange format. All bit patterns are allowed. +.. type:: bool + + A boolean immediate value, either false or true. + + In the textual format, :type:`bool` immediates appear as 'false' + and 'true'. + .. type:: intcc An integer condition code. See the :inst:`icmp` instruction for details. diff --git a/lib/cretonne/meta/base/immediates.py b/lib/cretonne/meta/base/immediates.py index 5f64e73b80..1defe46f6d 100644 --- a/lib/cretonne/meta/base/immediates.py +++ b/lib/cretonne/meta/base/immediates.py @@ -49,7 +49,7 @@ ieee64 = ImmediateKind('ieee64', 'A 64-bit immediate floating point number.') #: #: This type of immediate boolean can interact with SSA values with any #: :py:class:`cretonne.BoolType` type. -boolean = ImmediateKind('boolean', 'An immediate boolean.', +boolean = ImmediateKind('bool', 'An immediate boolean.', rust_type='bool') #: A condition code for comparing integer values.