From: Reid Spencer Date: Wed, 11 Apr 2007 23:23:49 +0000 (+0000) Subject: Document the part_set intrinsic. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f86037f17d42110323ee80f69f0e3f130affc96d;p=oota-llvm.git Document the part_set intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35929 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LangRef.html b/docs/LangRef.html index 56f6b864114..d487cbee16e 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -184,7 +184,8 @@
  • 'llvm.ctpop.*' Intrinsic
  • 'llvm.ctlz.*' Intrinsic
  • 'llvm.cttz.*' Intrinsic
  • -
  • 'llvm.part_select.*' Intrinsic
  • +
  • 'llvm.part.select.*' Intrinsic
  • +
  • 'llvm.part.set.*' Intrinsic
  • Debugger intrinsics
  • @@ -4641,6 +4642,56 @@ only the %hiBit - %loBit bits set, as follows:

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

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

    +  declare i17 @llvm.part.set.i17.i17.i9 (i17 %val, i9 %repl, i32 %lo, i32 %hi)
    +  declare i29 @llvm.part.set.i29.i29.i9 (i29 %val, i9 %repl, i32 %lo, i32 %hi)
    +
    + +
    Overview:
    +

    The 'llvm.part.set' family of intrinsic functions replaces a range +of bits in an integer value with another integer value. It returns the integer +with the replaced bits.

    + +
    Arguments:
    +

    The first argument, %val and the result may be integer types of +any bit width but they must have the same bit width. %val is the value +whose bits will be replaced. The second argument, %repl may be an +integer of any bit width. The third and fourth arguments must be i32 +type since they specify only a bit index.

    + +
    Semantics:
    +

    The operation of the 'llvm.part.set' intrinsic has two modes +of operation: forwards and reverse. If %lo is greater than +%hi then the intrinsic operates in reverse mode. Otherwise it +operates in forward mode.

    +

    For both modes, the %repl value is prepared for use by either +truncating it down to the size of the replacement area or zero extending it +up to that size.

    +

    In forward mode, the bits between %lo and %hi (inclusive) +are replaced with corresponding bits from %repl. That is the 0th bit +in %repl replaces the %loth bit in %val and etc. up +to the %hith bit. +

    In reverse mode, a similar computation is made except that the bits replaced +wrap around to include both the highest and lowest bits. For example, if a +16 bit value is being replaced then %lo=8 and %hi=4 would +cause these bits to be set: 0xFF1F

    . +
    Examples:
    +
    +  llvm.part.set(0xFFFF, 0, Y, 4, 7) -> 0xFF0F
    +  llvm.part.set(0xFFFF, 0, Y, 7, 4) -> 0x0060
    +  llvm.part.set(0xFFFF, 0, Y, 8, 3) -> 0x00F0
    +  llvm.part.set(0xFFFF, 0, Y, 3, 8) -> 0xFE07
    +
    +