diff options
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r-- | llvm/docs/LangRef.rst | 92 |
1 files changed, 54 insertions, 38 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 0c54f57..0339101 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -12175,8 +12175,8 @@ makes sense: ; get pointers for 8 elements from array B %ptrs = getelementptr double, ptr %B, <8 x i32> %C ; load 8 elements from array B into A - %A = call <8 x double> @llvm.masked.gather.v8f64.v8p0f64(<8 x ptr> %ptrs, - i32 8, <8 x i1> %mask, <8 x double> %passthru) + %A = call <8 x double> @llvm.masked.gather.v8f64.v8p0f64( + <8 x ptr> align 8 %ptrs, <8 x i1> %mask, <8 x double> %passthru) Conversion Operations --------------------- @@ -21062,12 +21062,15 @@ integer element type. Syntax: """"""" -This is an overloaded intrinsic. +This is an overloaded intrinsic. You can use ``llvm.matrix.column.major.load`` +to load any vector type with a stride of any bitwidth up to 64. :: - declare vectorty @llvm.matrix.column.major.load.*( + declare <4 x i32> @llvm.matrix.column.major.load.v4i32.i64( ptrty %Ptr, i64 %Stride, i1 <IsVolatile>, i32 <Rows>, i32 <Cols>) + declare <9 x double> @llvm.matrix.column.major.load.v9f64.i32( + ptrty %Ptr, i32 %Stride, i1 <IsVolatile>, i32 <Rows>, i32 <Cols>) Overview: """"""""" @@ -21086,9 +21089,9 @@ Arguments: The first argument ``%Ptr`` is a pointer type to the returned vector type, and corresponds to the start address to load from. The second argument ``%Stride`` -is a positive, constant integer with ``%Stride >= <Rows>``. ``%Stride`` is used -to compute the column memory addresses. I.e., for a column ``C``, its start -memory addresses is calculated with ``%Ptr + C * %Stride``. The third Argument +is a positive integer for which ``%Stride >= <Rows>``. ``%Stride`` is used to +compute the column memory addresses. I.e., for a column ``C``, its start memory +addresses is calculated with ``%Ptr + C * %Stride``. The third Argument ``<IsVolatile>`` is a boolean value. The fourth and fifth arguments, ``<Rows>`` and ``<Cols>``, correspond to the number of rows and columns, respectively, and must be positive, constant integers. The returned vector must @@ -21103,11 +21106,17 @@ The :ref:`align <attr_align>` parameter attribute can be provided for the Syntax: """"""" +This is an overloaded intrinsic. ``llvm.matrix.column.major.store`` to store +any vector type with a stride of any bitwidth up to 64. :: - declare void @llvm.matrix.column.major.store.*( - vectorty %In, ptrty %Ptr, i64 %Stride, i1 <IsVolatile>, i32 <Rows>, i32 <Cols>) + declare void @llvm.matrix.column.major.store.v4i32.i64( + <4 x i32> %In, ptrty %Ptr, i64 %Stride, i1 <IsVolatile>, i32 <Rows>, + i32 <Cols>) + declare void @llvm.matrix.column.major.store.v9f64.i32( + <9 x double> %In, ptrty %Ptr, i32 %Stride, i1 <IsVolatile>, i32 + <Rows>, i32 <Cols>) Overview: """"""""" @@ -21127,7 +21136,7 @@ Arguments: The first argument ``%In`` is a vector that corresponds to a ``<Rows> x <Cols>`` matrix to be stored to memory. The second argument ``%Ptr`` is a pointer to the vector type of ``%In``, and is the start address of the matrix -in memory. The third argument ``%Stride`` is a positive, constant integer with +in memory. The third argument ``%Stride`` is a positive integer for which ``%Stride >= <Rows>``. ``%Stride`` is used to compute the column memory addresses. I.e., for a column ``C``, its start memory addresses is calculated with ``%Ptr + C * %Stride``. The fourth argument ``<IsVolatile>`` is a boolean @@ -24289,7 +24298,7 @@ Examples: .. code-block:: llvm %active.lane.mask = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i64(i64 %elem0, i64 429) - %wide.masked.load = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(<4 x i32>* %3, i32 4, <4 x i1> %active.lane.mask, <4 x i32> poison) + %wide.masked.load = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(ptr align 4 %3, <4 x i1> %active.lane.mask, <4 x i32> poison) .. _int_loop_dependence_war_mask: @@ -24347,9 +24356,9 @@ Examples: .. code-block:: llvm %loop.dependence.mask = call <4 x i1> @llvm.loop.dependence.war.mask.v4i1(ptr %ptrA, ptr %ptrB, i64 4) - %vecA = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(ptr %ptrA, i32 4, <4 x i1> %loop.dependence.mask, <4 x i32> poison) + %vecA = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(ptr align 4 %ptrA, <4 x i1> %loop.dependence.mask, <4 x i32> poison) [...] - call @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %vecA, ptr %ptrB, i32 4, <4 x i1> %loop.dependence.mask) + call @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %vecA, ptr align 4 %ptrB, <4 x i1> %loop.dependence.mask) .. _int_loop_dependence_raw_mask: @@ -24412,9 +24421,9 @@ Examples: .. code-block:: llvm %loop.dependence.mask = call <4 x i1> @llvm.loop.dependence.raw.mask.v4i1(ptr %ptrA, ptr %ptrB, i64 4) - call @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %vecA, ptr %ptrA, i32 4, <4 x i1> %loop.dependence.mask) + call @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %vecA, ptr align 4 %ptrA, <4 x i1> %loop.dependence.mask) [...] - %vecB = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(ptr %ptrB, i32 4, <4 x i1> %loop.dependence.mask, <4 x i32> poison) + %vecB = call <4 x i32> @llvm.masked.load.v4i32.p0v4i32(ptr align 4 %ptrB, <4 x i1> %loop.dependence.mask, <4 x i32> poison) .. _int_experimental_vp_splice: @@ -24610,7 +24619,7 @@ Examples: %r = call <8 x i8> @llvm.vp.load.v8i8.p0(ptr align 2 %ptr, <8 x i1> %mask, i32 %evl) ;; For all lanes below %evl, %r is lane-wise equivalent to %also.r - %also.r = call <8 x i8> @llvm.masked.load.v8i8.p0(ptr %ptr, i32 2, <8 x i1> %mask, <8 x i8> poison) + %also.r = call <8 x i8> @llvm.masked.load.v8i8.p0(ptr align 2 %ptr, <8 x i1> %mask, <8 x i8> poison) .. _int_vp_load_ff: @@ -24930,7 +24939,7 @@ Examples: %r = call <8 x i8> @llvm.vp.gather.v8i8.v8p0(<8 x ptr> align 8 %ptrs, <8 x i1> %mask, i32 %evl) ;; For all lanes below %evl, %r is lane-wise equivalent to %also.r - %also.r = call <8 x i8> @llvm.masked.gather.v8i8.v8p0(<8 x ptr> %ptrs, i32 8, <8 x i1> %mask, <8 x i8> poison) + %also.r = call <8 x i8> @llvm.masked.gather.v8i8.v8p0(<8 x ptr> align 8 %ptrs, <8 x i1> %mask, <8 x i8> poison) .. _int_vp_scatter: @@ -24988,7 +24997,7 @@ Examples: call void @llvm.vp.scatter.v8i8.v8p0(<8 x i8> %val, <8 x ptr> align 1 %ptrs, <8 x i1> %mask, i32 %evl) ;; For all lanes below %evl, the call above is lane-wise equivalent to the call below. - call void @llvm.masked.scatter.v8i8.v8p0(<8 x i8> %val, <8 x ptr> %ptrs, i32 1, <8 x i1> %mask) + call void @llvm.masked.scatter.v8i8.v8p0(<8 x i8> %val, <8 x ptr> align 1 %ptrs, <8 x i1> %mask) .. _int_vp_trunc: @@ -26769,10 +26778,10 @@ This is an overloaded intrinsic. The loaded data is a vector of any integer, flo :: - declare <16 x float> @llvm.masked.load.v16f32.p0(ptr <ptr>, i32 <alignment>, <16 x i1> <mask>, <16 x float> <passthru>) - declare <2 x double> @llvm.masked.load.v2f64.p0(ptr <ptr>, i32 <alignment>, <2 x i1> <mask>, <2 x double> <passthru>) + declare <16 x float> @llvm.masked.load.v16f32.p0(ptr <ptr>, <16 x i1> <mask>, <16 x float> <passthru>) + declare <2 x double> @llvm.masked.load.v2f64.p0(ptr <ptr>, <2 x i1> <mask>, <2 x double> <passthru>) ;; The data is a vector of pointers - declare <8 x ptr> @llvm.masked.load.v8p0.p0(ptr <ptr>, i32 <alignment>, <8 x i1> <mask>, <8 x ptr> <passthru>) + declare <8 x ptr> @llvm.masked.load.v8p0.p0(ptr <ptr>, <8 x i1> <mask>, <8 x ptr> <passthru>) Overview: """"""""" @@ -26783,7 +26792,9 @@ Reads a vector from memory according to the provided mask. The mask holds a bit Arguments: """""""""" -The first argument is the base pointer for the load. The second argument is the alignment of the source location. It must be a power of two constant integer value. The third argument, mask, is a vector of boolean values with the same number of elements as the return type. The fourth is a pass-through value that is used to fill the masked-off lanes of the result. The return type, underlying type of the base pointer and the type of the '``passthru``' argument are the same vector types. +The first argument is the base pointer for the load. The second argument, mask, is a vector of boolean values with the same number of elements as the return type. The third is a pass-through value that is used to fill the masked-off lanes of the result. The return type, underlying type of the base pointer and the type of the '``passthru``' argument are the same vector types. + +The alignment of the base pointer can be specified using the ``align`` attribute on the first argument. Semantics: """""""""" @@ -26797,7 +26808,7 @@ Masked-off lanes are also not considered accessed for the purpose of data races :: - %res = call <16 x float> @llvm.masked.load.v16f32.p0(ptr %ptr, i32 4, <16 x i1>%mask, <16 x float> %passthru) + %res = call <16 x float> @llvm.masked.load.v16f32.p0(ptr align 4 %ptr, <16 x i1>%mask, <16 x float> %passthru) ;; The result of the two following instructions is identical aside from potential memory access exception %loadlal = load <16 x float>, ptr %ptr, align 4 @@ -26814,10 +26825,10 @@ This is an overloaded intrinsic. The data stored in memory is a vector of any in :: - declare void @llvm.masked.store.v8i32.p0 (<8 x i32> <value>, ptr <ptr>, i32 <alignment>, <8 x i1> <mask>) - declare void @llvm.masked.store.v16f32.p0(<16 x float> <value>, ptr <ptr>, i32 <alignment>, <16 x i1> <mask>) + declare void @llvm.masked.store.v8i32.p0 (<8 x i32> <value>, ptr <ptr>, <8 x i1> <mask>) + declare void @llvm.masked.store.v16f32.p0(<16 x float> <value>, ptr <ptr>, <16 x i1> <mask>) ;; The data is a vector of pointers - declare void @llvm.masked.store.v8p0.p0 (<8 x ptr> <value>, ptr <ptr>, i32 <alignment>, <8 x i1> <mask>) + declare void @llvm.masked.store.v8p0.p0 (<8 x ptr> <value>, ptr <ptr>, <8 x i1> <mask>) Overview: """"""""" @@ -26827,8 +26838,9 @@ Writes a vector to memory according to the provided mask. The mask holds a bit f Arguments: """""""""" -The first argument is the vector value to be written to memory. The second argument is the base pointer for the store, it has the same underlying type as the value argument. The third argument is the alignment of the destination location. It must be a power of two constant integer value. The fourth argument, mask, is a vector of boolean values. The types of the mask and the value argument must have the same number of vector elements. +The first argument is the vector value to be written to memory. The second argument is the base pointer for the store, it has the same underlying type as the value argument. The third argument, mask, is a vector of boolean values. The types of the mask and the value argument must have the same number of vector elements. +The alignment of the base pointer can be specified using the ``align`` attribute on the second argument. Semantics: """""""""" @@ -26841,7 +26853,7 @@ Masked-off lanes are also not considered accessed for the purpose of data races :: - call void @llvm.masked.store.v16f32.p0(<16 x float> %value, ptr %ptr, i32 4, <16 x i1> %mask) + call void @llvm.masked.store.v16f32.p0(<16 x float> %value, ptr align 4 %ptr, <16 x i1> %mask) ;; The result of the following instructions is identical aside from potential data races and memory access exceptions %oldval = load <16 x float>, ptr %ptr, align 4 @@ -26865,9 +26877,9 @@ This is an overloaded intrinsic. The loaded data are multiple scalar values of a :: - declare <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr> <ptrs>, i32 <alignment>, <16 x i1> <mask>, <16 x float> <passthru>) - declare <2 x double> @llvm.masked.gather.v2f64.v2p1(<2 x ptr addrspace(1)> <ptrs>, i32 <alignment>, <2 x i1> <mask>, <2 x double> <passthru>) - declare <8 x ptr> @llvm.masked.gather.v8p0.v8p0(<8 x ptr> <ptrs>, i32 <alignment>, <8 x i1> <mask>, <8 x ptr> <passthru>) + declare <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr> <ptrs>, <16 x i1> <mask>, <16 x float> <passthru>) + declare <2 x double> @llvm.masked.gather.v2f64.v2p1(<2 x ptr addrspace(1)> <ptrs>, <2 x i1> <mask>, <2 x double> <passthru>) + declare <8 x ptr> @llvm.masked.gather.v8p0.v8p0(<8 x ptr> <ptrs>, <8 x i1> <mask>, <8 x ptr> <passthru>) Overview: """"""""" @@ -26878,7 +26890,9 @@ Reads scalar values from arbitrary memory locations and gathers them into one ve Arguments: """""""""" -The first argument is a vector of pointers which holds all memory addresses to read. The second argument is an alignment of the source addresses. It must be 0 or a power of two constant integer value. The third argument, mask, is a vector of boolean values with the same number of elements as the return type. The fourth is a pass-through value that is used to fill the masked-off lanes of the result. The return type, underlying type of the vector of pointers and the type of the '``passthru``' argument are the same vector types. +The first argument is a vector of pointers which holds all memory addresses to read. The second argument, mask, is a vector of boolean values with the same number of elements as the return type. The third is a pass-through value that is used to fill the masked-off lanes of the result. The return type, underlying type of the vector of pointers and the type of the '``passthru``' argument are the same vector types. + +The alignment of the pointers can be specified using the ``align`` attribute on the first argument. Semantics: """""""""" @@ -26889,7 +26903,7 @@ The semantics of this operation are equivalent to a sequence of conditional scal :: - %res = call <4 x double> @llvm.masked.gather.v4f64.v4p0(<4 x ptr> %ptrs, i32 8, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x double> poison) + %res = call <4 x double> @llvm.masked.gather.v4f64.v4p0(<4 x ptr> align 8 %ptrs, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x double> poison) ;; The gather with all-true mask is equivalent to the following instruction sequence %ptr0 = extractelement <4 x ptr> %ptrs, i32 0 @@ -26918,9 +26932,9 @@ This is an overloaded intrinsic. The data stored in memory is a vector of any in :: - declare void @llvm.masked.scatter.v8i32.v8p0 (<8 x i32> <value>, <8 x ptr> <ptrs>, i32 <alignment>, <8 x i1> <mask>) - declare void @llvm.masked.scatter.v16f32.v16p1(<16 x float> <value>, <16 x ptr addrspace(1)> <ptrs>, i32 <alignment>, <16 x i1> <mask>) - declare void @llvm.masked.scatter.v4p0.v4p0 (<4 x ptr> <value>, <4 x ptr> <ptrs>, i32 <alignment>, <4 x i1> <mask>) + declare void @llvm.masked.scatter.v8i32.v8p0 (<8 x i32> <value>, <8 x ptr> <ptrs>, <8 x i1> <mask>) + declare void @llvm.masked.scatter.v16f32.v16p1(<16 x float> <value>, <16 x ptr addrspace(1)> <ptrs>, <16 x i1> <mask>) + declare void @llvm.masked.scatter.v4p0.v4p0 (<4 x ptr> <value>, <4 x ptr> <ptrs>, <4 x i1> <mask>) Overview: """"""""" @@ -26930,7 +26944,9 @@ Writes each element from the value vector to the corresponding memory address. T Arguments: """""""""" -The first argument is a vector value to be written to memory. The second argument is a vector of pointers, pointing to where the value elements should be stored. It has the same underlying type as the value argument. The third argument is an alignment of the destination addresses. It must be 0 or a power of two constant integer value. The fourth argument, mask, is a vector of boolean values. The types of the mask and the value argument must have the same number of vector elements. +The first argument is a vector value to be written to memory. The second argument is a vector of pointers, pointing to where the value elements should be stored. It has the same underlying type as the value argument. The third argument, mask, is a vector of boolean values. The types of the mask and the value argument must have the same number of vector elements. + +The alignment of the pointers can be specified using the ``align`` attribute on the second argument. Semantics: """""""""" @@ -26940,7 +26956,7 @@ The '``llvm.masked.scatter``' intrinsics is designed for writing selected vector :: ;; This instruction unconditionally stores data vector in multiple addresses - call @llvm.masked.scatter.v8i32.v8p0(<8 x i32> %value, <8 x ptr> %ptrs, i32 4, <8 x i1> <true, true, .. true>) + call @llvm.masked.scatter.v8i32.v8p0(<8 x i32> %value, <8 x ptr> align 4 %ptrs, <8 x i1> <true, true, .. true>) ;; It is equivalent to a list of scalar stores %val0 = extractelement <8 x i32> %value, i32 0 |