-flegacy-vector-maths, enabled by default

This commit is contained in:
Wolfgang Bumiller 2013-01-14 11:15:06 +01:00
parent d7f4e981a3
commit d12e6e15c9
3 changed files with 9 additions and 0 deletions

7
ir.c
View file

@ -600,6 +600,13 @@ bool ir_function_pass_peephole(ir_function *self)
if (!instr_is_operation(oper->opcode))
continue;
if (OPTS_FLAG(LEGACY_VECTOR_MATHS)) {
if (oper->opcode == INSTR_MUL_VF && oper->_ops[2]->memberof == oper->_ops[1])
continue;
if (oper->opcode == INSTR_MUL_FV && oper->_ops[1]->memberof == oper->_ops[2])
continue;
}
value = oper->_ops[0];
/* only do it for SSA values */

1
opts.c
View file

@ -66,6 +66,7 @@ static void opts_setdefault() {
opts_set(opts.flags, FTEPP_PREDEFS, false);
opts_set(opts.flags, CORRECT_TERNARY, true);
opts_set(opts.flags, BAIL_ON_WERROR, true);
opts_set(opts.flags, LEGACY_VECTOR_MATHS, true);
}
void opts_backup_non_Wall() {

View file

@ -49,6 +49,7 @@
GMQCC_DEFINE_FLAG(UNTYPED_NIL)
GMQCC_DEFINE_FLAG(PERMISSIVE)
GMQCC_DEFINE_FLAG(VARIADIC_ARGS)
GMQCC_DEFINE_FLAG(LEGACY_VECTOR_MATHS)
#endif
/* warning flags */