From: Reid Spencer Date: Sun, 1 Apr 2007 19:00:37 +0000 (+0000) Subject: Preview documentation for additional intrinsic functions. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a13ba7d59771675c671aac8ae8d5727805d86073;p=oota-llvm.git Preview documentation for additional intrinsic functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35558 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LangRef.html b/docs/LangRef.html index 84e46fb2bcb..45352cc4eb5 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -4589,41 +4589,289 @@ of src. For example, llvm.cttz(2) = 1.
- 'llvm.bit.concat.*' Intrinsic + 'llvm.bit.and.reduce.*' Intrinsic
+
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.and.reduce on +any integer bit width. +

+  declare i1 @llvm.bit.and.reduce.i32(i32 %val)
+  declare i1 @llvm.bit.and.reduce.i97(i97 %val)
+
+
Overview:
+

The 'llvm.bit.and.reduce' family of intrinsic functions applies the +AND operator bitwise to each bit in %val until it yields the result. +

+ +
Arguments:
+

The argument may be any bit width. The result is always a 1-bit integer.

+ +
Semantics:
+

The 'llvm.bit.and.reduce' intrinsic is the equivalent of a test +against -1. Only if all bits in %val are set will the result +be 1, otherwise 0.

+
+ + +
+ 'llvm.bit.or.reduce.*' Intrinsic +
+
Syntax:
-

This is an overloaded intrinsic. You can use llvm.bit.concat on any -integer bit width. +

This is an overloaded intrinsic. You can use llvm.bit.or.reduce on +any integer bit width.

-  declare i32 @llvm.bit.concat.i32.i17.i15 (i17 %hi, i15 %lo)
-  declare i29 @llvm.bit.concat.i29(i16 %lo, i13 %lo)
+  declare i1 @llvm.bit.or.reduce.i32(i32 %val)
+  declare i1 @llvm.bit.or.reduce.i97(i97 %val)
 
+
Overview:
+

The 'llvm.bit.or.reduce' family of intrinsic functions applies the +OR operator bitwise to each bit in %val until it yields the result. +

+ +
Arguments:
+

The argument may be any bit width. The result is always a 1-bit integer.

+ +
Semantics:
+

The 'llvm.bit.or.reduce' intrinsic is the equivalent of a test +against 0. Only if all bits in %val are clear will the result +be 0, otherwise 1.

+
+ + +
+ 'llvm.bit.xor.reduce.*' Intrinsic +
+
+
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.xor.reduce on +any integer bit width. +

+  declare i1 @llvm.bit.xor.reduce.i32(i32 %val)
+  declare i1 @llvm.bit.xor.reduce.i97(i97 %val)
+
Overview:
-

-The 'llvm.bit.concat' family of intrinsic functions concatenates two -integer values to produce a longer one. +

The 'llvm.bit.xor.reduce' family of intrinsic functions applies the +XOR operator bitwise to each bit in %val until it yields the result.

Arguments:
+

The argument may be any bit width. The result is always a 1-bit integer.

-

-The two arguments may be any bit width. The result must be an integer whose bit -width is the sum of the arguments' bit widths. The first argument represents the -bits that will occupy the high order bit locations in the concatenated result. -THe second argument will occupy the lower order bit locations in the result. +

Semantics:
+

The 'llvm.bit.xor.reduce' computes its result by performing an XOR +operation on the two lowest order bits in %val. That result is then +XOR'd with the next bit in %val and this process continues until all +bits in %val have been XOR'd with the result of the previous XORs. The +resulting bit is returned.

+
+ + +
+ 'llvm.bit.nand.reduce.*' Intrinsic +
+ +
+
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.nand.reduce on +any integer bit width. +

+  declare i1 @llvm.bit.nand.reduce.i32(i32 %val)
+  declare i1 @llvm.bit.nand.reduce.i97(i97 %val)
+
+
Overview:
+

The 'llvm.bit.nand.reduce' family of intrinsic functions applies the +NAND operator bitwise to each bit in %val until it yields the result. +

+ +
Arguments:
+

The argument may be any bit width. The result is always a 1-bit integer.

+ +
Semantics:
+

The 'llvm.bit.nand.reduce' intrinsic is the equivalent of taking the +complement of the llvm.bit.and.reduce intrinsic. That is, it returns 0 +if %val is all ones (-1) and 1 otherwise.

+
+ + +
+ 'llvm.bit.nor.reduce.*' Intrinsic +
+ +
+
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.nor.reduce on +any integer bit width. +

+  declare i1 @llvm.bit.nor.reduce.i32(i32 %val)
+  declare i1 @llvm.bit.nor.reduce.i97(i97 %val)
+
+
Overview:
+

The 'llvm.bit.nor.reduce' family of intrinsic functions applies the +NOR operator bitwise to each bit in %val until it yields the result. +

+ +
Arguments:
+

The argument may be any bit width. The result is always a 1-bit integer.

+ +
Semantics:
+

The 'llvm.bit.nor.reduce' intrinsic is equivalent to the complement +of the llvm.bit.or.reduce intrinsic. That is, it returns 1 if all bits +in %val are 0, and 1 otherwise.

+
+ + +
+ 'llvm.bit.nxor.reduce.*' Intrinsic +
+ +
+
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.nxor.reduce on +any integer bit width. +

+  declare i1 @llvm.bit.nxor.reduce.i32(i32 %val)
+  declare i1 @llvm.bit.nxor.reduce.i97(i97 %val)
+
+
Overview:
+

The 'llvm.bit.nxor.reduce' family of intrinsic functions applies the +AND operator bitwise to each bit in %val until it yields the result.

+
Arguments:
+

The argument may be any bit width. The result is always a 1-bit integer.

+
Semantics:
+

The 'llvm.bit.nxor.reduce' intrinsic is the equivalent of the +complement of the llvm.bit.xor.reduce intrinsic.

+
+ + +
+ 'llvm.bit.select.*' Intrinsic +
+ +
+
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.select on any +integer bit width. +

+  declare i1 @llvm.bit.select.i17  (i17 %val, i32 %bit)
+  declare i1 @llvm.bit.select.i29  (i29 %val, i32 %bit)
+
+ +
Overview:
+

The 'llvm.bit.select' family of intrinsic functions selects a +specific bit from an integer value and returns it.

+ +
Arguments:
+

The two arguments may be any bit width. The result is always a 1-bit +integer. The first argument, %val may be any bit width and is the +value from which the bit is selected. The second argument, %bit must +be an i32 and is the bit index of the bit to be selected. Bits are +numbered starting with 0 as the lowest ordered bit.

+
Semantics:
+

The 'llvm.bit.select' intrinsic is the equivalent of shift and a +truncate operation. The %val is shifted right by %bit bits and +then truncated to a 1-bit integer.

+
+ + +
+ 'llvm.bit.set.*' Intrinsic +
+ +
+
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.set on any +integer bit width. +

+  declare i17 @llvm.bit.set.i17.i17 (i17 %val, i32 %bit)
+  declare i52 @llvm.bit.set.i52.i52 (i52 %val, i32 %bit)
+
+ +
Overview:

-The 'llvm.bit.concat' intrinsic is the equivalent of two zext -instructions, a shl and an or. This sequence can be -implemented in hardware so this intrinsic assists with recognizing the sequence -for code generation purposes. The operation proceeds as follows:

+The 'llvm.bit.set' family of intrinsic functions sets a specific bit in +a %val and returns the result.

+ +
Arguments:
+

The result and the first argument, %val, may be an integer of any +bit width, but they must be the same bit width. The second argument must be an +i32.

+ +
Semantics:
+

The 'llvm.bit.set' intrinsic is the equivalent of creating a bit +mask for the %bit requested in the width of %val, ORing that +mask with %val and returning the result.

+
+ + +
+ 'llvm.bit.clear.*' Intrinsic +
+ +
+ +
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.clear on any +integer bit width. +

+  declare i17 @llvm.bit.clear.i17.i17 (i17 %val, i32 %bit)
+  declare i29 @llvm.bit.clear.i29.i29 (i29 %val, i32 %bit)
+
+ +
Overview:
+

The 'llvm.bit.clear' family of intrinsic functions clears a specific +bit in a value and returns the result.

