Exemplo n.º 1
0
    def codegen(context, builder, signature, args):
        data, index, value = args
        ptr = irutils.get_member_value(builder, data, 0)
        value = truncate_or_extend(builder, nb_value, eltype, value,
                                   ptr.type.pointee)

        builder.store(value, builder.gep(ptr, [index]))
Exemplo n.º 2
0
    def codegen(context, builder, signature, args):
        data, index = args
        ptr = irutils.get_member_value(builder, data, 0)
        res = builder.load(builder.gep(ptr, [index]))

        if isinstance(T, types.Float):
            res = builder.bitcast(res, nv.type)

        return builder.icmp_signed('==', res, nv)
Exemplo n.º 3
0
    def codegen(context, builder, signature, args):
        data, index = args
        ptr = irutils.get_member_value(builder, data, 0)

        ty = ptr.type.pointee
        nv = ir.Constant(ir.IntType(T.bitwidth), null_value)
        if isinstance(T, types.Float):
            nv = builder.bitcast(nv, ty)
        builder.store(nv, builder.gep(ptr, [index]))
Exemplo n.º 4
0
def StructureNumbaType_getattr_impl(context, builder, sig, struct, attr):
    model = datamodel.default_manager.lookup(sig)
    index = model.get_field_position(attr)
    return get_member_value(builder, struct, index)
Exemplo n.º 5
0
    def codegen(context, builder, signature, args):
        data, index = args
        ptr = irutils.get_member_value(builder, data, 0)
        res = builder.load(builder.gep(ptr, [index]))

        return res
Exemplo n.º 6
0
 def codegen(context, builder, signature, args):
     data, = args
     return irutils.get_member_value(builder, data, 1)