Example #1
0
def get_arg_descr(cpu, ffi_type):
    from rpython.rlib.jit_libffi import types
    kind = types.getkind(ffi_type)
    if kind == 'i' or kind == 'u':
        size = rffi.getintfield(ffi_type, 'c_size')
    else:
        size = 0
    return _get_ffi2descr_dict(cpu)[kind, size]
Example #2
0
def get_arg_descr(cpu, ffi_type):
    from rpython.rlib.jit_libffi import types
    kind = types.getkind(ffi_type)
    if kind == 'i' or kind == 'u':
        size = rffi.getintfield(ffi_type, 'c_size')
    else:
        size = 0
    return _get_ffi2descr_dict(cpu)[kind, size]
Example #3
0
def get_ffi_type_kind(cpu, ffi_type):
    from rpython.rlib.jit_libffi import types
    kind = types.getkind(ffi_type)
    if ((not cpu.supports_floats and kind == 'f')
            or (not cpu.supports_longlong and kind == 'L')
            or (not cpu.supports_singlefloats and kind == 'S') or kind == '*'
            or kind == '?'):
        raise UnsupportedKind("Unsupported kind '%s'" % kind)
    if kind == 'u':
        kind = 'i'
    return kind
Example #4
0
def get_ffi_type_kind(cpu, ffi_type):
    from rpython.rlib.jit_libffi import types
    kind = types.getkind(ffi_type)
    if ((not cpu.supports_floats and kind == 'f') or
        (not cpu.supports_longlong and kind == 'L') or
        (not cpu.supports_singlefloats and kind == 'S') or
        kind == '*' or kind == '?'):
        raise UnsupportedKind("Unsupported kind '%s'" % kind)
    if kind == 'u':
        kind = 'i'
    return kind
Example #5
0
def is_ffi_type_signed(ffi_type):
    from rpython.rlib.jit_libffi import types
    kind = types.getkind(ffi_type)
    return kind != 'u'
Example #6
0
def is_ffi_type_signed(ffi_type):
    from rpython.rlib.jit_libffi import types
    kind = types.getkind(ffi_type)
    return kind != 'u'