+ +
Arguments:
+

The result and the first argument, %val, may be an integer of any +bit width, but they must be the same bit width. The second argument must be an +i32.

+ +
Semantics:
+

The 'llvm.bit.clear' intrinsic is the equivalent of making a bit +mask in the width of %val but with the bit at index %bit set +to zero, ANDing that mask with %val and returning the result.

+
+ + +
+ 'llvm.bit.concat.*' Intrinsic +
+ +
+ +
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.concat on any +integer bit width. +

+  declare i32 @llvm.bit.concat.i32.i17.i15 (i17 %hi, i15 %lo)
+  declare i29 @llvm.bit.concat.i29.i12.i15 (i12 %hi, i15 %lo)
+
+ +
Overview:
+

The 'llvm.bit.concat' family of intrinsic functions concatenates two +integer values to produce a longer one.

+ +
Arguments:
+

The two arguments may be any bit width. The result must be an integer type +whose bit width is the sum of the arguments' bit widths. The first argument, +%hi, represents the bits that will occupy the high order bit locations +in the concatenated result. The second argument, %lo, will occupy the +lower order bit locations in the result.

+ +
Semantics:
+ +

The 'llvm.bit.concat' intrinsic is the equivalent of two +zext instructions, a shl and an or. The operation +proceeds as follows:

  1. Each of the arguments is zext'd to the result bit width.
  2. The %hi argument is shift left by the width of the %lo @@ -4633,6 +4881,83 @@ for code generation purposes. The operation proceeds as follows:

+ +
+ 'llvm.bit.part.select.*' Intrinsic +
+ +
+ +
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.part.select +on any integer bit width. +

+  declare i17 @llvm.bit.part.select.i17.i17 (i17 %val, i32 %loBit, i32 %hiBit)
+  declare i29 @llvm.bit.part.select.i29.i29 (i29 %val, i32 %loBit, i32 %hiBit)
+
+ +
Overview:
+

The 'llvm.bit.part.select' family of intrinsic functions selects a +range of bits from an integer value and returns them in the same bit width as +the original value.

+ +
Arguments:
+

The first argument, %val and the result may be integer types of +any bit width but they must have the same bit width. The second and third +arguments must be i32 type.

+ +
Semantics:
+

The 'llvm.bit.part.select' intrinsic is the equivalent of shifting +%val right by %loBit bits and then ANDing it with a mask with +only the %hiBit - %loBit bits set, as follows:

+
    +
  1. The %val is shifted right (LSHR) by the number of bits specified + by %loBits. This normalizes the value to the low order bits.
  2. +
  3. The %loBits value is subtracted from the %hiBits value + to determine the number of bits to retain.
  4. +
  5. A mask of the retained bits is created by shifting a -1 value.
  6. +
  7. The mask is ANDed with %val to produce the result. +
+
+ + +
+ 'llvm.bit.part.set.*' Intrinsic +
+ +
+ +
Syntax:
+

This is an overloaded intrinsic. You can use llvm.bit.part.set on +any integer bit width. +

+  declare i17 @llvm.bit.part.set.i17.i17.i9 (i17 %val, i32 %bit, i9 %newbits)
+  declare i29 @llvm.bit.part.set.i29.i29.i13(i29 %val, i32 %bit, i13 %newbits)
+
+ +
Overview:
+

The 'llvm.bit.part.set' family of intrinsic functions sets a range +of bits in a given value to a new value and returns the result.

+ +
Arguments:
+

The first argument and the result may be an integer type of any bit width but +they must have the same bit width. The second argument must be an i32. +The third argument may be any any bit width less than or equal to the bit width +of the first argument.

+ +
Semantics:
+

The 'llvm.bit.part.set' intrinsic sets the value given by +%newbits into %val at the bit index given by %bit. +This is equivalent to the following sequence:

+
    +
  1. The bits in %val starting at %bit and up to the width + of %newbits are cleared by ANDing them with a zero mask.
  2. +
  3. The bits in %newbits are shifted left by %bit bits. +
  4. The shifted %newbits value is OR'd into %val to produce + the result.
  5. +
+
+
Debugger Intrinsics