Did I find the right examples for you? yes no

All Samples(561)  |  Call(372)  |  Derive(0)  |  Import(189)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rlib/rope.py   plexnet(Download)
import py
import sys
from pypy.rlib.rarithmetic import intmask, ovfcheck
from pypy.rlib.rarithmetic import r_uint, LONG_BIT
from pypy.rlib.objectmodel import we_are_translated
MAX_DEPTH = 32 # maybe should be smaller
CONCATENATE_WHEN_MULTIPLYING = 128
HIGHEST_BIT_SET = intmask(1L << (NBITS - 1))
 
def find_fib_index(l):
        i += 1
 
mul_by_1000003_pow_table = [intmask(pow(1000003, 2**_i, 2**LONG_BIT))
                            for _i in range(LONG_BIT)]
 
    while b:
        if b & 1:
            a = intmask(a * mul_by_1000003_pow_table[index])
        b >>= 1
        index += 1
        h1 = self.hash
        h2 = other.hash
        x = intmask(h2 + masked_mul_by_1000003_pow(h1, rightlength))
        x |= HIGHEST_BIT_SET
        result.hash = x

src/s/y/Sypy-HEAD/rlib/rbigint.py   Sypy(Download)
from pypy.rlib.rarithmetic import LONG_BIT, intmask, r_uint, r_ulonglong
from pypy.rlib.rarithmetic import ovfcheck, r_longlong, widen, is_valid_int
from pypy.rlib.rarithmetic import most_neg_value_of_same_type
from pypy.rlib.rfloat import isfinite
from pypy.rlib.debug import make_sure_not_resized, check_regular_int
def _mask_digit(x):
    return intmask(x & MASK)
_mask_digit._annspecialcase_ = 'specialize:argtype(0)'
 
def _widen_digit(x):
def _check_digits(l):
    for x in l:
        assert type(x) is type(NULLDIGIT)
        assert intmask(x) & MASK == intmask(x)
class Entry(extregistry.ExtRegistryEntry):
        # than the sign bit).
        sign = self.sign
        if intmask(x) < 0 and (sign > 0 or (x << 1) != 0):
            raise OverflowError
        return intmask(intmask(x) * sign)

src/s/y/Sypy-HEAD/rlib/rope.py   Sypy(Download)
import py
import sys
from pypy.rlib.rarithmetic import intmask, ovfcheck
from pypy.rlib.rarithmetic import r_uint, LONG_BIT
from pypy.rlib.objectmodel import we_are_translated
MAX_DEPTH = 32 # maybe should be smaller
CONCATENATE_WHEN_MULTIPLYING = 128
HIGHEST_BIT_SET = intmask(1L << (NBITS - 1))
 
def find_fib_index(l):
        i += 1
 
mul_by_1000003_pow_table = [intmask(pow(1000003, 2**_i, 2**LONG_BIT))
                            for _i in range(LONG_BIT)]
 
    while b:
        if b & 1:
            a = intmask(a * mul_by_1000003_pow_table[index])
        b >>= 1
        index += 1
        h1 = self.hash
        h2 = other.hash
        x = intmask(h2 + masked_mul_by_1000003_pow(h1, rightlength))
        x |= HIGHEST_BIT_SET
        result.hash = x

src/s/y/Sypy-HEAD/jit/codewriter/support.py   Sypy(Download)
from pypy.rlib import rgc
from pypy.rlib.jit import elidable
from pypy.rlib.rarithmetic import r_longlong, r_ulonglong, r_uint, intmask
 
def getargtypes(annotator, values):
def _ll_1_llong_from_int(x):
    return r_longlong(intmask(x))
 
def _ll_1_ullong_from_int(x):
    return r_ulonglong(intmask(x))
def _ll_1_llong_to_int(xll):
    return intmask(xll)
 
def _ll_1_llong_from_float(xf):
    return r_longlong(xf)

src/s/y/Sypy-HEAD/rpython/memory/gc/minimark.py   Sypy(Download)
from pypy.rpython.memory.gc import minimarkpage, env
from pypy.rpython.memory.support import mangle_hash
from pypy.rlib.rarithmetic import ovfcheck, LONG_BIT, intmask, r_uint
from pypy.rlib.rarithmetic import LONG_BIT_SHIFT
from pypy.rlib.debug import ll_assert, debug_print, debug_start, debug_stop
        # --- Optimized version:
        return intmask(
          ((r_uint(length) + r_uint((LONG_BIT << self.card_page_shift) - 1)) >>
           (self.card_page_shift + LONG_BIT_SHIFT)))
 
        # --- Optimized version:
        return intmask(
            ((r_uint(length) + r_uint((8 << self.card_page_shift) - 1)) >>
             (self.card_page_shift + 3)))
 

