mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
ast_binary_new should determine the return type...
This commit is contained in:
parent
7756cb9205
commit
45933d2ce9
2 changed files with 13 additions and 0 deletions
12
ast.c
12
ast.c
|
@ -170,6 +170,18 @@ ast_binary* ast_binary_new(lex_ctx ctx, int op,
|
|||
self->left = left;
|
||||
self->right = right;
|
||||
|
||||
if (op >= INSTR_EQ_F && op <= INSTR_GT)
|
||||
self->expression.vtype = TYPE_FLOAT;
|
||||
else if (op == INSTR_AND || op == INSTR_OR ||
|
||||
op == INSTR_BITAND || op == INSTR_BITOR)
|
||||
self->expression.vtype = TYPE_FLOAT;
|
||||
else if (op == INSTR_MUL_VF || op == INSTR_MUL_FV)
|
||||
self->expression.vtype = TYPE_VECTOR;
|
||||
else if (op == INSTR_MUL_V)
|
||||
self->expression.vtype = TYPE_FLOAT;
|
||||
else
|
||||
self->expression.vtype = left->expression.vtype;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
1
ir.c
1
ir.c
|
@ -1175,6 +1175,7 @@ ir_value* ir_block_create_binop(ir_block *self,
|
|||
case INSTR_ADD_V:
|
||||
case INSTR_SUB_V:
|
||||
case INSTR_MUL_VF:
|
||||
case INSTR_MUL_FV:
|
||||
#if 0
|
||||
case INSTR_DIV_VF:
|
||||
case INSTR_MUL_IV:
|
||||
|
|
Loading…
Reference in a new issue