From b734b803bd38ff6c857b2706a8221a9ba0f0522b Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Sat, 20 Jun 2009 01:02:51 +0000 Subject: KQuery documentation: division and shift operations. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@73814 91177308-0d34-0410-b5e6-96231b3b80d8 --- www/KQuery.html | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 8 deletions(-) (limited to 'www/KQuery.html') diff --git a/www/KQuery.html b/www/KQuery.html index f0aaffae..4c43dad9 100644 --- a/www/KQuery.html +++ b/www/KQuery.html @@ -27,7 +27,7 @@
  1. Identifiers
  2. Numbers
  3. -
  4. Numbers
  5. +
  6. Types
  • Declarations @@ -51,8 +51,8 @@
  • Sub
  • Mul
  • UDiv
  • -
  • SDiv
  • URem
  • +
  • SDiv
  • SRem
  • @@ -384,20 +384,31 @@

    Add, Sub, Mul, - UDiv, - SDiv, - URem, - SRem

    + UDiv, SDiv, URem, SRem

    Syntax:

    - arithmetic-expr-kind = ( "Add" | "Sub" | "Mul" | "UDiv" | "SDiv" | "URem" )
    + arithmetic-expr-kind = ( "Add" | "Sub" | "Mul" | "UDiv" | "URem" | "SDiv" | "SRem" )
    expression = "(" arithmetic-expr-kind type expression expression ")"

    Arithmetic operations are always binary and the types of the left- and right-hand side expressions must match the expression type.

    +

    UDiv

    +

    Truncated unsigned division. Undefined if divisor is 0.

    + +

    URem

    +

    Unsigned remainder. Undefined if divisor is 0

    + +

    SDiv

    +

    Signed division. Undefined if divisor is 0.

    + +

    SRem

    +

    Signed remainder. Undefined if divisor is 0. Sign of the + remainder is the same as that of the dividend.

    + +

    Bitwise Operations

    And, @@ -416,7 +427,37 @@

    Bitwise operations are always binary and the types of the left- and right-hand side expressions must match the expression type.

    -

    FIXME: Pin down semantics of Shl, LShr, and AShr.

    +

    Shl

    + +
    + expression = "(" "Shl" type X Y ")" +
    + +

    Logical shift left. Moves each bit of X to the left + by Y positions. The Y right-most bits of X are + replaced with zero, and the left-most bits discarded.

    + + +

    LShr

    + +
    + expression = "(" "LShr" type X Y ")" +
    + +

    Logical shift right. Moves each bit of X to the right + by Y positions. The Y left-most bits of X are + replaced with zero, and the right-most bits discarded.

    + + +

    AShr

    + +
    + expression = "(" "AShr" type X Y ")" +
    + +

    Arithmetic shift right. Behaves as LShr except that the + left-most bits of X copy the initial left-most bit (the sign + bit) of X.

    Comparisons

    -- cgit 1.4.1