X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FLangRef.html;h=09903f1016be76acc2decca4a81db68375ee86be;hb=4a6da60787fcc66c521288fbd139cf8afdca5957;hp=e44edf421fd12259eb33a6948beb3c399791691b;hpb=3a5bff8d04dd028cf3e0bbd3c28069c03a501f5a;p=oota-llvm.git diff --git a/docs/LangRef.html b/docs/LangRef.html index e44edf421fd..09903f1016b 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -1226,8 +1226,8 @@ type "{ i32, [0 x float]}", for example.

Overview:

The function type can be thought of as a function signature. It consists of a return type and a list of formal parameter types. The -return type of a function type is a scalar type or a struct type. If the -return type is a struct type then all struct elements must be of first +return type of a function type is a scalar type or a void type or a struct type. +If the return type is a struct type then all struct elements must be of first class types. Function types are usually used to build virtual function tables (which are structures of pointers to functions), for indirect function calls, and when defining a function.

@@ -1465,8 +1465,10 @@ them all and their syntax.

Floating point constants use standard decimal notation (e.g. 123.421), exponential notation (e.g. 1.23421e+2), or a more precise hexadecimal - notation (see below). Floating point constants must have a floating point type.
+ notation (see below). The assembler requires the exact decimal value of + a floating-point constant. For example, the assembler accepts 1.25 but + rejects 1.3 because 1.3 is a repeating decimal in binary. Floating point + constants must have a floating point type.
Null pointer constants
@@ -2053,11 +2055,10 @@ no-return function cannot be reached, and other facts.

Binary Operations

Binary operators are used to do most of the computation in a -program. They require two operands, execute an operation on them, and +program. They require two operands of the same type, execute an operation on them, and produce a single value. The operands might represent multiple data, as is the case with the vector data type. -The result value of a binary operator is not -necessarily the same type as its operands.

+The result value has the same type as its operands.

There are several different binary operators:

@@ -2190,7 +2191,7 @@ operands.

types. This instruction can also take vector versions of the values in which case the elements must be integers.

Semantics:
-

The value produced is the signed integer quotient of the two operands.

+

The value produced is the signed integer quotient of the two operands rounded towards zero.

Note that signed integer division and unsigned integer division are distinct operations; for unsigned integer division, use 'udiv'.

Division by zero leads to undefined behavior. Overflow also leads to @@ -2238,8 +2239,7 @@ types. This instruction can also take vector versions of the values in which case the elements must be integers.

Semantics:

This instruction returns the unsigned integer remainder of a division. -This instruction always performs an unsigned division to get the remainder, -regardless of whether the arguments are unsigned or not.

+This instruction always performs an unsigned division to get the remainder.

Note that unsigned integer remainder and signed integer remainder are distinct operations; for signed integer remainder, use 'srem'.

Taking the remainder of a division by zero leads to undefined behavior.

@@ -2303,7 +2303,8 @@ division of its two operands.

identical types. This instruction can also take vector versions of floating point values.

Semantics:
-

This instruction returns the remainder of a division.

+

This instruction returns the remainder of a division. +The remainder has the same sign as the dividend.

Example:
  <result> = frem float 4.0, %var          ; yields {float}:result = 4.0 % %var
 
@@ -2316,9 +2317,8 @@ Operations

Bitwise binary operators are used to do various forms of bit-twiddling in a program. They are generally very efficient instructions and can commonly be strength reduced from other -instructions. They require two operands, execute an operation on them, -and produce a single value. The resulting value of the bitwise binary -operators is always the same type as its first operand.

+instructions. They require two operands of the same type, execute an operation on them, +and produce a single value. The resulting value is the same type as its operands.

@@ -2341,9 +2341,9 @@ the left a specified number of bits.

Semantics:
-

The value produced is var1 * 2var2. If -var2 is (statically or dynamically) equal to or larger than the number -of bits in var1, the result is undefined.

+

