asterror(ast_ctx(self), "ir_builder_create_global failed");
return false;
}
+ if (self->expression.vtype == TYPE_FIELD)
+ v->fieldtype = self->expression.next->expression.vtype;
v->context = ast_ctx(self);
if (self->isconst) {
extern size_t type_sizeof[TYPE_COUNT];
extern uint16_t type_store_instr[TYPE_COUNT];
+extern uint16_t field_store_instr[TYPE_COUNT];
/* could use type_store_instr + INSTR_STOREP_F - INSTR_STORE_F
* but this breaks when TYPE_INTEGER is added, since with the enhanced
* instruction set, the old ones are left untouched, thus the _I instructions
case opid1('='):
if (ast_istype(exprs[0], ast_entfield)) {
ast_expression *field = ((ast_entfield*)exprs[0])->field;
- assignop = type_storep_instr[exprs[0]->expression.vtype];
+ if (OPTS_FLAG(ADJUST_VECTOR_FIELDS) &&
+ exprs[0]->expression.vtype == TYPE_FIELD &&
+ exprs[0]->expression.next->expression.vtype == TYPE_VECTOR)
+ {
+ assignop = type_storep_instr[TYPE_VECTOR];
+ }
+ else
+ assignop = type_storep_instr[exprs[0]->expression.vtype];
if (!ast_compare_type(field->expression.next, exprs[1])) {
char ty1[1024];
char ty2[1024];
}
else
{
- assignop = type_store_instr[exprs[0]->expression.vtype];
+ if (OPTS_FLAG(ADJUST_VECTOR_FIELDS) &&
+ exprs[0]->expression.vtype == TYPE_FIELD &&
+ exprs[0]->expression.next->expression.vtype == TYPE_VECTOR)
+ {
+ assignop = type_store_instr[TYPE_VECTOR];
+ }
+ else
+ assignop = type_store_instr[exprs[0]->expression.vtype];
if (!ast_compare_type(exprs[0], exprs[1])) {
char ty1[1024];
char ty2[1024];