mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
the codegen has to use STORE_V for .vector, not STORE_FLD - contrary to the regular global-assignment, even fteqcc gets this right, so gmqcc should too
This commit is contained in:
parent
9141217481
commit
04fd3d04d9
1 changed files with 24 additions and 2 deletions
26
ir.c
26
ir.c
|
@ -75,6 +75,22 @@ uint16_t type_store_instr[TYPE_COUNT] = {
|
|||
INSTR_STORE_V, /* variant, should never be accessed */
|
||||
};
|
||||
|
||||
uint16_t field_store_instr[TYPE_COUNT] = {
|
||||
INSTR_STORE_FLD,
|
||||
INSTR_STORE_FLD,
|
||||
INSTR_STORE_FLD,
|
||||
INSTR_STORE_V,
|
||||
INSTR_STORE_FLD,
|
||||
INSTR_STORE_FLD,
|
||||
INSTR_STORE_FLD,
|
||||
INSTR_STORE_FLD,
|
||||
#if 0
|
||||
INSTR_STORE_FLD, /* integer type */
|
||||
#endif
|
||||
|
||||
INSTR_STORE_V, /* variant, should never be accessed */
|
||||
};
|
||||
|
||||
uint16_t type_storep_instr[TYPE_COUNT] = {
|
||||
INSTR_STOREP_F, /* should use I when having integer support */
|
||||
INSTR_STOREP_S,
|
||||
|
@ -2502,7 +2518,10 @@ tailcall:
|
|||
stmt.opcode = INSTR_STORE_F;
|
||||
stmt.o3.u1 = 0;
|
||||
|
||||
stmt.opcode = type_store_instr[param->vtype];
|
||||
if (param->vtype == TYPE_FIELD)
|
||||
stmt.opcode = field_store_instr[param->fieldtype];
|
||||
else
|
||||
stmt.opcode = type_store_instr[param->vtype];
|
||||
stmt.o1.u1 = ir_value_code_addr(param);
|
||||
stmt.o2.u1 = OFS_PARM0 + 3 * p;
|
||||
if (code_statements_add(stmt) < 0)
|
||||
|
@ -2521,7 +2540,10 @@ tailcall:
|
|||
if (retvalue && retvalue->store != store_return && retvalue->life_count)
|
||||
{
|
||||
/* not to be kept in OFS_RETURN */
|
||||
stmt.opcode = type_store_instr[retvalue->vtype];
|
||||
if (retvalue->vtype == TYPE_FIELD)
|
||||
stmt.opcode = field_store_instr[retvalue->vtype];
|
||||
else
|
||||
stmt.opcode = type_store_instr[retvalue->vtype];
|
||||
stmt.o1.u1 = OFS_RETURN;
|
||||
stmt.o2.u1 = ir_value_code_addr(retvalue);
|
||||
stmt.o3.u1 = 0;
|
||||
|
|
Loading…
Reference in a new issue