From c78f33757d606315c642ec598116cf9db63b97c2 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 12 Jan 2007 03:35:51 +0000 Subject: Update for changes in the assembly syntax. bool is replaced with i1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33106 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 64 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 31 deletions(-) (limited to 'docs') diff --git a/docs/LangRef.html b/docs/LangRef.html index b3cc8db..5e3527e 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -770,7 +770,7 @@ system. The current set of primitive types is as follows:

- + @@ -797,7 +797,7 @@ classifications:

- @@ -806,7 +806,7 @@ classifications:

- @@ -1118,7 +1118,7 @@ them all and their syntax.

Boolean constants
The two strings 'true' and 'false' are both valid - constants of the bool type. + constants of the i1 type.
Integer constants
@@ -1480,7 +1480,7 @@ return value.

'br' Instruction
Syntax:
-
  br bool <cond>, label <iftrue>, label <iffalse>
br label <dest> ; Unconditional branch +
  br i1 <cond>, label <iftrue>, label <iffalse>
br label <dest> ; Unconditional branch
Overview:

The 'br' instruction is used to cause control flow to @@ -1489,16 +1489,16 @@ two forms of this instruction, corresponding to a conditional branch and an unconditional branch.

Arguments:

The conditional branch form of the 'br' instruction takes a -single 'bool' value and two 'label' values. The +single 'i1' value and two 'label' values. The unconditional form of the 'br' instruction takes a single 'label' value as a target.

Semantics:
-

Upon execution of a conditional 'br' instruction, the 'bool' +

Upon execution of a conditional 'br' instruction, the 'i1' argument is evaluated. If the value is true, control flows to the 'iftrue' label argument. If "cond" is false, control flows to the 'iffalse' label argument.

Example:
-
Test:
%cond = icmp eq, i32 %a, %b
br bool %cond, label %IfEqual, label %IfUnequal
IfEqual:
Test:
%cond =
icmp eq, i32 %a, %b
br i1 %cond, label %IfEqual, label %IfUnequal
IfEqual:
ret i32 1
IfUnequal:
ret i32 0
@@ -1547,7 +1547,7 @@ branches or with a lookup table.

  ; Emulate a conditional br instruction
- %Val = zext bool %value to i32
+ %Val = zext i1 %value to i32
  switch i32 %Val, label %truedest [i32 0, label %falsedest ]
 
  ; Emulate an unconditional br instruction
@@ -2699,8 +2699,8 @@ It will always truncate bits.

Example:
   %X = trunc i32 257 to i8              ; yields i8:1
-  %Y = trunc i32 123 to bool               ; yields bool:true
-  %Y = trunc i32 122 to bool               ; yields bool:false
+  %Y = trunc i32 123 to i1              ; yields i1:true
+  %Y = trunc i32 122 to i1              ; yields i1:false
 
@@ -2734,12 +2734,12 @@ the operand and the type are the same size, no bit filling is done and the cast is considered a no-op cast because no bits change (only the type changes).

-

When zero extending from bool, the result will alwasy be either 0 or 1.

+

When zero extending from i1, the result will alwasy be either 0 or 1.

Example:
   %X = zext i32 257 to i64              ; yields i64:257
-  %Y = zext bool true to i32              ; yields i32:1
+  %Y = zext i1 true to i32              ; yields i32:1
 
@@ -2773,12 +2773,12 @@ the type ty2. When the the operand and the type are the same size, no bit filling is done and the cast is considered a no-op cast because no bits change (only the type changes).

-

When sign extending from bool, the extension always results in -1 or 0.

+

When sign extending from i1, the extension always results in -1 or 0.

Example:
   %X = sext i8  -1 to i16              ; yields i16   :65535
-  %Y = sext bool true to i32             ; yields i32:-1
+  %Y = sext i1 true to i32             ; yields i32:-1
 
@@ -2882,14 +2882,14 @@ must be an integral type.

towards zero) unsigned integer value. If the value cannot fit in ty2, the results are undefined.

-

When converting to bool, the conversion is done as a comparison against -zero. If the value was zero, the bool result will be false. -If the value was non-zero, the bool result will be true.

+

When converting to i1, the conversion is done as a comparison against +zero. If the value was zero, the i1 result will be false. +If the value was non-zero, the i1 result will be true.

Example:
-  %X = fp2uint double 123.0 to i32         ; yields i32:123
-  %Y = fp2uint float 1.0E+300 to bool      ; yields bool:true
+  %X = fp2uint double 123.0 to i32      ; yields i32:123
+  %Y = fp2uint float 1.0E+300 to i1     ; yields i1:true
   %X = fp2uint float 1.04E+17 to i8     ; yields undefined:1
 
@@ -2922,14 +2922,14 @@ must also be an integral type.

towards zero) signed integer value. If the value cannot fit in ty2, the results are undefined.

-

When converting to bool, the conversion is done as a comparison against -zero. If the value was zero, the bool result will be false. -If the value was non-zero, the bool result will be true.

+

When converting to i1, the conversion is done as a comparison against +zero. If the value was zero, the i1 result will be false. +If the value was non-zero, the i1 result will be true.

Example:
-  %X = fptosi double -123.0 to i32        ; yields i32:-123
-  %Y = fptosi float 1.0E-247 to bool      ; yields bool:true
+  %X = fptosi double -123.0 to i32      ; yields i32:-123
+  %Y = fptosi float 1.0E-247 to i1      ; yields i1:true
   %X = fptosi float 1.04E+17 to i8      ; yields undefined:1
 
@@ -3122,7 +3122,8 @@ instructions, which defy better classification.

Syntax:
-
  <result> = icmp <cond> <ty> <var1>, <var2>   ; yields {bool}:result
+
  <result> = icmp <cond> <ty> <var1>, <var2>
+; yields {i1}:result
 
Overview:

The 'icmp' instruction returns a boolean value based on comparison @@ -3148,7 +3149,7 @@ a value, just a keyword. The possibilities for the condition code are:

Semantics:

The 'icmp' compares var1 and var2 according to the condition code given as cond. The comparison performed always -yields a bool result, as follows: +yields a i1 result, as follows:

  1. eq: yields true if the operands are equal, false otherwise. No sign interpretation is necessary or performed. @@ -3194,7 +3195,8 @@ elements.

Syntax:
-
  <result> = fcmp <cond> <ty> <var1>, <var2>   ; yields {bool}:result
+
  <result> = fcmp <cond> <ty> <var1>, <var2>
+; yields {i1}:result
 
Overview:

The 'fcmp' instruction returns a boolean value based on comparison @@ -3231,7 +3233,7 @@ types.

Semantics:

The 'fcmp' compares var1 and var2 according to the condition code given as cond. The comparison performed always -yields a bool result, as follows: +yields a i1 result, as follows:

  1. false: always yields false, regardless of operands.
  2. oeq: yields true if both operands are not a QNAN and @@ -3311,7 +3313,7 @@ came from in the last terminator instruction.

    Syntax:
    -  <result> = select bool <cond>, <ty> <val1>, <ty> <val2>             ; yields ty
    +  <result> = select i1 <cond>, <ty> <val1>, <ty> <val2>             ; yields ty
     
    Overview:
    @@ -3338,7 +3340,7 @@ value argument; otherwise, it returns the second value argument.
    Example:
    -  %X = select bool true, i8 17, i8 42          ; yields i8:17
    +  %X = select i1 true, i8 17, i8 42          ; yields i8:17
     
-- cgit v1.1
TypeDescription
boolTrue or False value
i1True or False value
i16Signless 16-bit value
i64Signless 64-bit value
double64-bit floating point value
integralbool, i8, i16, i32, i64 + i1, i8, i16, i32, i64
first classbool, i8, i16, i32, i64, float, double,
+
i1, i8, i16, i32, i64, float, double,
pointer,packed