The value produced is var1 * 2var2 mod 2n, +where n is the width of the result. If var2 is (statically or dynamically) negative or +equal to or larger than the number of bits in var1, the result is undefined.

Example:
   <result> = shl i32 4, %var   ; yields {i32}: 4 << %var
@@ -2787,7 +2787,7 @@ address space (address space zero).

bytes of memory from the operating system and returns a pointer of the appropriate type to the program. If "NumElements" is specified, it is the number of elements allocated, otherwise "NumElements" is defaulted to be one. -If an alignment is specified, the value result of the allocation is guaranteed to +If a constant alignment is specified, the value result of the allocation is guaranteed to be aligned to at least that boundary. If not specified, or if zero, the target can choose to align the allocation on any convenient boundary.

@@ -2796,7 +2796,8 @@ choose to align the allocation on any convenient boundary.

Semantics:

Memory is allocated using the system "malloc" function, and -a pointer is returned.

+a pointer is returned. Allocating zero bytes is undefined. The result is null +if there is insufficient memory available.

Example:
@@ -2838,7 +2839,8 @@ instruction.

Semantics:

Access to the memory pointed to by the pointer is no longer defined -after this instruction executes.

+after this instruction executes. If the pointer is null, the result is +undefined.

Example:
@@ -2874,7 +2876,7 @@ space (address space zero).

bytes of memory on the runtime stack, returning a pointer of the appropriate type to the program. If "NumElements" is specified, it is the number of elements allocated, otherwise "NumElements" is defaulted to be one. -If an alignment is specified, the value result of the allocation is guaranteed +If a constant alignment is specified, the value result of the allocation is guaranteed to be aligned to at least that boundary. If not specified, or if zero, the target can choose to align the allocation on any convenient boundary.

@@ -2887,7 +2889,8 @@ memory is automatically released when the function returns. The 'allocaret or unwind -instructions), the memory is reclaimed.

+instructions), the memory is reclaimed. Allocating zero bytes +is legal, but the result is undefined.

Example:
@@ -2916,7 +2919,7 @@ the number or order of execution of this load with other volatile load and store instructions.

-The optional "align" argument specifies the alignment of the operation +The optional constant "align" argument specifies the alignment of the operation (that is, the alignment of the memory address). A value of 0 or an omitted "align" argument means that the operation has the preferential alignment for the target. It is the responsibility of the code emitter @@ -2947,13 +2950,14 @@ Instruction

Arguments:

There are two arguments to the 'store' instruction: a value to store and an address at which to store it. The type of the '<pointer>' -operand must be a pointer to the type of the '<value>' +operand must be a pointer to the first class type +of the '<value>' operand. If the store is marked as volatile, then the optimizer is not allowed to modify the number or order of execution of this store with other volatile load and store instructions.

-The optional "align" argument specifies the alignment of the operation +The optional constant "align" argument specifies the alignment of the operation (that is, the alignment of the memory address). A value of 0 or an omitted "align" argument means that the operation has the preferential alignment for the target. It is the responsibility of the code emitter @@ -3043,8 +3047,8 @@ entry: on the pointer type that is being indexed into. Pointer and array types can use a 32-bit or 64-bit integer type but the value will always be sign extended -to 64-bits. Structure types require i32 -constants.

+to 64-bits. Structure and packed +structure types require i32 constants.

In the example above, the first index is indexing into the '%ST*' type, which is a pointer, yielding a '%ST' = '{ i32, double, %RT @@ -3552,7 +3556,7 @@ instructions, which defy better classification.

Overview:

The 'icmp' instruction returns a boolean value based on comparison -of its two integer operands.

+of its two integer or pointer operands.

Arguments:

The 'icmp' instruction takes three operands. The first operand is the condition code indicating the kind of comparison to perform. It is not @@ -3918,7 +3922,7 @@ results.

The 'getresult' instruction takes a call or invoke value as its first argument. The value must have structure type. -The second argument is an unsigned index value which must be in range for +The second argument is a constant unsigned index value which must be in range for the number of values returned by the call.

Semantics: