From: Reid Spencer Date: Sun, 3 Dec 2006 16:53:48 +0000 (+0000) Subject: Update for signless GEP semantics. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=42ddd84addeabef697be2d2f7e33c8f8acb446d9;p=oota-llvm.git Update for signless GEP semantics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32159 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LangRef.html b/docs/LangRef.html index 5b7b1256efb..7f0353102fa 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -2491,9 +2491,9 @@ elements of the aggregate object to index to. The actual types of the arguments provided depend on the type of the first pointer argument. The 'getelementptr' instruction is used to index down through the type levels of a structure or to a specific index in an array. When indexing into a -structure, only uint -integer constants are allowed. When indexing into an array or pointer, -int and long and ulong indexes are allowed.

+structure, only uint integer constants are allowed. When indexing +into an array or pointer, integers of any size are allowed, and will be sign +extended to 64-bit values.

For example, let's consider a C code fragment and how it gets compiled to LLVM:

@@ -2534,9 +2534,10 @@ compiled to LLVM:

The index types specified for the 'getelementptr' instruction depend on the pointer type that is being indexed into. Pointer -and array types require int, -ulong, or long values, and structure -types require uint constants.

+and array types can use any +integer type but the value will always be sign extended +to 64-bits. Structure types, require uint +constants.

In the example above, the first index is indexing into the '%ST*' type, which is a pointer, yielding a '%ST' = '{ int, double, %RT