diff --git a/docs/LangRef.html b/docs/LangRef.html index 54b01eae874..d74ef742dbc 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -3097,7 +3097,7 @@ the value cannot fit in the floating point value, the results are undefined.
%X = uitofp i32 257 to float ; yields float:257.0 - %Y = uitofp i8 -1 to double ; yields double:255.0 + %Y = uitofp i8 -1 to double ; yields double:255.0@@ -3129,7 +3129,7 @@ the value cannot fit in the floating point value, the results are undefined.
%X = sitofp i32 257 to float ; yields float:257.0 - %Y = sitofp i8 -1 to double ; yields double:-1.0 + %Y = sitofp i8 -1 to double ; yields double:-1.0@@ -3159,12 +3159,13 @@ must be a pointer value, and a type to cast it to truncating or zero extending that value to the size of the integer type. If value is smaller than ty2 then a zero extension is done. If value is larger than ty2 then a truncation is done. If they -are the same size, then nothing is done (no-op cast). +are the same size, then nothing is done (no-op cast) other than a type +change.
- %X = ptrtoint i32* %X to i8 ; yields truncation on 32-bit - %Y = ptrtoint i32* %x to i64 ; yields zero extend on 32-bit + %X = ptrtoint i32* %X to i8 ; yields truncation on 32-bit architecture + %Y = ptrtoint i32* %x to i64 ; yields zero extension on 32-bit architecture@@ -3198,9 +3199,9 @@ nothing is done (no-op cast).
- %X = inttoptr i32 255 to i32* ; yields zero extend on 64-bit - %X = inttoptr i32 255 to i32* ; yields no-op on 32-bit - %Y = inttoptr i16 0 to i32* ; yields zero extend on 32-bit + %X = inttoptr i32 255 to i32* ; yields zero extension on 64-bit architecture + %X = inttoptr i32 255 to i32* ; yields no-op on 32-bit architecture + %Y = inttoptr i64 0 to i32* ; yields truncation on 32-bit architecture@@ -3237,7 +3238,7 @@ other types, use the inttoptr or
- %X = bitcast i8 255 to i8 ; yields i8 :-1 + %X = bitcast i8 255 to i8 ; yields i8 :-1 %Y = bitcast i32* %x to sint* ; yields sint*:%x %Z = bitcast <2xint> %V to i64; ; yields i64: %V@@ -3255,16 +3256,15 @@ instructions, which defy better classification.
<result> = icmp <cond> <ty> <var1>, <var2> -; yields {i1}:result +<result> = icmp <cond> <ty> <var1>, <var2> ; yields {i1}:resultOverview:
The 'icmp' instruction returns a boolean value based on comparison of its two integer operands.
Arguments:
The 'icmp' instruction takes three operands. The first operand is -the condition code which indicates the kind of comparison to perform. It is not -a value, just a keyword. The possibilities for the condition code are: +the condition code indicating the kind of comparison to perform. It is not +a value, just a keyword. The possible condition code are:
- eq: equal
- ne: not equal
@@ -3307,7 +3307,7 @@ yields a i1 result, as follows: true if var1 is less than or equal to var2.If the operands are pointer typed, the pointer -values are treated as integers and then compared.
+values are compared as if they were integers.Example:
<result> = icmp eq i32 4, 5 ; yields: result=false @@ -3324,16 +3324,15 @@ values are treated as integers and then compared.
<result> = fcmp <cond> <ty> <var1>, <var2> -; yields {i1}:result +<result> = fcmp <cond> <ty> <var1>, <var2> ; yields {i1}:resultOverview:
The 'fcmp' instruction returns a boolean value based on comparison of its floating point operands.
Arguments:
The 'fcmp' instruction takes three operands. The first operand is -the condition code which indicates the kind of comparison to perform. It is not -a value, just a keyword. The possibilities for the condition code are: +the condition code indicating the kind of comparison to perform. It is not +a value, just a keyword. The possible condition code are:
-
- false: no comparison, always returns false
- oeq: ordered and equal
@@ -3352,13 +3351,11 @@ a value, just a keyword. The possibilities for the condition code are:- uno: unordered (either nans)
- true: no comparison, always returns true
In the preceding, ordered means that neither operand is a QNAN while +
Ordered means that neither operand is a QNAN while unordered means that either operand may be a QNAN.
The val1 and val2 arguments must be floating point typed. They must have identical types.
-In the foregoing, ordered means that neither operand is a QNAN and -unordered means that either operand is a QNAN.
Semantics:
The 'fcmp' compares var1 and var2 according to the condition code given as cond. The comparison performed always @@ -3412,7 +3409,7 @@ Instruction
The 'phi' instruction is used to implement the φ node in the SSA graph representing the function.
The type of the incoming values are specified with the first type +
The type of the incoming values is specified with the first type field. After this, the 'phi' instruction takes a list of pairs as arguments, with one pair for each predecessor basic block of the current block. Only values of first class @@ -3422,9 +3419,9 @@ may be used as the label arguments.
block and the PHI instructions: i.e. PHI instructions must be first in a basic block.At runtime, the 'phi' instruction logically takes on the -value specified by the parameter, depending on which basic block we -came from in the last terminator instruction.
+At runtime, the 'phi' instruction logically takes on the value +specified by the pair corresponding to the predecessor basic block that executed +just prior to the current block.
Loop: ; Infinite loop that counts from 0 on up...@@ -3539,7 +3536,7 @@ the invoke instruction.
%indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]
%nextindvar = add i32 %indvar, 1
br label %Loop
%retval = call i32 %test(i32 %argc) - call i32(i8 *, ...) *%printf(i8 * %msg, i32 12, i8 42); + call i32(i8 *, ...) *%printf(i8 * %msg, i32 12, i8 42); %X = tail call i32 %foo() %Y = tail call fastcc i32 %foo()@@ -3569,7 +3566,7 @@ the "variable argument" area of a function call. It is used to implement the
This instruction takes a va_list* value and the type of the argument. It returns a value of the specified argument type and -increments the va_list to point to the next argument. Again, the +increments the va_list to point to the next argument. The actual type of va_list is target specific.
LLVM supports the notion of an "intrinsic function". These functions have well known names and semantics and are required to follow certain restrictions. Overall, these intrinsics represent an extension mechanism for the LLVM -language that does not require changing all of the transformations in LLVM to -add to the language (or the bytecode reader/writer, the parser, -etc...).
+language that does not require changing all of the transformations in LLVM when +adding to the language (or the bytecode reader/writer, the parser, etc...).Intrinsic function names must all start with an "llvm." prefix. This -prefix is reserved in LLVM for intrinsic names; thus, functions may not be named -this. Intrinsic functions must always be external functions: you cannot define -the body of intrinsic functions. Intrinsic functions may only be used in call -or invoke instructions: it is illegal to take the address of an intrinsic -function. Additionally, because intrinsic functions are part of the LLVM -language, it is required that they all be documented here if any are added.
+prefix is reserved in LLVM for intrinsic names; thus, function names may not +begin with this prefix. Intrinsic functions must always be external functions: +you cannot define the body of intrinsic functions. Intrinsic functions may +only be used in call or invoke instructions: it is illegal to take the address +of an intrinsic function. Additionally, because intrinsic functions are part +of the LLVM language, it is required if any are added that they be documented +here. -Some intrinsic functions can be overloaded. That is, the intrinsic represents +
Some intrinsic functions can be overloaded, i.e., the intrinsic represents a family of functions that perform the same operation but on different data types. This is most frequent with the integer types. Since LLVM can represent over 8 million different integer types, there is a way to declare an intrinsic -that can be overloaded based on its arguments. Such intrinsics will have the -names of the arbitrary types encoded into the intrinsic function name, each +that can be overloaded based on its arguments. Such an intrinsic will have the +names of its argument types encoded into its function name, each preceded by a period. For example, the llvm.ctpop function can take an integer of any width. This leads to a family of functions such as i32 @llvm.ctpop.i8(i8 %val) and i32 @llvm.ctpop.i29(i29 %val). @@ -3648,8 +3645,8 @@ named macros defined in the <stdarg.h> header file.
All of these functions operate on arguments that use a target-specific value type "va_list". The LLVM assembly language reference manual does not define what this type is, so all -transformations should be prepared to handle intrinsics with any type -used.
+transformations should be prepared to handle these functions regardless of +the type used.This example shows how the va_arg instruction and the variable argument handling intrinsic functions are @@ -3658,17 +3655,17 @@ used.
define i32 @test(i32 %X, ...) { ; Initialize variable argument processing - %ap = alloca i8 * + %ap = alloca i8* %ap2 = bitcast i8** %ap to i8* call void @llvm.va_start(i8* %ap2) ; Read a single integer argument - %tmp = va_arg i8 ** %ap, i32 + %tmp = va_arg i8** %ap, i32 ; Demonstrate usage of llvm.va_copy and llvm.va_end - %aq = alloca i8 * + %aq = alloca i8* %aq2 = bitcast i8** %aq to i8* - call void @llvm.va_copy(i8 *%aq2, i8* %ap2) + call void @llvm.va_copy(i8* %aq2, i8* %ap2) call void @llvm.va_end(i8* %aq2) ; Stop processing of arguments. @@ -3704,10 +3701,10 @@ href="#i_va_arg">va_arg.The 'llvm.va_start' intrinsic works just like the va_start macro available in C. In a target-dependent way, it initializes the -va_list element the argument points to, so that the next call to +va_list element to which the argument points, so that the next call to va_arg will produce the first variable argument passed to the function. Unlike the C va_start macro, this intrinsic does not need to know the -last argument of the function, the compiler can figure that out.
+last argument of the function as the compiler can figure that out. @@ -3721,21 +3718,22 @@ last argument of the function, the compiler can figure that out.declare void @llvm.va_end(i8* <arglist>)Overview:
-The 'llvm.va_end' intrinsic destroys <arglist> +
The 'llvm.va_end' intrinsic destroys *<arglist>, which has been initialized previously with llvm.va_start or llvm.va_copy.
Arguments:
-The argument is a va_list to destroy.
+The argument is a pointer to a va_list to destroy.
Semantics:
The 'llvm.va_end' intrinsic works just like the va_end -macro available in C. In a target-dependent way, it destroys the va_list. -Calls to llvm.va_start and llvm.va_copy must be matched exactly -with calls to llvm.va_end.
+macro available in C. In a target-dependent way, it destroys the +va_list element to which the argument points. Calls to llvm.va_start and +llvm.va_copy must be matched exactly with calls to +llvm.va_end. @@ -3754,8 +3752,8 @@ with calls to llvm.va_end.Overview:
-The 'llvm.va_copy' intrinsic copies the current argument position from -the source argument list to the destination argument list.
+The 'llvm.va_copy' intrinsic copies the current argument position +from the source argument list to the destination argument list.
Arguments:
@@ -3765,11 +3763,12 @@ The second argument is a pointer to a va_list element to copy from.Semantics:
-The 'llvm.va_copy' intrinsic works just like the va_copy macro -available in C. In a target-dependent way, it copies the source -va_list element into the destination list. This intrinsic is necessary -because the llvm.va_start intrinsic may be -arbitrarily complex and require memory allocation, for example.
+The 'llvm.va_copy' intrinsic works just like the va_copy +macro available in C. In a target-dependent way, it copies the source +va_list element into the destination va_list element. This +intrinsic is necessary because the +llvm.va_start intrinsic may be arbitrarily complex and require, for +example, memory allocation.