re-arrange the types of store and storep so things make a little more sense

This commit is contained in:
Bill Currie 2001-08-13 23:00:17 +00:00
parent 283b0e1a21
commit d55199bece
2 changed files with 19 additions and 19 deletions

View file

@ -80,19 +80,19 @@ opcode_t pr_opcodes[] = {
{".", "address", OP_ADDRESS, 1, false, ev_entity, ev_field, ev_pointer, PROG_ID_VERSION},
{"=", "store.f", OP_STORE_F, 5, true, ev_float, ev_float, ev_float, PROG_ID_VERSION},
{"=", "store.v", OP_STORE_V, 5, true, ev_vector, ev_vector, ev_vector, PROG_ID_VERSION},
{"=", "store.s", OP_STORE_S, 5, true, ev_string, ev_string, ev_string, PROG_ID_VERSION},
{"=", "store.ent", OP_STORE_ENT, 5, true, ev_entity, ev_entity, ev_entity, PROG_ID_VERSION},
{"=", "store.fld", OP_STORE_FLD, 5, true, ev_field, ev_field, ev_field, PROG_ID_VERSION},
{"=", "store.fnc", OP_STORE_FNC, 5, true, ev_func, ev_func, ev_func, PROG_ID_VERSION},
{"=", "store.f", OP_STORE_F, 5, true, ev_float, ev_float, ev_void, PROG_ID_VERSION},
{"=", "store.v", OP_STORE_V, 5, true, ev_vector, ev_vector, ev_void, PROG_ID_VERSION},
{"=", "store.s", OP_STORE_S, 5, true, ev_string, ev_string, ev_void, PROG_ID_VERSION},
{"=", "store.ent", OP_STORE_ENT, 5, true, ev_entity, ev_entity, ev_void, PROG_ID_VERSION},
{"=", "store.fld", OP_STORE_FLD, 5, true, ev_field, ev_field, ev_void, PROG_ID_VERSION},
{"=", "store.fnc", OP_STORE_FNC, 5, true, ev_func, ev_func, ev_void, PROG_ID_VERSION},
{"=", "storep.f", OP_STOREP_F, 5, true, ev_pointer, ev_float, ev_float, PROG_ID_VERSION},
{"=", "storep.v", OP_STOREP_V, 5, true, ev_pointer, ev_vector, ev_vector, PROG_ID_VERSION},
{"=", "storep.s", OP_STOREP_S, 5, true, ev_pointer, ev_string, ev_string, PROG_ID_VERSION},
{"=", "storep.ent", OP_STOREP_ENT, 5, true, ev_pointer, ev_entity, ev_entity, PROG_ID_VERSION},
{"=", "storep.fld", OP_STOREP_FLD, 5, true, ev_pointer, ev_field, ev_field, PROG_ID_VERSION},
{"=", "storep.fnc", OP_STOREP_FNC, 5, true, ev_pointer, ev_func, ev_func, PROG_ID_VERSION},
{"=", "storep.f", OP_STOREP_F, 5, true, ev_float, ev_pointer, ev_void, PROG_ID_VERSION},
{"=", "storep.v", OP_STOREP_V, 5, true, ev_vector, ev_pointer, ev_void, PROG_ID_VERSION},
{"=", "storep.s", OP_STOREP_S, 5, true, ev_string, ev_pointer, ev_void, PROG_ID_VERSION},
{"=", "storep.ent", OP_STOREP_ENT, 5, true, ev_entity, ev_pointer, ev_void, PROG_ID_VERSION},
{"=", "storep.fld", OP_STOREP_FLD, 5, true, ev_field, ev_pointer, ev_void, PROG_ID_VERSION},
{"=", "storep.fnc", OP_STOREP_FNC, 5, true, ev_func, ev_pointer, ev_void, PROG_ID_VERSION},
{"<RETURN>", "return", OP_RETURN, -1, false, ev_void, ev_void, ev_void, PROG_ID_VERSION},
@ -148,8 +148,8 @@ opcode_t pr_opcodes[] = {
{"!", "not.i", OP_NOT_I, -1, false, ev_integer, ev_integer, ev_integer, PROG_VERSION},
{"==", "eq.i", OP_EQ_I, 4, false, ev_integer, ev_integer, ev_integer, PROG_VERSION},
{"!=", "ne.i", OP_NE_I, 4, false, ev_integer, ev_integer, ev_integer, PROG_VERSION},
{"=", "store.i", OP_STORE_I, 5, true, ev_integer, ev_integer, ev_integer, PROG_VERSION},
{"=", "storep.i", OP_STOREP_I, 5, true, ev_pointer, ev_integer, ev_integer, PROG_VERSION},
{"=", "store.i", OP_STORE_I, 5, true, ev_integer, ev_integer, ev_void, PROG_VERSION},
{"=", "storep.i", OP_STOREP_I, 5, true, ev_integer, ev_pointer, ev_void, PROG_VERSION},
{".", "load.i", OP_LOAD_I, 1, false, ev_entity, ev_field, ev_integer, PROG_VERSION},
{"^", "bitxor.f", OP_BITXOR_F, 2, false, ev_float, ev_float, ev_float, PROG_VERSION},

View file

@ -99,7 +99,7 @@ emit_function_call (expr_t *e, def_t *dest)
args[ind] = PR_GetTempDef (types[get_type (earg)], pr_scope);
arg = emit_sub_expr (earg, args[ind]);
if (earg->type != ex_expr && earg->type != ex_uexpr) {
op = PR_Opcode_Find ("=", 5, arg, args[ind], args[ind]);
op = PR_Opcode_Find ("=", 5, arg, args[ind], &def_void);
emit_statement (e->line, op, arg, args[ind], 0);
}
}
@ -108,7 +108,7 @@ emit_function_call (expr_t *e, def_t *dest)
arg = args[ind];
parm = def_parms[ind];
parm.type = arg->type;
op = PR_Opcode_Find ("=", 5, arg, &parm, &parm);
op = PR_Opcode_Find ("=", 5, arg, &parm, &def_void);
emit_statement (e->line, op, arg, &parm, 0);
}
op = PR_Opcode_Find (va ("<CALL%d>", count), -1, &def_function, &def_void, &def_void);
@ -118,7 +118,7 @@ emit_function_call (expr_t *e, def_t *dest)
if (def_ret.type->type != ev_void) {
if (!dest)
dest = PR_GetTempDef (def_ret.type, pr_scope);
op = PR_Opcode_Find ("=", 5, dest, &def_ret, &def_ret);
op = PR_Opcode_Find ("=", 5, &def_ret, dest, &def_void);
emit_statement (e->line, op, &def_ret, dest, 0);
return dest;
} else
@ -136,7 +136,7 @@ emit_assign_expr (expr_t *e)
def_a = emit_sub_expr (e1, 0);
if (def_a->type == &type_pointer) {
def_b = emit_sub_expr (e2, 0);
op = PR_Opcode_Find ("=", 5, def_a, def_b, def_b);
op = PR_Opcode_Find ("=", 5, def_b, def_a, &def_void);
emit_statement (e->line, op, def_b, def_a, 0);
} else {
if (def_a->initialized) {
@ -153,7 +153,7 @@ emit_assign_expr (expr_t *e)
}
def_b = emit_sub_expr (e2, def_a);
if (def_b != def_a) {
op = PR_Opcode_Find ("=", 5, def_a, def_b, def_b);
op = PR_Opcode_Find ("=", 5, def_b, def_a, &def_void);
emit_statement (e->line, op, def_b, def_a, 0);
}
}