diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-31 17:49:08 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-31 17:49:08 +0000 |
commit | 16e4ed5879da57502ea3686c79c63f86994fbe75 (patch) | |
tree | b03848cef153e0fa6d41779770d4b382a62247b4 /docs | |
parent | 04ded924f3583438c6633823eddb87761fa73cce (diff) | |
download | external_llvm-16e4ed5879da57502ea3686c79c63f86994fbe75.zip external_llvm-16e4ed5879da57502ea3686c79c63f86994fbe75.tar.gz external_llvm-16e4ed5879da57502ea3686c79c63f86994fbe75.tar.bz2 |
Reject bitcasts between address spaces with different sizes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187506 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LangRef.rst | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst index 91f2289..dc96d8f 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -1061,7 +1061,9 @@ the specifications in the ``datalayout`` keyword. The default specifications are given in this list: - ``E`` - big endian -- ``p:64:64:64`` - 64-bit pointers with 64-bit alignment +- ``p:64:64:64`` - 64-bit pointers with 64-bit alignment. +- ``p[n]:64:64:64`` - Other address spaces are assumed to be the + same as the default address space. - ``S0`` - natural stack alignment is unspecified - ``i1:8:8`` - i1 is 8-bit (byte) aligned - ``i8:8:8`` - i8 is 8-bit (byte) aligned @@ -2583,7 +2585,7 @@ Examples: It is sometimes useful to attach information to loop constructs. Currently, loop metadata is implemented as metadata attached to the branch instruction in the loop latch block. This type of metadata refer to a metadata node that is -guaranteed to be separate for each loop. The loop identifier metadata is +guaranteed to be separate for each loop. The loop identifier metadata is specified with the name ``llvm.loop``. The loop identifier metadata is implemented using a metadata that refers to @@ -5613,24 +5615,24 @@ Arguments: The '``bitcast``' instruction takes a value to cast, which must be a non-aggregate first class value, and a type to cast it to, which must -also be a non-aggregate :ref:`first class <t_firstclass>` type. The bit -sizes of ``value`` and the destination type, ``ty2``, must be identical. -If the source type is a pointer, the destination type must also be a -pointer. This instruction supports bitwise conversion of vectors to -integers and to vectors of other types (as long as they have the same -size). +also be a non-aggregate :ref:`first class <t_firstclass>` type. The +bit sizes of ``value`` and the destination type, ``ty2``, must be +identical. If the source type is a pointer, the destination type must +also be a pointer of the same size. This instruction supports bitwise +conversion of vectors to integers and to vectors of other types (as +long as they have the same size). Semantics: """""""""" -The '``bitcast``' instruction converts ``value`` to type ``ty2``. It is -always a *no-op cast* because no bits change with this conversion. The -conversion is done as if the ``value`` had been stored to memory and -read back as type ``ty2``. Pointer (or vector of pointers) types may -only be converted to other pointer (or vector of pointers) types with -this instruction. To convert pointers to other types, use the -:ref:`inttoptr <i_inttoptr>` or :ref:`ptrtoint <i_ptrtoint>` instructions -first. +The '``bitcast``' instruction converts ``value`` to type ``ty2``. It +is always a *no-op cast* because no bits change with this +conversion. The conversion is done as if the ``value`` had been stored +to memory and read back as type ``ty2``. Pointer (or vector of +pointers) types may only be converted to other pointer (or vector of +pointers) types with this instruction if the pointer sizes are +equal. To convert pointers to other types, use the :ref:`inttoptr +<i_inttoptr>` or :ref:`ptrtoint <i_ptrtoint>` instructions first. Example: """""""" |