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]
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
def is_ffi_type_signed(ffi_type): from rpython.rlib.jit_libffi import types kind = types.getkind(ffi_type) return kind != 'u'