src/s/y/Sypy-HEAD/rpython/lltypesystem/opimpl.py   Sypy(Download)
 
# global synonyms for some types
from pypy.rlib.rarithmetic import intmask
from pypy.rlib.rarithmetic import r_int, r_uint, r_longlong, r_ulonglong
from pypy.rpython.lltypesystem.llmemory import AddressAsInt
        assert isinstance(x, llgroup.CombinedSymbolic)
    assert isinstance(y, (int, long, llmemory.AddressOffset))
    return intmask(x + y)
 
def op_int_sub(x, y):
    if not is_valid_int(x):
        from pypy.rpython.lltypesystem import llgroup
        assert isinstance(x, llgroup.CombinedSymbolic)
    assert is_valid_int(y)
    return intmask(x - y)
def op_int_mul(x, y):
    assert isinstance(x, (int, long, llmemory.AddressOffset))
    assert isinstance(y, (int, long, llmemory.AddressOffset))
    return intmask(x * y)
 
def op_cast_float_to_int(f):
    assert type(f) is float
    return intmask(int(f))
 
def op_cast_float_to_uint(f):

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/rlib/objectmodel.py   plexnet(Download)
    just the same as compute_hash(x).
    """
    from pypy.rlib.rarithmetic import intmask
    return intmask(id(x))
 
# ----------
 
def _hash_string(s):
    """The algorithm behind compute_hash() for a string or a unicode."""
    from pypy.rlib.rarithmetic import intmask
        i += 1
    x ^= length
    return intmask(x)
 
def _hash_float(f):
    In RPython, floats cannot be used with ints in dicts, anyway.
    """
    from pypy.rlib.rarithmetic import intmask, isinf, isnan
    if isinf(f):
        if f < 0.0:

src/s/y/Sypy-HEAD/jit/metainterp/blackhole.py   Sypy(Download)
from pypy.rlib.debug import debug_start, debug_stop, ll_assert, make_sure_not_resized
from pypy.rlib.objectmodel import we_are_translated
from pypy.rlib.rarithmetic import intmask, LONG_BIT, r_uint, ovfcheck
from pypy.rlib.rtimer import read_timestamp
from pypy.rlib.unroll import unrolling_iterable
def signedord(c):
    value = ord(c)
    value = intmask(value << (LONG_BIT-8)) >> (LONG_BIT-8)
    return value
 
    def bhimpl_int_add(a, b):
        return intmask(a + b)
 
    @arguments("i", "i", returns="i")
    def bhimpl_int_sub(a, b):
        return intmask(a - b)
 
    @arguments("i", "i", returns="i")
    def bhimpl_int_mul(a, b):
        return intmask(a * b)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/jit/metainterp/executor.py   plexnet(Download)
from pypy.rpython.ootypesystem import ootype
from pypy.rpython.lltypesystem.lloperation import llop
from pypy.rlib.rarithmetic import ovfcheck, r_uint, intmask
from pypy.jit.metainterp.history import BoxInt, ConstInt, check_descr
from pypy.jit.metainterp.history import INT, REF, ConstFloat
def do_int_add(cpu, box1, box2):
    return ConstInt(intmask(box1.getint() + box2.getint()))
 
def do_int_sub(cpu, box1, box2):
    return ConstInt(intmask(box1.getint() - box2.getint()))
 
def do_int_mul(cpu, box1, box2):
    return ConstInt(intmask(box1.getint() * box2.getint()))
def do_int_lshift(cpu, box1, box2):
    return ConstInt(intmask(box1.getint() << box2.getint()))
 
def do_uint_rshift(cpu, box1, box2):
    v = r_uint(box1.getint()) >> r_uint(box2.getint())

src/s/y/Sypy-HEAD/rlib/rtimer.py   Sypy(Download)
import time
 
from pypy.rlib.rarithmetic import r_longlong, r_ulonglong, r_uint
from pypy.rlib.rarithmetic import intmask, longlongmask
from pypy.rpython.extregistry import ExtRegistryEntry
    x = long(time.time() * 500000000)
    if _is_64_bit:
        return intmask(x)
    else:
        return longlongmask(x)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next