From f1ac465b67d5fc11a0d9cd09b98ceb4ffa75dd97 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 1 Jul 2011 21:52:38 +0000 Subject: Generalize @llvm.ctlz, @llvm.cttz, and @llvm.ctpop to work on vectors of integers, and fix the one optimization pass that I'm aware of that needs updating for this. At least one current target, ARM NEON, can implement these operations on vectors directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134265 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/LangRef.html b/docs/LangRef.html index 74b2391..bc72144 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -6626,7 +6626,8 @@ LLVM.

Syntax:

This is an overloaded intrinsic. You can use llvm.ctpop on any integer bit - width. Not all targets support all bit widths however.

+ width, or on any vector with integer elements. Not all targets support all + bit widths or vector types, however.

   declare i8 @llvm.ctpop.i8(i8  <src>)
@@ -6634,6 +6635,7 @@ LLVM.

declare i32 @llvm.ctpop.i32(i32 <src>) declare i64 @llvm.ctpop.i64(i64 <src>) declare i256 @llvm.ctpop.i256(i256 <src>) + declare <2 x i32> @llvm.ctpop.v2i32(<2 x i32> <src>)
Overview:
@@ -6642,10 +6644,12 @@ LLVM.

Arguments:

The only argument is the value to be counted. The argument may be of any - integer type. The return type must match the argument type.

+ integer type, or a vector with integer elements. + The return type must match the argument type.

Semantics:
-

The 'llvm.ctpop' intrinsic counts the 1's in a variable.

+

The 'llvm.ctpop' intrinsic counts the 1's in a variable, or within each + element of a vector.

@@ -6658,7 +6662,8 @@ LLVM.

Syntax:

This is an overloaded intrinsic. You can use llvm.ctlz on any - integer bit width. Not all targets support all bit widths however.

+ integer bit width, or any vector whose elements are integers. Not all + targets support all bit widths or vector types, however.

   declare i8 @llvm.ctlz.i8 (i8  <src>)
@@ -6666,6 +6671,7 @@ LLVM.

declare i32 @llvm.ctlz.i32(i32 <src>) declare i64 @llvm.ctlz.i64(i64 <src>) declare i256 @llvm.ctlz.i256(i256 <src>) + declare <2 x i32> @llvm.ctlz.v2i32(<2 x i32> <src;gt)
Overview:
@@ -6674,11 +6680,13 @@ LLVM.

Arguments:

The only argument is the value to be counted. The argument may be of any - integer type. The return type must match the argument type.

+ integer type, or any vector type with integer element type. + The return type must match the argument type.

Semantics:

The 'llvm.ctlz' intrinsic counts the leading (most significant) - zeros in a variable. If the src == 0 then the result is the size in bits of + zeros in a variable, or within each element of the vector if the operation + is of vector type. If the src == 0 then the result is the size in bits of the type of src. For example, llvm.ctlz(i32 2) = 30.

@@ -6692,7 +6700,8 @@ LLVM.

Syntax:

This is an overloaded intrinsic. You can use llvm.cttz on any - integer bit width. Not all targets support all bit widths however.

+ integer bit width, or any vector of integer elements. Not all targets + support all bit widths or vector types, however.

   declare i8 @llvm.cttz.i8 (i8  <src>)
@@ -6700,6 +6709,7 @@ LLVM.

declare i32 @llvm.cttz.i32(i32 <src>) declare i64 @llvm.cttz.i64(i64 <src>) declare i256 @llvm.cttz.i256(i256 <src>) + declase <2 x i32> @llvm.cttz.v2i32(<2 x i32> <src>)
Overview:
@@ -6708,11 +6718,13 @@ LLVM.

Arguments:

The only argument is the value to be counted. The argument may be of any - integer type. The return type must match the argument type.

+ integer type, or a vectory with integer element type.. The return type + must match the argument type.

Semantics:

The 'llvm.cttz' intrinsic counts the trailing (least significant) - zeros in a variable. If the src == 0 then the result is the size in bits of + zeros in a variable, or within each element of a vector. + If the src == 0 then the result is the size in bits of the type of src. For example, llvm.cttz(2) = 1.

-- cgit v1.1