X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FLangRef.html;h=d846b3963dbcf537f2498cbd1c659932ad71bb0d;hb=d4448796cf4175700997597e975734f3b0b6b42c;hp=8c045000fec0d53b2af679283fe37a8e0b01ce8f;hpb=3fa91b08a4ced58f520cb07d51316256d831893b;p=oota-llvm.git diff --git a/docs/LangRef.html b/docs/LangRef.html index 8c045000fec..d846b3963db 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -120,10 +120,10 @@
  • 'sext .. to' Instruction
  • 'fptrunc .. to' Instruction
  • 'fpext .. to' Instruction
  • -
  • 'fp2uint .. to' Instruction
  • -
  • 'fp2sint .. to' Instruction
  • -
  • 'uint2fp .. to' Instruction
  • -
  • 'sint2fp .. to' Instruction
  • +
  • 'fptoui .. to' Instruction
  • +
  • 'fptosi .. to' Instruction
  • +
  • 'uitofp .. to' Instruction
  • +
  • 'sitofp .. to' Instruction
  • 'bitconvert .. to' Instruction
  • Other Operations @@ -1206,17 +1206,17 @@ following is the syntax for constant expressions:

    constant. TYPE must be an integer type. CST must be floating point. If the value won't fit in the integer type, the results are undefined. -
    fp2sint ( CST to TYPE )
    +
    fptosi ( CST to TYPE )
    Convert a floating point constant to the corresponding signed integer constant. TYPE must be an integer type. CST must be floating point. If the value won't fit in the integer type, the results are undefined.
    -
    uint2fp ( CST to TYPE )
    +
    uitofp ( CST to TYPE )
    Convert an unsigned integer constant to the corresponding floating point constant. TYPE must be floating point. CST must be of integer type. If the value won't fit in the floating point type, the results are undefined.
    -
    sint2fp ( CST to TYPE )
    +
    sitofp ( CST to TYPE )
    Convert a signed integer constant to the corresponding floating point constant. TYPE must be floating point. CST must be of integer type. If the value won't fit in the floating point type, the results are undefined.
    @@ -2640,19 +2640,15 @@ The 'trunc' instruction truncates its operand to the type ty2. The 'trunc' instruction takes a value to trunc, which must be an integer type, and a type that specifies the size and type of the result, which must be an integral -type.

    +type. The bit size of value must be larger than the bit size of +ty2. Equal sized types are not allowed.

    Semantics:

    The 'trunc' instruction truncates the high order bits in value -and converts the reamining bits to ty2. The bit size of value -must be larger than the bit size of ty2. Equal sized types are not -allowed. This implies that a trunc cannot be a no-op cast. It -will always truncate bits.

    - -

    When truncating to bool, the truncation is done as a comparison against -zero. If the value was zero, the bool result will be false. -If the value was non-zero, the bool result will be true.

    +and converts the remaining bits to ty2. Since the source size must be +larger than the destination size, trunc cannot be a no-op cast. +It will always truncate bits.

    Example:
    @@ -2681,8 +2677,8 @@ If the value was non-zero, the bool result will be true.

    The 'zext' instruction takes a value to cast, which must be of integral type, and a type to cast it to, which must also be of integral type. The bit size of the -value must be smaller than or equal to the bit size of the -destination type, ty2.

    +value must be smaller than the bit size of the destination type, +ty2.

    Semantics:

    The zext fills the high order bits of the value with zero @@ -2691,9 +2687,7 @@ the operand and the type are the same size, no bit filling is done and the cast is considered a no-op cast because no bits change (only the type changes).

    -

    When zero extending to bool, the extension is done as a comparison against -zero. If the value was zero, the bool result will be false. -If the value was non-zero, the bool result will be true.

    +

    When zero extending from bool, the result will alwasy be either 0 or 1.

    Example:
    @@ -2720,7 +2714,9 @@ If the value was non-zero, the bool result will be true.

    The 'sext' instruction takes a value to cast, which must be of integral type, and a type to cast it to, which must -also be of integral type.

    +also be of integral type. The bit size of the +value must be smaller than the bit size of the destination type, +ty2.

    Semantics:

    @@ -2730,12 +2726,9 @@ the type ty2. When the the operand and the type are the same size, no bit filling is done and the cast is considered a no-op cast because no bits change (only the type changes).

    -

    When sign extending to bool, the extension is done as a comparison against -zero. If the value was zero, the bool result will be false. -If the value was non-zero, the bool result will be true.

    +

    When sign extending from bool, the extension always results in -1 or 0.

    Example:
    -
       %X = sext sbyte -1 to ushort           ; yields ushort:65535
       %Y = sext bool true to int             ; yields int:-1
    @@ -2768,10 +2761,10 @@ cast it to. The size of value must be larger than the size of
     no-op cast.

    Semantics:
    -

    The 'fptrunc' instruction converts a -floating point value from a larger type to a smaller -type. If the value cannot fit within the destination type, ty2, then -the results are undefined.

    +

    The 'fptrunc' instruction truncates a value from a larger +floating point type to a smaller +floating point type. If the value cannot fit within +the destination type, ty2, then the results are undefined.

    Example:
    @@ -2798,13 +2791,15 @@ floating point value.

    Arguments:

    The 'fpext' instruction takes a floating point value to cast, -and a floating point type to cast it to.

    +and a floating point type to cast it to. The source +type must be smaller than the destination type.

    Semantics:
    -

    The 'fpext' instruction extends the value from one floating -point type to another. If the type of the value and ty2 are -the same, the instruction is considered a no-op cast because no bits -change.

    +

    The 'fpext' instruction extends the value from a smaller +floating point type to a larger +floating point type. The fpext cannot be +used to make a no-op cast because it always changes bits. Use +bitconvert to make a no-op cast for a floating point cast.

    Example:
    @@ -2815,7 +2810,7 @@ change.

    @@ -2854,28 +2849,28 @@ If the value was non-zero, the bool result will be true.

    Syntax:
    -  <result> = fp2sint <ty> <value> to <ty2>             ; yields ty2
    +  <result> = fptosi <ty> <value> to <ty2>             ; yields ty2
     
    Overview:
    -

    The 'fp2sint' instruction converts +

    The 'fptosi' instruction converts floating point value to type ty2.

    Arguments:
    -

    The 'fp2sint' instruction takes a value to cast, which must be a +

    The 'fptosi' instruction takes a value to cast, which must be a floating point value, and a type to cast it to, which must also be an integral type.

    Semantics:
    -

    The 'fp2sint' instruction converts its +

    The 'fptosi' instruction converts its floating point operand into the nearest (rounding towards zero) signed integer value. If the value cannot fit in ty2, the results are undefined.

    @@ -2886,75 +2881,75 @@ If the value was non-zero, the bool result will be true.

    Example:
    -  %X = fp2sint double -123.0 to int        ; yields int:-123
    -  %Y = fp2sint float 1.0E-247 to bool      ; yields bool:true
    -  %X = fp2sint float 1.04E+17 to sbyte     ; yields undefined:1
    +  %X = fptosi double -123.0 to int        ; yields int:-123
    +  %Y = fptosi float 1.0E-247 to bool      ; yields bool:true
    +  %X = fptosi float 1.04E+17 to sbyte     ; yields undefined:1
     
    Syntax:
    -  <result> = uint2fp <ty> <value> to <ty2>             ; yields ty2
    +  <result> = uitofp <ty> <value> to <ty2>             ; yields ty2
     
    Overview:
    -

    The 'uint2fp' instruction regards value as an unsigned +

    The 'uitofp' instruction regards value as an unsigned integer and converts that value to the ty2 type.

    Arguments:
    -

    The 'uint2fp' instruction takes a value to cast, which must be an +

    The 'uitofp' instruction takes a value to cast, which must be an integral value, and a type to cast it to, which must be a floating point type.

    Semantics:
    -

    The 'uint2fp' instruction interprets its operand as an unsigned +

    The 'uitofp' instruction interprets its operand as an unsigned integer quantity and converts it to the corresponding floating point value. If the value cannot fit in the floating point value, the results are undefined.

    Example:
    -  %X = uint2fp int 257 to float         ; yields float:257.0
    -  %Y = uint2fp sbyte -1 to double       ; yields double:255.0
    +  %X = uitofp int 257 to float         ; yields float:257.0
    +  %Y = uitofp sbyte -1 to double       ; yields double:255.0
     
    Syntax:
    -  <result> = sint2fp <ty> <value> to <ty2>             ; yields ty2
    +  <result> = sitofp <ty> <value> to <ty2>             ; yields ty2
     
    Overview:
    -

    The 'sint2fp' instruction regards value as a signed +

    The 'sitofp' instruction regards value as a signed integer and converts that value to the ty2 type.

    Arguments:
    -

    The 'sint2fp' instruction takes a value to cast, which must be an +

    The 'sitofp' instruction takes a value to cast, which must be an integral value, and a type to cast it to, which must be a floating point type.

    Semantics:
    -

    The 'sint2fp' instruction interprets its operand as a signed +

    The 'sitofp' instruction interprets its operand as a signed integer quantity and converts it to the corresponding floating point value. If the value cannot fit in the floating point value, the results are undefined.

    Example:
    -  %X = sint2fp int 257 to float         ; yields float:257.0
    -  %Y = sint2fp sbyte -1 to double       ; yields double:-1.0
    +  %X = sitofp int 257 to float         ; yields float:257.0
    +  %Y = sitofp sbyte -1 to double       ; yields double:-1.0
     
    @@ -2983,8 +2978,8 @@ and the destination type, ty2, must be identical.

    The 'bitconvert' instruction converts value to type ty2 as if the value had been stored to memory and read back as type ty2. That is, no bits are changed during the conversion. The -bitconvert instruction may be used to construct no-op casts that -the zext, sext, and fpext instructions do not permit.

    +bitconvert instruction is the only conversion instruction that permits +no-op casts to be constructed.

    Example: